1 # RUN: llc -mtriple=amdgcn-amd-amdhsa -verify-machineinstrs -amdgpu-dce-in-ra=0 -stress-regalloc=1 -start-before=simple-register-coalescing -stop-after=greedy,1 -o - %s | FileCheck %s
2 # https://bugs.llvm.org/show_bug.cgi?id=33620
5 # This would assert due to the empty live interval created for %9
6 # on the last S_NOP with an undef subreg use.
8 # CHECK-LABEL: name: expecting_non_empty_interval
10 # CHECK: undef %7.sub1:vreg_64 = V_MAC_F32_e32 0, undef %1:vgpr_32, undef %7.sub1, implicit $mode, implicit $exec
11 # CHECK-NEXT: SI_SPILL_V64_SAVE %7, %stack.0, $sgpr32, 0, implicit $exec :: (store (s64) into %stack.0, align 4, addrspace 5)
12 # CHECK-NEXT: undef %5.sub1:vreg_64 = V_MOV_B32_e32 1786773504, implicit $exec
13 # CHECK-NEXT: dead %3:vgpr_32 = V_MUL_F32_e32 0, %5.sub1, implicit $mode, implicit $exec
15 # CHECK: S_NOP 0, implicit %6.sub1
16 # CHECK-NEXT: %8:vreg_64 = SI_SPILL_V64_RESTORE %stack.0, $sgpr32, 0, implicit $exec :: (load (s64) from %stack.0, align 4, addrspace 5)
17 # CHECK-NEXT: S_NOP 0, implicit %8.sub1
18 # CHECK-NEXT: S_NOP 0, implicit undef %9.sub0
20 name: expecting_non_empty_interval
21 tracksRegLiveness: true
23 scratchRSrcReg: $sgpr0_sgpr1_sgpr2_sgpr3
24 stackPtrOffsetReg: $sgpr32
29 undef %0.sub1:vreg_64 = V_MAC_F32_e32 0, undef %1:vgpr_32, undef %0.sub1, implicit $mode, implicit $exec
30 undef %2.sub1:vreg_64 = V_MOV_B32_e32 1786773504, implicit $exec
31 dead %3:vgpr_32 = V_MUL_F32_e32 0, %2.sub1, implicit $mode, implicit $exec
34 S_NOP 0, implicit %2.sub1
35 S_NOP 0, implicit %0.sub1
36 S_NOP 0, implicit undef %0.sub0
40 # Similar assert which happens when trying to rematerialize.
41 # https://bugs.llvm.org/show_bug.cgi?id=33884
43 # CHECK-LABEL: name: rematerialize_empty_interval_has_reference
46 # CHECK: undef %1.sub2:vreg_128 = V_MOV_B32_e32 1786773504, implicit $exec
49 # CHECK-NEXT: S_NOP 0, implicit %1.sub2
50 # CHECK-NEXT: S_NOP 0, implicit undef %4.sub0
51 # CHECK-NEXT: undef %2.sub2:vreg_128 = V_MOV_B32_e32 0, implicit $exec
52 # CHECK-NEXT: S_NOP 0, implicit %2.sub2
53 name: rematerialize_empty_interval_has_reference
54 tracksRegLiveness: true
56 scratchRSrcReg: $sgpr0_sgpr1_sgpr2_sgpr3
57 stackPtrOffsetReg: $sgpr32
62 undef %0.sub2:vreg_128 = V_MOV_B32_e32 0, implicit $exec
63 undef %1.sub2:vreg_128 = V_MOV_B32_e32 1786773504, implicit $exec
66 S_NOP 0, implicit %1.sub2
67 S_NOP 0, implicit undef %0.sub0
68 S_NOP 0, implicit %0.sub2