1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx900 -verify-machineinstrs --stress-regalloc=2 -start-before=greedy -stop-after=virtregrewriter -o - %s | FileCheck -check-prefix=GCN %s
4 # Case that should really rematerialize
6 name: test_remat_s_load_dword_imm
7 tracksRegLiveness: true
11 ; GCN-LABEL: name: test_remat_s_load_dword_imm
12 ; GCN: liveins: $sgpr8_sgpr9
14 ; GCN-NEXT: renamable $sgpr2_sgpr3 = COPY $sgpr8_sgpr9
15 ; GCN-NEXT: renamable $sgpr1 = S_LOAD_DWORD_IMM renamable $sgpr2_sgpr3, 4, 0 :: (dereferenceable invariant load (s32), addrspace 4)
16 ; GCN-NEXT: renamable $sgpr0 = S_LOAD_DWORD_IMM renamable $sgpr2_sgpr3, 0, 0 :: (dereferenceable invariant load (s32), addrspace 4)
17 ; GCN-NEXT: S_NOP 0, implicit killed renamable $sgpr0
18 ; GCN-NEXT: S_NOP 0, implicit killed renamable $sgpr1
19 ; GCN-NEXT: renamable $sgpr0 = S_LOAD_DWORD_IMM renamable $sgpr2_sgpr3, 8, 0 :: (dereferenceable invariant load (s32), addrspace 4)
20 ; GCN-NEXT: S_NOP 0, implicit killed renamable $sgpr0
21 ; GCN-NEXT: S_ENDPGM 0, implicit killed renamable $sgpr2_sgpr3
22 %0:sreg_64_xexec = COPY $sgpr8_sgpr9
23 %1:sreg_32_xm0_xexec = S_LOAD_DWORD_IMM %0, 0, 0 :: (invariant dereferenceable load (s32), addrspace 4)
24 %2:sreg_32_xm0_xexec = S_LOAD_DWORD_IMM %0, 4, 0 :: (invariant dereferenceable load (s32), addrspace 4)
25 %3:sreg_32_xm0_xexec = S_LOAD_DWORD_IMM %0, 8, 0 :: (invariant dereferenceable load (s32), addrspace 4)
29 S_ENDPGM 0, implicit %0
33 name: test_remat_s_load_dword_immx2
34 tracksRegLiveness: true
38 ; GCN-LABEL: name: test_remat_s_load_dword_immx2
39 ; GCN: liveins: $sgpr8_sgpr9
41 ; GCN-NEXT: renamable $sgpr0_sgpr1 = COPY $sgpr8_sgpr9
42 ; GCN-NEXT: renamable $sgpr2_sgpr3 = S_LOAD_DWORDX2_IMM renamable $sgpr0_sgpr1, 0, 0 :: (dereferenceable invariant load (s64), addrspace 4)
43 ; GCN-NEXT: S_NOP 0, implicit killed renamable $sgpr2_sgpr3
44 ; GCN-NEXT: renamable $sgpr2_sgpr3 = S_LOAD_DWORDX2_IMM renamable $sgpr0_sgpr1, 4, 0 :: (dereferenceable invariant load (s64), addrspace 4)
45 ; GCN-NEXT: S_NOP 0, implicit killed renamable $sgpr2_sgpr3
46 ; GCN-NEXT: renamable $sgpr2_sgpr3 = S_LOAD_DWORDX2_IMM renamable $sgpr0_sgpr1, 8, 0 :: (dereferenceable invariant load (s64), addrspace 4)
47 ; GCN-NEXT: S_NOP 0, implicit killed renamable $sgpr2_sgpr3
48 ; GCN-NEXT: S_ENDPGM 0, implicit killed renamable $sgpr0_sgpr1
49 %0:sreg_64_xexec = COPY $sgpr8_sgpr9
50 %1:sreg_64_xexec = S_LOAD_DWORDX2_IMM %0, 0, 0 :: (invariant dereferenceable load (s64), addrspace 4)
51 %2:sreg_64_xexec = S_LOAD_DWORDX2_IMM %0, 4, 0 :: (invariant dereferenceable load (s64), addrspace 4)
52 %3:sreg_64_xexec = S_LOAD_DWORDX2_IMM %0, 8, 0 :: (invariant dereferenceable load (s64), addrspace 4)
56 S_ENDPGM 0, implicit %0
60 name: test_remat_s_load_dword_immx4
61 tracksRegLiveness: true
65 ; GCN-LABEL: name: test_remat_s_load_dword_immx4
66 ; GCN: liveins: $sgpr8_sgpr9
68 ; GCN-NEXT: renamable $sgpr0_sgpr1 = COPY $sgpr8_sgpr9
69 ; GCN-NEXT: renamable $sgpr4_sgpr5_sgpr6_sgpr7 = S_LOAD_DWORDX4_IMM renamable $sgpr0_sgpr1, 0, 0 :: (dereferenceable invariant load (s128), addrspace 4)
70 ; GCN-NEXT: S_NOP 0, implicit killed renamable $sgpr4_sgpr5_sgpr6_sgpr7
71 ; GCN-NEXT: renamable $sgpr4_sgpr5_sgpr6_sgpr7 = S_LOAD_DWORDX4_IMM renamable $sgpr0_sgpr1, 4, 0 :: (dereferenceable invariant load (s128), addrspace 4)
72 ; GCN-NEXT: S_NOP 0, implicit killed renamable $sgpr4_sgpr5_sgpr6_sgpr7
73 ; GCN-NEXT: renamable $sgpr4_sgpr5_sgpr6_sgpr7 = S_LOAD_DWORDX4_IMM renamable $sgpr0_sgpr1, 8, 0 :: (dereferenceable invariant load (s128), addrspace 4)
74 ; GCN-NEXT: S_NOP 0, implicit killed renamable $sgpr4_sgpr5_sgpr6_sgpr7
75 ; GCN-NEXT: S_ENDPGM 0, implicit killed renamable $sgpr0_sgpr1
76 %0:sreg_64_xexec = COPY $sgpr8_sgpr9
77 %1:sgpr_128 = S_LOAD_DWORDX4_IMM %0, 0, 0 :: (invariant dereferenceable load (s128), addrspace 4)
78 %2:sgpr_128 = S_LOAD_DWORDX4_IMM %0, 4, 0 :: (invariant dereferenceable load (s128), addrspace 4)
79 %3:sgpr_128 = S_LOAD_DWORDX4_IMM %0, 8, 0 :: (invariant dereferenceable load (s128), addrspace 4)
83 S_ENDPGM 0, implicit %0
87 name: test_remat_s_load_dword_immx8
88 tracksRegLiveness: true
92 ; GCN-LABEL: name: test_remat_s_load_dword_immx8
93 ; GCN: liveins: $sgpr8_sgpr9
95 ; GCN-NEXT: renamable $sgpr0_sgpr1 = COPY $sgpr8_sgpr9
96 ; GCN-NEXT: renamable $sgpr4_sgpr5_sgpr6_sgpr7_sgpr8_sgpr9_sgpr10_sgpr11 = S_LOAD_DWORDX8_IMM renamable $sgpr0_sgpr1, 0, 0 :: (dereferenceable invariant load (s256), addrspace 4)
97 ; GCN-NEXT: S_NOP 0, implicit killed renamable $sgpr4_sgpr5_sgpr6_sgpr7_sgpr8_sgpr9_sgpr10_sgpr11
98 ; GCN-NEXT: renamable $sgpr4_sgpr5_sgpr6_sgpr7_sgpr8_sgpr9_sgpr10_sgpr11 = S_LOAD_DWORDX8_IMM renamable $sgpr0_sgpr1, 4, 0 :: (dereferenceable invariant load (s256), addrspace 4)
99 ; GCN-NEXT: S_NOP 0, implicit killed renamable $sgpr4_sgpr5_sgpr6_sgpr7_sgpr8_sgpr9_sgpr10_sgpr11
100 ; GCN-NEXT: renamable $sgpr4_sgpr5_sgpr6_sgpr7_sgpr8_sgpr9_sgpr10_sgpr11 = S_LOAD_DWORDX8_IMM renamable $sgpr0_sgpr1, 8, 0 :: (dereferenceable invariant load (s256), addrspace 4)
101 ; GCN-NEXT: S_NOP 0, implicit killed renamable $sgpr4_sgpr5_sgpr6_sgpr7_sgpr8_sgpr9_sgpr10_sgpr11
102 ; GCN-NEXT: S_ENDPGM 0, implicit killed renamable $sgpr0_sgpr1
103 %0:sreg_64_xexec = COPY $sgpr8_sgpr9
104 %1:sgpr_256 = S_LOAD_DWORDX8_IMM %0, 0, 0 :: (invariant dereferenceable load (s256), addrspace 4)
105 %2:sgpr_256 = S_LOAD_DWORDX8_IMM %0, 4, 0 :: (invariant dereferenceable load (s256), addrspace 4)
106 %3:sgpr_256 = S_LOAD_DWORDX8_IMM %0, 8, 0 :: (invariant dereferenceable load (s256), addrspace 4)
110 S_ENDPGM 0, implicit %0
114 name: test_remat_s_load_dword_immx16
115 tracksRegLiveness: true
118 liveins: $sgpr8_sgpr9
119 ; GCN-LABEL: name: test_remat_s_load_dword_immx16
120 ; GCN: liveins: $sgpr8_sgpr9
122 ; GCN-NEXT: renamable $sgpr0_sgpr1 = COPY $sgpr8_sgpr9
123 ; GCN-NEXT: renamable $sgpr4_sgpr5_sgpr6_sgpr7_sgpr8_sgpr9_sgpr10_sgpr11_sgpr12_sgpr13_sgpr14_sgpr15_sgpr16_sgpr17_sgpr18_sgpr19 = S_LOAD_DWORDX16_IMM renamable $sgpr0_sgpr1, 0, 0 :: (dereferenceable invariant load (s512), addrspace 4)
124 ; GCN-NEXT: S_NOP 0, implicit killed renamable $sgpr4_sgpr5_sgpr6_sgpr7_sgpr8_sgpr9_sgpr10_sgpr11_sgpr12_sgpr13_sgpr14_sgpr15_sgpr16_sgpr17_sgpr18_sgpr19
125 ; GCN-NEXT: renamable $sgpr4_sgpr5_sgpr6_sgpr7_sgpr8_sgpr9_sgpr10_sgpr11_sgpr12_sgpr13_sgpr14_sgpr15_sgpr16_sgpr17_sgpr18_sgpr19 = S_LOAD_DWORDX16_IMM renamable $sgpr0_sgpr1, 4, 0 :: (dereferenceable invariant load (s512), addrspace 4)
126 ; GCN-NEXT: S_NOP 0, implicit killed renamable $sgpr4_sgpr5_sgpr6_sgpr7_sgpr8_sgpr9_sgpr10_sgpr11_sgpr12_sgpr13_sgpr14_sgpr15_sgpr16_sgpr17_sgpr18_sgpr19
127 ; GCN-NEXT: renamable $sgpr4_sgpr5_sgpr6_sgpr7_sgpr8_sgpr9_sgpr10_sgpr11_sgpr12_sgpr13_sgpr14_sgpr15_sgpr16_sgpr17_sgpr18_sgpr19 = S_LOAD_DWORDX16_IMM renamable $sgpr0_sgpr1, 8, 0 :: (dereferenceable invariant load (s512), addrspace 4)
128 ; GCN-NEXT: S_NOP 0, implicit killed renamable $sgpr4_sgpr5_sgpr6_sgpr7_sgpr8_sgpr9_sgpr10_sgpr11_sgpr12_sgpr13_sgpr14_sgpr15_sgpr16_sgpr17_sgpr18_sgpr19
129 ; GCN-NEXT: S_ENDPGM 0, implicit killed renamable $sgpr0_sgpr1
130 %0:sreg_64_xexec = COPY $sgpr8_sgpr9
131 %1:sgpr_512 = S_LOAD_DWORDX16_IMM %0, 0, 0 :: (invariant dereferenceable load (s512), addrspace 4)
132 %2:sgpr_512 = S_LOAD_DWORDX16_IMM %0, 4, 0 :: (invariant dereferenceable load (s512), addrspace 4)
133 %3:sgpr_512 = S_LOAD_DWORDX16_IMM %0, 8, 0 :: (invariant dereferenceable load (s512), addrspace 4)
137 S_ENDPGM 0, implicit %0
141 name: test_remat_s_load_dword_immx16_subreg
142 tracksRegLiveness: true
145 liveins: $sgpr8_sgpr9, $vgpr0_vgpr1
146 ; GCN-LABEL: name: test_remat_s_load_dword_immx16_subreg
147 ; GCN: liveins: $sgpr8_sgpr9, $vgpr0_vgpr1
149 ; GCN-NEXT: renamable $sgpr0_sgpr1 = COPY $sgpr8_sgpr9
150 ; GCN-NEXT: renamable $sgpr4_sgpr5_sgpr6_sgpr7_sgpr8_sgpr9_sgpr10_sgpr11_sgpr12_sgpr13_sgpr14_sgpr15_sgpr16_sgpr17_sgpr18_sgpr19 = S_LOAD_DWORDX16_IMM renamable $sgpr0_sgpr1, 128, 0 :: (dereferenceable invariant load (s512), align 4, addrspace 4)
151 ; GCN-NEXT: renamable $sgpr4_sgpr5_sgpr6_sgpr7_sgpr8_sgpr9_sgpr10_sgpr11 = S_LOAD_DWORDX8_IMM renamable $sgpr0_sgpr1, 32, 0 :: (dereferenceable invariant load (s256), align 4, addrspace 4)
152 ; GCN-NEXT: renamable $sgpr12_sgpr13_sgpr14_sgpr15_sgpr16_sgpr17_sgpr18_sgpr19 = COPY killed renamable $sgpr4_sgpr5_sgpr6_sgpr7_sgpr8_sgpr9_sgpr10_sgpr11
153 ; GCN-NEXT: S_NOP 0, implicit killed renamable $sgpr12_sgpr13_sgpr14_sgpr15_sgpr16_sgpr17_sgpr18_sgpr19
154 ; GCN-NEXT: renamable $sgpr4_sgpr5_sgpr6_sgpr7_sgpr8_sgpr9_sgpr10_sgpr11_sgpr12_sgpr13_sgpr14_sgpr15_sgpr16_sgpr17_sgpr18_sgpr19 = S_LOAD_DWORDX16_IMM renamable $sgpr0_sgpr1, 128, 0 :: (dereferenceable invariant load (s512), align 4, addrspace 4)
155 ; GCN-NEXT: renamable $sgpr4_sgpr5_sgpr6_sgpr7_sgpr8_sgpr9_sgpr10_sgpr11 = S_LOAD_DWORDX8_IMM renamable $sgpr0_sgpr1, 0, 0 :: (dereferenceable invariant load (s256), align 4, addrspace 4)
156 ; GCN-NEXT: S_NOP 0, implicit killed renamable $sgpr4_sgpr5_sgpr6_sgpr7_sgpr8_sgpr9_sgpr10_sgpr11
157 ; GCN-NEXT: S_ENDPGM 0, implicit killed renamable $sgpr0_sgpr1
158 %0:sreg_64_xexec = COPY $sgpr8_sgpr9
159 %1:sgpr_512 = S_LOAD_DWORDX16_IMM %0, 0, 0 :: (invariant dereferenceable load (s512), align 4, addrspace 4)
160 %2:sgpr_512 = S_LOAD_DWORDX16_IMM %0, 128, 0 :: (invariant dereferenceable load (s512), align 4, addrspace 4)
161 %2.sub8_sub9_sub10_sub11_sub12_sub13_sub14_sub15:sgpr_512 = COPY %1.sub8_sub9_sub10_sub11_sub12_sub13_sub14_sub15:sgpr_512
162 S_NOP 0, implicit %2.sub8_sub9_sub10_sub11_sub12_sub13_sub14_sub15
163 %3:sgpr_512 = S_LOAD_DWORDX16_IMM %0, 128, 0 :: (invariant dereferenceable load (s512), align 4, addrspace 4)
164 %3.sub0_sub1_sub2_sub3_sub4_sub5_sub6_sub7:sgpr_512 = COPY %1.sub0_sub1_sub2_sub3_sub4_sub5_sub6_sub7:sgpr_512
165 S_NOP 0, implicit %3.sub0_sub1_sub2_sub3_sub4_sub5_sub6_sub7:sgpr_512
167 S_ENDPGM 0, implicit %0
171 name: test_remat_s_load_dword_immx16_subreg_no_shrinking_double_use
172 tracksRegLiveness: true
175 liveins: $sgpr8_sgpr9, $vgpr0_vgpr1
176 ; GCN-LABEL: name: test_remat_s_load_dword_immx16_subreg_no_shrinking_double_use
177 ; GCN: liveins: $sgpr8_sgpr9, $vgpr0_vgpr1
179 ; GCN-NEXT: renamable $sgpr0_sgpr1 = COPY $sgpr8_sgpr9
180 ; GCN-NEXT: renamable $sgpr4_sgpr5_sgpr6_sgpr7_sgpr8_sgpr9_sgpr10_sgpr11_sgpr12_sgpr13_sgpr14_sgpr15_sgpr16_sgpr17_sgpr18_sgpr19 = S_LOAD_DWORDX16_IMM renamable $sgpr0_sgpr1, 128, 0 :: (dereferenceable invariant load (s512), align 4, addrspace 4)
181 ; GCN-NEXT: renamable $sgpr4_sgpr5_sgpr6_sgpr7_sgpr8_sgpr9_sgpr10_sgpr11_sgpr12_sgpr13_sgpr14_sgpr15_sgpr16_sgpr17_sgpr18_sgpr19 = S_LOAD_DWORDX16_IMM renamable $sgpr0_sgpr1, 0, 0 :: (dereferenceable invariant load (s512), align 4, addrspace 4)
182 ; GCN-NEXT: renamable $sgpr12_sgpr13_sgpr14_sgpr15_sgpr16_sgpr17_sgpr18_sgpr19 = KILL killed renamable $sgpr12_sgpr13_sgpr14_sgpr15_sgpr16_sgpr17_sgpr18_sgpr19, implicit renamable $sgpr4_sgpr5_sgpr6_sgpr7
183 ; GCN-NEXT: S_NOP 0, implicit killed renamable $sgpr12_sgpr13_sgpr14_sgpr15_sgpr16_sgpr17_sgpr18_sgpr19
184 ; GCN-NEXT: renamable $sgpr4_sgpr5_sgpr6_sgpr7_sgpr8_sgpr9_sgpr10_sgpr11_sgpr12_sgpr13_sgpr14_sgpr15_sgpr16_sgpr17_sgpr18_sgpr19 = S_LOAD_DWORDX16_IMM renamable $sgpr0_sgpr1, 128, 0 :: (dereferenceable invariant load (s512), align 4, addrspace 4)
185 ; GCN-NEXT: renamable $sgpr4_sgpr5_sgpr6_sgpr7_sgpr8_sgpr9_sgpr10_sgpr11 = S_LOAD_DWORDX8_IMM renamable $sgpr0_sgpr1, 0, 0 :: (dereferenceable invariant load (s256), align 4, addrspace 4)
186 ; GCN-NEXT: renamable $sgpr4_sgpr5_sgpr6_sgpr7_sgpr8_sgpr9_sgpr10_sgpr11 = KILL killed renamable $sgpr4_sgpr5_sgpr6_sgpr7_sgpr8_sgpr9_sgpr10_sgpr11, implicit renamable $sgpr0_sgpr1
187 ; GCN-NEXT: S_NOP 0, implicit killed renamable $sgpr4_sgpr5_sgpr6_sgpr7_sgpr8_sgpr9_sgpr10_sgpr11
188 ; GCN-NEXT: S_ENDPGM 0, implicit killed renamable $sgpr0_sgpr1
189 %0:sreg_64_xexec = COPY $sgpr8_sgpr9
190 %1:sgpr_512 = S_LOAD_DWORDX16_IMM %0, 0, 0 :: (invariant dereferenceable load (s512), align 4, addrspace 4)
191 %2:sgpr_512 = S_LOAD_DWORDX16_IMM %0, 128, 0 :: (invariant dereferenceable load (s512), align 4, addrspace 4)
192 %2.sub8_sub9_sub10_sub11_sub12_sub13_sub14_sub15:sgpr_512 = COPY %1.sub8_sub9_sub10_sub11_sub12_sub13_sub14_sub15:sgpr_512, implicit %1.sub0_sub1_sub2_sub3:sgpr_512
193 S_NOP 0, implicit %2.sub8_sub9_sub10_sub11_sub12_sub13_sub14_sub15
194 %3:sgpr_512 = S_LOAD_DWORDX16_IMM %0, 128, 0 :: (invariant dereferenceable load (s512), align 4, addrspace 4)
195 %3.sub0_sub1_sub2_sub3_sub4_sub5_sub6_sub7:sgpr_512 = COPY %1.sub0_sub1_sub2_sub3_sub4_sub5_sub6_sub7:sgpr_512, implicit %0
196 S_NOP 0, implicit %3.sub0_sub1_sub2_sub3_sub4_sub5_sub6_sub7:sgpr_512
197 S_ENDPGM 0, implicit %0
201 name: test_remat_s_load_dword_immx16_subreg_no_shrinking_bundle
202 tracksRegLiveness: true
205 liveins: $sgpr8_sgpr9, $vgpr0_vgpr1
206 ; GCN-LABEL: name: test_remat_s_load_dword_immx16_subreg_no_shrinking_bundle
207 ; GCN: liveins: $sgpr8_sgpr9, $vgpr0_vgpr1
209 ; GCN-NEXT: renamable $sgpr0_sgpr1 = COPY $sgpr8_sgpr9
210 ; GCN-NEXT: renamable $sgpr4_sgpr5_sgpr6_sgpr7_sgpr8_sgpr9_sgpr10_sgpr11_sgpr12_sgpr13_sgpr14_sgpr15_sgpr16_sgpr17_sgpr18_sgpr19 = S_LOAD_DWORDX16_IMM renamable $sgpr0_sgpr1, 128, 0 :: (dereferenceable invariant load (s512), align 4, addrspace 4)
211 ; GCN-NEXT: renamable $sgpr4_sgpr5_sgpr6_sgpr7_sgpr8_sgpr9_sgpr10_sgpr11_sgpr12_sgpr13_sgpr14_sgpr15_sgpr16_sgpr17_sgpr18_sgpr19 = S_LOAD_DWORDX16_IMM renamable $sgpr0_sgpr1, 0, 0 :: (dereferenceable invariant load (s512), align 4, addrspace 4)
212 ; GCN-NEXT: S_NOP 0, implicit killed renamable $sgpr12_sgpr13_sgpr14_sgpr15_sgpr16_sgpr17_sgpr18_sgpr19
213 ; GCN-NEXT: S_ENDPGM 0, implicit killed renamable $sgpr0_sgpr1
214 %0:sreg_64_xexec = COPY $sgpr8_sgpr9
215 %1:sgpr_512 = S_LOAD_DWORDX16_IMM %0, 0, 0 :: (invariant dereferenceable load (s512), align 4, addrspace 4)
216 %2:sgpr_512 = S_LOAD_DWORDX16_IMM %0, 128, 0 :: (invariant dereferenceable load (s512), align 4, addrspace 4)
217 %2.sub8_sub9_sub10_sub11_sub12_sub13_sub14_sub15:sgpr_512 = COPY %1.sub8_sub9_sub10_sub11_sub12_sub13_sub14_sub15:sgpr_512 {
218 internal %2.sub8_sub9_sub10_sub11_sub12_sub13_sub14_sub15:sgpr_512 = COPY %1.sub8_sub9_sub10_sub11_sub12_sub13_sub14_sub15:sgpr_512
220 S_NOP 0, implicit %2.sub8_sub9_sub10_sub11_sub12_sub13_sub14_sub15
222 S_ENDPGM 0, implicit %0
226 name: test_remat_s_load_dword_immx8_subreg
227 tracksRegLiveness: true
230 liveins: $sgpr8_sgpr9, $vgpr0_vgpr1
231 ; GCN-LABEL: name: test_remat_s_load_dword_immx8_subreg
232 ; GCN: liveins: $sgpr8_sgpr9, $vgpr0_vgpr1
234 ; GCN-NEXT: renamable $sgpr0_sgpr1 = COPY $sgpr8_sgpr9
235 ; GCN-NEXT: renamable $sgpr4_sgpr5_sgpr6_sgpr7_sgpr8_sgpr9_sgpr10_sgpr11 = S_LOAD_DWORDX8_IMM renamable $sgpr0_sgpr1, 128, 0 :: (dereferenceable invariant load (s256), align 4, addrspace 4)
236 ; GCN-NEXT: renamable $sgpr4_sgpr5_sgpr6_sgpr7 = S_LOAD_DWORDX4_IMM renamable $sgpr0_sgpr1, 16, 0 :: (dereferenceable invariant load (s128), align 4, addrspace 4)
237 ; GCN-NEXT: renamable $sgpr8_sgpr9_sgpr10_sgpr11 = COPY killed renamable $sgpr4_sgpr5_sgpr6_sgpr7
238 ; GCN-NEXT: S_NOP 0, implicit killed renamable $sgpr8_sgpr9_sgpr10_sgpr11
239 ; GCN-NEXT: renamable $sgpr4_sgpr5_sgpr6_sgpr7_sgpr8_sgpr9_sgpr10_sgpr11 = S_LOAD_DWORDX8_IMM renamable $sgpr0_sgpr1, 128, 0 :: (dereferenceable invariant load (s256), align 4, addrspace 4)
240 ; GCN-NEXT: renamable $sgpr4_sgpr5_sgpr6_sgpr7 = S_LOAD_DWORDX4_IMM renamable $sgpr0_sgpr1, 0, 0 :: (dereferenceable invariant load (s128), align 4, addrspace 4)
241 ; GCN-NEXT: S_NOP 0, implicit killed renamable $sgpr4_sgpr5_sgpr6_sgpr7
242 ; GCN-NEXT: S_ENDPGM 0, implicit killed renamable $sgpr0_sgpr1
243 %0:sreg_64_xexec = COPY $sgpr8_sgpr9
244 %1:sgpr_256 = S_LOAD_DWORDX8_IMM %0, 0, 0 :: (invariant dereferenceable load (s256), align 4, addrspace 4)
245 %2:sgpr_256 = S_LOAD_DWORDX8_IMM %0, 128, 0 :: (invariant dereferenceable load (s256), align 4, addrspace 4)
246 %2.sub4_sub5_sub6_sub7:sgpr_256 = COPY %1.sub4_sub5_sub6_sub7:sgpr_256
247 S_NOP 0, implicit %2.sub4_sub5_sub6_sub7
248 %3:sgpr_256 = S_LOAD_DWORDX8_IMM %0, 128, 0 :: (invariant dereferenceable load (s256), align 4, addrspace 4)
249 %3.sub0_sub1_sub2_sub3:sgpr_256 = COPY %1.sub0_sub1_sub2_sub3:sgpr_256
250 S_NOP 0, implicit %3.sub0_sub1_sub2_sub3:sgpr_256
252 S_ENDPGM 0, implicit %0
257 name: test_remat_s_get_waveid_in_workgroup
258 tracksRegLiveness: true
261 liveins: $sgpr8_sgpr9
262 ; GCN-LABEL: name: test_remat_s_get_waveid_in_workgroup
263 ; GCN: liveins: $sgpr8_sgpr9
265 ; GCN-NEXT: renamable $sgpr2_sgpr3 = COPY $sgpr8_sgpr9
266 ; GCN-NEXT: renamable $sgpr0 = S_GET_WAVEID_IN_WORKGROUP
267 ; GCN-NEXT: SI_SPILL_S32_SAVE killed renamable $sgpr0, %stack.1, implicit $exec, implicit $sp_reg :: (store (s32) into %stack.1, addrspace 5)
268 ; GCN-NEXT: renamable $sgpr1 = S_GET_WAVEID_IN_WORKGROUP
269 ; GCN-NEXT: renamable $sgpr0 = S_GET_WAVEID_IN_WORKGROUP
270 ; GCN-NEXT: SI_SPILL_S32_SAVE killed renamable $sgpr0, %stack.0, implicit $exec, implicit $sp_reg :: (store (s32) into %stack.0, addrspace 5)
271 ; GCN-NEXT: renamable $sgpr0 = SI_SPILL_S32_RESTORE %stack.1, implicit $exec, implicit $sp_reg :: (load (s32) from %stack.1, addrspace 5)
272 ; GCN-NEXT: S_NOP 0, implicit killed renamable $sgpr0
273 ; GCN-NEXT: S_NOP 0, implicit killed renamable $sgpr1
274 ; GCN-NEXT: renamable $sgpr0 = SI_SPILL_S32_RESTORE %stack.0, implicit $exec, implicit $sp_reg :: (load (s32) from %stack.0, addrspace 5)
275 ; GCN-NEXT: S_NOP 0, implicit killed renamable $sgpr0
276 ; GCN-NEXT: S_ENDPGM 0, implicit killed renamable $sgpr2_sgpr3
277 %0:sreg_64_xexec = COPY $sgpr8_sgpr9
278 %1:sreg_32_xm0_xexec = S_GET_WAVEID_IN_WORKGROUP
279 %2:sreg_32_xm0_xexec = S_GET_WAVEID_IN_WORKGROUP
280 %3:sreg_32_xm0_xexec = S_GET_WAVEID_IN_WORKGROUP
284 S_ENDPGM 0, implicit %0
289 name: test_remat_s_load_dword_sgpr
290 tracksRegLiveness: true
293 liveins: $sgpr8_sgpr9, $sgpr10
294 ; GCN-LABEL: name: test_remat_s_load_dword_sgpr
295 ; GCN: liveins: $sgpr10, $sgpr8_sgpr9
297 ; GCN-NEXT: renamable $sgpr2_sgpr3 = COPY $sgpr8_sgpr9
298 ; GCN-NEXT: renamable $sgpr0 = COPY $sgpr10
299 ; GCN-NEXT: renamable $sgpr1 = S_LOAD_DWORD_SGPR renamable $sgpr2_sgpr3, renamable $sgpr0, 0 :: (dereferenceable invariant load (s32), addrspace 4)
300 ; GCN-NEXT: S_NOP 0, implicit killed renamable $sgpr1
301 ; GCN-NEXT: renamable $sgpr1 = S_LOAD_DWORD_SGPR renamable $sgpr2_sgpr3, renamable $sgpr0, 0 :: (dereferenceable invariant load (s32), addrspace 4)
302 ; GCN-NEXT: S_NOP 0, implicit killed renamable $sgpr1
303 ; GCN-NEXT: renamable $sgpr1 = S_LOAD_DWORD_SGPR renamable $sgpr2_sgpr3, renamable $sgpr0, 0 :: (dereferenceable invariant load (s32), addrspace 4)
304 ; GCN-NEXT: S_NOP 0, implicit killed renamable $sgpr1
305 ; GCN-NEXT: S_ENDPGM 0, implicit killed renamable $sgpr2_sgpr3, implicit killed renamable $sgpr0
306 %0:sreg_64_xexec = COPY $sgpr8_sgpr9
307 %1:sgpr_32 = COPY $sgpr10
308 %2:sreg_32_xm0_xexec = S_LOAD_DWORD_SGPR %0, %1, 0 :: (invariant dereferenceable load (s32), addrspace 4)
309 %3:sreg_32_xm0_xexec = S_LOAD_DWORD_SGPR %0, %1, 0 :: (invariant dereferenceable load (s32), addrspace 4)
310 %4:sreg_32_xm0_xexec = S_LOAD_DWORD_SGPR %0, %1, 0 :: (invariant dereferenceable load (s32), addrspace 4)
314 S_ENDPGM 0, implicit %0, implicit %1
318 name: test_remat_s_load_dword_sgpr_imm
319 tracksRegLiveness: true
322 liveins: $sgpr8_sgpr9, $sgpr10
323 ; GCN-LABEL: name: test_remat_s_load_dword_sgpr_imm
324 ; GCN: liveins: $sgpr10, $sgpr8_sgpr9
326 ; GCN-NEXT: renamable $sgpr2_sgpr3 = COPY $sgpr8_sgpr9
327 ; GCN-NEXT: renamable $sgpr0 = COPY $sgpr10
328 ; GCN-NEXT: renamable $sgpr1 = S_LOAD_DWORD_SGPR_IMM renamable $sgpr2_sgpr3, renamable $sgpr0, 0, 0 :: (dereferenceable invariant load (s32), addrspace 4)
329 ; GCN-NEXT: S_NOP 0, implicit killed renamable $sgpr1
330 ; GCN-NEXT: renamable $sgpr1 = S_LOAD_DWORD_SGPR_IMM renamable $sgpr2_sgpr3, renamable $sgpr0, 4, 0 :: (dereferenceable invariant load (s32), addrspace 4)
331 ; GCN-NEXT: S_NOP 0, implicit killed renamable $sgpr1
332 ; GCN-NEXT: renamable $sgpr1 = S_LOAD_DWORD_SGPR_IMM renamable $sgpr2_sgpr3, renamable $sgpr0, 8, 0 :: (dereferenceable invariant load (s32), addrspace 4)
333 ; GCN-NEXT: S_NOP 0, implicit killed renamable $sgpr1
334 ; GCN-NEXT: S_ENDPGM 0, implicit killed renamable $sgpr2_sgpr3, implicit killed renamable $sgpr0
335 %0:sreg_64_xexec = COPY $sgpr8_sgpr9
336 %1:sgpr_32 = COPY $sgpr10
337 %2:sreg_32_xm0_xexec = S_LOAD_DWORD_SGPR_IMM %0, %1, 0, 0 :: (invariant dereferenceable load (s32), addrspace 4)
338 %3:sreg_32_xm0_xexec = S_LOAD_DWORD_SGPR_IMM %0, %1, 4, 0 :: (invariant dereferenceable load (s32), addrspace 4)
339 %4:sreg_32_xm0_xexec = S_LOAD_DWORD_SGPR_IMM %0, %1, 8, 0 :: (invariant dereferenceable load (s32), addrspace 4)
343 S_ENDPGM 0, implicit %0, implicit %1
347 name: test_remat_s_load_dword_imm_ci
348 tracksRegLiveness: true
351 liveins: $sgpr8_sgpr9
352 ; GCN-LABEL: name: test_remat_s_load_dword_imm_ci
353 ; GCN: liveins: $sgpr8_sgpr9
355 ; GCN-NEXT: renamable $sgpr2_sgpr3 = COPY $sgpr8_sgpr9
356 ; GCN-NEXT: renamable $sgpr0 = S_LOAD_DWORD_IMM_ci renamable $sgpr2_sgpr3, 0, 0 :: (dereferenceable invariant load (s32), addrspace 4)
357 ; GCN-NEXT: SI_SPILL_S32_SAVE killed renamable $sgpr0, %stack.0, implicit $exec, implicit $sp_reg :: (store (s32) into %stack.0, addrspace 5)
358 ; GCN-NEXT: renamable $sgpr1 = S_LOAD_DWORD_IMM_ci renamable $sgpr2_sgpr3, 4, 0 :: (dereferenceable invariant load (s32), addrspace 4)
359 ; GCN-NEXT: renamable $sgpr0 = S_LOAD_DWORD_IMM_ci renamable $sgpr2_sgpr3, 8, 0 :: (dereferenceable invariant load (s32), addrspace 4)
360 ; GCN-NEXT: SI_SPILL_S32_SAVE killed renamable $sgpr0, %stack.1, implicit $exec, implicit $sp_reg :: (store (s32) into %stack.1, addrspace 5)
361 ; GCN-NEXT: renamable $sgpr0 = SI_SPILL_S32_RESTORE %stack.0, implicit $exec, implicit $sp_reg :: (load (s32) from %stack.0, addrspace 5)
362 ; GCN-NEXT: S_NOP 0, implicit killed renamable $sgpr0
363 ; GCN-NEXT: S_NOP 0, implicit killed renamable $sgpr1
364 ; GCN-NEXT: renamable $sgpr0 = SI_SPILL_S32_RESTORE %stack.1, implicit $exec, implicit $sp_reg :: (load (s32) from %stack.1, addrspace 5)
365 ; GCN-NEXT: S_NOP 0, implicit killed renamable $sgpr0
366 ; GCN-NEXT: S_ENDPGM 0, implicit killed renamable $sgpr2_sgpr3
367 %0:sreg_64_xexec = COPY $sgpr8_sgpr9
368 %1:sreg_32_xm0_xexec = S_LOAD_DWORD_IMM_ci %0, 0, 0 :: (invariant dereferenceable load (s32), addrspace 4)
369 %2:sreg_32_xm0_xexec = S_LOAD_DWORD_IMM_ci %0, 4, 0 :: (invariant dereferenceable load (s32), addrspace 4)
370 %3:sreg_32_xm0_xexec = S_LOAD_DWORD_IMM_ci %0, 8, 0 :: (invariant dereferenceable load (s32), addrspace 4)
374 S_ENDPGM 0, implicit %0
378 name: test_remat_s_buffer_load_dword_imm
379 tracksRegLiveness: true
382 liveins: $sgpr8_sgpr9_sgpr10_sgpr11
383 ; GCN-LABEL: name: test_remat_s_buffer_load_dword_imm
384 ; GCN: liveins: $sgpr8_sgpr9_sgpr10_sgpr11
386 ; GCN-NEXT: renamable $sgpr4_sgpr5_sgpr6_sgpr7 = COPY $sgpr8_sgpr9_sgpr10_sgpr11
387 ; GCN-NEXT: renamable $sgpr1 = S_BUFFER_LOAD_DWORD_IMM renamable $sgpr4_sgpr5_sgpr6_sgpr7, 4, 0 :: (dereferenceable invariant load (s32), addrspace 4)
388 ; GCN-NEXT: renamable $sgpr0 = S_BUFFER_LOAD_DWORD_IMM renamable $sgpr4_sgpr5_sgpr6_sgpr7, 0, 0 :: (dereferenceable invariant load (s32), addrspace 4)
389 ; GCN-NEXT: S_NOP 0, implicit killed renamable $sgpr0
390 ; GCN-NEXT: S_NOP 0, implicit killed renamable $sgpr1
391 ; GCN-NEXT: renamable $sgpr0 = S_BUFFER_LOAD_DWORD_IMM renamable $sgpr4_sgpr5_sgpr6_sgpr7, 8, 0 :: (dereferenceable invariant load (s32), addrspace 4)
392 ; GCN-NEXT: S_NOP 0, implicit killed renamable $sgpr0
393 ; GCN-NEXT: S_ENDPGM 0, implicit killed renamable $sgpr4_sgpr5_sgpr6_sgpr7
394 %0:sgpr_128 = COPY $sgpr8_sgpr9_sgpr10_sgpr11
395 %1:sreg_32_xm0_xexec = S_BUFFER_LOAD_DWORD_IMM %0, 0, 0 :: (invariant dereferenceable load (s32), addrspace 4)
396 %2:sreg_32_xm0_xexec = S_BUFFER_LOAD_DWORD_IMM %0, 4, 0 :: (invariant dereferenceable load (s32), addrspace 4)
397 %3:sreg_32_xm0_xexec = S_BUFFER_LOAD_DWORD_IMM %0, 8, 0 :: (invariant dereferenceable load (s32), addrspace 4)
401 S_ENDPGM 0, implicit %0
405 name: test_remat_s_scratch_load_dword_imm
406 tracksRegLiveness: true
409 liveins: $sgpr8_sgpr9
410 ; GCN-LABEL: name: test_remat_s_scratch_load_dword_imm
411 ; GCN: liveins: $sgpr8_sgpr9
413 ; GCN-NEXT: renamable $sgpr2_sgpr3 = COPY $sgpr8_sgpr9
414 ; GCN-NEXT: renamable $sgpr1 = S_SCRATCH_LOAD_DWORD_IMM renamable $sgpr2_sgpr3, 4, 0, implicit $flat_scr :: (dereferenceable invariant load (s32), addrspace 4)
415 ; GCN-NEXT: renamable $sgpr0 = S_SCRATCH_LOAD_DWORD_IMM renamable $sgpr2_sgpr3, 0, 0, implicit $flat_scr :: (dereferenceable invariant load (s32), addrspace 4)
416 ; GCN-NEXT: S_NOP 0, implicit killed renamable $sgpr0
417 ; GCN-NEXT: S_NOP 0, implicit killed renamable $sgpr1
418 ; GCN-NEXT: renamable $sgpr0 = S_SCRATCH_LOAD_DWORD_IMM renamable $sgpr2_sgpr3, 8, 0, implicit $flat_scr :: (dereferenceable invariant load (s32), addrspace 4)
419 ; GCN-NEXT: S_NOP 0, implicit killed renamable $sgpr0
420 ; GCN-NEXT: S_ENDPGM 0, implicit killed renamable $sgpr2_sgpr3
421 %0:sreg_64_xexec = COPY $sgpr8_sgpr9
422 %1:sreg_32_xm0_xexec = S_SCRATCH_LOAD_DWORD_IMM %0, 0, 0, implicit $flat_scr :: (invariant dereferenceable load (s32), addrspace 4)
423 %2:sreg_32_xm0_xexec = S_SCRATCH_LOAD_DWORD_IMM %0, 4, 0, implicit $flat_scr :: (invariant dereferenceable load (s32), addrspace 4)
424 %3:sreg_32_xm0_xexec = S_SCRATCH_LOAD_DWORD_IMM %0, 8, 0, implicit $flat_scr :: (invariant dereferenceable load (s32), addrspace 4)
428 S_ENDPGM 0, implicit %0
432 name: test_remat_s_load_dword_invariant_not_dereferenceable
433 tracksRegLiveness: true
436 liveins: $sgpr8_sgpr9
437 ; GCN-LABEL: name: test_remat_s_load_dword_invariant_not_dereferenceable
438 ; GCN: liveins: $sgpr8_sgpr9
440 ; GCN-NEXT: renamable $sgpr2_sgpr3 = COPY $sgpr8_sgpr9
441 ; GCN-NEXT: renamable $sgpr1 = S_LOAD_DWORD_IMM renamable $sgpr2_sgpr3, 4, 0 :: (invariant load (s32), addrspace 4)
442 ; GCN-NEXT: renamable $sgpr0 = S_LOAD_DWORD_IMM renamable $sgpr2_sgpr3, 0, 0 :: (invariant load (s32), addrspace 4)
443 ; GCN-NEXT: S_NOP 0, implicit killed renamable $sgpr0
444 ; GCN-NEXT: S_NOP 0, implicit killed renamable $sgpr1
445 ; GCN-NEXT: renamable $sgpr0 = S_LOAD_DWORD_IMM renamable $sgpr2_sgpr3, 8, 0 :: (invariant load (s32), addrspace 4)
446 ; GCN-NEXT: S_NOP 0, implicit killed renamable $sgpr0
447 ; GCN-NEXT: S_ENDPGM 0, implicit killed renamable $sgpr2_sgpr3
448 %0:sreg_64_xexec = COPY $sgpr8_sgpr9
449 %1:sreg_32_xm0_xexec = S_LOAD_DWORD_IMM %0, 0, 0 :: (invariant load (s32), addrspace 4)
450 %2:sreg_32_xm0_xexec = S_LOAD_DWORD_IMM %0, 4, 0 :: (invariant load (s32), addrspace 4)
451 %3:sreg_32_xm0_xexec = S_LOAD_DWORD_IMM %0, 8, 0 :: (invariant load (s32), addrspace 4)
455 S_ENDPGM 0, implicit %0
459 #---------------------------------------------------------------------
461 #---------------------------------------------------------------------
464 name: test_no_remat_s_load_dword_not_invariant
465 tracksRegLiveness: true
468 liveins: $sgpr8_sgpr9
469 ; GCN-LABEL: name: test_no_remat_s_load_dword_not_invariant
470 ; GCN: liveins: $sgpr8_sgpr9
472 ; GCN-NEXT: renamable $sgpr2_sgpr3 = COPY $sgpr8_sgpr9
473 ; GCN-NEXT: renamable $sgpr0 = S_LOAD_DWORD_IMM renamable $sgpr2_sgpr3, 0, 0 :: (dereferenceable load (s32), addrspace 4)
474 ; GCN-NEXT: SI_SPILL_S32_SAVE killed renamable $sgpr0, %stack.0, implicit $exec, implicit $sp_reg :: (store (s32) into %stack.0, addrspace 5)
475 ; GCN-NEXT: renamable $sgpr1 = S_LOAD_DWORD_IMM renamable $sgpr2_sgpr3, 4, 0 :: (dereferenceable load (s32), addrspace 4)
476 ; GCN-NEXT: renamable $sgpr0 = S_LOAD_DWORD_IMM renamable $sgpr2_sgpr3, 8, 0 :: (dereferenceable load (s32), addrspace 4)
477 ; GCN-NEXT: SI_SPILL_S32_SAVE killed renamable $sgpr0, %stack.1, implicit $exec, implicit $sp_reg :: (store (s32) into %stack.1, addrspace 5)
478 ; GCN-NEXT: renamable $sgpr0 = SI_SPILL_S32_RESTORE %stack.0, implicit $exec, implicit $sp_reg :: (load (s32) from %stack.0, addrspace 5)
479 ; GCN-NEXT: S_NOP 0, implicit killed renamable $sgpr0
480 ; GCN-NEXT: S_NOP 0, implicit killed renamable $sgpr1
481 ; GCN-NEXT: renamable $sgpr0 = SI_SPILL_S32_RESTORE %stack.1, implicit $exec, implicit $sp_reg :: (load (s32) from %stack.1, addrspace 5)
482 ; GCN-NEXT: S_NOP 0, implicit killed renamable $sgpr0
483 ; GCN-NEXT: S_ENDPGM 0, implicit killed renamable $sgpr2_sgpr3
484 %0:sreg_64_xexec = COPY $sgpr8_sgpr9
485 %1:sreg_32_xm0_xexec = S_LOAD_DWORD_IMM %0, 0, 0 :: (dereferenceable load (s32), addrspace 4)
486 %2:sreg_32_xm0_xexec = S_LOAD_DWORD_IMM %0, 4, 0 :: (dereferenceable load (s32), addrspace 4)
487 %3:sreg_32_xm0_xexec = S_LOAD_DWORD_IMM %0, 8, 0 :: (dereferenceable load (s32), addrspace 4)
491 S_ENDPGM 0, implicit %0
495 name: test_no_remat_s_memtime
496 tracksRegLiveness: true
499 liveins: $sgpr8_sgpr9
500 ; GCN-LABEL: name: test_no_remat_s_memtime
501 ; GCN: liveins: $sgpr8_sgpr9
503 ; GCN-NEXT: SI_SPILL_S64_SAVE $sgpr8_sgpr9, %stack.0, implicit $exec, implicit $sp_reg :: (store (s64) into %stack.0, align 4, addrspace 5)
504 ; GCN-NEXT: renamable $sgpr2_sgpr3 = S_MEMTIME
505 ; GCN-NEXT: renamable $sgpr0_sgpr1 = S_MEMTIME
506 ; GCN-NEXT: SI_SPILL_S64_SAVE killed renamable $sgpr0_sgpr1, %stack.2, implicit $exec, implicit $sp_reg :: (store (s64) into %stack.2, align 4, addrspace 5)
507 ; GCN-NEXT: renamable $sgpr0_sgpr1 = S_MEMTIME
508 ; GCN-NEXT: SI_SPILL_S64_SAVE killed renamable $sgpr0_sgpr1, %stack.1, implicit $exec, implicit $sp_reg :: (store (s64) into %stack.1, align 4, addrspace 5)
509 ; GCN-NEXT: S_NOP 0, implicit killed renamable $sgpr2_sgpr3
510 ; GCN-NEXT: renamable $sgpr0_sgpr1 = SI_SPILL_S64_RESTORE %stack.2, implicit $exec, implicit $sp_reg :: (load (s64) from %stack.2, align 4, addrspace 5)
511 ; GCN-NEXT: S_NOP 0, implicit killed renamable $sgpr0_sgpr1
512 ; GCN-NEXT: renamable $sgpr0_sgpr1 = SI_SPILL_S64_RESTORE %stack.1, implicit $exec, implicit $sp_reg :: (load (s64) from %stack.1, align 4, addrspace 5)
513 ; GCN-NEXT: S_NOP 0, implicit killed renamable $sgpr0_sgpr1
514 ; GCN-NEXT: renamable $sgpr0_sgpr1 = SI_SPILL_S64_RESTORE %stack.0, implicit $exec, implicit $sp_reg :: (load (s64) from %stack.0, align 4, addrspace 5)
515 ; GCN-NEXT: S_ENDPGM 0, implicit killed renamable $sgpr0_sgpr1
516 %0:sreg_64_xexec = COPY $sgpr8_sgpr9
517 %1:sreg_64_xexec = S_MEMTIME
518 %2:sreg_64_xexec = S_MEMTIME
519 %3:sreg_64_xexec = S_MEMTIME
523 S_ENDPGM 0, implicit %0
527 name: test_no_remat_s_memrealtime
528 tracksRegLiveness: true
531 liveins: $sgpr8_sgpr9
532 ; GCN-LABEL: name: test_no_remat_s_memrealtime
533 ; GCN: liveins: $sgpr8_sgpr9
535 ; GCN-NEXT: SI_SPILL_S64_SAVE $sgpr8_sgpr9, %stack.0, implicit $exec, implicit $sp_reg :: (store (s64) into %stack.0, align 4, addrspace 5)
536 ; GCN-NEXT: renamable $sgpr2_sgpr3 = S_MEMREALTIME
537 ; GCN-NEXT: renamable $sgpr0_sgpr1 = S_MEMREALTIME
538 ; GCN-NEXT: SI_SPILL_S64_SAVE killed renamable $sgpr0_sgpr1, %stack.2, implicit $exec, implicit $sp_reg :: (store (s64) into %stack.2, align 4, addrspace 5)
539 ; GCN-NEXT: renamable $sgpr0_sgpr1 = S_MEMREALTIME
540 ; GCN-NEXT: SI_SPILL_S64_SAVE killed renamable $sgpr0_sgpr1, %stack.1, implicit $exec, implicit $sp_reg :: (store (s64) into %stack.1, align 4, addrspace 5)
541 ; GCN-NEXT: S_NOP 0, implicit killed renamable $sgpr2_sgpr3
542 ; GCN-NEXT: renamable $sgpr0_sgpr1 = SI_SPILL_S64_RESTORE %stack.2, implicit $exec, implicit $sp_reg :: (load (s64) from %stack.2, align 4, addrspace 5)
543 ; GCN-NEXT: S_NOP 0, implicit killed renamable $sgpr0_sgpr1
544 ; GCN-NEXT: renamable $sgpr0_sgpr1 = SI_SPILL_S64_RESTORE %stack.1, implicit $exec, implicit $sp_reg :: (load (s64) from %stack.1, align 4, addrspace 5)
545 ; GCN-NEXT: S_NOP 0, implicit killed renamable $sgpr0_sgpr1
546 ; GCN-NEXT: renamable $sgpr0_sgpr1 = SI_SPILL_S64_RESTORE %stack.0, implicit $exec, implicit $sp_reg :: (load (s64) from %stack.0, align 4, addrspace 5)
547 ; GCN-NEXT: S_ENDPGM 0, implicit killed renamable $sgpr0_sgpr1
548 %0:sreg_64_xexec = COPY $sgpr8_sgpr9
549 %1:sreg_64_xexec = S_MEMREALTIME
550 %2:sreg_64_xexec = S_MEMREALTIME
551 %3:sreg_64_xexec = S_MEMREALTIME
555 S_ENDPGM 0, implicit %0
559 name: test_no_remat_s_load_dword_immx2_tied
560 tracksRegLiveness: true
563 liveins: $sgpr8_sgpr9
564 ; GCN-LABEL: name: test_no_remat_s_load_dword_immx2_tied
565 ; GCN: liveins: $sgpr8_sgpr9
567 ; GCN-NEXT: renamable $sgpr0_sgpr1 = COPY $sgpr8_sgpr9
568 ; GCN-NEXT: renamable $sgpr2_sgpr3 = S_LOAD_DWORDX2_IMM renamable $sgpr0_sgpr1, 0, 0 :: (dereferenceable invariant load (s64), addrspace 4)
569 ; GCN-NEXT: SI_SPILL_S64_SAVE killed renamable $sgpr2_sgpr3, %stack.1, implicit $exec, implicit $sp_reg :: (store (s64) into %stack.1, align 4, addrspace 5)
570 ; GCN-NEXT: renamable $sgpr2_sgpr3 = S_LOAD_DWORDX2_IMM renamable $sgpr0_sgpr1, 4, 0 :: (dereferenceable invariant load (s64), addrspace 4)
571 ; GCN-NEXT: SI_SPILL_S64_SAVE killed renamable $sgpr2_sgpr3, %stack.0, implicit $exec, implicit $sp_reg :: (store (s64) into %stack.0, align 4, addrspace 5)
572 ; GCN-NEXT: renamable $sgpr0_sgpr1 = S_LOAD_DWORDX2_IMM renamable $sgpr0_sgpr1, 8, 0 :: (dereferenceable invariant load (s64), addrspace 4)
573 ; GCN-NEXT: renamable $sgpr2_sgpr3 = SI_SPILL_S64_RESTORE %stack.1, implicit $exec, implicit $sp_reg :: (load (s64) from %stack.1, align 4, addrspace 5)
574 ; GCN-NEXT: S_NOP 0, implicit killed renamable $sgpr2_sgpr3
575 ; GCN-NEXT: renamable $sgpr2_sgpr3 = SI_SPILL_S64_RESTORE %stack.0, implicit $exec, implicit $sp_reg :: (load (s64) from %stack.0, align 4, addrspace 5)
576 ; GCN-NEXT: S_NOP 0, implicit killed renamable $sgpr2_sgpr3
577 ; GCN-NEXT: S_NOP 0, implicit killed renamable $sgpr0_sgpr1
578 undef %0.sub0_sub1:sgpr_256 = COPY $sgpr8_sgpr9
579 %1:sreg_64_xexec = S_LOAD_DWORDX2_IMM %0.sub0_sub1:sgpr_256, 0, 0 :: (invariant dereferenceable load (s64), addrspace 4)
580 %2:sreg_64_xexec = S_LOAD_DWORDX2_IMM %0.sub0_sub1:sgpr_256, 4, 0 :: (invariant dereferenceable load (s64), addrspace 4)
581 %0.sub0_sub1:sgpr_256 = S_LOAD_DWORDX2_IMM %0.sub0_sub1:sgpr_256, 8, 0 :: (invariant dereferenceable load (s64), addrspace 4)
584 S_NOP 0, implicit %0.sub0_sub1:sgpr_256