1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt < %s -passes=slp-vectorizer -S -mtriple=aarch64-w32-windows-gnu | FileCheck %s
4 define i32 @foo(i32 %v1, double %v2) {
7 ; CHECK-NEXT: [[TMP0:%.*]] = insertelement <2 x i32> <i32 poison, i32 undef>, i32 [[V1:%.*]], i32 0
8 ; CHECK-NEXT: [[TMP1:%.*]] = sitofp <2 x i32> [[TMP0]] to <2 x double>
9 ; CHECK-NEXT: [[TMP2:%.*]] = shufflevector <2 x double> [[TMP1]], <2 x double> poison, <4 x i32> <i32 0, i32 0, i32 1, i32 1>
10 ; CHECK-NEXT: br label [[FOR_COND15_PREHEADER:%.*]]
11 ; CHECK: for.cond15.preheader:
12 ; CHECK-NEXT: br label [[IF_END:%.*]]
14 ; CHECK-NEXT: br label [[IF_END_1:%.*]]
16 ; CHECK-NEXT: br label [[FOR_COND15:%.*]]
18 ; CHECK-NEXT: switch i32 undef, label [[DO_BODY:%.*]] [
19 ; CHECK-NEXT: i32 0, label [[SW_BB:%.*]]
20 ; CHECK-NEXT: i32 1, label [[SW_BB195:%.*]]
23 ; CHECK-NEXT: [[ARRAYIDX43:%.*]] = getelementptr inbounds [4 x [2 x double]], ptr undef, i32 0, i64 1, i64 0
24 ; CHECK-NEXT: [[TMP3:%.*]] = insertelement <2 x double> <double poison, double undef>, double [[V2:%.*]], i32 0
25 ; CHECK-NEXT: [[TMP4:%.*]] = fmul <2 x double> [[TMP3]], [[TMP1]]
26 ; CHECK-NEXT: [[TMP5:%.*]] = shufflevector <2 x double> [[TMP4]], <2 x double> poison, <4 x i32> <i32 0, i32 0, i32 1, i32 1>
27 ; CHECK-NEXT: [[TMP6:%.*]] = load <4 x double>, ptr [[ARRAYIDX43]], align 8
28 ; CHECK-NEXT: [[TMP7:%.*]] = fmul <4 x double> [[TMP6]], [[TMP5]]
29 ; CHECK-NEXT: [[TMP8:%.*]] = call <4 x double> @llvm.fmuladd.v4f64(<4 x double> undef, <4 x double> [[TMP2]], <4 x double> [[TMP7]])
30 ; CHECK-NEXT: br label [[SW_EPILOG:%.*]]
32 ; CHECK-NEXT: br label [[SW_EPILOG]]
34 ; CHECK-NEXT: unreachable
36 ; CHECK-NEXT: [[TMP9:%.*]] = phi <4 x double> [ undef, [[SW_BB195]] ], [ [[TMP8]], [[SW_BB]] ]
37 ; CHECK-NEXT: ret i32 undef
39 ; CHECK-NEXT: br label [[FOR_COND15_1:%.*]]
40 ; CHECK: for.cond15.1:
41 ; CHECK-NEXT: br i1 undef, label [[FOR_END39:%.*]], label [[FOR_COND15_PREHEADER]]
44 %conv = sitofp i32 undef to double
45 %conv2 = sitofp i32 %v1 to double
46 br label %for.cond15.preheader
48 for.cond15.preheader: ; preds = %for.cond15.1, %entry
51 for.cond15: ; preds = %if.end
54 if.end: ; preds = %for.cond15.preheader
57 for.end39: ; preds = %for.cond15.1
58 switch i32 undef, label %do.body [
60 i32 1, label %sw.bb195
63 sw.bb: ; preds = %for.end39
64 %arrayidx43 = getelementptr inbounds [4 x [2 x double]], ptr undef, i32 0, i64 1, i64 0
65 %0 = load double, ptr %arrayidx43, align 8
66 %arrayidx45 = getelementptr inbounds [4 x [2 x double]], ptr undef, i32 0, i64 2, i64 0
67 %1 = load double, ptr %arrayidx45, align 8
68 %arrayidx51 = getelementptr inbounds [4 x [2 x double]], ptr undef, i32 0, i64 2, i64 1
69 %2 = load double, ptr %arrayidx51, align 8
70 %arrayidx58 = getelementptr inbounds [4 x [2 x double]], ptr undef, i32 0, i64 1, i64 1
71 %3 = load double, ptr %arrayidx58, align 8
72 %mul = fmul double %v2, %conv2
73 %mul109 = fmul double undef, %conv
74 %mul143 = fmul double %0, %mul
75 %4 = call double @llvm.fmuladd.f64(double undef, double %conv2, double %mul143)
76 %mul154 = fmul double %1, %mul109
77 %5 = call double @llvm.fmuladd.f64(double undef, double %conv, double %mul154)
78 %mul172 = fmul double %3, %mul
79 %6 = call double @llvm.fmuladd.f64(double undef, double %conv2, double %mul172)
80 %mul183 = fmul double %2, %mul109
81 %7 = call double @llvm.fmuladd.f64(double undef, double %conv, double %mul183)
84 sw.bb195: ; preds = %for.end39
87 do.body: ; preds = %for.end39
90 sw.epilog: ; preds = %sw.bb195, %sw.bb
91 %x4.0 = phi double [ undef, %sw.bb195 ], [ %7, %sw.bb ]
92 %x3.0 = phi double [ undef, %sw.bb195 ], [ %6, %sw.bb ]
93 %x1.0 = phi double [ undef, %sw.bb195 ], [ %5, %sw.bb ]
94 %x0.0 = phi double [ undef, %sw.bb195 ], [ %4, %sw.bb ]
97 if.end.1: ; preds = %for.cond15
98 br label %for.cond15.1
100 for.cond15.1: ; preds = %if.end.1
101 br i1 undef, label %for.end39, label %for.cond15.preheader
104 declare double @llvm.fmuladd.f64(double, double, double)