Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / llvm / test / CodeGen / AMDGPU / fold-sgpr-copy.mir
blob2025db5bd8391ea1ec131aa28b8b2c11bf7ae919
1 # RUN: llc -march=amdgcn -mcpu=gfx900 -run-pass=si-fold-operands,dead-mi-elimination -verify-machineinstrs %s -o - | FileCheck -check-prefix=GCN %s
3 ---
5 # GCN-LABEL: name: fold_sgpr_to_sgpr_copy_full
6 # GCN:      %0:sgpr_32 = IMPLICIT_DEF
7 # GCN-NEXT: S_STORE_DWORD_IMM %0, undef $sgpr10_sgpr11, 0, 0
9 name:            fold_sgpr_to_sgpr_copy_full
10 body:             |
11   bb.0:
13     %0:sgpr_32 = IMPLICIT_DEF
14     %1:sgpr_32 = COPY %0
15     %2:sgpr_32 = COPY %1
16     S_STORE_DWORD_IMM %2, undef $sgpr10_sgpr11, 0, 0
17 ...
19 # GCN-LABEL: name: fold_sgpr_to_sgpr_copy_subreg
20 # GCN:      %0:sreg_64 = IMPLICIT_DEF
21 # GCN-NEXT: %2:sgpr_32 = COPY %0.sub0
22 # GCN-NEXT: S_STORE_DWORD_IMM %2, undef $sgpr10_sgpr11, 0, 0
24 name:            fold_sgpr_to_sgpr_copy_subreg
25 body:             |
26   bb.0:
28     %0:sreg_64 = IMPLICIT_DEF
29     %1:sgpr_32 = COPY %0.sub0
30     %2:sgpr_32 = COPY %1
31     S_STORE_DWORD_IMM %2, undef $sgpr10_sgpr11, 0, 0
32 ...
34 # GCN-LABEL: name: fold_sgpr_to_sgpr_copy_subreg2
35 # GCN:      %0:sreg_64 = IMPLICIT_DEF
36 # GCN-NEXT: %3:sreg_32_xm0_xexec = COPY %0.sub0
37 # GCN-NEXT: S_STORE_DWORD_IMM %3, undef $sgpr10_sgpr11, 0, 0
39 name:            fold_sgpr_to_sgpr_copy_subreg2
40 body:             |
41   bb.0:
43     %0:sreg_64 = IMPLICIT_DEF
44     %1:sgpr_32 = COPY %0.sub0
45     %2:sgpr_32 = COPY %1
46     %3:sreg_32_xm0_xexec = COPY %2
47     S_STORE_DWORD_IMM %3, undef $sgpr10_sgpr11, 0, 0
48 ...