1 # RUN: llc -march=amdgcn -verify-machineinstrs -run-pass=simple-register-coalescing,rename-independent-subregs -o - %s | FileCheck -check-prefix=GCN %s
4 # GCN-LABEL: name: mac_invalid_operands
5 # GCN: undef %18.sub0:vreg_128 = V_MAC_F32_e32 undef %3:vgpr_32, undef %9:vgpr_32, undef %18.sub0, implicit $exec
7 name: mac_invalid_operands
9 exposesReturnsTwice: false
11 regBankSelected: false
13 tracksRegLiveness: true
15 scratchRSrcReg: '$sgpr0_sgpr1_sgpr2_sgpr3'
16 scratchWaveOffsetReg: '$sgpr4'
17 frameOffsetReg: '$sgpr4'
20 - { id: 0, class: vreg_128 }
21 - { id: 1, class: vreg_128 }
22 - { id: 2, class: sgpr_64 }
23 - { id: 3, class: vgpr_32 }
24 - { id: 4, class: vgpr_32 }
25 - { id: 5, class: vgpr_32 }
26 - { id: 6, class: vgpr_32 }
27 - { id: 7, class: sreg_64 }
28 - { id: 8, class: vgpr_32 }
29 - { id: 9, class: vgpr_32 }
30 - { id: 10, class: vreg_64 }
31 - { id: 11, class: vreg_64 }
32 - { id: 12, class: vreg_128 }
33 - { id: 13, class: vreg_128 }
34 - { id: 14, class: vgpr_32 }
35 - { id: 15, class: vreg_64 }
36 - { id: 16, class: vgpr_32 }
37 - { id: 17, class: vreg_128 }
40 successors: %bb.2, %bb.1
42 %7 = V_CMP_NEQ_F32_e64 0, 0, 0, undef %3, 0, implicit $exec
44 S_CBRANCH_VCCZ %bb.2, implicit killed $vcc
49 %4 = V_ADD_F32_e32 undef %6, undef %5, implicit $exec
50 undef %12.sub0 = COPY killed %4
57 %8 = V_MAC_F32_e32 undef %3, undef %9, undef %8, implicit $exec
58 undef %13.sub0 = COPY %8
60 %13.sub2 = COPY killed %8
66 FLAT_STORE_DWORD undef %10, %1.sub2, 0, 0, 0, 0, implicit $exec, implicit $flat_scr
68 %16 = COPY killed %1.sub0
69 undef %15.sub0 = COPY killed %16
70 %15.sub1 = COPY killed %14
71 FLAT_STORE_DWORDX2 undef %11, killed %15, 0, 0, 0, 0, implicit $exec, implicit $flat_scr
76 # Make sure others uses after the mac are properly handled and not
77 # left unreplaced due to iterator issues from substituteRegister.
79 # GCN-LABEL: name: vreg_does_not_dominate
81 # GCN: undef %8.sub1:vreg_128 = V_MAC_F32_e32 undef %2:vgpr_32, undef %1:vgpr_32, undef %8.sub1, implicit $exec
82 # GCN: undef %7.sub0:vreg_128 = V_MOV_B32_e32 0, implicit $exec
83 # GCN: undef %9.sub2:vreg_128 = COPY %7.sub0
85 # GCN: undef %6.sub3:vreg_128 = V_ADD_F32_e32 undef %3:vgpr_32, undef %3:vgpr_32, implicit $exec
86 # GCN: undef %7.sub0:vreg_128 = V_ADD_F32_e64 0, 0, 0, 0, 0, 0, implicit $exec
87 # GCN: %8.sub1:vreg_128 = V_ADD_F32_e32 %8.sub1, %8.sub1, implicit $exec
89 # GCN: BUFFER_STORE_DWORD_OFFEN %6.sub3, %0,
90 # GCN: BUFFER_STORE_DWORD_OFFEN %9.sub2, %0,
91 # GCN: BUFFER_STORE_DWORD_OFFEN %8.sub1, %0,
92 # GCN: BUFFER_STORE_DWORD_OFFEN %7.sub0, %0,
93 name: vreg_does_not_dominate
95 exposesReturnsTwice: false
97 regBankSelected: false
99 tracksRegLiveness: true
101 scratchRSrcReg: '$sgpr0_sgpr1_sgpr2_sgpr3'
102 scratchWaveOffsetReg: '$sgpr4'
103 frameOffsetReg: '$sgpr4'
105 - { id: 0, class: vgpr_32, preferred-register: '' }
106 - { id: 1, class: vgpr_32, preferred-register: '' }
107 - { id: 2, class: vgpr_32, preferred-register: '' }
108 - { id: 3, class: vgpr_32, preferred-register: '' }
109 - { id: 4, class: vgpr_32, preferred-register: '' }
110 - { id: 5, class: sreg_64, preferred-register: '' }
111 - { id: 6, class: vreg_128, preferred-register: '' }
113 - { reg: '$vgpr0', virtual-reg: '%0' }
114 - { reg: '$sgpr30_sgpr31', virtual-reg: '%5' }
117 successors: %bb.2, %bb.1
118 liveins: $vgpr0, $sgpr30_sgpr31, $sgpr5
120 %5 = COPY $sgpr30_sgpr31
122 undef %6.sub1 = V_MAC_F32_e32 undef %2, undef %1, undef %6.sub1, implicit $exec
123 %6.sub0 = V_MOV_B32_e32 0, implicit $exec
124 %6.sub2 = COPY %6.sub0
125 S_CBRANCH_VCCNZ %bb.2, implicit undef $vcc
131 %6.sub3 = V_ADD_F32_e32 undef %3, undef %3, implicit $exec
132 %6.sub0 = V_ADD_F32_e64 0, 0, 0, 0, 0, 0, implicit $exec
133 %6.sub1 = V_ADD_F32_e32 %6.sub1, %6.sub1, implicit $exec
134 %6.sub2 = COPY %6.sub0
137 BUFFER_STORE_DWORD_OFFEN %6.sub3, %0, $sgpr0_sgpr1_sgpr2_sgpr3, $sgpr4, 12, 0, 0, 0, 0, 0, implicit $exec
138 BUFFER_STORE_DWORD_OFFEN %6.sub2, %0, $sgpr0_sgpr1_sgpr2_sgpr3, $sgpr4, 8, 0, 0, 0, 0, 0, implicit $exec
139 BUFFER_STORE_DWORD_OFFEN %6.sub1, %0, $sgpr0_sgpr1_sgpr2_sgpr3, $sgpr4, 4, 0, 0, 0, 0, 0, implicit $exec
140 BUFFER_STORE_DWORD_OFFEN %6.sub0, %0, $sgpr0_sgpr1_sgpr2_sgpr3, $sgpr4, 0, 0, 0, 0, 0, 0, implicit $exec
141 $sgpr30_sgpr31 = COPY %5
142 S_SETPC_B64_return $sgpr30_sgpr31
146 # GCN-LABEL: name: inf_loop_tied_operand
148 # GCN-NEXT: undef %2.sub0:vreg_128 = V_MAC_F32_e32 1073741824, undef %0:vgpr_32, undef %2.sub0, implicit $exec
149 # GCN-NEXT: dead undef %3.sub1:vreg_128 = COPY %2.sub0
151 name: inf_loop_tied_operand
152 tracksRegLiveness: true
154 - { id: 0, class: vgpr_32, preferred-register: '' }
155 - { id: 1, class: vgpr_32, preferred-register: '' }
156 - { id: 2, class: vreg_128, preferred-register: '' }
159 %1 = V_MAC_F32_e32 1073741824, undef %0, undef %1, implicit $exec
160 undef %2.sub0 = COPY %1