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