1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 2
2 ; RUN: opt -S -passes=slp-vectorizer -mtriple=x86_64-unknown-linux-gnu < %s | FileCheck %s
4 define void @blam(ptr %arg, double %load2, i1 %fcmp3) {
5 ; CHECK-LABEL: define void @blam
6 ; CHECK-SAME: (ptr [[ARG:%.*]], double [[LOAD2:%.*]], i1 [[FCMP3:%.*]]) {
8 ; CHECK-NEXT: [[GETELEMENTPTR13:%.*]] = getelementptr double, ptr [[ARG]], i64 3
9 ; CHECK-NEXT: [[TMP0:%.*]] = load <2 x double>, ptr [[ARG]], align 8
10 ; CHECK-NEXT: [[TMP1:%.*]] = insertelement <2 x i1> poison, i1 [[FCMP3]], i32 0
11 ; CHECK-NEXT: [[TMP2:%.*]] = shufflevector <2 x i1> [[TMP1]], <2 x i1> poison, <2 x i32> zeroinitializer
12 ; CHECK-NEXT: [[TMP3:%.*]] = select <2 x i1> [[TMP2]], <2 x double> zeroinitializer, <2 x double> [[TMP0]]
13 ; CHECK-NEXT: [[TMP4:%.*]] = insertelement <2 x double> [[TMP0]], double [[LOAD2]], i32 0
14 ; CHECK-NEXT: [[TMP5:%.*]] = fcmp olt <2 x double> [[TMP4]], zeroinitializer
15 ; CHECK-NEXT: [[TMP6:%.*]] = select <2 x i1> [[TMP5]], <2 x double> zeroinitializer, <2 x double> [[TMP0]]
16 ; CHECK-NEXT: [[TMP7:%.*]] = fcmp olt <2 x double> [[TMP3]], zeroinitializer
17 ; CHECK-NEXT: [[TMP8:%.*]] = select <2 x i1> [[TMP7]], <2 x double> <double 0.000000e+00, double 1.000000e+00>, <2 x double> <double 1.000000e+00, double 0.000000e+00>
18 ; CHECK-NEXT: [[TMP9:%.*]] = shufflevector <2 x double> [[TMP8]], <2 x double> poison, <2 x i32> <i32 1, i32 0>
19 ; CHECK-NEXT: [[TMP10:%.*]] = fcmp olt <2 x double> [[TMP9]], [[TMP6]]
20 ; CHECK-NEXT: [[TMP11:%.*]] = shufflevector <2 x double> [[TMP4]], <2 x double> <double poison, double 0.000000e+00>, <2 x i32> <i32 0, i32 3>
21 ; CHECK-NEXT: [[TMP12:%.*]] = shufflevector <2 x double> [[TMP4]], <2 x double> <double 0.000000e+00, double poison>, <2 x i32> <i32 2, i32 0>
22 ; CHECK-NEXT: [[TMP13:%.*]] = select <2 x i1> [[TMP10]], <2 x double> [[TMP11]], <2 x double> [[TMP12]]
23 ; CHECK-NEXT: [[TMP14:%.*]] = fcmp olt <2 x double> [[TMP13]], zeroinitializer
24 ; CHECK-NEXT: [[TMP15:%.*]] = select <2 x i1> [[TMP14]], <2 x double> zeroinitializer, <2 x double> <double 1.000000e+00, double 1.000000e+00>
25 ; CHECK-NEXT: [[TMP16:%.*]] = fcmp ogt <2 x double> [[TMP15]], zeroinitializer
26 ; CHECK-NEXT: [[TMP17:%.*]] = shufflevector <2 x double> [[TMP4]], <2 x double> poison, <2 x i32> zeroinitializer
27 ; CHECK-NEXT: [[TMP18:%.*]] = select <2 x i1> [[TMP16]], <2 x double> zeroinitializer, <2 x double> [[TMP17]]
28 ; CHECK-NEXT: [[TMP19:%.*]] = fcmp olt <2 x double> [[TMP18]], zeroinitializer
29 ; CHECK-NEXT: [[TMP20:%.*]] = select <2 x i1> [[TMP19]], <2 x double> <double 1.000000e+00, double 1.000000e+00>, <2 x double> zeroinitializer
30 ; CHECK-NEXT: store <2 x double> [[TMP20]], ptr [[GETELEMENTPTR13]], align 8
31 ; CHECK-NEXT: ret void
34 %getelementptr = getelementptr double, ptr %arg, i64 1
35 %load = load double, ptr %getelementptr, align 8
36 %fcmp = fcmp olt double %load, 0.000000e+00
37 %select3 = select i1 %fcmp, double 0.000000e+00, double %load
38 %select4 = select i1 %fcmp3, double 0.000000e+00, double %load
39 %load7 = load double, ptr %arg, align 8
40 %select10 = select i1 %fcmp3, double 0.000000e+00, double %load7
41 %fcmp11 = fcmp olt double %load2, 0.000000e+00
42 %select128 = select i1 %fcmp11, double 0.000000e+00, double %load7
43 %getelementptr13 = getelementptr double, ptr %arg, i64 3
44 %getelementptr21 = getelementptr double, ptr %arg, i64 4
45 %fcmp23 = fcmp olt double %select10, 0.000000e+00
46 %select24 = select i1 %fcmp23, double 0.000000e+00, double 1.000000e+00
47 %fcmp29 = fcmp olt double %select4, 0.000000e+00
48 %select30 = select i1 %fcmp29, double 1.000000e+00, double 0.000000e+00
49 %fcmp33 = fcmp olt double %select24, %select3
50 %select34 = select i1 %fcmp33, double 0.000000e+00, double %load2
51 %fcmp39 = fcmp olt double %select30, %select128
52 %select40 = select i1 %fcmp39, double %load2, double 0.000000e+00
53 %fcmp62 = fcmp olt double %select34, 0.000000e+00
54 %select639 = select i1 %fcmp62, double 0.000000e+00, double 1.000000e+00
55 %fcmp76 = fcmp olt double %select40, 0.000000e+00
56 %select77 = select i1 %fcmp76, double 0.000000e+00, double 1.000000e+00
57 %fcmp90 = fcmp ogt double %select639, 0.000000e+00
58 %select91 = select i1 %fcmp90, double 0.000000e+00, double %load2
59 %fcmp92 = fcmp ogt double %select77, 0.000000e+00
60 %select93 = select i1 %fcmp92, double 0.000000e+00, double %load2
61 %fcmp108 = fcmp olt double %select93, 0.000000e+00
62 %select109 = select i1 %fcmp108, double 1.000000e+00, double 0.000000e+00
63 %fcmp110 = fcmp olt double %select91, 0.000000e+00
64 %select111 = select i1 %fcmp110, double 1.000000e+00, double 0.000000e+00
65 store double %select111, ptr %getelementptr21, align 8
66 store double %select109, ptr %getelementptr13, align 8