1 # RUN: llc -mtriple=amdgcn -mcpu=gfx1010 -run-pass=si-fold-operands,dead-mi-elimination -verify-machineinstrs %s -o - | FileCheck -check-prefix=GCN %s
2 # RUN: llc -mtriple=amdgcn -mcpu=gfx1100 -run-pass=si-fold-operands,dead-mi-elimination -verify-machineinstrs %s -o - | FileCheck -check-prefix=GCN %s
4 # GCN-LABEL: name: fold_vgpr_to_vgpr_copy
5 # GCN: %0:vreg_64 = IMPLICIT_DEF
6 # GCN-NEXT: %1:vgpr_32 = IMPLICIT_DEF
7 # GCN-NEXT: %2:vgpr_32 = IMPLICIT_DEF
8 # GCN-NEXT: DS_WRITE2_B32_gfx9 %0.sub0, killed %1, killed %2, 0, 1, 0, implicit $exec
11 name: fold_vgpr_to_vgpr_copy
15 %0:vreg_64 = IMPLICIT_DEF
16 %4:vgpr_32 = IMPLICIT_DEF
17 %3:vgpr_32 = IMPLICIT_DEF
18 %1:vgpr_32 = COPY %0.sub0
20 DS_WRITE2_B32_gfx9 %2, killed %4, killed %3, 0, 1, 0, implicit $exec
23 # GCN-LABEL: name: fold_sgpr_to_vgpr_copy
24 # GCN: %0:sreg_64 = IMPLICIT_DEF
25 # GCN-NEXT: %1:vgpr_32 = IMPLICIT_DEF
26 # GCN-NEXT: %2:vgpr_32 = IMPLICIT_DEF
27 # GCN-NEXT: %4:vgpr_32 = COPY %0.sub0
28 # GCN-NEXT: DS_WRITE2_B32_gfx9 %4, killed %1, killed %2, 0, 1, 0, implicit $exec
29 name: fold_sgpr_to_vgpr_copy
33 %0:sreg_64 = IMPLICIT_DEF
34 %4:vgpr_32 = IMPLICIT_DEF
35 %3:vgpr_32 = IMPLICIT_DEF
36 %1:sgpr_32 = COPY %0.sub0
38 DS_WRITE2_B32_gfx9 %2, killed %4, killed %3, 0, 1, 0, implicit $exec
41 # GCN-LABEL: name: fma_sgpr_use
42 # GCN: %0:sreg_64_xexec = IMPLICIT_DEF
43 # GCN-NEXT: %4:vgpr_32 = nnan ninf nsz arcp contract afn reassoc V_FMA_F32_e64 2, %0.sub0, 0, 1073741824, 0, %0.sub1, 0, 0, implicit $mode, implicit $exec
48 %0:sreg_64_xexec = IMPLICIT_DEF
49 %1:sgpr_32 = COPY %0.sub0
50 %2:sgpr_32 = COPY %0.sub1
52 %4:vgpr_32 = nnan ninf nsz arcp contract afn reassoc V_FMAC_F32_e64 2, %1, 0, 1073741824, 0, %3, 0, 0, implicit $mode, implicit $exec
53 DS_WRITE2_B32_gfx9 undef %5:vgpr_32, killed %4, undef %6:vgpr_32, 0, 1, 0, implicit $exec
56 # GCN-LABEL: name: fma_sgpr_sgpr_use
57 # GCN: %0:sgpr_32 = IMPLICIT_DEF
58 # GCN-NEXT: %2:vgpr_32 = V_MOV_B32_e32 1234567, implicit $exec
59 # GCN-NEXT: %3:vgpr_32 = V_FMAC_F32_e64 0, %0, 0, 1234567, 0, %2, 0, 0, implicit $mode, implicit $exec
61 name: fma_sgpr_sgpr_use
64 %0:sgpr_32 = IMPLICIT_DEF
65 %1:sgpr_32 = S_MOV_B32 1234567
67 %3:vgpr_32 = V_FMAC_F32_e64 0, %0, 0, %1, 0, %2, 0, 0, implicit $mode, implicit $exec
68 S_ENDPGM 0, implicit %3