1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple=amdgcn-- -mcpu=gfx1010 -verify-machineinstrs -run-pass=si-form-memory-clauses,greedy,virtregrewriter -o - %s | FileCheck %s
3 # FIXME: -start-before=si-form-memory-clauses doesn't work correctly with -stop-after
5 # This used to produce a bundle that was impossible for the register
9 name: unallocatable_clause_bundle
10 tracksRegLiveness: true
13 scratchRSrcReg: '$sgpr100_sgpr101_sgpr102_sgpr103'
14 stackPtrOffsetReg: '$sgpr32'
16 privateSegmentBuffer: { reg: '$sgpr0_sgpr1_sgpr2_sgpr3' }
22 liveins: $sgpr0_sgpr1_sgpr2_sgpr3, $vgpr0
24 ; CHECK-LABEL: name: unallocatable_clause_bundle
25 ; CHECK: liveins: $vgpr0, $sgpr0_sgpr1_sgpr2_sgpr3
27 ; CHECK-NEXT: renamable $sgpr4 = COPY $sgpr0
28 ; CHECK-NEXT: SI_SPILL_S128_SAVE $sgpr0_sgpr1_sgpr2_sgpr3, %stack.0, implicit $exec, implicit $sgpr32 :: (store (s128) into %stack.0, align 4, addrspace 5)
29 ; CHECK-NEXT: renamable $sgpr5 = S_MOV_B32 0
30 ; CHECK-NEXT: renamable $sgpr76 = COPY renamable $sgpr5
31 ; CHECK-NEXT: renamable $sgpr77 = COPY renamable $sgpr5
32 ; CHECK-NEXT: renamable $sgpr78 = COPY renamable $sgpr5
33 ; CHECK-NEXT: renamable $sgpr0 = S_MOV_B32 1056964608
34 ; CHECK-NEXT: renamable $sgpr79 = COPY renamable $sgpr5
35 ; CHECK-NEXT: renamable $sgpr1 = COPY renamable $sgpr0
36 ; CHECK-NEXT: renamable $sgpr8 = COPY renamable $sgpr5
37 ; CHECK-NEXT: renamable $sgpr9 = COPY renamable $sgpr5
38 ; CHECK-NEXT: renamable $sgpr10 = COPY renamable $sgpr5
39 ; CHECK-NEXT: renamable $sgpr11 = COPY renamable $sgpr5
40 ; CHECK-NEXT: renamable $sgpr12 = COPY renamable $sgpr5
41 ; CHECK-NEXT: renamable $sgpr13 = COPY renamable $sgpr5
42 ; CHECK-NEXT: renamable $sgpr14 = COPY renamable $sgpr5
43 ; CHECK-NEXT: renamable $sgpr15 = COPY renamable $sgpr5
44 ; CHECK-NEXT: renamable $vgpr5_vgpr6 = COPY killed renamable $sgpr0_sgpr1
45 ; CHECK-NEXT: renamable $sgpr16_sgpr17_sgpr18_sgpr19_sgpr20_sgpr21_sgpr22_sgpr23 = S_LOAD_DWORDX8_IMM renamable $sgpr4_sgpr5, 1088, 0 :: (dereferenceable load (s256), addrspace 6)
46 ; CHECK-NEXT: renamable $sgpr80_sgpr81_sgpr82_sgpr83 = S_LOAD_DWORDX4_IMM renamable $sgpr4_sgpr5, 0, 0 :: (load (s128), addrspace 6)
47 ; CHECK-NEXT: renamable $sgpr0 = S_MOV_B32 1200
48 ; CHECK-NEXT: renamable $sgpr1 = COPY renamable $sgpr5
49 ; CHECK-NEXT: renamable $sgpr24_sgpr25_sgpr26_sgpr27_sgpr28_sgpr29_sgpr30_sgpr31 = S_LOAD_DWORDX8_IMM renamable $sgpr4_sgpr5, 1152, 0 :: (dereferenceable load (s256), addrspace 6)
50 ; CHECK-NEXT: renamable $sgpr84_sgpr85_sgpr86_sgpr87 = S_LOAD_DWORDX4_IMM renamable $sgpr0_sgpr1, 0, 0 :: (load (s128), addrspace 6)
51 ; CHECK-NEXT: KILL killed renamable $sgpr0, renamable $sgpr1
52 ; CHECK-NEXT: renamable $sgpr0 = S_MOV_B32 1264
53 ; CHECK-NEXT: renamable $sgpr1 = COPY renamable $sgpr5
54 ; CHECK-NEXT: renamable $sgpr36_sgpr37_sgpr38_sgpr39_sgpr40_sgpr41_sgpr42_sgpr43 = S_LOAD_DWORDX8_IMM renamable $sgpr4_sgpr5, 1216, 0 :: (dereferenceable load (s256), addrspace 6)
55 ; CHECK-NEXT: renamable $sgpr88_sgpr89_sgpr90_sgpr91 = S_LOAD_DWORDX4_IMM killed renamable $sgpr0_sgpr1, 0, 0 :: (load (s128), addrspace 6)
56 ; CHECK-NEXT: renamable $sgpr0 = S_MOV_B32 1328
57 ; CHECK-NEXT: renamable $sgpr1 = COPY renamable $sgpr5
58 ; CHECK-NEXT: renamable $sgpr44_sgpr45_sgpr46_sgpr47_sgpr48_sgpr49_sgpr50_sgpr51 = S_LOAD_DWORDX8_IMM renamable $sgpr4_sgpr5, 1280, 0 :: (dereferenceable load (s256), addrspace 6)
59 ; CHECK-NEXT: renamable $sgpr92_sgpr93_sgpr94_sgpr95 = S_LOAD_DWORDX4_IMM killed renamable $sgpr0_sgpr1, 0, 0 :: (load (s128), addrspace 6)
60 ; CHECK-NEXT: renamable $sgpr52_sgpr53_sgpr54_sgpr55_sgpr56_sgpr57_sgpr58_sgpr59 = S_LOAD_DWORDX8_IMM renamable $sgpr4_sgpr5, 1344, 0 :: (dereferenceable load (s256), addrspace 6)
61 ; CHECK-NEXT: renamable $sgpr0 = S_MOV_B32 1392
62 ; CHECK-NEXT: renamable $sgpr1 = COPY renamable $sgpr5
63 ; CHECK-NEXT: renamable $sgpr60_sgpr61_sgpr62_sgpr63_sgpr64_sgpr65_sgpr66_sgpr67 = S_LOAD_DWORDX8_IMM renamable $sgpr4_sgpr5, 0, 0 :: (load (s256), addrspace 6)
64 ; CHECK-NEXT: renamable $sgpr2 = S_MOV_B32 1456
65 ; CHECK-NEXT: renamable $sgpr3 = COPY renamable $sgpr5
66 ; CHECK-NEXT: renamable $sgpr68_sgpr69_sgpr70_sgpr71_sgpr72_sgpr73_sgpr74_sgpr75 = S_LOAD_DWORDX8_IMM renamable $sgpr4_sgpr5, 1472, 0 :: (dereferenceable load (s256), addrspace 6)
67 ; CHECK-NEXT: renamable $sgpr4 = S_MOV_B32 1520
68 ; CHECK-NEXT: renamable $sgpr96_sgpr97_sgpr98_sgpr99 = S_LOAD_DWORDX4_IMM killed renamable $sgpr2_sgpr3, 0, 0 :: (load (s128), addrspace 6)
69 ; CHECK-NEXT: renamable $sgpr4_sgpr5_sgpr6_sgpr7 = S_LOAD_DWORDX4_IMM killed renamable $sgpr4_sgpr5, 0, 0 :: (load (s128), addrspace 6)
70 ; CHECK-NEXT: renamable $sgpr0_sgpr1_sgpr2_sgpr3 = S_LOAD_DWORDX4_IMM killed renamable $sgpr0_sgpr1, 0, 0 :: (load (s128), addrspace 6)
71 ; CHECK-NEXT: renamable $vgpr7 = IMAGE_SAMPLE_LZ_V1_V2_gfx10 renamable $vgpr5_vgpr6, killed renamable $sgpr8_sgpr9_sgpr10_sgpr11_sgpr12_sgpr13_sgpr14_sgpr15, killed renamable $sgpr76_sgpr77_sgpr78_sgpr79, 1, 1, 0, 0, 0, 0, 0, 0, 0, implicit $exec :: (dereferenceable load (s128))
72 ; CHECK-NEXT: renamable $vgpr8 = IMAGE_SAMPLE_LZ_V1_V2_gfx10 renamable $vgpr5_vgpr6, killed renamable $sgpr16_sgpr17_sgpr18_sgpr19_sgpr20_sgpr21_sgpr22_sgpr23, killed renamable $sgpr80_sgpr81_sgpr82_sgpr83, 1, 1, 0, 0, 0, 0, 0, 0, 0, implicit $exec :: (dereferenceable load (s128))
73 ; CHECK-NEXT: renamable $vgpr9 = IMAGE_SAMPLE_LZ_V1_V2_gfx10 renamable $vgpr5_vgpr6, killed renamable $sgpr24_sgpr25_sgpr26_sgpr27_sgpr28_sgpr29_sgpr30_sgpr31, killed renamable $sgpr84_sgpr85_sgpr86_sgpr87, 1, 1, 0, 0, 0, 0, 0, 0, 0, implicit $exec :: (dereferenceable load (s128))
74 ; CHECK-NEXT: renamable $vgpr10 = IMAGE_SAMPLE_LZ_V1_V2_gfx10 renamable $vgpr5_vgpr6, killed renamable $sgpr36_sgpr37_sgpr38_sgpr39_sgpr40_sgpr41_sgpr42_sgpr43, killed renamable $sgpr88_sgpr89_sgpr90_sgpr91, 1, 1, 0, 0, 0, 0, 0, 0, 0, implicit $exec :: (dereferenceable load (s128))
75 ; CHECK-NEXT: renamable $vgpr11 = IMAGE_SAMPLE_LZ_V1_V2_gfx10 renamable $vgpr5_vgpr6, killed renamable $sgpr44_sgpr45_sgpr46_sgpr47_sgpr48_sgpr49_sgpr50_sgpr51, killed renamable $sgpr92_sgpr93_sgpr94_sgpr95, 1, 1, 0, 0, 0, 0, 0, 0, 0, implicit $exec :: (dereferenceable load (s128))
76 ; CHECK-NEXT: renamable $vgpr12 = IMAGE_SAMPLE_LZ_V1_V2_gfx10 renamable $vgpr5_vgpr6, killed renamable $sgpr60_sgpr61_sgpr62_sgpr63_sgpr64_sgpr65_sgpr66_sgpr67, killed renamable $sgpr96_sgpr97_sgpr98_sgpr99, 1, 1, 0, 0, 0, 0, 0, 0, 0, implicit $exec :: (dereferenceable load (s128))
77 ; CHECK-NEXT: renamable $vgpr13 = IMAGE_SAMPLE_LZ_V1_V2_gfx10 renamable $vgpr5_vgpr6, renamable $sgpr68_sgpr69_sgpr70_sgpr71_sgpr72_sgpr73_sgpr74_sgpr75, renamable $sgpr4_sgpr5_sgpr6_sgpr7, 1, 1, 0, 0, 0, 0, 0, 0, 0, implicit $exec :: (dereferenceable load (s128))
78 ; CHECK-NEXT: renamable $vgpr14 = IMAGE_SAMPLE_LZ_V1_V2_gfx10 renamable $vgpr5_vgpr6, renamable $sgpr52_sgpr53_sgpr54_sgpr55_sgpr56_sgpr57_sgpr58_sgpr59, renamable $sgpr0_sgpr1_sgpr2_sgpr3, 1, 1, 0, 0, 0, 0, 0, 0, 0, implicit $exec :: (dereferenceable load (s128))
79 ; CHECK-NEXT: renamable $sgpr8_sgpr9_sgpr10_sgpr11 = SI_SPILL_S128_RESTORE %stack.0, implicit $exec, implicit $sgpr32 :: (load (s128) from %stack.0, align 4, addrspace 5)
80 ; CHECK-NEXT: renamable $vgpr1_vgpr2_vgpr3_vgpr4 = BUFFER_LOAD_FORMAT_XYZW_IDXEN renamable $vgpr0, renamable $sgpr8_sgpr9_sgpr10_sgpr11, 0, 0, 0, 0, implicit $exec :: (dereferenceable load (s128), align 1, addrspace 7)
81 ; CHECK-NEXT: KILL killed renamable $sgpr4_sgpr5_sgpr6_sgpr7
82 ; CHECK-NEXT: KILL killed renamable $sgpr68_sgpr69_sgpr70_sgpr71_sgpr72_sgpr73_sgpr74_sgpr75
83 ; CHECK-NEXT: KILL killed renamable $vgpr5_vgpr6
84 ; CHECK-NEXT: KILL killed renamable $sgpr0_sgpr1_sgpr2_sgpr3
85 ; CHECK-NEXT: KILL killed renamable $sgpr52_sgpr53_sgpr54_sgpr55_sgpr56_sgpr57_sgpr58_sgpr59
86 ; CHECK-NEXT: KILL killed renamable $sgpr8_sgpr9_sgpr10_sgpr11
87 ; CHECK-NEXT: KILL killed renamable $vgpr0
88 ; CHECK-NEXT: renamable $vgpr0 = nofpexcept V_MAX_F32_e32 killed $vgpr7, killed $vgpr8, implicit $mode, implicit $exec
89 ; CHECK-NEXT: renamable $vgpr0 = V_MAX3_F32_e64 0, killed $vgpr0, 0, killed $vgpr9, 0, killed $vgpr10, 0, 0, implicit $mode, implicit $exec
90 ; CHECK-NEXT: renamable $vgpr1 = nofpexcept V_ADD_F32_e32 -1083321614, killed $vgpr12, implicit $mode, implicit $exec
91 ; CHECK-NEXT: renamable $vgpr3 = nofpexcept V_ADD_F32_e32 -1090988802, killed $vgpr13, implicit $mode, implicit $exec
92 ; CHECK-NEXT: renamable $vgpr0 = V_MAX3_F32_e64 0, killed $vgpr0, 0, killed $vgpr11, 0, killed $vgpr14, 0, 0, implicit $mode, implicit $exec
93 ; CHECK-NEXT: renamable $vgpr0 = V_MAX3_F32_e64 0, killed $vgpr0, 0, killed $vgpr1, 0, killed $vgpr3, 0, 0, implicit $mode, implicit $exec
94 ; CHECK-NEXT: renamable $sgpr0 = nofpexcept V_CMP_GT_F32_e64 0, 1028443341, 0, killed $vgpr0, 0, implicit $mode, implicit $exec
95 ; CHECK-NEXT: renamable $vgpr0 = V_CNDMASK_B32_e64 0, 0, 0, 1065353216, killed $sgpr0, implicit $exec
96 ; CHECK-NEXT: EXP_DONE 12, killed renamable $vgpr0, killed renamable $vgpr2, undef renamable $vgpr0, undef renamable $vgpr0, -1, 0, 15, implicit $exec
97 ; CHECK-NEXT: S_ENDPGM 0
98 %0:vgpr_32 = COPY $vgpr0
99 undef %1.sub0:sgpr_64 = COPY $sgpr0
100 %2:sgpr_128 = COPY $sgpr0_sgpr1_sgpr2_sgpr3
101 %1.sub1:sgpr_64 = S_MOV_B32 0
102 undef %3.sub0:sgpr_128 = COPY %1.sub1
103 %3.sub1:sgpr_128 = COPY %1.sub1
104 %3.sub2:sgpr_128 = COPY %1.sub1
105 undef %4.sub0:sgpr_64 = S_MOV_B32 1056964608
106 %3.sub3:sgpr_128 = COPY %1.sub1
107 %4.sub1:sgpr_64 = COPY %4.sub0
108 undef %5.sub0:sgpr_256 = COPY %1.sub1
109 %5.sub1:sgpr_256 = COPY %1.sub1
110 %5.sub2:sgpr_256 = COPY %1.sub1
111 %5.sub3:sgpr_256 = COPY %1.sub1
112 %5.sub4:sgpr_256 = COPY %1.sub1
113 %5.sub5:sgpr_256 = COPY %1.sub1
114 %5.sub6:sgpr_256 = COPY %1.sub1
115 %5.sub7:sgpr_256 = COPY %1.sub1
117 %7:sgpr_256 = S_LOAD_DWORDX8_IMM %1, 1088, 0 :: (dereferenceable load (s256), addrspace 6)
118 %8:sgpr_128 = S_LOAD_DWORDX4_IMM %1, 0, 0 :: (load (s128), addrspace 6)
119 undef %9.sub0:sreg_64_xexec = S_MOV_B32 1200
120 %9.sub1:sreg_64_xexec = COPY %1.sub1
121 %10:sgpr_256 = S_LOAD_DWORDX8_IMM %1, 1152, 0 :: (dereferenceable load (s256), addrspace 6)
122 %11:sgpr_128 = S_LOAD_DWORDX4_IMM %9, 0, 0 :: (load (s128), addrspace 6)
123 undef %12.sub0:sreg_64_xexec = S_MOV_B32 1264
124 %12.sub1:sreg_64_xexec = COPY %1.sub1
125 %13:sgpr_256 = S_LOAD_DWORDX8_IMM %1, 1216, 0 :: (dereferenceable load (s256), addrspace 6)
126 %14:sgpr_128 = S_LOAD_DWORDX4_IMM %12, 0, 0 :: (load (s128), addrspace 6)
127 undef %15.sub0:sreg_64_xexec = S_MOV_B32 1328
128 %15.sub1:sreg_64_xexec = COPY %1.sub1
129 %16:sgpr_256 = S_LOAD_DWORDX8_IMM %1, 1280, 0 :: (dereferenceable load (s256), addrspace 6)
130 %17:sgpr_128 = S_LOAD_DWORDX4_IMM %15, 0, 0 :: (load (s128), addrspace 6)
131 %18:sgpr_256 = S_LOAD_DWORDX8_IMM %1, 1344, 0 :: (dereferenceable load (s256), addrspace 6)
132 undef %19.sub0:sreg_64_xexec = S_MOV_B32 1392
133 %19.sub1:sreg_64_xexec = COPY %1.sub1
134 %20:sgpr_256 = S_LOAD_DWORDX8_IMM %1, 0, 0 :: (load (s256), addrspace 6)
135 undef %21.sub0:sreg_64_xexec = S_MOV_B32 1456
136 %21.sub1:sreg_64_xexec = COPY %1.sub1
137 %22:sgpr_256 = S_LOAD_DWORDX8_IMM %1, 1472, 0 :: (dereferenceable load (s256), addrspace 6)
138 %1.sub0:sgpr_64 = S_MOV_B32 1520
139 %23:sgpr_128 = S_LOAD_DWORDX4_IMM %21, 0, 0 :: (load (s128), addrspace 6)
140 %24:sgpr_128 = S_LOAD_DWORDX4_IMM %1, 0, 0 :: (load (s128), addrspace 6)
141 %25:sgpr_128 = S_LOAD_DWORDX4_IMM %19, 0, 0 :: (load (s128), addrspace 6)
142 %26:vgpr_32 = IMAGE_SAMPLE_LZ_V1_V2_gfx10 %6, %5, %3, 1, 1, 0, 0, 0, 0, 0, 0, 0, implicit $exec :: (dereferenceable load (s128))
143 %27:vgpr_32 = IMAGE_SAMPLE_LZ_V1_V2_gfx10 %6, %7, %8, 1, 1, 0, 0, 0, 0, 0, 0, 0, implicit $exec :: (dereferenceable load (s128))
144 %28:vgpr_32 = IMAGE_SAMPLE_LZ_V1_V2_gfx10 %6, %10, %11, 1, 1, 0, 0, 0, 0, 0, 0, 0, implicit $exec :: (dereferenceable load (s128))
145 %29:vgpr_32 = IMAGE_SAMPLE_LZ_V1_V2_gfx10 %6, %13, %14, 1, 1, 0, 0, 0, 0, 0, 0, 0, implicit $exec :: (dereferenceable load (s128))
146 %30:vgpr_32 = IMAGE_SAMPLE_LZ_V1_V2_gfx10 %6, %16, %17, 1, 1, 0, 0, 0, 0, 0, 0, 0, implicit $exec :: (dereferenceable load (s128))
147 %31:vgpr_32 = IMAGE_SAMPLE_LZ_V1_V2_gfx10 %6, %20, %23, 1, 1, 0, 0, 0, 0, 0, 0, 0, implicit $exec :: (dereferenceable load (s128))
148 %32:vgpr_32 = IMAGE_SAMPLE_LZ_V1_V2_gfx10 %6, %22, %24, 1, 1, 0, 0, 0, 0, 0, 0, 0, implicit $exec :: (dereferenceable load (s128))
149 %33:vgpr_32 = IMAGE_SAMPLE_LZ_V1_V2_gfx10 %6, %18, %25, 1, 1, 0, 0, 0, 0, 0, 0, 0, implicit $exec :: (dereferenceable load (s128))
150 %34:vreg_128 = BUFFER_LOAD_FORMAT_XYZW_IDXEN %0, %2, 0, 0, 0, 0, implicit $exec :: (dereferenceable load (s128), align 1, addrspace 7)
151 %35:vgpr_32 = nofpexcept V_MAX_F32_e32 %26, %27, implicit $mode, implicit $exec
152 %36:vgpr_32 = V_MAX3_F32_e64 0, %35, 0, %28, 0, %29, 0, 0, implicit $mode, implicit $exec
153 %37:vgpr_32 = nofpexcept V_ADD_F32_e32 -1083321614, %31, implicit $mode, implicit $exec
154 %38:vgpr_32 = nofpexcept V_ADD_F32_e32 -1090988802, %32, implicit $mode, implicit $exec
155 %39:vgpr_32 = V_MAX3_F32_e64 0, %36, 0, %30, 0, %33, 0, 0, implicit $mode, implicit $exec
156 %40:vgpr_32 = V_MAX3_F32_e64 0, %39, 0, %37, 0, %38, 0, 0, implicit $mode, implicit $exec
157 %41:sreg_32_xm0_xexec = nofpexcept V_CMP_GT_F32_e64 0, 1028443341, 0, %40, 0, implicit $mode, implicit $exec
158 %42:vgpr_32 = V_CNDMASK_B32_e64 0, 0, 0, 1065353216, %41, implicit $exec
159 EXP_DONE 12, %42, %34.sub1, undef %43:vgpr_32, undef %44:vgpr_32, -1, 0, 15, implicit $exec