1
1
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2
2
; RUN: opt < %s -passes=slp-vectorizer -S -mtriple=aarch64-w32-windows-gnu | FileCheck %s
3
3
4
- define i32 @foo () {
4
+ define i32 @foo (i32 %v1 , double %v2 ) {
5
5
; CHECK-LABEL: @foo(
6
6
; CHECK-NEXT: entry:
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>
7
10
; CHECK-NEXT: br label [[FOR_COND15_PREHEADER:%.*]]
8
11
; CHECK: for.cond15.preheader:
9
12
; CHECK-NEXT: br label [[IF_END:%.*]]
@@ -13,21 +16,24 @@ define i32 @foo() {
13
16
; CHECK-NEXT: br label [[FOR_COND15:%.*]]
14
17
; CHECK: for.end39:
15
18
; CHECK-NEXT: switch i32 undef, label [[DO_BODY:%.*]] [
16
- ; CHECK-NEXT: i32 0, label [[SW_BB:%.*]]
17
- ; CHECK-NEXT: i32 1, label [[SW_BB195:%.*]]
19
+ ; CHECK-NEXT: i32 0, label [[SW_BB:%.*]]
20
+ ; CHECK-NEXT: i32 1, label [[SW_BB195:%.*]]
18
21
; CHECK-NEXT: ]
19
22
; CHECK: sw.bb:
20
23
; CHECK-NEXT: [[ARRAYIDX43:%.*]] = getelementptr inbounds [4 x [2 x double]], ptr undef, i32 0, i64 1, i64 0
21
- ; CHECK-NEXT: [[TMP1:%.*]] = load <4 x double>, ptr [[ARRAYIDX43]], align 8
22
- ; CHECK-NEXT: [[TMP2:%.*]] = fmul <4 x double> [[TMP1]], <double 0x7FF8000000000000, double 0x7FF8000000000000, double 0x7FF8000000000000, double 0x7FF8000000000000>
23
- ; CHECK-NEXT: [[TMP3:%.*]] = call <4 x double> @llvm.fmuladd.v4f64(<4 x double> undef, <4 x double> zeroinitializer, <4 x double> [[TMP2]])
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]])
24
30
; CHECK-NEXT: br label [[SW_EPILOG:%.*]]
25
31
; CHECK: sw.bb195:
26
32
; CHECK-NEXT: br label [[SW_EPILOG]]
27
33
; CHECK: do.body:
28
34
; CHECK-NEXT: unreachable
29
35
; CHECK: sw.epilog:
30
- ; CHECK-NEXT: [[TMP4 :%.*]] = phi <4 x double> [ undef, [[SW_BB195]] ], [ [[TMP3 ]], [[SW_BB]] ]
36
+ ; CHECK-NEXT: [[TMP9 :%.*]] = phi <4 x double> [ undef, [[SW_BB195]] ], [ [[TMP8 ]], [[SW_BB]] ]
31
37
; CHECK-NEXT: ret i32 undef
32
38
; CHECK: if.end.1:
33
39
; CHECK-NEXT: br label [[FOR_COND15_1:%.*]]
@@ -36,7 +42,7 @@ define i32 @foo() {
36
42
;
37
43
entry:
38
44
%conv = sitofp i32 undef to double
39
- %conv2 = sitofp i32 undef to double
45
+ %conv2 = sitofp i32 %v1 to double
40
46
br label %for.cond15.preheader
41
47
42
48
for.cond15.preheader: ; preds = %for.cond15.1, %entry
@@ -63,7 +69,7 @@ sw.bb: ; preds = %for.end39
63
69
%2 = load double , ptr %arrayidx51 , align 8
64
70
%arrayidx58 = getelementptr inbounds [4 x [2 x double ]], ptr undef , i32 0 , i64 1 , i64 1
65
71
%3 = load double , ptr %arrayidx58 , align 8
66
- %mul = fmul double undef , %conv2
72
+ %mul = fmul double %v2 , %conv2
67
73
%mul109 = fmul double undef , %conv
68
74
%mul143 = fmul double %0 , %mul
69
75
%4 = call double @llvm.fmuladd.f64 (double undef , double %conv2 , double %mul143 )
0 commit comments