1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 4
2 ; RUN: llc -mtriple hexagon-- -o - %s | FileCheck %s
4 ; Reproducer for https://github.com/llvm/llvm-project/issues/89060
6 ; Problem was a bug in argument copy elison. Given that the %alloca is
7 ; eliminated, the same frame index will be used for accessing %alloca and %a
8 ; on the fixed stack. Care must be taken when setting up
9 ; MachinePointerInfo/MemOperands for those accesses to either make sure that
10 ; we always refer to the fixed stack slot the same way (not using the
11 ; ir.alloca name), or make sure that we still detect that they alias each
12 ; other if using different kinds of MemOperands to identify the same fixed
15 define i32 @f(i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32 %q1, i32 %a, i32 %q2) {
17 ; CHECK: .cfi_startproc
18 ; CHECK-NEXT: // %bb.0:
20 ; CHECK-NEXT: r0 = memw(r29+#36)
21 ; CHECK-NEXT: r1 = memw(r29+#28)
24 ; CHECK-NEXT: r0 = sub(r1,r0)
25 ; CHECK-NEXT: r2 = memw(r29+#32)
26 ; CHECK-NEXT: memw(r29+#32) = ##666
29 ; CHECK-NEXT: r0 = xor(r0,r2)
30 ; CHECK-NEXT: jumpr r31
33 store i32 %a, ptr %alloca ; Should be elided.
34 store i32 666, ptr %alloca
36 %y = xor i32 %x, %a ; Results in a load of %a from fixed stack.
37 ; Using same frame index as elided %alloca.