1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 3
2 ; RUN: opt -passes=slp-vectorizer -S -mtriple=x86_64-unknown-linux-gnu < %s | FileCheck %s
4 define void @test(double %0) {
5 ; CHECK-LABEL: define void @test(
6 ; CHECK-SAME: double [[TMP0:%.*]]) {
7 ; CHECK-NEXT: [[TMP2:%.*]] = insertelement <2 x double> poison, double [[TMP0]], i32 0
8 ; CHECK-NEXT: [[TMP3:%.*]] = shufflevector <2 x double> [[TMP2]], <2 x double> poison, <2 x i32> zeroinitializer
9 ; CHECK-NEXT: br label [[TMP4:%.*]]
11 ; CHECK-NEXT: [[TMP5:%.*]] = fsub <2 x double> zeroinitializer, [[TMP3]]
12 ; CHECK-NEXT: [[TMP6:%.*]] = fsub <2 x double> zeroinitializer, [[TMP3]]
13 ; CHECK-NEXT: br label [[DOTBACKEDGE:%.*]]
15 ; CHECK-NEXT: [[TMP7:%.*]] = fmul <2 x double> [[TMP5]], [[TMP6]]
16 ; CHECK-NEXT: [[TMP8:%.*]] = fcmp olt <2 x double> [[TMP7]], zeroinitializer
17 ; CHECK-NEXT: br label [[TMP4]]
22 %3 = fsub double 0.000000e+00, %0
23 %4 = fsub double 0.000000e+00, %0
24 %5 = fsub double 0.000000e+00, %0
28 %6 = fmul double %4, %5
29 %7 = fcmp olt double %6, 0.000000e+00
30 %8 = fmul double %5, %3
31 %9 = fcmp olt double %8, 0.000000e+00
35 define void @test1(double %0, <4 x double> %v) {
36 ; CHECK-LABEL: define void @test1(
37 ; CHECK-SAME: double [[TMP0:%.*]], <4 x double> [[V:%.*]]) {
38 ; CHECK-NEXT: [[TMP2:%.*]] = shufflevector <4 x double> [[V]], <4 x double> poison, <2 x i32> <i32 poison, i32 0>
39 ; CHECK-NEXT: [[TMP3:%.*]] = insertelement <2 x double> [[TMP2]], double [[TMP0]], i32 0
40 ; CHECK-NEXT: [[TMP4:%.*]] = shufflevector <2 x double> [[TMP3]], <2 x double> poison, <4 x i32> <i32 0, i32 1, i32 0, i32 0>
41 ; CHECK-NEXT: br label [[TMP5:%.*]]
43 ; CHECK-NEXT: [[TMP6:%.*]] = fsub <4 x double> <double 1.000000e+00, double 2.000000e+00, double 3.000000e+00, double 4.000000e+00>, [[V]]
44 ; CHECK-NEXT: [[TMP7:%.*]] = fsub <4 x double> <double 0.000000e+00, double 1.000000e+00, double 0.000000e+00, double 0.000000e+00>, [[TMP4]]
45 ; CHECK-NEXT: br label [[DOTBACKEDGE:%.*]]
47 ; CHECK-NEXT: [[TMP8:%.*]] = fmul <4 x double> [[TMP7]], [[TMP6]]
48 ; CHECK-NEXT: [[TMP9:%.*]] = fcmp olt <4 x double> [[TMP8]], zeroinitializer
49 ; CHECK-NEXT: br label [[TMP5]]
51 %e0 = extractelement <4 x double> %v, i32 0
52 %e1 = extractelement <4 x double> %v, i32 1
53 %e2 = extractelement <4 x double> %v, i32 2
54 %e3 = extractelement <4 x double> %v, i32 3
58 %m1 = fsub double 1.000000e+00, %e0
59 %m2 = fsub double 2.000000e+00, %e1
60 %m3 = fsub double 3.000000e+00, %e2
61 %m4 = fsub double 4.000000e+00, %e3
62 %3 = fsub double 0.000000e+00, %0
63 %4 = fsub double 0.000000e+00, %0
64 %5 = fsub double 0.000000e+00, %0
68 %6 = fmul double %m1, %m2
69 %7 = fcmp olt double %6, 0.000000e+00
70 %8 = fmul double %3, %m1
71 %9 = fcmp olt double %8, 0.000000e+00
72 %10 = fmul double %4, %m3
73 %11 = fcmp olt double %10, 0.000000e+00
74 %12 = fmul double %5, %m4
75 %13 = fcmp olt double %12, 0.000000e+00
79 define void @test2(double %0) {
80 ; CHECK-LABEL: define void @test2(
81 ; CHECK-SAME: double [[TMP0:%.*]]) {
82 ; CHECK-NEXT: [[TMP2:%.*]] = insertelement <2 x double> poison, double [[TMP0]], i32 0
83 ; CHECK-NEXT: [[TMP3:%.*]] = shufflevector <2 x double> [[TMP2]], <2 x double> poison, <2 x i32> zeroinitializer
84 ; CHECK-NEXT: br label [[TMP4:%.*]]
86 ; CHECK-NEXT: [[TMP5:%.*]] = fsub <2 x double> <double 3.000000e+00, double 2.000000e+00>, [[TMP3]]
87 ; CHECK-NEXT: [[TMP6:%.*]] = fsub <2 x double> <double 3.000000e+00, double 1.000000e+00>, [[TMP3]]
88 ; CHECK-NEXT: br label [[DOTBACKEDGE:%.*]]
90 ; CHECK-NEXT: [[TMP7:%.*]] = fmul <2 x double> [[TMP5]], [[TMP6]]
91 ; CHECK-NEXT: [[TMP8:%.*]] = fcmp olt <2 x double> [[TMP7]], zeroinitializer
92 ; CHECK-NEXT: br label [[TMP4]]
97 %3 = fsub double 1.000000e+00, %0
98 %4 = fsub double 2.000000e+00, %0
99 %5 = fsub double 3.000000e+00, %0
103 %6 = fmul double %4, %3
104 %7 = fcmp olt double %6, 0.000000e+00
105 %8 = fmul double %5, %5
106 %9 = fcmp olt double %8, 0.000000e+00