1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple=amdgcn-amd-amdhsa -verify-machineinstrs -amdgpu-enable-rewrite-partial-reg-uses=false -amdgpu-dce-in-ra=0 -stress-regalloc=1 -start-before=register-coalescer -stop-after=greedy,1 -o - %s | FileCheck %s
3 # https://bugs.llvm.org/show_bug.cgi?id=33620
6 # This would assert due to the empty live interval created for %9
7 # on the last S_NOP with an undef subreg use.
12 name: expecting_non_empty_interval
13 tracksRegLiveness: true
15 scratchRSrcReg: $sgpr0_sgpr1_sgpr2_sgpr3
16 stackPtrOffsetReg: $sgpr32
18 ; CHECK-LABEL: name: expecting_non_empty_interval
20 ; CHECK-NEXT: successors: %bb.1(0x80000000)
22 ; CHECK-NEXT: undef [[V_MOV_B32_e32_:%[0-9]+]].sub1:vreg_64 = V_MOV_B32_e32 1786773504, implicit $exec
23 ; CHECK-NEXT: dead [[V_MUL_F32_e32_:%[0-9]+]]:vgpr_32 = V_MUL_F32_e32 0, [[V_MOV_B32_e32_]].sub1, implicit $mode, implicit $exec
24 ; CHECK-NEXT: undef [[V_MAC_F32_e32_:%[0-9]+]].sub1:vreg_64 = V_MAC_F32_e32 0, undef %1:vgpr_32, undef [[V_MAC_F32_e32_]].sub1, implicit $mode, implicit $exec
25 ; CHECK-NEXT: SI_SPILL_V64_SAVE [[V_MAC_F32_e32_]], %stack.0, $sgpr32, 0, implicit $exec :: (store (s64) into %stack.0, align 4, addrspace 5)
28 ; CHECK-NEXT: undef [[V_MOV_B32_e32_1:%[0-9]+]].sub1:vreg_64 = V_MOV_B32_e32 1786773504, implicit $exec
29 ; CHECK-NEXT: S_NOP 0, implicit [[V_MOV_B32_e32_1]].sub1
30 ; CHECK-NEXT: [[SI_SPILL_V64_RESTORE:%[0-9]+]]:vreg_64 = SI_SPILL_V64_RESTORE %stack.0, $sgpr32, 0, implicit $exec :: (load (s64) from %stack.0, align 4, addrspace 5)
31 ; CHECK-NEXT: S_NOP 0, implicit [[SI_SPILL_V64_RESTORE]].sub1
32 ; CHECK-NEXT: S_NOP 0, implicit undef %9.sub0:vreg_64
36 undef %0.sub1:vreg_64 = V_MAC_F32_e32 0, undef %1:vgpr_32, undef %0.sub1, implicit $mode, implicit $exec
37 undef %2.sub1:vreg_64 = V_MOV_B32_e32 1786773504, implicit $exec
38 dead %3:vgpr_32 = V_MUL_F32_e32 0, %2.sub1, implicit $mode, implicit $exec
41 S_NOP 0, implicit %2.sub1
42 S_NOP 0, implicit %0.sub1
43 S_NOP 0, implicit undef %0.sub0
47 # Similar assert which happens when trying to rematerialize.
48 # https://bugs.llvm.org/show_bug.cgi?id=33884
52 name: rematerialize_empty_interval_has_reference
53 tracksRegLiveness: true
55 scratchRSrcReg: $sgpr0_sgpr1_sgpr2_sgpr3
56 stackPtrOffsetReg: $sgpr32
58 ; CHECK-LABEL: name: rematerialize_empty_interval_has_reference
60 ; CHECK-NEXT: successors: %bb.1(0x80000000)
62 ; CHECK-NEXT: undef [[V_MOV_B32_e32_:%[0-9]+]].sub2:vreg_128 = V_MOV_B32_e32 1786773504, implicit $exec
65 ; CHECK-NEXT: S_NOP 0, implicit [[V_MOV_B32_e32_]].sub2
66 ; CHECK-NEXT: S_NOP 0, implicit undef %4.sub0:vreg_128
67 ; CHECK-NEXT: undef [[V_MOV_B32_e32_1:%[0-9]+]].sub2:vreg_128 = V_MOV_B32_e32 0, implicit $exec
68 ; CHECK-NEXT: S_NOP 0, implicit [[V_MOV_B32_e32_1]].sub2
72 undef %0.sub2:vreg_128 = V_MOV_B32_e32 0, implicit $exec
73 undef %1.sub2:vreg_128 = V_MOV_B32_e32 1786773504, implicit $exec
76 S_NOP 0, implicit %1.sub2
77 S_NOP 0, implicit undef %0.sub0
78 S_NOP 0, implicit %0.sub2