1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt -passes=slp-vectorizer -mcpu=skx -mtriple=x86_64-unknown-linux-gnu -S < %s | FileCheck %s
4 define void @main(ptr %0) {
6 ; CHECK-NEXT: [[TMP2:%.*]] = load <2 x double>, ptr [[TMP0:%.*]], align 8
7 ; CHECK-NEXT: [[TMP3:%.*]] = fsub <2 x double> zeroinitializer, [[TMP2]]
8 ; CHECK-NEXT: [[TMP4:%.*]] = fadd <2 x double> zeroinitializer, [[TMP2]]
9 ; CHECK-NEXT: [[TMP5:%.*]] = shufflevector <2 x double> [[TMP3]], <2 x double> [[TMP4]], <4 x i32> <i32 1, i32 2, i32 1, i32 2>
10 ; CHECK-NEXT: [[TMP6:%.*]] = fmul <4 x double> [[TMP5]], zeroinitializer
11 ; CHECK-NEXT: [[TMP7:%.*]] = call <4 x double> @llvm.fabs.v4f64(<4 x double> [[TMP6]])
12 ; CHECK-NEXT: [[TMP8:%.*]] = fcmp oeq <4 x double> [[TMP7]], zeroinitializer
13 ; CHECK-NEXT: [[TMP9:%.*]] = call i1 @llvm.vector.reduce.or.v4i1(<4 x i1> [[TMP8]])
14 ; CHECK-NEXT: [[TMP10:%.*]] = select i1 [[TMP9]], double 0.000000e+00, double 0.000000e+00
15 ; CHECK-NEXT: store double [[TMP10]], ptr null, align 8
16 ; CHECK-NEXT: ret void
18 %.unpack = load double, ptr %0, align 8
19 %.elt1 = getelementptr { double, double }, ptr %0, i64 0, i32 1
20 %.unpack2 = load double, ptr %.elt1, align 8
21 %2 = fadd double %.unpack, 0.000000e+00
22 %3 = fsub double 0.000000e+00, %.unpack2
23 %4 = fmul double %2, 0.000000e+00
24 %5 = call double @llvm.fabs.f64(double %4)
25 %6 = fmul double %3, 0.000000e+00
26 %7 = call double @llvm.fabs.f64(double %6)
27 %8 = fmul double %3, 0.000000e+00
28 %9 = call double @llvm.fabs.f64(double %8)
29 %10 = fmul double %2, 0.000000e+00
30 %11 = call double @llvm.fabs.f64(double %10)
31 %12 = fcmp oeq double %5, 0.000000e+00
32 %13 = fcmp oeq double %7, 0.000000e+00
34 %15 = fcmp oeq double %11, 0.000000e+00
36 %17 = fcmp oeq double %9, 0.000000e+00
38 %19 = select i1 %18, double 0.000000e+00, double 0.000000e+00
39 store double %19, ptr null, align 8
43 declare double @llvm.fabs.f64(double)