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
5 name: test_remat_s_mov_b32
6 tracksRegLiveness: true
9 ; GCN-LABEL: name: test_remat_s_mov_b32
10 ; GCN: renamable $sgpr0 = S_MOV_B32 1
11 ; GCN: renamable $sgpr1 = S_MOV_B32 2
12 ; GCN: S_NOP 0, implicit killed renamable $sgpr0
13 ; GCN: S_NOP 0, implicit killed renamable $sgpr1
14 ; GCN: renamable $sgpr0 = S_MOV_B32 3
15 ; GCN: S_NOP 0, implicit killed renamable $sgpr0
17 %0:sreg_32 = S_MOV_B32 1
18 %1:sreg_32 = S_MOV_B32 2
19 %2:sreg_32 = S_MOV_B32 3
26 name: test_no_remat_s_mov_b32_impuse_exec
27 tracksRegLiveness: true
29 stackPtrOffsetReg: $sgpr32
32 ; GCN-LABEL: name: test_no_remat_s_mov_b32_impuse_exec
33 ; GCN: $exec = IMPLICIT_DEF
34 ; GCN: renamable $sgpr0 = S_MOV_B32 1, implicit $exec
35 ; GCN: SI_SPILL_S32_SAVE killed renamable $sgpr0, %stack.1, implicit $exec, implicit $sgpr32 :: (store (s32) into %stack.1, addrspace 5)
36 ; GCN: renamable $sgpr1 = S_MOV_B32 2, implicit $exec
37 ; GCN: renamable $sgpr0 = S_MOV_B32 3, implicit $exec
38 ; GCN: SI_SPILL_S32_SAVE killed renamable $sgpr0, %stack.0, implicit $exec, implicit $sgpr32 :: (store (s32) into %stack.0, addrspace 5)
39 ; GCN: renamable $sgpr0 = SI_SPILL_S32_RESTORE %stack.1, implicit $exec, implicit $sgpr32 :: (load (s32) from %stack.1, addrspace 5)
40 ; GCN: S_NOP 0, implicit killed renamable $sgpr0
41 ; GCN: S_NOP 0, implicit killed renamable $sgpr1
42 ; GCN: renamable $sgpr0 = SI_SPILL_S32_RESTORE %stack.0, implicit $exec, implicit $sgpr32 :: (load (s32) from %stack.0, addrspace 5)
43 ; GCN: S_NOP 0, implicit killed renamable $sgpr0
46 %0:sreg_32 = S_MOV_B32 1, implicit $exec
47 %1:sreg_32 = S_MOV_B32 2, implicit $exec
48 %2:sreg_32 = S_MOV_B32 3, implicit $exec
55 name: test_remat_s_mov_b64
56 tracksRegLiveness: true
59 ; GCN-LABEL: name: test_remat_s_mov_b64
60 ; GCN: renamable $sgpr0_sgpr1 = S_MOV_B64 1
61 ; GCN: renamable $sgpr2_sgpr3 = S_MOV_B64 2
62 ; GCN: S_NOP 0, implicit killed renamable $sgpr0_sgpr1
63 ; GCN: S_NOP 0, implicit killed renamable $sgpr2_sgpr3
64 ; GCN: renamable $sgpr0_sgpr1 = S_MOV_B64 3
65 ; GCN: S_NOP 0, implicit killed renamable $sgpr0_sgpr1
67 %0:sgpr_64 = S_MOV_B64 1
68 %1:sgpr_64 = S_MOV_B64 2
69 %2:sgpr_64 = S_MOV_B64 3
76 name: test_remat_s_brev_b32
77 tracksRegLiveness: true
80 ; GCN-LABEL: name: test_remat_s_brev_b32
81 ; GCN: renamable $sgpr0 = S_BREV_B32 1
82 ; GCN: renamable $sgpr1 = S_BREV_B32 2
83 ; GCN: S_NOP 0, implicit killed renamable $sgpr0
84 ; GCN: S_NOP 0, implicit killed renamable $sgpr1
85 ; GCN: renamable $sgpr0 = S_BREV_B32 3
86 ; GCN: S_NOP 0, implicit killed renamable $sgpr0
88 %0:sreg_32 = S_BREV_B32 1
89 %1:sreg_32 = S_BREV_B32 2
90 %2:sreg_32 = S_BREV_B32 3
97 name: test_remat_s_brev_b64
98 tracksRegLiveness: true
101 ; GCN-LABEL: name: test_remat_s_brev_b64
102 ; GCN: renamable $sgpr0_sgpr1 = S_BREV_B64 1
103 ; GCN: renamable $sgpr2_sgpr3 = S_BREV_B64 2
104 ; GCN: S_NOP 0, implicit killed renamable $sgpr0_sgpr1
105 ; GCN: S_NOP 0, implicit killed renamable $sgpr2_sgpr3
106 ; GCN: renamable $sgpr0_sgpr1 = S_BREV_B64 3
107 ; GCN: S_NOP 0, implicit killed renamable $sgpr0_sgpr1
109 %0:sgpr_64 = S_BREV_B64 1
110 %1:sgpr_64 = S_BREV_B64 2
111 %2:sgpr_64 = S_BREV_B64 3
118 name: test_remat_s_ff0_i32_b32
119 tracksRegLiveness: true
122 ; GCN-LABEL: name: test_remat_s_ff0_i32_b32
123 ; GCN: renamable $sgpr0 = S_FF0_I32_B32 1
124 ; GCN: renamable $sgpr1 = S_FF0_I32_B32 2
125 ; GCN: S_NOP 0, implicit killed renamable $sgpr0
126 ; GCN: S_NOP 0, implicit killed renamable $sgpr1
127 ; GCN: renamable $sgpr0 = S_FF0_I32_B32 3
128 ; GCN: S_NOP 0, implicit killed renamable $sgpr0
130 %0:sreg_32 = S_FF0_I32_B32 1
131 %1:sreg_32 = S_FF0_I32_B32 2
132 %2:sreg_32 = S_FF0_I32_B32 3
139 name: test_remat_s_ff1_i32_b32
140 tracksRegLiveness: true
143 ; GCN-LABEL: name: test_remat_s_ff1_i32_b32
144 ; GCN: renamable $sgpr0 = S_FF1_I32_B32 1
145 ; GCN: renamable $sgpr1 = S_FF1_I32_B32 2
146 ; GCN: S_NOP 0, implicit killed renamable $sgpr0
147 ; GCN: S_NOP 0, implicit killed renamable $sgpr1
148 ; GCN: renamable $sgpr0 = S_FF1_I32_B32 3
149 ; GCN: S_NOP 0, implicit killed renamable $sgpr0
151 %0:sreg_32 = S_FF1_I32_B32 1
152 %1:sreg_32 = S_FF1_I32_B32 2
153 %2:sreg_32 = S_FF1_I32_B32 3
160 name: test_remat_s_ff0_i32_b64
161 tracksRegLiveness: true
164 ; GCN-LABEL: name: test_remat_s_ff0_i32_b64
165 ; GCN: renamable $sgpr0 = S_FF0_I32_B64 1
166 ; GCN: renamable $sgpr1 = S_FF0_I32_B64 2
167 ; GCN: S_NOP 0, implicit killed renamable $sgpr0
168 ; GCN: S_NOP 0, implicit killed renamable $sgpr1
169 ; GCN: renamable $sgpr0 = S_FF0_I32_B64 3
170 ; GCN: S_NOP 0, implicit killed renamable $sgpr0
172 %0:sreg_32 = S_FF0_I32_B64 1
173 %1:sreg_32 = S_FF0_I32_B64 2
174 %2:sreg_32 = S_FF0_I32_B64 3
181 name: test_remat_s_ff1_i32_b64
182 tracksRegLiveness: true
185 ; GCN-LABEL: name: test_remat_s_ff1_i32_b64
186 ; GCN: renamable $sgpr0 = S_FF1_I32_B64 1
187 ; GCN: renamable $sgpr1 = S_FF1_I32_B64 2
188 ; GCN: S_NOP 0, implicit killed renamable $sgpr0
189 ; GCN: S_NOP 0, implicit killed renamable $sgpr1
190 ; GCN: renamable $sgpr0 = S_FF1_I32_B64 3
191 ; GCN: S_NOP 0, implicit killed renamable $sgpr0
193 %0:sreg_32 = S_FF1_I32_B64 1
194 %1:sreg_32 = S_FF1_I32_B64 2
195 %2:sreg_32 = S_FF1_I32_B64 3
202 name: test_remat_s_flbit_i32_b32
203 tracksRegLiveness: true
206 ; GCN-LABEL: name: test_remat_s_flbit_i32_b32
207 ; GCN: renamable $sgpr0 = S_FLBIT_I32_B32 1
208 ; GCN: renamable $sgpr1 = S_FLBIT_I32_B32 2
209 ; GCN: S_NOP 0, implicit killed renamable $sgpr0
210 ; GCN: S_NOP 0, implicit killed renamable $sgpr1
211 ; GCN: renamable $sgpr0 = S_FLBIT_I32_B32 3
212 ; GCN: S_NOP 0, implicit killed renamable $sgpr0
214 %0:sreg_32 = S_FLBIT_I32_B32 1
215 %1:sreg_32 = S_FLBIT_I32_B32 2
216 %2:sreg_32 = S_FLBIT_I32_B32 3
223 name: test_remat_s_flbit_i32_b64
224 tracksRegLiveness: true
227 ; GCN-LABEL: name: test_remat_s_flbit_i32_b64
228 ; GCN: renamable $sgpr0 = S_FLBIT_I32_B64 1
229 ; GCN: renamable $sgpr1 = S_FLBIT_I32_B64 2
230 ; GCN: S_NOP 0, implicit killed renamable $sgpr0
231 ; GCN: S_NOP 0, implicit killed renamable $sgpr1
232 ; GCN: renamable $sgpr0 = S_FLBIT_I32_B64 3
233 ; GCN: S_NOP 0, implicit killed renamable $sgpr0
235 %0:sreg_32 = S_FLBIT_I32_B64 1
236 %1:sreg_32 = S_FLBIT_I32_B64 2
237 %2:sreg_32 = S_FLBIT_I32_B64 3
244 name: test_remat_s_flbit_i32
245 tracksRegLiveness: true
248 ; GCN-LABEL: name: test_remat_s_flbit_i32
249 ; GCN: renamable $sgpr0 = S_FLBIT_I32 1
250 ; GCN: renamable $sgpr1 = S_FLBIT_I32 2
251 ; GCN: S_NOP 0, implicit killed renamable $sgpr0
252 ; GCN: S_NOP 0, implicit killed renamable $sgpr1
253 ; GCN: renamable $sgpr0 = S_FLBIT_I32 3
254 ; GCN: S_NOP 0, implicit killed renamable $sgpr0
256 %0:sreg_32 = S_FLBIT_I32 1
257 %1:sreg_32 = S_FLBIT_I32 2
258 %2:sreg_32 = S_FLBIT_I32 3
265 name: test_remat_s_flbit_i32_i64
266 tracksRegLiveness: true
269 ; GCN-LABEL: name: test_remat_s_flbit_i32_i64
270 ; GCN: renamable $sgpr0 = S_FLBIT_I32_I64 1
271 ; GCN: renamable $sgpr1 = S_FLBIT_I32_I64 2
272 ; GCN: S_NOP 0, implicit killed renamable $sgpr0
273 ; GCN: S_NOP 0, implicit killed renamable $sgpr1
274 ; GCN: renamable $sgpr0 = S_FLBIT_I32_I64 3
275 ; GCN: S_NOP 0, implicit killed renamable $sgpr0
277 %0:sreg_32 = S_FLBIT_I32_I64 1
278 %1:sreg_32 = S_FLBIT_I32_I64 2
279 %2:sreg_32 = S_FLBIT_I32_I64 3
286 name: test_remat_s_sext_i32_i8
287 tracksRegLiveness: true
290 ; GCN-LABEL: name: test_remat_s_sext_i32_i8
291 ; GCN: renamable $sgpr0 = S_SEXT_I32_I8 1
292 ; GCN: renamable $sgpr1 = S_SEXT_I32_I8 2
293 ; GCN: S_NOP 0, implicit killed renamable $sgpr0
294 ; GCN: S_NOP 0, implicit killed renamable $sgpr1
295 ; GCN: renamable $sgpr0 = S_SEXT_I32_I8 3
296 ; GCN: S_NOP 0, implicit killed renamable $sgpr0
298 %0:sreg_32 = S_SEXT_I32_I8 1
299 %1:sreg_32 = S_SEXT_I32_I8 2
300 %2:sreg_32 = S_SEXT_I32_I8 3
307 name: test_remat_s_sext_i32_i16
308 tracksRegLiveness: true
311 ; GCN-LABEL: name: test_remat_s_sext_i32_i16
312 ; GCN: renamable $sgpr0 = S_SEXT_I32_I16 1
313 ; GCN: renamable $sgpr1 = S_SEXT_I32_I16 2
314 ; GCN: S_NOP 0, implicit killed renamable $sgpr0
315 ; GCN: S_NOP 0, implicit killed renamable $sgpr1
316 ; GCN: renamable $sgpr0 = S_SEXT_I32_I16 3
317 ; GCN: S_NOP 0, implicit killed renamable $sgpr0
319 %0:sreg_32 = S_SEXT_I32_I16 1
320 %1:sreg_32 = S_SEXT_I32_I16 2
321 %2:sreg_32 = S_SEXT_I32_I16 3
328 name: test_remat_s_bitreplicate_b64_b32
329 tracksRegLiveness: true
332 ; GCN-LABEL: name: test_remat_s_bitreplicate_b64_b32
333 ; GCN: renamable $sgpr0_sgpr1 = S_BITREPLICATE_B64_B32 1
334 ; GCN: renamable $sgpr2_sgpr3 = S_BITREPLICATE_B64_B32 2
335 ; GCN: S_NOP 0, implicit killed renamable $sgpr0_sgpr1
336 ; GCN: S_NOP 0, implicit killed renamable $sgpr2_sgpr3
337 ; GCN: renamable $sgpr0_sgpr1 = S_BITREPLICATE_B64_B32 3
338 ; GCN: S_NOP 0, implicit killed renamable $sgpr0_sgpr1
340 %0:sgpr_64 = S_BITREPLICATE_B64_B32 1
341 %1:sgpr_64 = S_BITREPLICATE_B64_B32 2
342 %2:sgpr_64 = S_BITREPLICATE_B64_B32 3
349 name: test_remat_s_bfm_b32
350 tracksRegLiveness: true
353 ; GCN-LABEL: name: test_remat_s_bfm_b32
354 ; GCN: renamable $sgpr0 = S_BFM_B32 1, 1
355 ; GCN: renamable $sgpr1 = S_BFM_B32 2, 2
356 ; GCN: S_NOP 0, implicit killed renamable $sgpr0
357 ; GCN: S_NOP 0, implicit killed renamable $sgpr1
358 ; GCN: renamable $sgpr0 = S_BFM_B32 3, 3
359 ; GCN: S_NOP 0, implicit killed renamable $sgpr0
361 %0:sreg_32 = S_BFM_B32 1, 1
362 %1:sreg_32 = S_BFM_B32 2, 2
363 %2:sreg_32 = S_BFM_B32 3, 3
370 name: test_remat_s_bfm_b64
371 tracksRegLiveness: true
374 ; GCN-LABEL: name: test_remat_s_bfm_b64
375 ; GCN: renamable $sgpr0_sgpr1 = S_BFM_B64 1, 1
376 ; GCN: renamable $sgpr2_sgpr3 = S_BFM_B64 2, 2
377 ; GCN: S_NOP 0, implicit killed renamable $sgpr0_sgpr1
378 ; GCN: S_NOP 0, implicit killed renamable $sgpr2_sgpr3
379 ; GCN: renamable $sgpr0_sgpr1 = S_BFM_B64 3, 3
380 ; GCN: S_NOP 0, implicit killed renamable $sgpr0_sgpr1
382 %0:sgpr_64 = S_BFM_B64 1, 1
383 %1:sgpr_64 = S_BFM_B64 2, 2
384 %2:sgpr_64 = S_BFM_B64 3, 3
391 name: test_remat_s_mul_i32
392 tracksRegLiveness: true
395 ; GCN-LABEL: name: test_remat_s_mul_i32
396 ; GCN: renamable $sgpr0 = S_MUL_I32 1, 1
397 ; GCN: renamable $sgpr1 = S_MUL_I32 2, 2
398 ; GCN: S_NOP 0, implicit killed renamable $sgpr0
399 ; GCN: S_NOP 0, implicit killed renamable $sgpr1
400 ; GCN: renamable $sgpr0 = S_MUL_I32 3, 3
401 ; GCN: S_NOP 0, implicit killed renamable $sgpr0
403 %0:sreg_32 = S_MUL_I32 1, 1
404 %1:sreg_32 = S_MUL_I32 2, 2
405 %2:sreg_32 = S_MUL_I32 3, 3
412 name: test_remat_s_mul_hi_i32
413 tracksRegLiveness: true
416 ; GCN-LABEL: name: test_remat_s_mul_hi_i32
417 ; GCN: renamable $sgpr0 = S_MUL_HI_I32 1, 1
418 ; GCN: renamable $sgpr1 = S_MUL_HI_I32 2, 2
419 ; GCN: S_NOP 0, implicit killed renamable $sgpr0
420 ; GCN: S_NOP 0, implicit killed renamable $sgpr1
421 ; GCN: renamable $sgpr0 = S_MUL_HI_I32 3, 3
422 ; GCN: S_NOP 0, implicit killed renamable $sgpr0
424 %0:sreg_32 = S_MUL_HI_I32 1, 1
425 %1:sreg_32 = S_MUL_HI_I32 2, 2
426 %2:sreg_32 = S_MUL_HI_I32 3, 3
433 name: test_remat_s_mul_hi_u32
434 tracksRegLiveness: true
437 ; GCN-LABEL: name: test_remat_s_mul_hi_u32
438 ; GCN: renamable $sgpr0 = S_MUL_HI_U32 1, 1
439 ; GCN: renamable $sgpr1 = S_MUL_HI_U32 2, 2
440 ; GCN: S_NOP 0, implicit killed renamable $sgpr0
441 ; GCN: S_NOP 0, implicit killed renamable $sgpr1
442 ; GCN: renamable $sgpr0 = S_MUL_HI_U32 3, 3
443 ; GCN: S_NOP 0, implicit killed renamable $sgpr0
445 %0:sreg_32 = S_MUL_HI_U32 1, 1
446 %1:sreg_32 = S_MUL_HI_U32 2, 2
447 %2:sreg_32 = S_MUL_HI_U32 3, 3
454 name: test_remat_s_pack_ll_b32_b16
455 tracksRegLiveness: true
458 ; GCN-LABEL: name: test_remat_s_pack_ll_b32_b16
459 ; GCN: renamable $sgpr0 = S_PACK_LL_B32_B16 1, 1
460 ; GCN: renamable $sgpr1 = S_PACK_LL_B32_B16 2, 2
461 ; GCN: S_NOP 0, implicit killed renamable $sgpr0
462 ; GCN: S_NOP 0, implicit killed renamable $sgpr1
463 ; GCN: renamable $sgpr0 = S_PACK_LL_B32_B16 3, 3
464 ; GCN: S_NOP 0, implicit killed renamable $sgpr0
466 %0:sreg_32 = S_PACK_LL_B32_B16 1, 1
467 %1:sreg_32 = S_PACK_LL_B32_B16 2, 2
468 %2:sreg_32 = S_PACK_LL_B32_B16 3, 3
475 name: test_remat_s_pack_lh_b32_b16
476 tracksRegLiveness: true
479 ; GCN-LABEL: name: test_remat_s_pack_lh_b32_b16
480 ; GCN: renamable $sgpr0 = S_PACK_LH_B32_B16 1, 1
481 ; GCN: renamable $sgpr1 = S_PACK_LH_B32_B16 2, 2
482 ; GCN: S_NOP 0, implicit killed renamable $sgpr0
483 ; GCN: S_NOP 0, implicit killed renamable $sgpr1
484 ; GCN: renamable $sgpr0 = S_PACK_LH_B32_B16 3, 3
485 ; GCN: S_NOP 0, implicit killed renamable $sgpr0
487 %0:sreg_32 = S_PACK_LH_B32_B16 1, 1
488 %1:sreg_32 = S_PACK_LH_B32_B16 2, 2
489 %2:sreg_32 = S_PACK_LH_B32_B16 3, 3
496 name: test_remat_s_pack_hh_b32_b16
497 tracksRegLiveness: true
500 ; GCN-LABEL: name: test_remat_s_pack_hh_b32_b16
501 ; GCN: renamable $sgpr0 = S_PACK_HH_B32_B16 1, 1
502 ; GCN: renamable $sgpr1 = S_PACK_HH_B32_B16 2, 2
503 ; GCN: S_NOP 0, implicit killed renamable $sgpr0
504 ; GCN: S_NOP 0, implicit killed renamable $sgpr1
505 ; GCN: renamable $sgpr0 = S_PACK_HH_B32_B16 3, 3
506 ; GCN: S_NOP 0, implicit killed renamable $sgpr0
508 %0:sreg_32 = S_PACK_HH_B32_B16 1, 1
509 %1:sreg_32 = S_PACK_HH_B32_B16 2, 2
510 %2:sreg_32 = S_PACK_HH_B32_B16 3, 3