1 # RUN: llc -march=amdgcn -verify-machineinstrs -run-pass=register-coalescer,rename-independent-subregs -o - %s | FileCheck -check-prefix=GCN %s
4 # GCN-LABEL: name: mac_invalid_operands
5 # GCN: undef %18.sub0:vreg_128 = nofpexcept V_MAC_F32_e32 undef %3:vgpr_32, undef %9:vgpr_32, undef %18.sub0, implicit $mode, implicit $exec
7 name: mac_invalid_operands
9 exposesReturnsTwice: false
11 regBankSelected: false
13 tracksRegLiveness: true
15 scratchRSrcReg: '$sgpr0_sgpr1_sgpr2_sgpr3'
16 frameOffsetReg: '$sgpr4'
19 - { id: 0, class: vreg_128 }
20 - { id: 1, class: vreg_128 }
21 - { id: 2, class: sgpr_64 }
22 - { id: 3, class: vgpr_32 }
23 - { id: 4, class: vgpr_32 }
24 - { id: 5, class: vgpr_32 }
25 - { id: 6, class: vgpr_32 }
26 - { id: 7, class: sreg_64 }
27 - { id: 8, class: vgpr_32 }
28 - { id: 9, class: vgpr_32 }
29 - { id: 10, class: vreg_64 }
30 - { id: 11, class: vreg_64 }
31 - { id: 12, class: vreg_128 }
32 - { id: 13, class: vreg_128 }
33 - { id: 14, class: vgpr_32 }
34 - { id: 15, class: vreg_64 }
35 - { id: 16, class: vgpr_32 }
36 - { id: 17, class: vreg_128 }
39 successors: %bb.2, %bb.1
41 %7 = nofpexcept V_CMP_NEQ_F32_e64 0, 0, 0, undef %3, 0, implicit $mode, implicit $exec
43 S_CBRANCH_VCCZ %bb.2, implicit killed $vcc
48 %4 = nofpexcept V_ADD_F32_e32 undef %6, undef %5, implicit $mode, implicit $exec
49 undef %12.sub0 = COPY killed %4
56 %8 = nofpexcept V_MAC_F32_e32 undef %3, undef %9, undef %8, implicit $mode, implicit $exec
57 undef %13.sub0 = COPY %8
59 %13.sub2 = COPY killed %8
65 FLAT_STORE_DWORD undef %10, %1.sub2, 0, 0, implicit $exec, implicit $flat_scr
67 %16 = COPY killed %1.sub0
68 undef %15.sub0 = COPY killed %16
69 %15.sub1 = COPY killed %14
70 FLAT_STORE_DWORDX2 undef %11, killed %15, 0, 0, implicit $exec, implicit $flat_scr
75 # Make sure others uses after the mac are properly handled and not
76 # left unreplaced due to iterator issues from substituteRegister.
78 # GCN-LABEL: name: vreg_does_not_dominate
80 # GCN: undef %8.sub1:vreg_128 = nofpexcept V_MAC_F32_e32 undef %2:vgpr_32, undef %1:vgpr_32, undef %8.sub1, implicit $mode, implicit $exec
81 # GCN: undef %7.sub0:vreg_128 = V_MOV_B32_e32 0, implicit $exec
82 # GCN: undef %9.sub2:vreg_128 = COPY %7.sub0
84 # GCN: undef %6.sub3:vreg_128 = nofpexcept V_ADD_F32_e32 undef %3:vgpr_32, undef %3:vgpr_32, implicit $mode, implicit $exec
85 # GCN: undef %7.sub0:vreg_128 = nofpexcept V_ADD_F32_e64 0, 0, 0, 0, 0, 0, implicit $mode, implicit $exec
86 # GCN: %8.sub1:vreg_128 = nofpexcept V_ADD_F32_e32 %8.sub1, %8.sub1, implicit $mode, implicit $exec
88 # GCN: BUFFER_STORE_DWORD_OFFEN %6.sub3, %0,
89 # GCN: BUFFER_STORE_DWORD_OFFEN %9.sub2, %0,
90 # GCN: BUFFER_STORE_DWORD_OFFEN %8.sub1, %0,
91 # GCN: BUFFER_STORE_DWORD_OFFEN %7.sub0, %0,
92 name: vreg_does_not_dominate
94 exposesReturnsTwice: false
96 regBankSelected: false
98 tracksRegLiveness: true
100 scratchRSrcReg: '$sgpr0_sgpr1_sgpr2_sgpr3'
101 frameOffsetReg: '$sgpr4'
103 - { id: 0, class: vgpr_32, preferred-register: '' }
104 - { id: 1, class: vgpr_32, preferred-register: '' }
105 - { id: 2, class: vgpr_32, preferred-register: '' }
106 - { id: 3, class: vgpr_32, preferred-register: '' }
107 - { id: 4, class: vgpr_32, preferred-register: '' }
108 - { id: 5, class: sreg_64, preferred-register: '' }
109 - { id: 6, class: vreg_128, preferred-register: '' }
111 - { reg: '$vgpr0', virtual-reg: '%0' }
112 - { reg: '$sgpr30_sgpr31', virtual-reg: '%5' }
115 successors: %bb.2, %bb.1
116 liveins: $vgpr0, $sgpr30_sgpr31, $sgpr5
118 %5 = COPY $sgpr30_sgpr31
120 undef %6.sub1 = nofpexcept V_MAC_F32_e32 undef %2, undef %1, undef %6.sub1, implicit $mode, implicit $exec
121 %6.sub0 = V_MOV_B32_e32 0, implicit $exec
122 %6.sub2 = COPY %6.sub0
123 S_CBRANCH_VCCNZ %bb.2, implicit undef $vcc
129 %6.sub3 = nofpexcept V_ADD_F32_e32 undef %3, undef %3, implicit $mode, implicit $exec
130 %6.sub0 = nofpexcept V_ADD_F32_e64 0, 0, 0, 0, 0, 0, implicit $mode, implicit $exec
131 %6.sub1 = nofpexcept V_ADD_F32_e32 %6.sub1, %6.sub1, implicit $mode, implicit $exec
132 %6.sub2 = COPY %6.sub0
135 BUFFER_STORE_DWORD_OFFEN %6.sub3, %0, $sgpr0_sgpr1_sgpr2_sgpr3, $sgpr4, 12, 0, 0, implicit $exec
136 BUFFER_STORE_DWORD_OFFEN %6.sub2, %0, $sgpr0_sgpr1_sgpr2_sgpr3, $sgpr4, 8, 0, 0, implicit $exec
137 BUFFER_STORE_DWORD_OFFEN %6.sub1, %0, $sgpr0_sgpr1_sgpr2_sgpr3, $sgpr4, 4, 0, 0, implicit $exec
138 BUFFER_STORE_DWORD_OFFEN %6.sub0, %0, $sgpr0_sgpr1_sgpr2_sgpr3, $sgpr4, 0, 0, 0, implicit $exec
139 $sgpr30_sgpr31 = COPY %5
140 S_SETPC_B64_return $sgpr30_sgpr31
144 # GCN-LABEL: name: inf_loop_tied_operand
146 # GCN-NEXT: undef %2.sub0:vreg_128 = nofpexcept V_MAC_F32_e32 1073741824, undef %0:vgpr_32, undef %2.sub0, implicit $mode, implicit $exec
147 # GCN-NEXT: dead undef %3.sub1:vreg_128 = COPY %2.sub0
149 name: inf_loop_tied_operand
150 tracksRegLiveness: true
152 - { id: 0, class: vgpr_32, preferred-register: '' }
153 - { id: 1, class: vgpr_32, preferred-register: '' }
154 - { id: 2, class: vreg_128, preferred-register: '' }
157 %1 = nofpexcept V_MAC_F32_e32 1073741824, undef %0, undef %1, implicit $mode, implicit $exec
158 undef %2.sub0 = COPY %1