39 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --include-generated-funcs --version 42; RUN: llc -mtriple hexagon-- -o - %s | FileCheck %s3 4; Reproducer for https://github.com/llvm/llvm-project/issues/890605; Problem was a bug in argument copy elison. Given that the %alloca is6; eliminated, the same frame index will be used for accessing %alloca and %a7; on the fixed stack. Care must be taken when setting up8; MachinePointerInfo/MemOperands for those accesses to either make sure that9; we always refer to the fixed stack slot the same way (not using the10; ir.alloca name), or make sure that we still detect that they alias each11; other if using different kinds of MemOperands to identify the same fixed12; stack entry.13define i32 @f(i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32 %q1, i32 %a, i32 %q2) {14 %alloca = alloca i3215 store i32 %a, ptr %alloca ; Should be elided.16 store i32 666, ptr %alloca17 %x = sub i32 %q1, %q218 %y = xor i32 %x, %a ; Results in a load of %a from fixed stack.19 ; Using same frame index as elided %alloca.20 ret i32 %y21}22; CHECK-LABEL: f:23; CHECK: .cfi_startproc24; CHECK-NEXT: // %bb.0:25; CHECK-NEXT: {26; CHECK-NEXT: r0 = memw(r29+#36)27; CHECK-NEXT: r1 = memw(r29+#28)28; CHECK-NEXT: }29; CHECK-NEXT: {30; CHECK-NEXT: r0 = sub(r1,r0)31; CHECK-NEXT: r2 = memw(r29+#32)32; CHECK-NEXT: memw(r29+#32) = ##66633; CHECK-EMPTY:34; CHECK-NEXT: } :mem_noshuf35; CHECK-NEXT: {36; CHECK-NEXT: r0 = xor(r0,r2)37; CHECK-NEXT: jumpr r3138; CHECK-NEXT: }39