blob: d37964af76f2009008813cf1260fc26a8e1ed913 [file] [log] [blame]
Matt Arsenault2ed21932017-02-27 20:21:31 +00001# RUN: llc -march=amdgcn -run-pass peephole-opt -verify-machineinstrs %s -o - | FileCheck -check-prefix=GCN %s
Matt Arsenault2ed21932017-02-27 20:21:31 +00002...
Matt Arsenault2ed21932017-02-27 20:21:31 +00003# GCN-LABEL: name: no_fold_imm_madak_mac_clamp_f32
Puyan Lotfi43e94b12018-01-31 22:04:26 +00004# 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
Matt Arsenault2ed21932017-02-27 20:21:31 +00006
7name: no_fold_imm_madak_mac_clamp_f32
8tracksRegLiveness: true
9registers:
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 }
40liveins:
Puyan Lotfi43e94b12018-01-31 22:04:26 +000041 - { reg: '$sgpr0_sgpr1', virtual-reg: '%0' }
42 - { reg: '$vgpr0', virtual-reg: '%3' }
Matt Arsenault2ed21932017-02-27 20:21:31 +000043body: |
Matt Arsenault60b91e02017-07-06 20:56:57 +000044 bb.0:
Puyan Lotfi43e94b12018-01-31 22:04:26 +000045 liveins: $sgpr0_sgpr1, $vgpr0
Matt Arsenault2ed21932017-02-27 20:21:31 +000046
Puyan Lotfi43e94b12018-01-31 22:04:26 +000047 %3 = COPY $vgpr0
48 %0 = COPY $sgpr0_sgpr1
Matt Arsenault60b91e02017-07-06 20:56:57 +000049 %4 = S_LOAD_DWORDX2_IMM %0, 9, 0
50 %5 = S_LOAD_DWORDX2_IMM %0, 11, 0
51 %6 = S_LOAD_DWORDX2_IMM %0, 13, 0
Puyan Lotfi43e94b12018-01-31 22:04:26 +000052 %27 = V_ASHRREV_I32_e32 31, %3, implicit $exec
Matt Arsenault2ed21932017-02-27 20:21:31 +000053 %28 = REG_SEQUENCE %3, 1, %27, 2
54 %11 = S_MOV_B32 61440
55 %12 = S_MOV_B32 0
56 %13 = REG_SEQUENCE killed %12, 1, killed %11, 2
57 %14 = REG_SEQUENCE killed %5, 17, %13, 18
58 %15 = S_MOV_B32 2
Puyan Lotfi43e94b12018-01-31 22:04:26 +000059 %29 = V_LSHL_B64 killed %28, killed %15, implicit $exec
Matt Arsenault2ed21932017-02-27 20:21:31 +000060 %17 = REG_SEQUENCE killed %6, 17, %13, 18
61 %18 = REG_SEQUENCE killed %4, 17, %13, 18
62 %20 = COPY %29
Puyan Lotfi43e94b12018-01-31 22:04:26 +000063 %19 = BUFFER_LOAD_DWORD_ADDR64 %20, killed %14, 0, 0, 0, 0, 0, implicit $exec
Matt Arsenault2ed21932017-02-27 20:21:31 +000064 %22 = COPY %29
Puyan Lotfi43e94b12018-01-31 22:04:26 +000065 %21 = BUFFER_LOAD_DWORD_ADDR64 %22, killed %17, 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
Matt Arsenault2ed21932017-02-27 20:21:31 +000068 %26 = COPY %29
Puyan Lotfi43e94b12018-01-31 22:04:26 +000069 BUFFER_STORE_DWORD_ADDR64 killed %24, %26, killed %18, 0, 0, 0, 0, 0, implicit $exec
Matt Arsenault2ed21932017-02-27 20:21:31 +000070 S_ENDPGM
71
72...
73---
74# GCN-LABEL: name: no_fold_imm_madak_mac_omod_f32
Puyan Lotfi43e94b12018-01-31 22:04:26 +000075# 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
Matt Arsenault2ed21932017-02-27 20:21:31 +000077
78name: no_fold_imm_madak_mac_omod_f32
79tracksRegLiveness: true
80registers:
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 }
111liveins:
Puyan Lotfi43e94b12018-01-31 22:04:26 +0000112 - { reg: '$sgpr0_sgpr1', virtual-reg: '%0' }
113 - { reg: '$vgpr0', virtual-reg: '%3' }
Matt Arsenault2ed21932017-02-27 20:21:31 +0000114body: |
Matt Arsenault60b91e02017-07-06 20:56:57 +0000115 bb.0:
Puyan Lotfi43e94b12018-01-31 22:04:26 +0000116 liveins: $sgpr0_sgpr1, $vgpr0
Matt Arsenault2ed21932017-02-27 20:21:31 +0000117
Puyan Lotfi43e94b12018-01-31 22:04:26 +0000118 %3 = COPY $vgpr0
119 %0 = COPY $sgpr0_sgpr1
Matt Arsenault60b91e02017-07-06 20:56:57 +0000120 %4 = S_LOAD_DWORDX2_IMM %0, 9, 0
121 %5 = S_LOAD_DWORDX2_IMM %0, 11, 0
122 %6 = S_LOAD_DWORDX2_IMM %0, 13, 0
Puyan Lotfi43e94b12018-01-31 22:04:26 +0000123 %27 = V_ASHRREV_I32_e32 31, %3, implicit $exec
Matt Arsenault2ed21932017-02-27 20:21:31 +0000124 %28 = REG_SEQUENCE %3, 1, %27, 2
125 %11 = S_MOV_B32 61440
126 %12 = S_MOV_B32 0
127 %13 = REG_SEQUENCE killed %12, 1, killed %11, 2
128 %14 = REG_SEQUENCE killed %5, 17, %13, 18
129 %15 = S_MOV_B32 2
Puyan Lotfi43e94b12018-01-31 22:04:26 +0000130 %29 = V_LSHL_B64 killed %28, killed %15, implicit $exec
Matt Arsenault2ed21932017-02-27 20:21:31 +0000131 %17 = REG_SEQUENCE killed %6, 17, %13, 18
132 %18 = REG_SEQUENCE killed %4, 17, %13, 18
133 %20 = COPY %29
Puyan Lotfi43e94b12018-01-31 22:04:26 +0000134 %19 = BUFFER_LOAD_DWORD_ADDR64 %20, killed %14, 0, 0, 0, 0, 0, implicit $exec
Matt Arsenault2ed21932017-02-27 20:21:31 +0000135 %22 = COPY %29
Puyan Lotfi43e94b12018-01-31 22:04:26 +0000136 %21 = BUFFER_LOAD_DWORD_ADDR64 %22, killed %17, 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
Matt Arsenault2ed21932017-02-27 20:21:31 +0000139 %26 = COPY %29
Puyan Lotfi43e94b12018-01-31 22:04:26 +0000140 BUFFER_STORE_DWORD_ADDR64 killed %24, %26, killed %18, 0, 0, 0, 0, 0, implicit $exec
Matt Arsenault2ed21932017-02-27 20:21:31 +0000141 S_ENDPGM
142
143...
144---
145# GCN: name: no_fold_imm_madak_mad_clamp_f32
Puyan Lotfi43e94b12018-01-31 22:04:26 +0000146# 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
Matt Arsenault2ed21932017-02-27 20:21:31 +0000148
149name: no_fold_imm_madak_mad_clamp_f32
150tracksRegLiveness: true
151registers:
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 }
182liveins:
Puyan Lotfi43e94b12018-01-31 22:04:26 +0000183 - { reg: '$sgpr0_sgpr1', virtual-reg: '%0' }
184 - { reg: '$vgpr0', virtual-reg: '%3' }
Matt Arsenault2ed21932017-02-27 20:21:31 +0000185body: |
Matt Arsenault60b91e02017-07-06 20:56:57 +0000186 bb.0:
Puyan Lotfi43e94b12018-01-31 22:04:26 +0000187 liveins: $sgpr0_sgpr1, $vgpr0
Matt Arsenault2ed21932017-02-27 20:21:31 +0000188
Puyan Lotfi43e94b12018-01-31 22:04:26 +0000189 %3 = COPY $vgpr0
190 %0 = COPY $sgpr0_sgpr1
Matt Arsenault60b91e02017-07-06 20:56:57 +0000191 %4 = S_LOAD_DWORDX2_IMM %0, 9, 0
192 %5 = S_LOAD_DWORDX2_IMM %0, 11, 0
193 %6 = S_LOAD_DWORDX2_IMM %0, 13, 0
Puyan Lotfi43e94b12018-01-31 22:04:26 +0000194 %27 = V_ASHRREV_I32_e32 31, %3, implicit $exec
Matt Arsenault2ed21932017-02-27 20:21:31 +0000195 %28 = REG_SEQUENCE %3, 1, %27, 2
196 %11 = S_MOV_B32 61440
197 %12 = S_MOV_B32 0
198 %13 = REG_SEQUENCE killed %12, 1, killed %11, 2
199 %14 = REG_SEQUENCE killed %5, 17, %13, 18
200 %15 = S_MOV_B32 2
Puyan Lotfi43e94b12018-01-31 22:04:26 +0000201 %29 = V_LSHL_B64 killed %28, killed %15, implicit $exec
Matt Arsenault2ed21932017-02-27 20:21:31 +0000202 %17 = REG_SEQUENCE killed %6, 17, %13, 18
203 %18 = REG_SEQUENCE killed %4, 17, %13, 18
204 %20 = COPY %29
Puyan Lotfi43e94b12018-01-31 22:04:26 +0000205 %19 = BUFFER_LOAD_DWORD_ADDR64 %20, killed %14, 0, 0, 0, 0, 0, implicit $exec
Matt Arsenault2ed21932017-02-27 20:21:31 +0000206 %22 = COPY %29
Puyan Lotfi43e94b12018-01-31 22:04:26 +0000207 %21 = BUFFER_LOAD_DWORD_ADDR64 %22, killed %17, 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
Matt Arsenault2ed21932017-02-27 20:21:31 +0000210 %26 = COPY %29
Puyan Lotfi43e94b12018-01-31 22:04:26 +0000211 BUFFER_STORE_DWORD_ADDR64 killed %24, %26, killed %18, 0, 0, 0, 0, 0, implicit $exec
Matt Arsenault2ed21932017-02-27 20:21:31 +0000212 S_ENDPGM
213
214...
215---
216# GCN: name: no_fold_imm_madak_mad_omod_f32
Puyan Lotfi43e94b12018-01-31 22:04:26 +0000217# 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
Matt Arsenault2ed21932017-02-27 20:21:31 +0000219
220name: no_fold_imm_madak_mad_omod_f32
221tracksRegLiveness: true
222registers:
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 }
253liveins:
Puyan Lotfi43e94b12018-01-31 22:04:26 +0000254 - { reg: '$sgpr0_sgpr1', virtual-reg: '%0' }
255 - { reg: '$vgpr0', virtual-reg: '%3' }
Matt Arsenault2ed21932017-02-27 20:21:31 +0000256body: |
Matt Arsenault60b91e02017-07-06 20:56:57 +0000257 bb.0:
Puyan Lotfi43e94b12018-01-31 22:04:26 +0000258 liveins: $sgpr0_sgpr1, $vgpr0
Matt Arsenault2ed21932017-02-27 20:21:31 +0000259
Puyan Lotfi43e94b12018-01-31 22:04:26 +0000260 %3 = COPY $vgpr0
261 %0 = COPY $sgpr0_sgpr1
Matt Arsenault60b91e02017-07-06 20:56:57 +0000262 %4 = S_LOAD_DWORDX2_IMM %0, 9, 0
263 %5 = S_LOAD_DWORDX2_IMM %0, 11, 0
264 %6 = S_LOAD_DWORDX2_IMM %0, 13, 0
Puyan Lotfi43e94b12018-01-31 22:04:26 +0000265 %27 = V_ASHRREV_I32_e32 31, %3, implicit $exec
Matt Arsenault2ed21932017-02-27 20:21:31 +0000266 %28 = REG_SEQUENCE %3, 1, %27, 2
267 %11 = S_MOV_B32 61440
268 %12 = S_MOV_B32 0
269 %13 = REG_SEQUENCE killed %12, 1, killed %11, 2
270 %14 = REG_SEQUENCE killed %5, 17, %13, 18
271 %15 = S_MOV_B32 2
Puyan Lotfi43e94b12018-01-31 22:04:26 +0000272 %29 = V_LSHL_B64 killed %28, killed %15, implicit $exec
Matt Arsenault2ed21932017-02-27 20:21:31 +0000273 %17 = REG_SEQUENCE killed %6, 17, %13, 18
274 %18 = REG_SEQUENCE killed %4, 17, %13, 18
275 %20 = COPY %29
Puyan Lotfi43e94b12018-01-31 22:04:26 +0000276 %19 = BUFFER_LOAD_DWORD_ADDR64 %20, killed %14, 0, 0, 0, 0, 0, implicit $exec
Matt Arsenault2ed21932017-02-27 20:21:31 +0000277 %22 = COPY %29
Puyan Lotfi43e94b12018-01-31 22:04:26 +0000278 %21 = BUFFER_LOAD_DWORD_ADDR64 %22, killed %17, 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
Matt Arsenault2ed21932017-02-27 20:21:31 +0000281 %26 = COPY %29
Puyan Lotfi43e94b12018-01-31 22:04:26 +0000282 BUFFER_STORE_DWORD_ADDR64 killed %24, %26, killed %18, 0, 0, 0, 0, 0, implicit $exec
Matt Arsenault2ed21932017-02-27 20:21:31 +0000283 S_ENDPGM
284
285...