Files
llvm-project/llvm/test/CodeGen/AArch64/framelayout-fpr128-spill.mir
Benjamin Maxwell 327f1adef8 [AArch64] Ensure FPR128 callee-save stack offsets are aligned (#184314)
This was benign for Linux targets (as when dividing by the scale the
offset would be correctly truncated), so only resulted in failures with
`-DLLVM_ENABLE_ASSERTIONS=On`. On Windows, this was a miscompile as the
lack of alignment would result in the FPR128 callee-save getting
assigned to the same offset as the previous GPR.

Fixes: #183708
2026-03-08 09:38:42 +00:00

39 lines
1.9 KiB
YAML

# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py UTC_ARGS: --version 6
# RUN: llc -mtriple=aarch64-linux-gnu -run-pass=prologepilog %s -o - | FileCheck %s
# RUN: llc -mtriple=aarch64-windows-msvc -run-pass=prologepilog %s -o - | FileCheck %s --check-prefix=CHECK-WINDOWS
--- |
; Tests Q8 is assigned a 16-byte aligned offset after X10 is assigned an offset.
define preserve_allcc void @test_fpr128_spill_alignment() nounwind { entry: unreachable }
...
---
name: test_fpr128_spill_alignment
tracksRegLiveness: true
body: |
bb.0:
; CHECK-LABEL: name: test_fpr128_spill_alignment
; CHECK: liveins: $q8, $x10
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: early-clobber $sp = frame-setup STRQpre killed $q8, $sp, -32 :: (store (s128) into %stack.1)
; CHECK-NEXT: frame-setup STRXui killed $x10, $sp, 3 :: (store (s64) into %stack.0)
; CHECK-NEXT: $q8 = IMPLICIT_DEF
; CHECK-NEXT: $x10 = IMPLICIT_DEF
; CHECK-NEXT: $x10 = frame-destroy LDRXui $sp, 3 :: (load (s64) from %stack.0)
; CHECK-NEXT: early-clobber $sp, $q8 = frame-destroy LDRQpost $sp, 32 :: (load (s128) from %stack.1)
; CHECK-NEXT: RET_ReallyLR
;
; CHECK-WINDOWS-LABEL: name: test_fpr128_spill_alignment
; CHECK-WINDOWS: liveins: $x10, $q8
; CHECK-WINDOWS-NEXT: {{ $}}
; CHECK-WINDOWS-NEXT: early-clobber $sp = frame-setup STRXpre killed $x10, $sp, -32 :: (store (s64) into %stack.1)
; CHECK-WINDOWS-NEXT: frame-setup STRQui killed $q8, $sp, 1 :: (store (s128) into %stack.0)
; CHECK-WINDOWS-NEXT: $q8 = IMPLICIT_DEF
; CHECK-WINDOWS-NEXT: $x10 = IMPLICIT_DEF
; CHECK-WINDOWS-NEXT: $q8 = frame-destroy LDRQui $sp, 1 :: (load (s128) from %stack.0)
; CHECK-WINDOWS-NEXT: early-clobber $sp, $x10 = frame-destroy LDRXpost $sp, 32 :: (load (s64) from %stack.1)
; CHECK-WINDOWS-NEXT: RET_ReallyLR
$q8 = IMPLICIT_DEF
$x10 = IMPLICIT_DEF
RET_ReallyLR
...