1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 2
2 ; RUN: opt -passes=slp-vectorizer -mtriple=x86_64 -mcpu=core-avx2 -S %s | FileCheck %s
4 define <4 x double> @test(ptr %ia, ptr %ib, ptr %ic, ptr %id, ptr %ie, ptr %x) {
5 ; CHECK-LABEL: define <4 x double> @test
6 ; CHECK-SAME: (ptr [[IA:%.*]], ptr [[IB:%.*]], ptr [[IC:%.*]], ptr [[ID:%.*]], ptr [[IE:%.*]], ptr [[X:%.*]]) #[[ATTR0:[0-9]+]] {
7 ; CHECK-NEXT: [[I4238:%.*]] = load double, ptr [[IA]], align 8
8 ; CHECK-NEXT: [[I4252:%.*]] = load double, ptr [[IB]], align 8
9 ; CHECK-NEXT: [[I4264:%.*]] = load double, ptr [[IC]], align 8
10 ; CHECK-NEXT: [[I4275:%.*]] = load double, ptr [[ID]], align 8
11 ; CHECK-NEXT: [[I4277:%.*]] = load double, ptr [[IE]], align 8
12 ; CHECK-NEXT: [[I4326:%.*]] = load <4 x double>, ptr [[X]], align 8
13 ; CHECK-NEXT: [[TMP1:%.*]] = shufflevector <4 x double> [[I4326]], <4 x double> poison, <2 x i32> <i32 0, i32 poison>
14 ; CHECK-NEXT: [[TMP2:%.*]] = insertelement <2 x double> [[TMP1]], double [[I4275]], i32 1
15 ; CHECK-NEXT: [[TMP3:%.*]] = shufflevector <2 x double> [[TMP2]], <2 x double> poison, <4 x i32> <i32 0, i32 0, i32 0, i32 1>
16 ; CHECK-NEXT: [[TMP4:%.*]] = insertelement <4 x double> poison, double [[I4238]], i32 0
17 ; CHECK-NEXT: [[TMP5:%.*]] = insertelement <4 x double> [[TMP4]], double [[I4252]], i32 1
18 ; CHECK-NEXT: [[TMP6:%.*]] = insertelement <4 x double> [[TMP5]], double [[I4264]], i32 2
19 ; CHECK-NEXT: [[TMP7:%.*]] = insertelement <4 x double> [[TMP6]], double [[I4277]], i32 3
20 ; CHECK-NEXT: [[TMP8:%.*]] = fmul fast <4 x double> [[TMP3]], [[TMP7]]
21 ; CHECK-NEXT: ret <4 x double> [[TMP8]]
23 %i4238 = load double, ptr %ia, align 8
24 %i4252 = load double, ptr %ib, align 8
25 %i4264 = load double, ptr %ic, align 8
26 %i4275 = load double, ptr %id, align 8
28 %i4277 = load double, ptr %ie, align 8
30 %i4326 = load <4 x double>, ptr %x, align 8
32 %i4330 = extractelement <4 x double> %i4326, i32 0
34 %i4332 = fmul fast double %i4330, %i4238
35 %i4333 = fmul fast double %i4330, %i4252
36 %i4334 = fmul fast double %i4330, %i4264
37 %i4278 = fmul fast double %i4275, %i4277
40 %i4425 = insertelement <4 x double> poison, double %i4332, i32 0
41 %i4426 = insertelement <4 x double> %i4425, double %i4333, i32 1
42 %i4427 = insertelement <4 x double> %i4426, double %i4334, i32 2
43 %i4428 = insertelement <4 x double> %i4427, double %i4278, i32 3
44 ret <4 x double> %i4428