1 # RUN: llc -march=amdgcn -run-pass peephole-opt -verify-machineinstrs %s -o - | FileCheck -check-prefix=GCN %s
3 # GCN-LABEL: name: no_fold_imm_madak_mac_clamp_f32
4 # GCN: %23:vgpr_32 = V_MOV_B32_e32 1090519040, implicit $exec
5 # GCN-NEXT: %24:vgpr_32 = V_MAC_F32_e64 0, killed %19, 0, killed %21, 0, %23, 1, 0, implicit $exec
7 name: no_fold_imm_madak_mac_clamp_f32
8 tracksRegLiveness: true
10 - { id: 0, class: sgpr_64 }
11 - { id: 1, class: sreg_32_xm0 }
12 - { id: 2, class: sgpr_32 }
13 - { id: 3, class: vgpr_32 }
14 - { id: 4, class: sreg_64_xexec }
15 - { id: 5, class: sreg_64_xexec }
16 - { id: 6, class: sreg_64_xexec }
17 - { id: 7, class: sreg_32 }
18 - { id: 8, class: sreg_32 }
19 - { id: 9, class: sreg_32_xm0 }
20 - { id: 10, class: sreg_64 }
21 - { id: 11, class: sreg_32_xm0 }
22 - { id: 12, class: sreg_32_xm0 }
23 - { id: 13, class: sgpr_64 }
24 - { id: 14, class: sgpr_128 }
25 - { id: 15, class: sreg_32_xm0 }
26 - { id: 16, class: sreg_64 }
27 - { id: 17, class: sgpr_128 }
28 - { id: 18, class: sgpr_128 }
29 - { id: 19, class: vgpr_32 }
30 - { id: 20, class: vreg_64 }
31 - { id: 21, class: vgpr_32 }
32 - { id: 22, class: vreg_64 }
33 - { id: 23, class: vgpr_32 }
34 - { id: 24, class: vgpr_32 }
35 - { id: 25, class: vgpr_32 }
36 - { id: 26, class: vreg_64 }
37 - { id: 27, class: vgpr_32 }
38 - { id: 28, class: vreg_64 }
39 - { id: 29, class: vreg_64 }
41 - { reg: '$sgpr0_sgpr1', virtual-reg: '%0' }
42 - { reg: '$vgpr0', virtual-reg: '%3' }
45 liveins: $sgpr0_sgpr1, $vgpr0
48 %0 = COPY $sgpr0_sgpr1
49 %4 = S_LOAD_DWORDX2_IMM %0, 9, 0, 0
50 %5 = S_LOAD_DWORDX2_IMM %0, 11, 0, 0
51 %6 = S_LOAD_DWORDX2_IMM %0, 13, 0, 0
52 %27 = V_ASHRREV_I32_e32 31, %3, implicit $exec
53 %28 = REG_SEQUENCE %3, 1, %27, 2
56 %13 = REG_SEQUENCE killed %12, 1, killed %11, 2
57 %14 = REG_SEQUENCE killed %5, 17, %13, 18
59 %29 = V_LSHL_B64 killed %28, killed %15, implicit $exec
60 %17 = REG_SEQUENCE killed %6, 17, %13, 18
61 %18 = REG_SEQUENCE killed %4, 17, %13, 18
63 %19 = BUFFER_LOAD_DWORD_ADDR64 %20, killed %14, 0, 0, 0, 0, 0, 0, implicit $exec
65 %21 = BUFFER_LOAD_DWORD_ADDR64 %22, killed %17, 0, 0, 0, 0, 0, 0, implicit $exec
66 %23 = V_MOV_B32_e32 1090519040, implicit $exec
67 %24 = V_MAC_F32_e64 0, killed %19, 0, killed %21, 0, %23, 1, 0, implicit $exec
69 BUFFER_STORE_DWORD_ADDR64 killed %24, %26, killed %18, 0, 0, 0, 0, 0, 0, implicit $exec
74 # GCN-LABEL: name: no_fold_imm_madak_mac_omod_f32
75 # GCN: %23:vgpr_32 = V_MOV_B32_e32 1090519040, implicit $exec
76 # GCN: %24:vgpr_32 = V_MAC_F32_e64 0, killed %19, 0, killed %21, 0, %23, 0, 2, implicit $exec
78 name: no_fold_imm_madak_mac_omod_f32
79 tracksRegLiveness: true
81 - { id: 0, class: sgpr_64 }
82 - { id: 1, class: sreg_32_xm0 }
83 - { id: 2, class: sgpr_32 }
84 - { id: 3, class: vgpr_32 }
85 - { id: 4, class: sreg_64_xexec }
86 - { id: 5, class: sreg_64_xexec }
87 - { id: 6, class: sreg_64_xexec }
88 - { id: 7, class: sreg_32 }
89 - { id: 8, class: sreg_32 }
90 - { id: 9, class: sreg_32_xm0 }
91 - { id: 10, class: sreg_64 }
92 - { id: 11, class: sreg_32_xm0 }
93 - { id: 12, class: sreg_32_xm0 }
94 - { id: 13, class: sgpr_64 }
95 - { id: 14, class: sgpr_128 }
96 - { id: 15, class: sreg_32_xm0 }
97 - { id: 16, class: sreg_64 }
98 - { id: 17, class: sgpr_128 }
99 - { id: 18, class: sgpr_128 }
100 - { id: 19, class: vgpr_32 }
101 - { id: 20, class: vreg_64 }
102 - { id: 21, class: vgpr_32 }
103 - { id: 22, class: vreg_64 }
104 - { id: 23, class: vgpr_32 }
105 - { id: 24, class: vgpr_32 }
106 - { id: 25, class: vgpr_32 }
107 - { id: 26, class: vreg_64 }
108 - { id: 27, class: vgpr_32 }
109 - { id: 28, class: vreg_64 }
110 - { id: 29, class: vreg_64 }
112 - { reg: '$sgpr0_sgpr1', virtual-reg: '%0' }
113 - { reg: '$vgpr0', virtual-reg: '%3' }
116 liveins: $sgpr0_sgpr1, $vgpr0
119 %0 = COPY $sgpr0_sgpr1
120 %4 = S_LOAD_DWORDX2_IMM %0, 9, 0, 0
121 %5 = S_LOAD_DWORDX2_IMM %0, 11, 0, 0
122 %6 = S_LOAD_DWORDX2_IMM %0, 13, 0, 0
123 %27 = V_ASHRREV_I32_e32 31, %3, implicit $exec
124 %28 = REG_SEQUENCE %3, 1, %27, 2
125 %11 = S_MOV_B32 61440
127 %13 = REG_SEQUENCE killed %12, 1, killed %11, 2
128 %14 = REG_SEQUENCE killed %5, 17, %13, 18
130 %29 = V_LSHL_B64 killed %28, killed %15, implicit $exec
131 %17 = REG_SEQUENCE killed %6, 17, %13, 18
132 %18 = REG_SEQUENCE killed %4, 17, %13, 18
134 %19 = BUFFER_LOAD_DWORD_ADDR64 %20, killed %14, 0, 0, 0, 0, 0, 0, implicit $exec
136 %21 = BUFFER_LOAD_DWORD_ADDR64 %22, killed %17, 0, 0, 0, 0, 0, 0, implicit $exec
137 %23 = V_MOV_B32_e32 1090519040, implicit $exec
138 %24 = V_MAC_F32_e64 0, killed %19, 0, killed %21, 0, %23, 0, 2, implicit $exec
140 BUFFER_STORE_DWORD_ADDR64 killed %24, %26, killed %18, 0, 0, 0, 0, 0, 0, implicit $exec
145 # GCN: name: no_fold_imm_madak_mad_clamp_f32
146 # GCN: %23:vgpr_32 = V_MOV_B32_e32 1090519040, implicit $exec
147 # GCN: %24:vgpr_32 = V_MAD_F32 0, killed %19, 0, killed %21, 0, %23, 1, 0, implicit $exec
149 name: no_fold_imm_madak_mad_clamp_f32
150 tracksRegLiveness: true
152 - { id: 0, class: sgpr_64 }
153 - { id: 1, class: sreg_32_xm0 }
154 - { id: 2, class: sgpr_32 }
155 - { id: 3, class: vgpr_32 }
156 - { id: 4, class: sreg_64_xexec }
157 - { id: 5, class: sreg_64_xexec }
158 - { id: 6, class: sreg_64_xexec }
159 - { id: 7, class: sreg_32 }
160 - { id: 8, class: sreg_32 }
161 - { id: 9, class: sreg_32_xm0 }
162 - { id: 10, class: sreg_64 }
163 - { id: 11, class: sreg_32_xm0 }
164 - { id: 12, class: sreg_32_xm0 }
165 - { id: 13, class: sgpr_64 }
166 - { id: 14, class: sgpr_128 }
167 - { id: 15, class: sreg_32_xm0 }
168 - { id: 16, class: sreg_64 }
169 - { id: 17, class: sgpr_128 }
170 - { id: 18, class: sgpr_128 }
171 - { id: 19, class: vgpr_32 }
172 - { id: 20, class: vreg_64 }
173 - { id: 21, class: vgpr_32 }
174 - { id: 22, class: vreg_64 }
175 - { id: 23, class: vgpr_32 }
176 - { id: 24, class: vgpr_32 }
177 - { id: 25, class: vgpr_32 }
178 - { id: 26, class: vreg_64 }
179 - { id: 27, class: vgpr_32 }
180 - { id: 28, class: vreg_64 }
181 - { id: 29, class: vreg_64 }
183 - { reg: '$sgpr0_sgpr1', virtual-reg: '%0' }
184 - { reg: '$vgpr0', virtual-reg: '%3' }
187 liveins: $sgpr0_sgpr1, $vgpr0
190 %0 = COPY $sgpr0_sgpr1
191 %4 = S_LOAD_DWORDX2_IMM %0, 9, 0, 0
192 %5 = S_LOAD_DWORDX2_IMM %0, 11, 0, 0
193 %6 = S_LOAD_DWORDX2_IMM %0, 13, 0, 0
194 %27 = V_ASHRREV_I32_e32 31, %3, implicit $exec
195 %28 = REG_SEQUENCE %3, 1, %27, 2
196 %11 = S_MOV_B32 61440
198 %13 = REG_SEQUENCE killed %12, 1, killed %11, 2
199 %14 = REG_SEQUENCE killed %5, 17, %13, 18
201 %29 = V_LSHL_B64 killed %28, killed %15, implicit $exec
202 %17 = REG_SEQUENCE killed %6, 17, %13, 18
203 %18 = REG_SEQUENCE killed %4, 17, %13, 18
205 %19 = BUFFER_LOAD_DWORD_ADDR64 %20, killed %14, 0, 0, 0, 0, 0, 0, implicit $exec
207 %21 = BUFFER_LOAD_DWORD_ADDR64 %22, killed %17, 0, 0, 0, 0, 0, 0, implicit $exec
208 %23 = V_MOV_B32_e32 1090519040, implicit $exec
209 %24 = V_MAD_F32 0, killed %19, 0, killed %21, 0, %23, 1, 0, implicit $exec
211 BUFFER_STORE_DWORD_ADDR64 killed %24, %26, killed %18, 0, 0, 0, 0, 0, 0, implicit $exec
216 # GCN: name: no_fold_imm_madak_mad_omod_f32
217 # GCN: %23:vgpr_32 = V_MOV_B32_e32 1090519040, implicit $exec
218 # GCN: %24:vgpr_32 = V_MAD_F32 0, killed %19, 0, killed %21, 0, %23, 0, 1, implicit $exec
220 name: no_fold_imm_madak_mad_omod_f32
221 tracksRegLiveness: true
223 - { id: 0, class: sgpr_64 }
224 - { id: 1, class: sreg_32_xm0 }
225 - { id: 2, class: sgpr_32 }
226 - { id: 3, class: vgpr_32 }
227 - { id: 4, class: sreg_64_xexec }
228 - { id: 5, class: sreg_64_xexec }
229 - { id: 6, class: sreg_64_xexec }
230 - { id: 7, class: sreg_32 }
231 - { id: 8, class: sreg_32 }
232 - { id: 9, class: sreg_32_xm0 }
233 - { id: 10, class: sreg_64 }
234 - { id: 11, class: sreg_32_xm0 }
235 - { id: 12, class: sreg_32_xm0 }
236 - { id: 13, class: sgpr_64 }
237 - { id: 14, class: sgpr_128 }
238 - { id: 15, class: sreg_32_xm0 }
239 - { id: 16, class: sreg_64 }
240 - { id: 17, class: sgpr_128 }
241 - { id: 18, class: sgpr_128 }
242 - { id: 19, class: vgpr_32 }
243 - { id: 20, class: vreg_64 }
244 - { id: 21, class: vgpr_32 }
245 - { id: 22, class: vreg_64 }
246 - { id: 23, class: vgpr_32 }
247 - { id: 24, class: vgpr_32 }
248 - { id: 25, class: vgpr_32 }
249 - { id: 26, class: vreg_64 }
250 - { id: 27, class: vgpr_32 }
251 - { id: 28, class: vreg_64 }
252 - { id: 29, class: vreg_64 }
254 - { reg: '$sgpr0_sgpr1', virtual-reg: '%0' }
255 - { reg: '$vgpr0', virtual-reg: '%3' }
258 liveins: $sgpr0_sgpr1, $vgpr0
261 %0 = COPY $sgpr0_sgpr1
262 %4 = S_LOAD_DWORDX2_IMM %0, 9, 0, 0
263 %5 = S_LOAD_DWORDX2_IMM %0, 11, 0, 0
264 %6 = S_LOAD_DWORDX2_IMM %0, 13, 0, 0
265 %27 = V_ASHRREV_I32_e32 31, %3, implicit $exec
266 %28 = REG_SEQUENCE %3, 1, %27, 2
267 %11 = S_MOV_B32 61440
269 %13 = REG_SEQUENCE killed %12, 1, killed %11, 2
270 %14 = REG_SEQUENCE killed %5, 17, %13, 18
272 %29 = V_LSHL_B64 killed %28, killed %15, implicit $exec
273 %17 = REG_SEQUENCE killed %6, 17, %13, 18
274 %18 = REG_SEQUENCE killed %4, 17, %13, 18
276 %19 = BUFFER_LOAD_DWORD_ADDR64 %20, killed %14, 0, 0, 0, 0, 0, 0, implicit $exec
278 %21 = BUFFER_LOAD_DWORD_ADDR64 %22, killed %17, 0, 0, 0, 0, 0, 0, implicit $exec
279 %23 = V_MOV_B32_e32 1090519040, implicit $exec
280 %24 = V_MAD_F32 0, killed %19, 0, killed %21, 0, %23, 0, 1, implicit $exec
282 BUFFER_STORE_DWORD_ADDR64 killed %24, %26, killed %18, 0, 0, 0, 0, 0, 0, implicit $exec