1 # RUN: llc -mtriple=amdgcn--amdhsa -mcpu=gfx900 -verify-machineinstrs -run-pass si-fold-operands,dead-mi-elimination -o - %s | FileCheck -check-prefix=GCN %s
4 # GCN-LABEL: name: s_fold_and_imm_regimm_32{{$}}
5 # GCN: %10:vgpr_32 = V_MOV_B32_e32 1543, implicit $exec
6 # GCN: BUFFER_STORE_DWORD_OFFSET killed %10,
7 name: s_fold_and_imm_regimm_32
9 exposesReturnsTwice: false
11 regBankSelected: false
13 tracksRegLiveness: true
15 - { id: 0, class: sgpr_64 }
16 - { id: 1, class: sreg_64_xexec }
17 - { id: 2, class: sreg_32_xm0 }
18 - { id: 3, class: sreg_32_xm0 }
19 - { id: 4, class: sreg_32_xm0 }
20 - { id: 5, class: sreg_32_xm0 }
21 - { id: 6, class: sgpr_128 }
22 - { id: 7, class: sreg_32_xm0 }
23 - { id: 8, class: sreg_32_xm0 }
24 - { id: 9, class: sreg_32_xm0 }
25 - { id: 10, class: vgpr_32 }
27 - { reg: '$sgpr0_sgpr1', virtual-reg: '%0' }
29 isFrameAddressTaken: false
30 isReturnAddressTaken: false
39 hasOpaqueSPAdjustment: false
41 hasMustTailInVarArgFunc: false
46 %0 = COPY $sgpr0_sgpr1
47 %1 = S_LOAD_DWORDX2_IMM %0, 36, 0, 0
52 %6 = REG_SEQUENCE killed %2, 1, killed %3, 2, killed %4, 3, killed %5, 4
53 %7 = S_MOV_B32 1234567
55 %9 = S_AND_B32 killed %7, killed %8, implicit-def dead $scc
57 BUFFER_STORE_DWORD_OFFSET killed %10, killed %6, 0, 0, 0, 0, 0, 0, 0, implicit $exec
63 # GCN-LABEL: name: v_fold_and_imm_regimm_32{{$}}
65 # GCN: %9:vgpr_32 = V_MOV_B32_e32 646, implicit $exec
66 # GCN: FLAT_STORE_DWORD %19, %9,
68 # GCN: %10:vgpr_32 = V_MOV_B32_e32 646, implicit $exec
69 # GCN: FLAT_STORE_DWORD %19, %10
71 # GCN: %11:vgpr_32 = V_MOV_B32_e32 646, implicit $exec
72 # GCN: FLAT_STORE_DWORD %19, %11,
74 # GCN: %12:vgpr_32 = V_MOV_B32_e32 1234567, implicit $exec
75 # GCN: FLAT_STORE_DWORD %19, %12,
77 # GCN: %13:vgpr_32 = V_MOV_B32_e32 63, implicit $exec
78 # GCN: FLAT_STORE_DWORD %19, %13,
80 name: v_fold_and_imm_regimm_32
82 exposesReturnsTwice: false
84 regBankSelected: false
86 tracksRegLiveness: true
88 - { id: 0, class: sgpr_64 }
89 - { id: 1, class: sreg_32_xm0 }
90 - { id: 2, class: sgpr_32 }
91 - { id: 3, class: vgpr_32 }
92 - { id: 4, class: sreg_64_xexec }
93 - { id: 20, class: sreg_32_xm0 }
94 - { id: 24, class: vgpr_32 }
95 - { id: 25, class: vreg_64 }
96 - { id: 26, class: sreg_32_xm0 }
97 - { id: 27, class: vgpr_32 }
98 - { id: 28, class: vgpr_32 }
99 - { id: 29, class: vgpr_32 }
100 - { id: 30, class: vgpr_32 }
101 - { id: 31, class: vgpr_32 }
102 - { id: 32, class: vreg_64 }
103 - { id: 33, class: vreg_64 }
104 - { id: 34, class: vgpr_32 }
105 - { id: 35, class: vgpr_32 }
106 - { id: 36, class: vgpr_32 }
107 - { id: 37, class: vreg_64 }
108 - { id: 44, class: vgpr_32 }
111 - { reg: '$sgpr0_sgpr1', virtual-reg: '%0' }
112 - { reg: '$vgpr0', virtual-reg: '%3' }
114 isFrameAddressTaken: false
115 isReturnAddressTaken: false
124 hasOpaqueSPAdjustment: false
126 hasMustTailInVarArgFunc: false
129 liveins: $sgpr0_sgpr1, $vgpr0
132 %0 = COPY $sgpr0_sgpr1
133 %4 = S_LOAD_DWORDX2_IMM %0, 36, 0, 0
134 %31 = V_ASHRREV_I32_e64 31, %3, implicit $exec
135 %32 = REG_SEQUENCE %3, 1, %31, 2
136 %33 = V_LSHLREV_B64 2, killed %32, implicit $exec
138 %44 = V_ADD_I32_e32 %4.sub0, %33.sub0, implicit-def $vcc, implicit $exec
139 %36 = COPY killed %20
140 %35 = V_ADDC_U32_e32 %33.sub1, %36, implicit-def $vcc, implicit $vcc, implicit $exec
141 %37 = REG_SEQUENCE %44, 1, killed %35, 2
142 %24 = V_MOV_B32_e32 982, implicit $exec
143 %26 = S_MOV_B32 1234567
144 %34 = V_MOV_B32_e32 63, implicit $exec
146 %27 = V_AND_B32_e64 %26, %24, implicit $exec
147 FLAT_STORE_DWORD %37, %27, 0, 0, 0, 0, implicit $exec, implicit $flat_scr
149 %28 = V_AND_B32_e64 %24, %26, implicit $exec
150 FLAT_STORE_DWORD %37, %28, 0, 0, 0, 0, implicit $exec, implicit $flat_scr
152 %29 = V_AND_B32_e32 %26, %24, implicit $exec
153 FLAT_STORE_DWORD %37, %29, 0, 0, 0, 0, implicit $exec, implicit $flat_scr
155 %30 = V_AND_B32_e64 %26, %26, implicit $exec
156 FLAT_STORE_DWORD %37, %30, 0, 0, 0, 0, implicit $exec, implicit $flat_scr
158 %31 = V_AND_B32_e64 %34, %34, implicit $exec
159 FLAT_STORE_DWORD %37, %31, 0, 0, 0, 0, implicit $exec, implicit $flat_scr
166 # GCN-LABEL: name: s_fold_shl_imm_regimm_32{{$}}
167 # GC1: %13 = V_MOV_B32_e32 4096, implicit $exec
168 # GCN: BUFFER_STORE_DWORD_OFFSET killed %13,
170 name: s_fold_shl_imm_regimm_32
172 exposesReturnsTwice: false
174 regBankSelected: false
176 tracksRegLiveness: true
178 - { id: 0, class: sgpr_64 }
179 - { id: 1, class: sreg_32_xm0 }
180 - { id: 2, class: sgpr_32 }
181 - { id: 3, class: vgpr_32 }
182 - { id: 4, class: sreg_64_xexec }
183 - { id: 5, class: sreg_32_xm0_xexec }
184 - { id: 6, class: sreg_32_xm0 }
185 - { id: 7, class: sreg_32_xm0 }
186 - { id: 8, class: sreg_32_xm0 }
187 - { id: 9, class: sreg_32_xm0 }
188 - { id: 10, class: sgpr_128 }
189 - { id: 11, class: sreg_32_xm0 }
190 - { id: 12, class: sreg_32_xm0 }
191 - { id: 13, class: vgpr_32 }
193 - { reg: '$sgpr0_sgpr1', virtual-reg: '%0' }
195 isFrameAddressTaken: false
196 isReturnAddressTaken: false
205 hasOpaqueSPAdjustment: false
207 hasMustTailInVarArgFunc: false
210 liveins: $sgpr0_sgpr1
212 %0 = COPY $sgpr0_sgpr1
213 %4 = S_LOAD_DWORDX2_IMM %0, 36, 0, 0
219 %10 = REG_SEQUENCE killed %7, 1, killed %6, 2, killed %9, 3, killed %8, 4
220 %12 = S_LSHL_B32 killed %5, 12, implicit-def dead $scc
222 BUFFER_STORE_DWORD_OFFSET killed %13, killed %10, 0, 0, 0, 0, 0, 0, 0, implicit $exec
227 # GCN-LABEL: name: v_fold_shl_imm_regimm_32{{$}}
229 # GCN: %11:vgpr_32 = V_MOV_B32_e32 40955904, implicit $exec
230 # GCN: FLAT_STORE_DWORD %20, %11,
232 # GCN: %12:vgpr_32 = V_MOV_B32_e32 24, implicit $exec
233 # GCN: FLAT_STORE_DWORD %20, %12,
235 # GCN: %13:vgpr_32 = V_MOV_B32_e32 4096, implicit $exec
236 # GCN: FLAT_STORE_DWORD %20, %13,
238 # GCN: %14:vgpr_32 = V_MOV_B32_e32 24, implicit $exec
239 # GCN: FLAT_STORE_DWORD %20, %14,
241 # GCN: %15:vgpr_32 = V_MOV_B32_e32 0, implicit $exec
242 # GCN: FLAT_STORE_DWORD %20, %15,
244 # GCN: %22:vgpr_32 = V_MOV_B32_e32 4096, implicit $exec
245 # GCN: FLAT_STORE_DWORD %20, %22,
247 # GCN: %23:vgpr_32 = V_MOV_B32_e32 1, implicit $exec
248 # GCN: FLAT_STORE_DWORD %20, %23,
250 # GCN: %25:vgpr_32 = V_MOV_B32_e32 2, implicit $exec
251 # GCN: FLAT_STORE_DWORD %20, %25,
253 # GCN: %26:vgpr_32 = V_MOV_B32_e32 7927808, implicit $exec
254 # GCN: FLAT_STORE_DWORD %20, %26,
256 # GCN: %28:vgpr_32 = V_MOV_B32_e32 -8, implicit $exec
257 # GCN: FLAT_STORE_DWORD %20, %28,
259 name: v_fold_shl_imm_regimm_32
261 exposesReturnsTwice: false
263 regBankSelected: false
265 tracksRegLiveness: true
267 - { id: 0, class: sgpr_64 }
268 - { id: 1, class: sreg_32_xm0 }
269 - { id: 2, class: vgpr_32 }
270 - { id: 3, class: sreg_64_xexec }
271 - { id: 4, class: sreg_64_xexec }
272 - { id: 5, class: sreg_32_xm0 }
273 - { id: 6, class: vgpr_32 }
274 - { id: 7, class: sreg_32_xm0 }
275 - { id: 8, class: sreg_64 }
276 - { id: 9, class: sreg_32_xm0 }
277 - { id: 10, class: vgpr_32 }
278 - { id: 11, class: vgpr_32 }
279 - { id: 12, class: vgpr_32 }
280 - { id: 13, class: vgpr_32 }
281 - { id: 14, class: vgpr_32 }
282 - { id: 15, class: vgpr_32 }
283 - { id: 16, class: vreg_64 }
284 - { id: 17, class: vreg_64 }
285 - { id: 18, class: vgpr_32 }
286 - { id: 19, class: vgpr_32 }
287 - { id: 20, class: vreg_64 }
288 - { id: 21, class: vgpr_32 }
289 - { id: 22, class: vgpr_32 }
290 - { id: 23, class: vgpr_32 }
291 - { id: 24, class: vgpr_32 }
292 - { id: 25, class: vgpr_32 }
293 - { id: 26, class: vgpr_32 }
294 - { id: 27, class: sreg_32_xm0 }
295 - { id: 28, class: vgpr_32 }
297 - { reg: '$sgpr0_sgpr1', virtual-reg: '%0' }
298 - { reg: '$vgpr0', virtual-reg: '%2' }
300 isFrameAddressTaken: false
301 isReturnAddressTaken: false
310 hasOpaqueSPAdjustment: false
312 hasMustTailInVarArgFunc: false
315 liveins: $sgpr0_sgpr1, $vgpr0
318 %0 = COPY $sgpr0_sgpr1
319 %3 = S_LOAD_DWORDX2_IMM %0, 36, 0, 0 :: (non-temporal dereferenceable invariant load 8 from `i64 addrspace(4)* undef`)
320 %15 = V_ASHRREV_I32_e64 31, %2, implicit $exec
321 %16 = REG_SEQUENCE %2, 1, %15, 2
322 %17 = V_LSHLREV_B64 2, killed %16, implicit $exec
324 %21 = V_ADD_I32_e32 %3.sub0, %17.sub0, implicit-def $vcc, implicit $exec
326 %18 = V_ADDC_U32_e32 %17.sub1, %19, implicit-def $vcc, implicit $vcc, implicit $exec
327 %20 = REG_SEQUENCE %21, 1, killed %18, 2
328 %10 = V_MOV_B32_e32 9999, implicit $exec
329 %24 = V_MOV_B32_e32 3871, implicit $exec
330 %6 = V_MOV_B32_e32 1, implicit $exec
334 %11 = V_LSHLREV_B32_e64 12, %10, implicit $exec
335 FLAT_STORE_DWORD %20, %11, 0, 0, 0, 0, implicit $exec, implicit $flat_scr
337 %12 = V_LSHLREV_B32_e64 %7, 12, implicit $exec
338 FLAT_STORE_DWORD %20, %12, 0, 0, 0, 0, implicit $exec, implicit $flat_scr
340 %13 = V_LSHL_B32_e64 %7, 12, implicit $exec
341 FLAT_STORE_DWORD %20, %13, 0, 0, 0, 0, implicit $exec, implicit $flat_scr
343 %14 = V_LSHL_B32_e64 12, %7, implicit $exec
344 FLAT_STORE_DWORD %20, %14, 0, 0, 0, 0, implicit $exec, implicit $flat_scr
346 %15 = V_LSHL_B32_e64 12, %24, implicit $exec
347 FLAT_STORE_DWORD %20, %15, 0, 0, 0, 0, implicit $exec, implicit $flat_scr
349 %22 = V_LSHL_B32_e64 %6, 12, implicit $exec
350 FLAT_STORE_DWORD %20, %22, 0, 0, 0, 0, implicit $exec, implicit $flat_scr
352 %23 = V_LSHL_B32_e64 %6, 32, implicit $exec
353 FLAT_STORE_DWORD %20, %23, 0, 0, 0, 0, implicit $exec, implicit $flat_scr
355 %25 = V_LSHL_B32_e32 %6, %6, implicit $exec
356 FLAT_STORE_DWORD %20, %25, 0, 0, 0, 0, implicit $exec, implicit $flat_scr
358 %26 = V_LSHLREV_B32_e32 11, %24, implicit $exec
359 FLAT_STORE_DWORD %20, %26, 0, 0, 0, 0, implicit $exec, implicit $flat_scr
361 %28 = V_LSHL_B32_e32 %27, %6, implicit $exec
362 FLAT_STORE_DWORD %20, %28, 0, 0, 0, 0, implicit $exec, implicit $flat_scr
369 # GCN-LABEL: name: s_fold_ashr_imm_regimm_32{{$}}
370 # GCN: %11:vgpr_32 = V_MOV_B32_e32 243, implicit $exec
371 # GCN: BUFFER_STORE_DWORD_OFFSET killed %11, killed %8,
372 name: s_fold_ashr_imm_regimm_32
374 exposesReturnsTwice: false
376 regBankSelected: false
378 tracksRegLiveness: true
380 - { id: 0, class: sgpr_64 }
381 - { id: 1, class: sreg_32_xm0 }
382 - { id: 4, class: sreg_64_xexec }
383 - { id: 5, class: sreg_32_xm0_xexec }
384 - { id: 6, class: sreg_32_xm0 }
385 - { id: 7, class: sreg_32_xm0 }
386 - { id: 8, class: sreg_32_xm0 }
387 - { id: 9, class: sreg_32_xm0 }
388 - { id: 10, class: sgpr_128 }
389 - { id: 11, class: sreg_32_xm0 }
390 - { id: 12, class: sreg_32_xm0 }
391 - { id: 13, class: vgpr_32 }
393 - { reg: '$sgpr0_sgpr1', virtual-reg: '%0' }
395 isFrameAddressTaken: false
396 isReturnAddressTaken: false
405 hasOpaqueSPAdjustment: false
407 hasMustTailInVarArgFunc: false
410 liveins: $sgpr0_sgpr1
412 %0 = COPY $sgpr0_sgpr1
413 %4 = S_LOAD_DWORDX2_IMM %0, 36, 0, 0
414 %5 = S_MOV_B32 999123
419 %10 = REG_SEQUENCE killed %7, 1, killed %6, 2, killed %9, 3, killed %8, 4
420 %12 = S_ASHR_I32 killed %5, 12, implicit-def dead $scc
422 BUFFER_STORE_DWORD_OFFSET killed %13, killed %10, 0, 0, 0, 0, 0, 0, 0, implicit $exec
427 # GCN-LABEL: name: v_fold_ashr_imm_regimm_32{{$}}
428 # GCN: %11:vgpr_32 = V_MOV_B32_e32 3903258, implicit $exec
429 # GCN: FLAT_STORE_DWORD %20, %11,
431 # GCN: %12:vgpr_32 = V_MOV_B32_e32 62452139, implicit $exec
432 # GCN: FLAT_STORE_DWORD %20, %12,
434 # GCN: %13:vgpr_32 = V_MOV_B32_e32 1678031, implicit $exec
435 # GCN: FLAT_STORE_DWORD %20, %13,
437 # GCN: %14:vgpr_32 = V_MOV_B32_e32 3, implicit $exec
438 # GCN: FLAT_STORE_DWORD %20, %14,
440 # GCN: %15:vgpr_32 = V_MOV_B32_e32 -1, implicit $exec
441 # GCN: FLAT_STORE_DWORD %20, %15,
443 # GCN: %22:vgpr_32 = V_MOV_B32_e32 62500, implicit $exec
444 # GCN: FLAT_STORE_DWORD %20, %22,
446 # GCN: %23:vgpr_32 = V_MOV_B32_e32 500000, implicit $exec
447 # GCN: FLAT_STORE_DWORD %20, %23,
449 # GCN: %25:vgpr_32 = V_MOV_B32_e32 1920, implicit $exec
450 # GCN: FLAT_STORE_DWORD %20, %25,
452 # GCN: %26:vgpr_32 = V_MOV_B32_e32 487907, implicit $exec
453 # GCN: FLAT_STORE_DWORD %20, %26,
455 # GCN: %28:vgpr_32 = V_MOV_B32_e32 -1, implicit $exec
456 # GCN: FLAT_STORE_DWORD %20, %28,
458 name: v_fold_ashr_imm_regimm_32
460 exposesReturnsTwice: false
462 regBankSelected: false
464 tracksRegLiveness: true
466 - { id: 0, class: sgpr_64 }
467 - { id: 1, class: sreg_32_xm0 }
468 - { id: 2, class: vgpr_32 }
469 - { id: 3, class: sreg_64_xexec }
470 - { id: 4, class: sreg_64_xexec }
471 - { id: 5, class: sreg_32_xm0 }
472 - { id: 6, class: vgpr_32 }
473 - { id: 7, class: sreg_32_xm0 }
474 - { id: 8, class: sreg_32_xm0 }
475 - { id: 9, class: sreg_32_xm0 }
476 - { id: 10, class: vgpr_32 }
477 - { id: 11, class: vgpr_32 }
478 - { id: 12, class: vgpr_32 }
479 - { id: 13, class: vgpr_32 }
480 - { id: 14, class: vgpr_32 }
481 - { id: 15, class: vgpr_32 }
482 - { id: 16, class: vreg_64 }
483 - { id: 17, class: vreg_64 }
484 - { id: 18, class: vgpr_32 }
485 - { id: 19, class: vgpr_32 }
486 - { id: 20, class: vreg_64 }
487 - { id: 21, class: vgpr_32 }
488 - { id: 22, class: vgpr_32 }
489 - { id: 23, class: vgpr_32 }
490 - { id: 24, class: vgpr_32 }
491 - { id: 25, class: vgpr_32 }
492 - { id: 26, class: vgpr_32 }
493 - { id: 27, class: sreg_32_xm0 }
494 - { id: 28, class: vgpr_32 }
495 - { id: 32, class: sreg_32_xm0 }
496 - { id: 33, class: sreg_32_xm0 }
497 - { id: 34, class: vgpr_32 }
498 - { id: 35, class: vgpr_32 }
500 - { reg: '$sgpr0_sgpr1', virtual-reg: '%0' }
501 - { reg: '$vgpr0', virtual-reg: '%2' }
503 isFrameAddressTaken: false
504 isReturnAddressTaken: false
513 hasOpaqueSPAdjustment: false
515 hasMustTailInVarArgFunc: false
518 liveins: $sgpr0_sgpr1, $vgpr0
521 %0 = COPY $sgpr0_sgpr1
522 %3 = S_LOAD_DWORDX2_IMM %0, 36, 0, 0
523 %15 = V_ASHRREV_I32_e64 31, %2, implicit $exec
524 %16 = REG_SEQUENCE %2, 1, %15, 2
525 %17 = V_LSHLREV_B64 2, killed %16, implicit $exec
527 %21 = V_ADD_I32_e32 %3.sub0, %17.sub0, implicit-def $vcc, implicit $exec
529 %18 = V_ADDC_U32_e32 %17.sub1, %19, implicit-def $vcc, implicit $vcc, implicit $exec
530 %20 = REG_SEQUENCE %21, 1, killed %18, 2
531 %10 = V_MOV_B32_e32 999234234, implicit $exec
532 %24 = V_MOV_B32_e32 3871, implicit $exec
533 %6 = V_MOV_B32_e32 1000000, implicit $exec
534 %7 = S_MOV_B32 13424252
539 %34 = V_MOV_B32_e32 3841, implicit $exec
540 %35 = V_MOV_B32_e32 2, implicit $exec
542 %11 = V_ASHRREV_I32_e64 8, %10, implicit $exec
543 FLAT_STORE_DWORD %20, %11, 0, 0, 0, 0, implicit $exec, implicit $flat_scr
545 %12 = V_ASHRREV_I32_e64 %8, %10, implicit $exec
546 FLAT_STORE_DWORD %20, %12, 0, 0, 0, 0, implicit $exec, implicit $flat_scr
548 %13 = V_ASHR_I32_e64 %7, 3, implicit $exec
549 FLAT_STORE_DWORD %20, %13, 0, 0, 0, 0, implicit $exec, implicit $flat_scr
551 %14 = V_ASHR_I32_e64 7, %32, implicit $exec
552 FLAT_STORE_DWORD %20, %14, 0, 0, 0, 0, implicit $exec, implicit $flat_scr
554 %15 = V_ASHR_I32_e64 %27, %24, implicit $exec
555 FLAT_STORE_DWORD %20, %15, 0, 0, 0, 0, implicit $exec, implicit $flat_scr
557 %22 = V_ASHR_I32_e64 %6, 4, implicit $exec
558 FLAT_STORE_DWORD %20, %22, 0, 0, 0, 0, implicit $exec, implicit $flat_scr
560 %23 = V_ASHR_I32_e64 %6, %33, implicit $exec
561 FLAT_STORE_DWORD %20, %23, 0, 0, 0, 0, implicit $exec, implicit $flat_scr
563 %25 = V_ASHR_I32_e32 %34, %34, implicit $exec
564 FLAT_STORE_DWORD %20, %25, 0, 0, 0, 0, implicit $exec, implicit $flat_scr
566 %26 = V_ASHRREV_I32_e32 11, %10, implicit $exec
567 FLAT_STORE_DWORD %20, %26, 0, 0, 0, 0, implicit $exec, implicit $flat_scr
569 %28 = V_ASHR_I32_e32 %27, %35, implicit $exec
570 FLAT_STORE_DWORD %20, %28, 0, 0, 0, 0, implicit $exec, implicit $flat_scr
577 # GCN-LABEL: name: s_fold_lshr_imm_regimm_32{{$}}
578 # GCN: %11:vgpr_32 = V_MOV_B32_e32 1048332, implicit $exec
579 # GCN: BUFFER_STORE_DWORD_OFFSET killed %11, killed %8,
580 name: s_fold_lshr_imm_regimm_32
582 exposesReturnsTwice: false
584 regBankSelected: false
586 tracksRegLiveness: true
588 - { id: 0, class: sgpr_64 }
589 - { id: 1, class: sreg_32_xm0 }
590 - { id: 4, class: sreg_64_xexec }
591 - { id: 5, class: sreg_32_xm0_xexec }
592 - { id: 6, class: sreg_32_xm0 }
593 - { id: 7, class: sreg_32_xm0 }
594 - { id: 8, class: sreg_32_xm0 }
595 - { id: 9, class: sreg_32_xm0 }
596 - { id: 10, class: sgpr_128 }
597 - { id: 11, class: sreg_32_xm0 }
598 - { id: 12, class: sreg_32_xm0 }
599 - { id: 13, class: vgpr_32 }
601 - { reg: '$sgpr0_sgpr1', virtual-reg: '%0' }
603 isFrameAddressTaken: false
604 isReturnAddressTaken: false
613 hasOpaqueSPAdjustment: false
615 hasMustTailInVarArgFunc: false
618 liveins: $sgpr0_sgpr1
620 %0 = COPY $sgpr0_sgpr1
621 %4 = S_LOAD_DWORDX2_IMM %0, 36, 0, 0
622 %5 = S_MOV_B32 -999123
627 %10 = REG_SEQUENCE killed %7, 1, killed %6, 2, killed %9, 3, killed %8, 4
628 %12 = S_LSHR_B32 killed %5, 12, implicit-def dead $scc
630 BUFFER_STORE_DWORD_OFFSET killed %13, killed %10, 0, 0, 0, 0, 0, 0, 0, implicit $exec
636 # GCN-LABEL: name: v_fold_lshr_imm_regimm_32{{$}}
637 # GCN: %11:vgpr_32 = V_MOV_B32_e32 3903258, implicit $exec
638 # GCN: FLAT_STORE_DWORD %20, %11,
640 # GCN: %12:vgpr_32 = V_MOV_B32_e32 62452139, implicit $exec
641 # GCN: FLAT_STORE_DWORD %20, %12,
643 # GCN: %13:vgpr_32 = V_MOV_B32_e32 1678031, implicit $exec
644 # GCN: FLAT_STORE_DWORD %20, %13,
646 # GCN: %14:vgpr_32 = V_MOV_B32_e32 3, implicit $exec
647 # GCN: FLAT_STORE_DWORD %20, %14,
649 # GCN: %15:vgpr_32 = V_MOV_B32_e32 1, implicit $exec
650 # GCN: FLAT_STORE_DWORD %20, %15,
652 # GCN: %22:vgpr_32 = V_MOV_B32_e32 62500, implicit $exec
653 # GCN: FLAT_STORE_DWORD %20, %22,
655 # GCN: %23:vgpr_32 = V_MOV_B32_e32 500000, implicit $exec
656 # GCN: FLAT_STORE_DWORD %20, %23,
658 # GCN: %25:vgpr_32 = V_MOV_B32_e32 1920, implicit $exec
659 # GCN: FLAT_STORE_DWORD %20, %25,
661 # GCN: %26:vgpr_32 = V_MOV_B32_e32 487907, implicit $exec
662 # GCN: FLAT_STORE_DWORD %20, %26,
664 # GCN: %28:vgpr_32 = V_MOV_B32_e32 1073741823, implicit $exec
665 # GCN: FLAT_STORE_DWORD %20, %28,
667 name: v_fold_lshr_imm_regimm_32
669 exposesReturnsTwice: false
671 regBankSelected: false
673 tracksRegLiveness: true
675 - { id: 0, class: sgpr_64 }
676 - { id: 1, class: sreg_32_xm0 }
677 - { id: 2, class: vgpr_32 }
678 - { id: 3, class: sreg_64_xexec }
679 - { id: 4, class: sreg_64_xexec }
680 - { id: 5, class: sreg_32_xm0 }
681 - { id: 6, class: vgpr_32 }
682 - { id: 7, class: sreg_32_xm0 }
683 - { id: 8, class: sreg_32_xm0 }
684 - { id: 9, class: sreg_32_xm0 }
685 - { id: 10, class: vgpr_32 }
686 - { id: 11, class: vgpr_32 }
687 - { id: 12, class: vgpr_32 }
688 - { id: 13, class: vgpr_32 }
689 - { id: 14, class: vgpr_32 }
690 - { id: 15, class: vgpr_32 }
691 - { id: 16, class: vreg_64 }
692 - { id: 17, class: vreg_64 }
693 - { id: 18, class: vgpr_32 }
694 - { id: 19, class: vgpr_32 }
695 - { id: 20, class: vreg_64 }
696 - { id: 21, class: vgpr_32 }
697 - { id: 22, class: vgpr_32 }
698 - { id: 23, class: vgpr_32 }
699 - { id: 24, class: vgpr_32 }
700 - { id: 25, class: vgpr_32 }
701 - { id: 26, class: vgpr_32 }
702 - { id: 27, class: sreg_32_xm0 }
703 - { id: 28, class: vgpr_32 }
704 - { id: 32, class: sreg_32_xm0 }
705 - { id: 33, class: sreg_32_xm0 }
706 - { id: 34, class: vgpr_32 }
707 - { id: 35, class: vgpr_32 }
709 - { reg: '$sgpr0_sgpr1', virtual-reg: '%0' }
710 - { reg: '$vgpr0', virtual-reg: '%2' }
712 isFrameAddressTaken: false
713 isReturnAddressTaken: false
722 hasOpaqueSPAdjustment: false
724 hasMustTailInVarArgFunc: false
727 liveins: $sgpr0_sgpr1, $vgpr0
730 %0 = COPY $sgpr0_sgpr1
731 %3 = S_LOAD_DWORDX2_IMM %0, 36, 0, 0
732 %15 = V_ASHRREV_I32_e64 31, %2, implicit $exec
733 %16 = REG_SEQUENCE %2, 1, %15, 2
734 %17 = V_LSHLREV_B64 2, killed %16, implicit $exec
736 %21 = V_ADD_I32_e32 %3.sub0, %17.sub0, implicit-def $vcc, implicit $exec
738 %18 = V_ADDC_U32_e32 %17.sub1, %19, implicit-def $vcc, implicit $vcc, implicit $exec
739 %20 = REG_SEQUENCE %21, 1, killed %18, 2
740 %10 = V_MOV_B32_e32 999234234, implicit $exec
741 %24 = V_MOV_B32_e32 3871, implicit $exec
742 %6 = V_MOV_B32_e32 1000000, implicit $exec
743 %7 = S_MOV_B32 13424252
748 %34 = V_MOV_B32_e32 3841, implicit $exec
749 %35 = V_MOV_B32_e32 2, implicit $exec
751 %11 = V_LSHRREV_B32_e64 8, %10, implicit $exec
752 FLAT_STORE_DWORD %20, %11, 0, 0, 0, 0, implicit $exec, implicit $flat_scr
754 %12 = V_LSHRREV_B32_e64 %8, %10, implicit $exec
755 FLAT_STORE_DWORD %20, %12, 0, 0, 0, 0, implicit $exec, implicit $flat_scr
757 %13 = V_LSHR_B32_e64 %7, 3, implicit $exec
758 FLAT_STORE_DWORD %20, %13, 0, 0, 0, 0, implicit $exec, implicit $flat_scr
760 %14 = V_LSHR_B32_e64 7, %32, implicit $exec
761 FLAT_STORE_DWORD %20, %14, 0, 0, 0, 0, implicit $exec, implicit $flat_scr
763 %15 = V_LSHR_B32_e64 %27, %24, implicit $exec
764 FLAT_STORE_DWORD %20, %15, 0, 0, 0, 0, implicit $exec, implicit $flat_scr
766 %22 = V_LSHR_B32_e64 %6, 4, implicit $exec
767 FLAT_STORE_DWORD %20, %22, 0, 0, 0, 0, implicit $exec, implicit $flat_scr
769 %23 = V_LSHR_B32_e64 %6, %33, implicit $exec
770 FLAT_STORE_DWORD %20, %23, 0, 0, 0, 0, implicit $exec, implicit $flat_scr
772 %25 = V_LSHR_B32_e32 %34, %34, implicit $exec
773 FLAT_STORE_DWORD %20, %25, 0, 0, 0, 0, implicit $exec, implicit $flat_scr
775 %26 = V_LSHRREV_B32_e32 11, %10, implicit $exec
776 FLAT_STORE_DWORD %20, %26, 0, 0, 0, 0, implicit $exec, implicit $flat_scr
778 %28 = V_LSHR_B32_e32 %27, %35, implicit $exec
779 FLAT_STORE_DWORD %20, %28, 0, 0, 0, 0, implicit $exec, implicit $flat_scr
785 # There is only an undef use operand for %1, so there is no
786 # corresponding defining instruction
788 # GCN-LABEL: name: undefined_vreg_operand{{$}}
790 # GCN-NEXT: FLAT_STORE_DWORD undef %3:vreg_64, undef %1:vgpr_32,
791 # GCN-NEXT: S_ENDPGM 0
792 name: undefined_vreg_operand
793 tracksRegLiveness: true
795 - { id: 0, class: vgpr_32, preferred-register: '' }
796 - { id: 1, class: vgpr_32, preferred-register: '' }
797 - { id: 2, class: vgpr_32, preferred-register: '' }
798 - { id: 3, class: vreg_64, preferred-register: '' }
801 %0 = V_MOV_B32_e32 0, implicit $exec
802 %2 = V_XOR_B32_e64 killed %0, undef %1, implicit $exec
803 FLAT_STORE_DWORD undef %3, %2, 0, 0, 0, 0, implicit $exec, implicit $flat_scr
808 # Make sure there is no crash if one of the operands is a physical register
809 # GCN-LABEL: name: constant_fold_physreg_op{{$}}
810 # GCN: %3:sreg_64 = S_AND_B64 $exec, 0, implicit-def dead $scc
812 name: constant_fold_physreg_op
813 tracksRegLiveness: true
816 successors: %bb.1, %bb.3
817 liveins: $vgpr0, $sgpr4_sgpr5
819 %19:sreg_64 = IMPLICIT_DEF
820 %0:sreg_64 = SI_IF killed %19, %bb.3, implicit-def dead $exec, implicit-def dead $scc, implicit $exec
824 %6:sreg_64 = S_MOV_B64 0
825 %7:sreg_64 = S_AND_B64 $exec, killed %6, implicit-def dead $scc
830 SI_END_CF %0, implicit-def dead $exec, implicit-def dead $scc, implicit $exec
831 S_ENDPGM 0, implicit $vcc
835 # GCN-LABEL: name: constant_fold_lshl_or_reg0_immreg_reg{{$}}
836 # GCN: %2:vgpr_32 = COPY $vgpr0, implicit $exec
837 # GCN-NEXT: S_ENDPGM 0, implicit %2
839 name: constant_fold_lshl_or_reg0_immreg_reg
841 exposesReturnsTwice: false
843 regBankSelected: false
845 tracksRegLiveness: true
851 %0:vgpr_32 = V_MOV_B32_e32 0, implicit $exec
852 %1:vgpr_32 = V_MOV_B32_e32 16, implicit $exec
853 %2:vgpr_32 = V_LSHL_OR_B32 %0,%1, $vgpr0, implicit $exec
854 S_ENDPGM 0, implicit %2
860 # GCN-LABEL: name: constant_fold_lshl_or_reg0_immreg_imm{{$}}
861 # GCN: %2:vgpr_32 = V_MOV_B32_e32 10, implicit $exec
862 # GCN-NEXT: S_ENDPGM 0, implicit %2
864 name: constant_fold_lshl_or_reg0_immreg_imm
866 exposesReturnsTwice: false
868 regBankSelected: false
870 tracksRegLiveness: true
875 %0:vgpr_32 = V_MOV_B32_e32 0, implicit $exec
876 %1:vgpr_32 = V_MOV_B32_e32 16, implicit $exec
877 %2:vgpr_32 = V_LSHL_OR_B32 %0, %1, 10, implicit $exec
878 S_ENDPGM 0, implicit %2
884 # GCN-LABEL: name: constant_fold_lshl_or_reg0_immreg_immreg{{$}}
885 # GCN: %3:vgpr_32 = V_MOV_B32_e32 12345, implicit $exec
886 # GCN-NEXT: S_ENDPGM 0, implicit %3
888 name: constant_fold_lshl_or_reg0_immreg_immreg
890 exposesReturnsTwice: false
892 regBankSelected: false
894 tracksRegLiveness: true
899 %0:vgpr_32 = V_MOV_B32_e32 0, implicit $exec
900 %1:vgpr_32 = V_MOV_B32_e32 16, implicit $exec
901 %2:vgpr_32 = V_MOV_B32_e32 12345, implicit $exec
902 %3:vgpr_32 = V_LSHL_OR_B32 %0, %1, %2, implicit $exec
903 S_ENDPGM 0, implicit %3