1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=i686-unknown -mattr=+avx | FileCheck %s --check-prefixes=CHECK,X86,AVX,X86-AVX,AVX1,X86-AVX1
3 ; RUN: llc < %s -mtriple=i686-unknown -mattr=+avx2 | FileCheck %s --check-prefixes=CHECK,X86,AVX,X86-AVX,AVX2,X86-AVX2
4 ; RUN: llc < %s -mtriple=i686-unknown -mattr=+avx512f | FileCheck %s --check-prefixes=CHECK,X86,AVX512,X86-AVX512
5 ; RUN: llc < %s -mtriple=x86_64-unknown -mattr=+avx | FileCheck %s --check-prefixes=CHECK,X64,AVX,X64-AVX,AVX1,X64-AVX1
6 ; RUN: llc < %s -mtriple=x86_64-unknown -mattr=+avx2 | FileCheck %s --check-prefixes=CHECK,X64,AVX,X64-AVX,AVX2,X64-AVX2
7 ; RUN: llc < %s -mtriple=x86_64-unknown -mattr=+avx512f | FileCheck %s --check-prefixes=CHECK,X64,AVX512,X64-AVX512
9 ; Combine tests involving AVX target shuffles
11 declare <4 x float> @llvm.x86.avx.vpermil.ps(<4 x float>, i8)
12 declare <8 x float> @llvm.x86.avx.vpermil.ps.256(<8 x float>, i8)
13 declare <2 x double> @llvm.x86.avx.vpermil.pd(<2 x double>, i8)
14 declare <4 x double> @llvm.x86.avx.vpermil.pd.256(<4 x double>, i8)
16 declare <4 x float> @llvm.x86.avx.vpermilvar.ps(<4 x float>, <4 x i32>)
17 declare <8 x float> @llvm.x86.avx.vpermilvar.ps.256(<8 x float>, <8 x i32>)
18 declare <2 x double> @llvm.x86.avx.vpermilvar.pd(<2 x double>, <2 x i64>)
19 declare <4 x double> @llvm.x86.avx.vpermilvar.pd.256(<4 x double>, <4 x i64>)
21 declare <8 x i32> @llvm.x86.avx.vperm2f128.si.256(<8 x i32>, <8 x i32>, i8)
22 declare <8 x float> @llvm.x86.avx.vperm2f128.ps.256(<8 x float>, <8 x float>, i8)
23 declare <4 x double> @llvm.x86.avx.vperm2f128.pd.256(<4 x double>, <4 x double>, i8)
25 define <4 x float> @combine_vpermilvar_4f32_identity(<4 x float> %a0) {
26 ; CHECK-LABEL: combine_vpermilvar_4f32_identity:
28 ; CHECK-NEXT: ret{{[l|q]}}
29 %1 = tail call <4 x float> @llvm.x86.avx.vpermilvar.ps(<4 x float> %a0, <4 x i32> <i32 3, i32 2, i32 1, i32 0>)
30 %2 = tail call <4 x float> @llvm.x86.avx.vpermilvar.ps(<4 x float> %1, <4 x i32> <i32 3, i32 2, i32 1, i32 0>)
34 define <4 x float> @combine_vpermilvar_4f32_movddup(<4 x float> %a0) {
35 ; CHECK-LABEL: combine_vpermilvar_4f32_movddup:
37 ; CHECK-NEXT: vmovddup {{.*#+}} xmm0 = xmm0[0,0]
38 ; CHECK-NEXT: ret{{[l|q]}}
39 %1 = tail call <4 x float> @llvm.x86.avx.vpermilvar.ps(<4 x float> %a0, <4 x i32> <i32 0, i32 1, i32 0, i32 1>)
42 define <4 x float> @combine_vpermilvar_4f32_movddup_load(<4 x float> *%a0) {
43 ; X86-LABEL: combine_vpermilvar_4f32_movddup_load:
45 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
46 ; X86-NEXT: vmovddup {{.*#+}} xmm0 = mem[0,0]
49 ; X64-LABEL: combine_vpermilvar_4f32_movddup_load:
51 ; X64-NEXT: vmovddup {{.*#+}} xmm0 = mem[0,0]
53 %1 = load <4 x float>, <4 x float> *%a0
54 %2 = tail call <4 x float> @llvm.x86.avx.vpermilvar.ps(<4 x float> %1, <4 x i32> <i32 0, i32 1, i32 0, i32 1>)
58 define <4 x float> @combine_vpermilvar_4f32_movshdup(<4 x float> %a0) {
59 ; CHECK-LABEL: combine_vpermilvar_4f32_movshdup:
61 ; CHECK-NEXT: vmovshdup {{.*#+}} xmm0 = xmm0[1,1,3,3]
62 ; CHECK-NEXT: ret{{[l|q]}}
63 %1 = tail call <4 x float> @llvm.x86.avx.vpermilvar.ps(<4 x float> %a0, <4 x i32> <i32 undef, i32 1, i32 3, i32 3>)
67 define <4 x float> @combine_vpermilvar_4f32_movsldup(<4 x float> %a0) {
68 ; CHECK-LABEL: combine_vpermilvar_4f32_movsldup:
70 ; CHECK-NEXT: vmovsldup {{.*#+}} xmm0 = xmm0[0,0,2,2]
71 ; CHECK-NEXT: ret{{[l|q]}}
72 %1 = tail call <4 x float> @llvm.x86.avx.vpermilvar.ps(<4 x float> %a0, <4 x i32> <i32 0, i32 0, i32 2, i32 undef>)
76 define <4 x float> @combine_vpermilvar_4f32_unpckh(<4 x float> %a0) {
77 ; CHECK-LABEL: combine_vpermilvar_4f32_unpckh:
79 ; CHECK-NEXT: vpermilps {{.*#+}} xmm0 = xmm0[2,2,3,3]
80 ; CHECK-NEXT: ret{{[l|q]}}
81 %1 = tail call <4 x float> @llvm.x86.avx.vpermilvar.ps(<4 x float> %a0, <4 x i32> <i32 2, i32 2, i32 3, i32 3>)
85 define <4 x float> @combine_vpermilvar_4f32_unpckl(<4 x float> %a0) {
86 ; CHECK-LABEL: combine_vpermilvar_4f32_unpckl:
88 ; CHECK-NEXT: vpermilps {{.*#+}} xmm0 = xmm0[0,0,1,1]
89 ; CHECK-NEXT: ret{{[l|q]}}
90 %1 = tail call <4 x float> @llvm.x86.avx.vpermilvar.ps(<4 x float> %a0, <4 x i32> <i32 0, i32 0, i32 1, i32 1>)
94 define <8 x float> @combine_vpermilvar_8f32_identity(<8 x float> %a0) {
95 ; CHECK-LABEL: combine_vpermilvar_8f32_identity:
97 ; CHECK-NEXT: ret{{[l|q]}}
98 %1 = tail call <8 x float> @llvm.x86.avx.vpermilvar.ps.256(<8 x float> %a0, <8 x i32> <i32 3, i32 2, i32 1, i32 0, i32 2, i32 3, i32 0, i32 undef>)
99 %2 = tail call <8 x float> @llvm.x86.avx.vpermilvar.ps.256(<8 x float> %1, <8 x i32> <i32 3, i32 2, i32 1, i32 0, i32 2, i32 3, i32 0, i32 1>)
103 define <8 x float> @combine_vpermilvar_8f32_10326u4u(<8 x float> %a0) {
104 ; CHECK-LABEL: combine_vpermilvar_8f32_10326u4u:
106 ; CHECK-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[1,0,3,2,6,u,4,u]
107 ; CHECK-NEXT: ret{{[l|q]}}
108 %1 = tail call <8 x float> @llvm.x86.avx.vpermilvar.ps.256(<8 x float> %a0, <8 x i32> <i32 3, i32 2, i32 1, i32 0, i32 0, i32 1, i32 2, i32 undef>)
109 %2 = tail call <8 x float> @llvm.x86.avx.vpermilvar.ps.256(<8 x float> %1, <8 x i32> <i32 2, i32 3, i32 0, i32 1, i32 2, i32 3, i32 0, i32 undef>)
113 define <8 x float> @combine_vpermilvar_vperm2f128_8f32(<8 x float> %a0) {
114 ; AVX1-LABEL: combine_vpermilvar_vperm2f128_8f32:
116 ; AVX1-NEXT: vperm2f128 {{.*#+}} ymm0 = ymm0[2,3,0,1]
117 ; AVX1-NEXT: ret{{[l|q]}}
119 ; AVX2-LABEL: combine_vpermilvar_vperm2f128_8f32:
121 ; AVX2-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[2,3,0,1]
122 ; AVX2-NEXT: ret{{[l|q]}}
124 ; AVX512-LABEL: combine_vpermilvar_vperm2f128_8f32:
126 ; AVX512-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[2,3,0,1]
127 ; AVX512-NEXT: ret{{[l|q]}}
128 %1 = tail call <8 x float> @llvm.x86.avx.vpermilvar.ps.256(<8 x float> %a0, <8 x i32> <i32 3, i32 2, i32 1, i32 0, i32 3, i32 2, i32 1, i32 0>)
129 %2 = shufflevector <8 x float> %1, <8 x float> undef, <8 x i32> <i32 4, i32 5, i32 6, i32 7, i32 0, i32 1, i32 2, i32 3>
130 %3 = tail call <8 x float> @llvm.x86.avx.vpermilvar.ps.256(<8 x float> %2, <8 x i32> <i32 3, i32 2, i32 1, i32 0, i32 3, i32 2, i32 1, i32 0>)
134 define <8 x float> @combine_vpermilvar_vperm2f128_zero_8f32(<8 x float> %a0) {
135 ; CHECK-LABEL: combine_vpermilvar_vperm2f128_zero_8f32:
137 ; CHECK-NEXT: vperm2f128 {{.*#+}} ymm0 = zero,zero,ymm0[0,1]
138 ; CHECK-NEXT: ret{{[l|q]}}
139 %1 = tail call <8 x float> @llvm.x86.avx.vpermilvar.ps.256(<8 x float> %a0, <8 x i32> <i32 3, i32 2, i32 1, i32 0, i32 3, i32 2, i32 1, i32 0>)
140 %2 = shufflevector <8 x float> %1, <8 x float> zeroinitializer, <8 x i32> <i32 8, i32 8, i32 8, i32 8, i32 0, i32 1, i32 2, i32 3>
141 %3 = tail call <8 x float> @llvm.x86.avx.vpermilvar.ps.256(<8 x float> %2, <8 x i32> <i32 3, i32 2, i32 1, i32 0, i32 3, i32 2, i32 1, i32 0>)
145 define <4 x double> @combine_vperm2f128_vpermilvar_as_vpblendpd(<4 x double> %a0) {
146 ; CHECK-LABEL: combine_vperm2f128_vpermilvar_as_vpblendpd:
148 ; CHECK-NEXT: vpermilpd {{.*#+}} ymm0 = ymm0[1,0,3,2]
149 ; CHECK-NEXT: vmovapd %xmm0, %xmm0
150 ; CHECK-NEXT: vpermilpd {{.*#+}} ymm0 = ymm0[1,0,3,2]
151 ; CHECK-NEXT: ret{{[l|q]}}
152 %1 = tail call <4 x double> @llvm.x86.avx.vpermilvar.pd.256(<4 x double> %a0, <4 x i64> <i64 2, i64 0, i64 2, i64 0>)
153 %2 = shufflevector <4 x double> %1, <4 x double> zeroinitializer, <4 x i32> <i32 0, i32 1, i32 4, i32 5>
154 %3 = tail call <4 x double> @llvm.x86.avx.vpermilvar.pd.256(<4 x double> %2, <4 x i64> <i64 2, i64 0, i64 2, i64 0>)
158 define <8 x float> @combine_vpermilvar_8f32_movddup(<8 x float> %a0) {
159 ; CHECK-LABEL: combine_vpermilvar_8f32_movddup:
161 ; CHECK-NEXT: vmovddup {{.*#+}} ymm0 = ymm0[0,0,2,2]
162 ; CHECK-NEXT: ret{{[l|q]}}
163 %1 = tail call <8 x float> @llvm.x86.avx.vpermilvar.ps.256(<8 x float> %a0, <8 x i32> <i32 0, i32 1, i32 0, i32 1, i32 4, i32 5, i32 4, i32 5>)
166 define <8 x float> @combine_vpermilvar_8f32_movddup_load(<8 x float> *%a0) {
167 ; X86-LABEL: combine_vpermilvar_8f32_movddup_load:
169 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
170 ; X86-NEXT: vmovddup {{.*#+}} ymm0 = mem[0,0,2,2]
173 ; X64-LABEL: combine_vpermilvar_8f32_movddup_load:
175 ; X64-NEXT: vmovddup {{.*#+}} ymm0 = mem[0,0,2,2]
177 %1 = load <8 x float>, <8 x float> *%a0
178 %2 = tail call <8 x float> @llvm.x86.avx.vpermilvar.ps.256(<8 x float> %1, <8 x i32> <i32 0, i32 1, i32 0, i32 1, i32 4, i32 5, i32 4, i32 5>)
182 define <8 x float> @combine_vpermilvar_8f32_movshdup(<8 x float> %a0) {
183 ; CHECK-LABEL: combine_vpermilvar_8f32_movshdup:
185 ; CHECK-NEXT: vmovshdup {{.*#+}} ymm0 = ymm0[1,1,3,3,5,5,7,7]
186 ; CHECK-NEXT: ret{{[l|q]}}
187 %1 = tail call <8 x float> @llvm.x86.avx.vpermilvar.ps.256(<8 x float> %a0, <8 x i32> <i32 1, i32 1, i32 3, i32 3, i32 undef, i32 5, i32 7, i32 7>)
190 define <8 x float> @demandedelts_vpermilvar_8f32_movshdup(<8 x float> %a0, i32 %a1) {
191 ; CHECK-LABEL: demandedelts_vpermilvar_8f32_movshdup:
193 ; CHECK-NEXT: vmovshdup {{.*#+}} ymm0 = ymm0[1,1,3,3,5,5,7,7]
194 ; CHECK-NEXT: ret{{[l|q]}}
195 %1 = insertelement <8 x i32> <i32 1, i32 1, i32 3, i32 3, i32 undef, i32 5, i32 7, i32 7>, i32 %a1, i32 7
196 %2 = tail call <8 x float> @llvm.x86.avx.vpermilvar.ps.256(<8 x float> %a0, <8 x i32> %1)
197 %3 = shufflevector <8 x float> %2, <8 x float> undef, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 6>
201 define <8 x float> @combine_vpermilvar_8f32_movsldup(<8 x float> %a0) {
202 ; CHECK-LABEL: combine_vpermilvar_8f32_movsldup:
204 ; CHECK-NEXT: vmovsldup {{.*#+}} ymm0 = ymm0[0,0,2,2,4,4,6,6]
205 ; CHECK-NEXT: ret{{[l|q]}}
206 %1 = tail call <8 x float> @llvm.x86.avx.vpermilvar.ps.256(<8 x float> %a0, <8 x i32> <i32 0, i32 0, i32 2, i32 2, i32 4, i32 4, i32 6, i32 6>)
209 define <8 x float> @demandedelts_vpermilvar_8f32_movsldup(<8 x float> %a0, i32 %a1) {
210 ; CHECK-LABEL: demandedelts_vpermilvar_8f32_movsldup:
212 ; CHECK-NEXT: vmovsldup {{.*#+}} ymm0 = ymm0[0,0,2,2,4,4,6,6]
213 ; CHECK-NEXT: ret{{[l|q]}}
214 %1 = insertelement <8 x i32> <i32 0, i32 0, i32 2, i32 2, i32 4, i32 4, i32 6, i32 6>, i32 %a1, i32 0
215 %2 = tail call <8 x float> @llvm.x86.avx.vpermilvar.ps.256(<8 x float> %a0, <8 x i32> %1)
216 %3 = shufflevector <8 x float> %2, <8 x float> undef, <8 x i32> <i32 1, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7>
220 define <2 x double> @combine_vpermilvar_2f64_identity(<2 x double> %a0) {
221 ; CHECK-LABEL: combine_vpermilvar_2f64_identity:
223 ; CHECK-NEXT: ret{{[l|q]}}
224 %1 = tail call <2 x double> @llvm.x86.avx.vpermilvar.pd(<2 x double> %a0, <2 x i64> <i64 2, i64 0>)
225 %2 = tail call <2 x double> @llvm.x86.avx.vpermilvar.pd(<2 x double> %1, <2 x i64> <i64 2, i64 0>)
229 define <2 x double> @combine_vpermilvar_2f64_movddup(<2 x double> %a0) {
230 ; CHECK-LABEL: combine_vpermilvar_2f64_movddup:
232 ; CHECK-NEXT: vmovddup {{.*#+}} xmm0 = xmm0[0,0]
233 ; CHECK-NEXT: ret{{[l|q]}}
234 %1 = tail call <2 x double> @llvm.x86.avx.vpermilvar.pd(<2 x double> %a0, <2 x i64> <i64 0, i64 0>)
238 define <4 x double> @combine_vpermilvar_4f64_identity(<4 x double> %a0) {
239 ; CHECK-LABEL: combine_vpermilvar_4f64_identity:
241 ; CHECK-NEXT: ret{{[l|q]}}
242 %1 = tail call <4 x double> @llvm.x86.avx.vpermilvar.pd.256(<4 x double> %a0, <4 x i64> <i64 2, i64 0, i64 2, i64 0>)
243 %2 = tail call <4 x double> @llvm.x86.avx.vpermilvar.pd.256(<4 x double> %1, <4 x i64> <i64 2, i64 0, i64 2, i64 0>)
247 define <4 x double> @combine_vpermilvar_4f64_movddup(<4 x double> %a0) {
248 ; CHECK-LABEL: combine_vpermilvar_4f64_movddup:
250 ; CHECK-NEXT: vmovddup {{.*#+}} ymm0 = ymm0[0,0,2,2]
251 ; CHECK-NEXT: ret{{[l|q]}}
252 %1 = tail call <4 x double> @llvm.x86.avx.vpermilvar.pd.256(<4 x double> %a0, <4 x i64> <i64 0, i64 0, i64 4, i64 4>)
256 define <4 x float> @combine_vpermilvar_4f32_4stage(<4 x float> %a0) {
257 ; CHECK-LABEL: combine_vpermilvar_4f32_4stage:
259 ; CHECK-NEXT: vpermilps {{.*#+}} xmm0 = xmm0[2,0,3,1]
260 ; CHECK-NEXT: ret{{[l|q]}}
261 %1 = tail call <4 x float> @llvm.x86.avx.vpermilvar.ps(<4 x float> %a0, <4 x i32> <i32 3, i32 2, i32 1, i32 0>)
262 %2 = tail call <4 x float> @llvm.x86.avx.vpermilvar.ps(<4 x float> %1, <4 x i32> <i32 2, i32 3, i32 0, i32 1>)
263 %3 = tail call <4 x float> @llvm.x86.avx.vpermilvar.ps(<4 x float> %2, <4 x i32> <i32 0, i32 2, i32 1, i32 3>)
264 %4 = tail call <4 x float> @llvm.x86.avx.vpermilvar.ps(<4 x float> %3, <4 x i32> <i32 3, i32 2, i32 1, i32 0>)
268 define <8 x float> @combine_vpermilvar_8f32_4stage(<8 x float> %a0) {
269 ; CHECK-LABEL: combine_vpermilvar_8f32_4stage:
271 ; CHECK-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[2,0,3,1,6,4,7,5]
272 ; CHECK-NEXT: ret{{[l|q]}}
273 %1 = tail call <8 x float> @llvm.x86.avx.vpermilvar.ps.256(<8 x float> %a0, <8 x i32> <i32 3, i32 2, i32 1, i32 0, i32 3, i32 2, i32 1, i32 0>)
274 %2 = tail call <8 x float> @llvm.x86.avx.vpermilvar.ps.256(<8 x float> %1, <8 x i32> <i32 2, i32 3, i32 0, i32 1, i32 2, i32 3, i32 0, i32 1>)
275 %3 = tail call <8 x float> @llvm.x86.avx.vpermilvar.ps.256(<8 x float> %2, <8 x i32> <i32 0, i32 2, i32 1, i32 3, i32 0, i32 2, i32 1, i32 3>)
276 %4 = tail call <8 x float> @llvm.x86.avx.vpermilvar.ps.256(<8 x float> %3, <8 x i32> <i32 3, i32 2, i32 1, i32 0, i32 3, i32 2, i32 1, i32 0>)
280 define <4 x float> @combine_vpermilvar_4f32_as_insertps(<4 x float> %a0) {
281 ; CHECK-LABEL: combine_vpermilvar_4f32_as_insertps:
283 ; CHECK-NEXT: vinsertps {{.*#+}} xmm0 = xmm0[1],zero,xmm0[2],zero
284 ; CHECK-NEXT: ret{{[l|q]}}
285 %1 = call <4 x float> @llvm.x86.avx.vpermilvar.ps(<4 x float> %a0, <4 x i32> <i32 3, i32 2, i32 1, i32 0>)
286 %2 = shufflevector <4 x float> %1, <4 x float> zeroinitializer, <4 x i32> <i32 2, i32 4, i32 1, i32 4>
290 define <2 x double> @constant_fold_vpermilvar_pd() {
291 ; CHECK-LABEL: constant_fold_vpermilvar_pd:
293 ; CHECK-NEXT: vmovaps {{.*#+}} xmm0 = [2.0E+0,1.0E+0]
294 ; CHECK-NEXT: ret{{[l|q]}}
295 %1 = call <2 x double> @llvm.x86.avx.vpermilvar.pd(<2 x double> <double 1.0, double 2.0>, <2 x i64> <i64 2, i64 0>)
299 define <4 x double> @constant_fold_vpermilvar_pd_256() {
300 ; CHECK-LABEL: constant_fold_vpermilvar_pd_256:
302 ; CHECK-NEXT: vmovaps {{.*#+}} ymm0 = [2.0E+0,1.0E+0,3.0E+0,4.0E+0]
303 ; CHECK-NEXT: ret{{[l|q]}}
304 %1 = call <4 x double> @llvm.x86.avx.vpermilvar.pd.256(<4 x double> <double 1.0, double 2.0, double 3.0, double 4.0>, <4 x i64> <i64 2, i64 0, i64 0, i64 2>)
308 define <4 x float> @constant_fold_vpermilvar_ps() {
309 ; CHECK-LABEL: constant_fold_vpermilvar_ps:
311 ; CHECK-NEXT: vmovaps {{.*#+}} xmm0 = [4.0E+0,1.0E+0,3.0E+0,2.0E+0]
312 ; CHECK-NEXT: ret{{[l|q]}}
313 %1 = call <4 x float> @llvm.x86.avx.vpermilvar.ps(<4 x float> <float 1.0, float 2.0, float 3.0, float 4.0>, <4 x i32> <i32 3, i32 0, i32 2, i32 1>)
317 define <8 x float> @constant_fold_vpermilvar_ps_256() {
318 ; CHECK-LABEL: constant_fold_vpermilvar_ps_256:
320 ; CHECK-NEXT: vmovaps {{.*#+}} ymm0 = [1.0E+0,1.0E+0,3.0E+0,2.0E+0,5.0E+0,6.0E+0,6.0E+0,6.0E+0]
321 ; CHECK-NEXT: ret{{[l|q]}}
322 %1 = call <8 x float> @llvm.x86.avx.vpermilvar.ps.256(<8 x float> <float 1.0, float 2.0, float 3.0, float 4.0, float 5.0, float 6.0, float 7.0, float 8.0>, <8 x i32> <i32 4, i32 0, i32 2, i32 1, i32 0, i32 1, i32 1, i32 1>)
326 define void @PR39483() {
327 ; X86-AVX1-LABEL: PR39483:
328 ; X86-AVX1: # %bb.0: # %entry
329 ; X86-AVX1-NEXT: vmovups 32, %ymm0
330 ; X86-AVX1-NEXT: vmovups 64, %xmm1
331 ; X86-AVX1-NEXT: vshufps {{.*#+}} xmm1 = xmm1[0,1],mem[0,3]
332 ; X86-AVX1-NEXT: vinsertf128 $1, %xmm1, %ymm0, %ymm1
333 ; X86-AVX1-NEXT: vblendps {{.*#+}} ymm0 = ymm0[0,1],mem[2],ymm0[3,4],mem[5],ymm0[6,7]
334 ; X86-AVX1-NEXT: vextractf128 $1, %ymm0, %xmm2
335 ; X86-AVX1-NEXT: vblendps {{.*#+}} xmm0 = xmm0[0],xmm2[1],xmm0[2,3]
336 ; X86-AVX1-NEXT: vpermilps {{.*#+}} xmm0 = xmm0[2,1,0,3]
337 ; X86-AVX1-NEXT: vpermilpd {{.*#+}} xmm2 = xmm2[1,0]
338 ; X86-AVX1-NEXT: vinsertf128 $1, %xmm2, %ymm0, %ymm0
339 ; X86-AVX1-NEXT: vblendps {{.*#+}} ymm0 = ymm0[0,1,2,3,4],ymm1[5,6,7]
340 ; X86-AVX1-NEXT: vxorps %xmm1, %xmm1, %xmm1
341 ; X86-AVX1-NEXT: vmulps %ymm1, %ymm0, %ymm0
342 ; X86-AVX1-NEXT: vaddps %ymm1, %ymm0, %ymm0
343 ; X86-AVX1-NEXT: vmovups %ymm0, (%eax)
345 ; X86-AVX2-LABEL: PR39483:
346 ; X86-AVX2: # %bb.0: # %entry
347 ; X86-AVX2-NEXT: vmovups 32, %ymm0
348 ; X86-AVX2-NEXT: vblendps {{.*#+}} ymm0 = ymm0[0,1],mem[2],ymm0[3,4],mem[5],ymm0[6,7]
349 ; X86-AVX2-NEXT: vmovaps {{.*#+}} ymm1 = <2,5,0,3,6,u,u,u>
350 ; X86-AVX2-NEXT: vpermps %ymm0, %ymm1, %ymm0
351 ; X86-AVX2-NEXT: vpermilps {{.*#+}} ymm1 = mem[0,1,0,3,4,5,4,7]
352 ; X86-AVX2-NEXT: vpermpd {{.*#+}} ymm1 = ymm1[0,1,0,3]
353 ; X86-AVX2-NEXT: vblendps {{.*#+}} ymm0 = ymm0[0,1,2,3,4],ymm1[5,6,7]
354 ; X86-AVX2-NEXT: vxorps %xmm1, %xmm1, %xmm1
355 ; X86-AVX2-NEXT: vmulps %ymm1, %ymm0, %ymm0
356 ; X86-AVX2-NEXT: vaddps %ymm1, %ymm0, %ymm0
357 ; X86-AVX2-NEXT: vmovups %ymm0, (%eax)
359 ; X86-AVX512-LABEL: PR39483:
360 ; X86-AVX512: # %bb.0: # %entry
361 ; X86-AVX512-NEXT: vmovups 0, %zmm0
362 ; X86-AVX512-NEXT: vmovups 64, %ymm1
363 ; X86-AVX512-NEXT: vmovaps {{.*#+}} ymm2 = [2,5,8,11,14,17,20,23]
364 ; X86-AVX512-NEXT: vpermi2ps %zmm1, %zmm0, %zmm2
365 ; X86-AVX512-NEXT: vxorps %xmm0, %xmm0, %xmm0
366 ; X86-AVX512-NEXT: vmulps %ymm0, %ymm2, %ymm1
367 ; X86-AVX512-NEXT: vaddps %ymm0, %ymm1, %ymm0
368 ; X86-AVX512-NEXT: vmovups %ymm0, (%eax)
370 ; X64-AVX1-LABEL: PR39483:
371 ; X64-AVX1: # %bb.0: # %entry
372 ; X64-AVX1-NEXT: vmovups 32, %ymm0
373 ; X64-AVX1-NEXT: vmovups 64, %xmm1
374 ; X64-AVX1-NEXT: vshufps {{.*#+}} xmm1 = xmm1[0,1],mem[0,3]
375 ; X64-AVX1-NEXT: vinsertf128 $1, %xmm1, %ymm0, %ymm1
376 ; X64-AVX1-NEXT: vblendps {{.*#+}} ymm0 = ymm0[0,1],mem[2],ymm0[3,4],mem[5],ymm0[6,7]
377 ; X64-AVX1-NEXT: vextractf128 $1, %ymm0, %xmm2
378 ; X64-AVX1-NEXT: vblendps {{.*#+}} xmm0 = xmm0[0],xmm2[1],xmm0[2,3]
379 ; X64-AVX1-NEXT: vpermilps {{.*#+}} xmm0 = xmm0[2,1,0,3]
380 ; X64-AVX1-NEXT: vpermilpd {{.*#+}} xmm2 = xmm2[1,0]
381 ; X64-AVX1-NEXT: vinsertf128 $1, %xmm2, %ymm0, %ymm0
382 ; X64-AVX1-NEXT: vblendps {{.*#+}} ymm0 = ymm0[0,1,2,3,4],ymm1[5,6,7]
383 ; X64-AVX1-NEXT: vxorps %xmm1, %xmm1, %xmm1
384 ; X64-AVX1-NEXT: vmulps %ymm1, %ymm0, %ymm0
385 ; X64-AVX1-NEXT: vaddps %ymm1, %ymm0, %ymm0
386 ; X64-AVX1-NEXT: vmovups %ymm0, (%rax)
388 ; X64-AVX2-LABEL: PR39483:
389 ; X64-AVX2: # %bb.0: # %entry
390 ; X64-AVX2-NEXT: vmovups 32, %ymm0
391 ; X64-AVX2-NEXT: vblendps {{.*#+}} ymm0 = ymm0[0,1],mem[2],ymm0[3,4],mem[5],ymm0[6,7]
392 ; X64-AVX2-NEXT: vmovaps {{.*#+}} ymm1 = <2,5,0,3,6,u,u,u>
393 ; X64-AVX2-NEXT: vpermps %ymm0, %ymm1, %ymm0
394 ; X64-AVX2-NEXT: vpermilps {{.*#+}} ymm1 = mem[0,1,0,3,4,5,4,7]
395 ; X64-AVX2-NEXT: vpermpd {{.*#+}} ymm1 = ymm1[0,1,0,3]
396 ; X64-AVX2-NEXT: vblendps {{.*#+}} ymm0 = ymm0[0,1,2,3,4],ymm1[5,6,7]
397 ; X64-AVX2-NEXT: vxorps %xmm1, %xmm1, %xmm1
398 ; X64-AVX2-NEXT: vmulps %ymm1, %ymm0, %ymm0
399 ; X64-AVX2-NEXT: vaddps %ymm1, %ymm0, %ymm0
400 ; X64-AVX2-NEXT: vmovups %ymm0, (%rax)
402 ; X64-AVX512-LABEL: PR39483:
403 ; X64-AVX512: # %bb.0: # %entry
404 ; X64-AVX512-NEXT: vmovups 0, %zmm0
405 ; X64-AVX512-NEXT: vmovups 64, %ymm1
406 ; X64-AVX512-NEXT: vmovaps {{.*#+}} ymm2 = [2,5,8,11,14,17,20,23]
407 ; X64-AVX512-NEXT: vpermi2ps %zmm1, %zmm0, %zmm2
408 ; X64-AVX512-NEXT: vxorps %xmm0, %xmm0, %xmm0
409 ; X64-AVX512-NEXT: vmulps %ymm0, %ymm2, %ymm1
410 ; X64-AVX512-NEXT: vaddps %ymm0, %ymm1, %ymm0
411 ; X64-AVX512-NEXT: vmovups %ymm0, (%rax)
413 %wide.vec = load <24 x float>, <24 x float>* null, align 4
414 %strided.vec18 = shufflevector <24 x float> %wide.vec, <24 x float> undef, <8 x i32> <i32 2, i32 5, i32 8, i32 11, i32 14, i32 17, i32 20, i32 23>
415 %0 = fmul <8 x float> %strided.vec18, zeroinitializer
416 %1 = fadd <8 x float> zeroinitializer, %0
417 store <8 x float> %1, <8 x float>* undef, align 16