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
26 ; CHECK: renamable $sgpr4 = COPY $sgpr0
27 ; CHECK: SI_SPILL_S128_SAVE $sgpr0_sgpr1_sgpr2_sgpr3, %stack.0, implicit $exec, implicit $sgpr32 :: (store (s128) into %stack.0, align 4, addrspace 5)
28 ; CHECK: renamable $sgpr5 = S_MOV_B32 0
29 ; CHECK: renamable $sgpr76 = COPY renamable $sgpr5
30 ; CHECK: renamable $sgpr77 = COPY renamable $sgpr5
31 ; CHECK: renamable $sgpr78 = COPY renamable $sgpr5
32 ; CHECK: renamable $sgpr0 = S_MOV_B32 1056964608
33 ; CHECK: renamable $sgpr79 = COPY renamable $sgpr5
34 ; CHECK: renamable $sgpr1 = COPY renamable $sgpr0
35 ; CHECK: renamable $sgpr8 = COPY renamable $sgpr5
36 ; CHECK: renamable $sgpr9 = COPY renamable $sgpr5
37 ; CHECK: renamable $sgpr10 = COPY renamable $sgpr5
38 ; CHECK: renamable $sgpr11 = COPY renamable $sgpr5
39 ; CHECK: renamable $sgpr12 = COPY renamable $sgpr5
40 ; CHECK: renamable $sgpr13 = COPY renamable $sgpr5
41 ; CHECK: renamable $sgpr14 = COPY renamable $sgpr5
42 ; CHECK: renamable $sgpr15 = COPY renamable $sgpr5
43 ; CHECK: renamable $vgpr5_vgpr6 = COPY killed renamable $sgpr0_sgpr1
44 ; CHECK: renamable $sgpr16_sgpr17_sgpr18_sgpr19_sgpr20_sgpr21_sgpr22_sgpr23 = S_LOAD_DWORDX8_IMM renamable $sgpr4_sgpr5, 1088, 0 :: (dereferenceable load (s256), addrspace 6)
45 ; CHECK: renamable $sgpr80_sgpr81_sgpr82_sgpr83 = S_LOAD_DWORDX4_IMM renamable $sgpr4_sgpr5, 0, 0 :: (load (s128), addrspace 6)
46 ; CHECK: renamable $sgpr0 = S_MOV_B32 1200
47 ; CHECK: renamable $sgpr1 = COPY renamable $sgpr5
48 ; CHECK: renamable $sgpr24_sgpr25_sgpr26_sgpr27_sgpr28_sgpr29_sgpr30_sgpr31 = S_LOAD_DWORDX8_IMM renamable $sgpr4_sgpr5, 1152, 0 :: (dereferenceable load (s256), addrspace 6)
49 ; CHECK: renamable $sgpr84_sgpr85_sgpr86_sgpr87 = S_LOAD_DWORDX4_IMM renamable $sgpr0_sgpr1, 0, 0 :: (load (s128), addrspace 6)
50 ; CHECK: KILL killed renamable $sgpr0, renamable $sgpr1
51 ; CHECK: renamable $sgpr0 = S_MOV_B32 1264
52 ; CHECK: renamable $sgpr1 = COPY renamable $sgpr5
53 ; CHECK: renamable $sgpr36_sgpr37_sgpr38_sgpr39_sgpr40_sgpr41_sgpr42_sgpr43 = S_LOAD_DWORDX8_IMM renamable $sgpr4_sgpr5, 1216, 0 :: (dereferenceable load (s256), addrspace 6)
54 ; CHECK: renamable $sgpr88_sgpr89_sgpr90_sgpr91 = S_LOAD_DWORDX4_IMM renamable $sgpr0_sgpr1, 0, 0 :: (load (s128), addrspace 6)
55 ; CHECK: KILL killed renamable $sgpr0, renamable $sgpr1
56 ; CHECK: renamable $sgpr0 = S_MOV_B32 1328
57 ; CHECK: renamable $sgpr1 = COPY renamable $sgpr5
58 ; CHECK: 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: renamable $sgpr92_sgpr93_sgpr94_sgpr95 = S_LOAD_DWORDX4_IMM renamable $sgpr0_sgpr1, 0, 0 :: (load (s128), addrspace 6)
60 ; CHECK: KILL killed renamable $sgpr0, renamable $sgpr1
61 ; CHECK: renamable $sgpr52_sgpr53_sgpr54_sgpr55_sgpr56_sgpr57_sgpr58_sgpr59 = S_LOAD_DWORDX8_IMM renamable $sgpr4_sgpr5, 1344, 0 :: (dereferenceable load (s256), addrspace 6)
62 ; CHECK: renamable $sgpr0 = S_MOV_B32 1392
63 ; CHECK: renamable $sgpr1 = COPY renamable $sgpr5
64 ; CHECK: renamable $sgpr60_sgpr61_sgpr62_sgpr63_sgpr64_sgpr65_sgpr66_sgpr67 = S_LOAD_DWORDX8_IMM renamable $sgpr4_sgpr5, 0, 0 :: (load (s256), addrspace 6)
65 ; CHECK: renamable $sgpr2 = S_MOV_B32 1456
66 ; CHECK: renamable $sgpr3 = COPY renamable $sgpr5
67 ; CHECK: renamable $sgpr68_sgpr69_sgpr70_sgpr71_sgpr72_sgpr73_sgpr74_sgpr75 = S_LOAD_DWORDX8_IMM renamable $sgpr4_sgpr5, 1472, 0 :: (dereferenceable load (s256), addrspace 6)
68 ; CHECK: renamable $sgpr4 = S_MOV_B32 1520
69 ; CHECK: renamable $sgpr96_sgpr97_sgpr98_sgpr99 = S_LOAD_DWORDX4_IMM killed renamable $sgpr2_sgpr3, 0, 0 :: (load (s128), addrspace 6)
70 ; CHECK: renamable $sgpr4_sgpr5_sgpr6_sgpr7 = S_LOAD_DWORDX4_IMM killed renamable $sgpr4_sgpr5, 0, 0 :: (load (s128), addrspace 6)
71 ; CHECK: renamable $sgpr0_sgpr1_sgpr2_sgpr3 = S_LOAD_DWORDX4_IMM killed renamable $sgpr0_sgpr1, 0, 0 :: (load (s128), addrspace 6)
72 ; CHECK: 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) from custom "ImageResource")
73 ; CHECK: 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) from custom "ImageResource")
74 ; CHECK: 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) from custom "ImageResource")
75 ; CHECK: renamable $vgpr10 = IMAGE_SAMPLE_LZ_V1_V2_gfx10 renamable $vgpr5_vgpr6, renamable $sgpr36_sgpr37_sgpr38_sgpr39_sgpr40_sgpr41_sgpr42_sgpr43, renamable $sgpr88_sgpr89_sgpr90_sgpr91, 1, 1, 0, 0, 0, 0, 0, 0, 0, implicit $exec :: (dereferenceable load (s128) from custom "ImageResource")
76 ; CHECK: renamable $vgpr11 = IMAGE_SAMPLE_LZ_V1_V2_gfx10 renamable $vgpr5_vgpr6, renamable $sgpr44_sgpr45_sgpr46_sgpr47_sgpr48_sgpr49_sgpr50_sgpr51, renamable $sgpr92_sgpr93_sgpr94_sgpr95, 1, 1, 0, 0, 0, 0, 0, 0, 0, implicit $exec :: (dereferenceable load (s128) from custom "ImageResource")
77 ; CHECK: renamable $vgpr12 = IMAGE_SAMPLE_LZ_V1_V2_gfx10 renamable $vgpr5_vgpr6, renamable $sgpr60_sgpr61_sgpr62_sgpr63_sgpr64_sgpr65_sgpr66_sgpr67, renamable $sgpr96_sgpr97_sgpr98_sgpr99, 1, 1, 0, 0, 0, 0, 0, 0, 0, implicit $exec :: (dereferenceable load (s128) from custom "ImageResource")
78 ; CHECK: 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) from custom "ImageResource")
79 ; CHECK: 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) from custom "ImageResource")
80 ; CHECK: renamable $sgpr8_sgpr9_sgpr10_sgpr11 = SI_SPILL_S128_RESTORE %stack.0, implicit $exec, implicit $sgpr32 :: (load (s128) from %stack.0, align 4, addrspace 5)
81 ; CHECK: renamable $vgpr1_vgpr2_vgpr3_vgpr4 = BUFFER_LOAD_FORMAT_XYZW_IDXEN renamable $vgpr0, renamable $sgpr8_sgpr9_sgpr10_sgpr11, 0, 0, 0, 0, 0, implicit $exec :: (dereferenceable load (s128) from custom "BufferResource", align 1, addrspace 4)
82 ; CHECK: KILL killed renamable $sgpr4_sgpr5_sgpr6_sgpr7
83 ; CHECK: KILL killed renamable $sgpr92_sgpr93_sgpr94_sgpr95
84 ; CHECK: KILL killed renamable $sgpr68_sgpr69_sgpr70_sgpr71_sgpr72_sgpr73_sgpr74_sgpr75
85 ; CHECK: KILL killed renamable $sgpr60_sgpr61_sgpr62_sgpr63_sgpr64_sgpr65_sgpr66_sgpr67
86 ; CHECK: KILL killed renamable $sgpr36_sgpr37_sgpr38_sgpr39_sgpr40_sgpr41_sgpr42_sgpr43
87 ; CHECK: KILL killed renamable $vgpr5_vgpr6
88 ; CHECK: KILL killed renamable $sgpr0_sgpr1_sgpr2_sgpr3
89 ; CHECK: KILL killed renamable $sgpr52_sgpr53_sgpr54_sgpr55_sgpr56_sgpr57_sgpr58_sgpr59
90 ; CHECK: KILL killed renamable $sgpr96_sgpr97_sgpr98_sgpr99
91 ; CHECK: KILL killed renamable $sgpr44_sgpr45_sgpr46_sgpr47_sgpr48_sgpr49_sgpr50_sgpr51
92 ; CHECK: KILL killed renamable $sgpr8_sgpr9_sgpr10_sgpr11
93 ; CHECK: KILL killed renamable $sgpr88_sgpr89_sgpr90_sgpr91
94 ; CHECK: KILL killed renamable $vgpr0
95 ; CHECK: renamable $vgpr0 = nofpexcept V_MAX_F32_e32 killed $vgpr7, killed $vgpr8, implicit $mode, implicit $exec
96 ; CHECK: renamable $vgpr0 = V_MAX3_F32_e64 0, killed $vgpr0, 0, killed $vgpr9, 0, killed $vgpr10, 0, 0, implicit $mode, implicit $exec
97 ; CHECK: renamable $vgpr1 = nofpexcept V_ADD_F32_e32 -1083321614, killed $vgpr12, implicit $mode, implicit $exec
98 ; CHECK: renamable $vgpr3 = nofpexcept V_ADD_F32_e32 -1090988802, killed $vgpr13, implicit $mode, implicit $exec
99 ; CHECK: renamable $vgpr0 = V_MAX3_F32_e64 0, killed $vgpr0, 0, killed $vgpr11, 0, killed $vgpr14, 0, 0, implicit $mode, implicit $exec
100 ; CHECK: renamable $vgpr0 = V_MAX3_F32_e64 0, killed $vgpr0, 0, killed $vgpr1, 0, killed $vgpr3, 0, 0, implicit $mode, implicit $exec
101 ; CHECK: renamable $sgpr0 = nofpexcept V_CMP_GT_F32_e64 0, 1028443341, 0, killed $vgpr0, 0, implicit $mode, implicit $exec
102 ; CHECK: renamable $vgpr0 = V_CNDMASK_B32_e64 0, 0, 0, 1065353216, killed $sgpr0, implicit $exec
103 ; CHECK: EXP_DONE 12, killed renamable $vgpr0, killed renamable $vgpr2, undef renamable $vgpr0, undef renamable $vgpr0, -1, 0, 15, implicit $exec
105 %0:vgpr_32 = COPY $vgpr0
106 undef %1.sub0:sgpr_64 = COPY $sgpr0
107 %2:sgpr_128 = COPY $sgpr0_sgpr1_sgpr2_sgpr3
108 %1.sub1:sgpr_64 = S_MOV_B32 0
109 undef %3.sub0:sgpr_128 = COPY %1.sub1
110 %3.sub1:sgpr_128 = COPY %1.sub1
111 %3.sub2:sgpr_128 = COPY %1.sub1
112 undef %4.sub0:sgpr_64 = S_MOV_B32 1056964608
113 %3.sub3:sgpr_128 = COPY %1.sub1
114 %4.sub1:sgpr_64 = COPY %4.sub0
115 undef %5.sub0:sgpr_256 = COPY %1.sub1
116 %5.sub1:sgpr_256 = COPY %1.sub1
117 %5.sub2:sgpr_256 = COPY %1.sub1
118 %5.sub3:sgpr_256 = COPY %1.sub1
119 %5.sub4:sgpr_256 = COPY %1.sub1
120 %5.sub5:sgpr_256 = COPY %1.sub1
121 %5.sub6:sgpr_256 = COPY %1.sub1
122 %5.sub7:sgpr_256 = COPY %1.sub1
124 %7:sgpr_256 = S_LOAD_DWORDX8_IMM %1, 1088, 0 :: (dereferenceable load (s256), addrspace 6)
125 %8:sgpr_128 = S_LOAD_DWORDX4_IMM %1, 0, 0 :: (load (s128), addrspace 6)
126 undef %9.sub0:sreg_64_xexec = S_MOV_B32 1200
127 %9.sub1:sreg_64_xexec = COPY %1.sub1
128 %10:sgpr_256 = S_LOAD_DWORDX8_IMM %1, 1152, 0 :: (dereferenceable load (s256), addrspace 6)
129 %11:sgpr_128 = S_LOAD_DWORDX4_IMM %9, 0, 0 :: (load (s128), addrspace 6)
130 undef %12.sub0:sreg_64_xexec = S_MOV_B32 1264
131 %12.sub1:sreg_64_xexec = COPY %1.sub1
132 %13:sgpr_256 = S_LOAD_DWORDX8_IMM %1, 1216, 0 :: (dereferenceable load (s256), addrspace 6)
133 %14:sgpr_128 = S_LOAD_DWORDX4_IMM %12, 0, 0 :: (load (s128), addrspace 6)
134 undef %15.sub0:sreg_64_xexec = S_MOV_B32 1328
135 %15.sub1:sreg_64_xexec = COPY %1.sub1
136 %16:sgpr_256 = S_LOAD_DWORDX8_IMM %1, 1280, 0 :: (dereferenceable load (s256), addrspace 6)
137 %17:sgpr_128 = S_LOAD_DWORDX4_IMM %15, 0, 0 :: (load (s128), addrspace 6)
138 %18:sgpr_256 = S_LOAD_DWORDX8_IMM %1, 1344, 0 :: (dereferenceable load (s256), addrspace 6)
139 undef %19.sub0:sreg_64_xexec = S_MOV_B32 1392
140 %19.sub1:sreg_64_xexec = COPY %1.sub1
141 %20:sgpr_256 = S_LOAD_DWORDX8_IMM %1, 0, 0 :: (load (s256), addrspace 6)
142 undef %21.sub0:sreg_64_xexec = S_MOV_B32 1456
143 %21.sub1:sreg_64_xexec = COPY %1.sub1
144 %22:sgpr_256 = S_LOAD_DWORDX8_IMM %1, 1472, 0 :: (dereferenceable load (s256), addrspace 6)
145 %1.sub0:sgpr_64 = S_MOV_B32 1520
146 %23:sgpr_128 = S_LOAD_DWORDX4_IMM %21, 0, 0 :: (load (s128), addrspace 6)
147 %24:sgpr_128 = S_LOAD_DWORDX4_IMM %1, 0, 0 :: (load (s128), addrspace 6)
148 %25:sgpr_128 = S_LOAD_DWORDX4_IMM %19, 0, 0 :: (load (s128), addrspace 6)
149 %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) from custom "ImageResource")
150 %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) from custom "ImageResource")
151 %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) from custom "ImageResource")
152 %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) from custom "ImageResource")
153 %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) from custom "ImageResource")
154 %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) from custom "ImageResource")
155 %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) from custom "ImageResource")
156 %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) from custom "ImageResource")
157 %34:vreg_128 = BUFFER_LOAD_FORMAT_XYZW_IDXEN %0, %2, 0, 0, 0, 0, 0, implicit $exec :: (dereferenceable load (s128) from custom "BufferResource", align 1, addrspace 4)
158 %35:vgpr_32 = nofpexcept V_MAX_F32_e32 %26, %27, implicit $mode, implicit $exec
159 %36:vgpr_32 = V_MAX3_F32_e64 0, %35, 0, %28, 0, %29, 0, 0, implicit $mode, implicit $exec
160 %37:vgpr_32 = nofpexcept V_ADD_F32_e32 -1083321614, %31, implicit $mode, implicit $exec
161 %38:vgpr_32 = nofpexcept V_ADD_F32_e32 -1090988802, %32, implicit $mode, implicit $exec
162 %39:vgpr_32 = V_MAX3_F32_e64 0, %36, 0, %30, 0, %33, 0, 0, implicit $mode, implicit $exec
163 %40:vgpr_32 = V_MAX3_F32_e64 0, %39, 0, %37, 0, %38, 0, 0, implicit $mode, implicit $exec
164 %41:sreg_32_xm0_xexec = nofpexcept V_CMP_GT_F32_e64 0, 1028443341, 0, %40, 0, implicit $mode, implicit $exec
165 %42:vgpr_32 = V_CNDMASK_B32_e64 0, 0, 0, 1065353216, %41, implicit $exec
166 EXP_DONE 12, %42, %34.sub1, undef %43:vgpr_32, undef %44:vgpr_32, -1, 0, 15, implicit $exec