1+ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
12; RUN: opt < %s -mtriple=s390x-unknown-linux -mcpu=z16 -S -passes=slp-vectorizer \
23; RUN: -pass-remarks-output=%t | FileCheck %s
34; RUN: cat %t | FileCheck -check-prefix=REMARK %s
910; getGatherCost().
1011define void @fun0 (ptr nocapture %0 , double %1 ) {
1112; CHECK-LABEL: define void @fun0(
12- ; CHECK: fmul <2 x double>
13- ; CHECK-NEXT: call <2 x double> @llvm.fmuladd.v2f64(
14- ; CHECK-NEXT: call <2 x double> @llvm.fmuladd.v2f64(
15- ; CHECK-NEXT: call <2 x double> @llvm.sqrt.v2f64(
13+ ; CHECK-SAME: ptr nocapture [[TMP0:%.*]], double [[TMP1:%.*]]) #[[ATTR0:[0-9]+]] {
14+ ; CHECK-NEXT: [[TMP3:%.*]] = load double, ptr [[TMP0]], align 8
15+ ; CHECK-NEXT: [[TMP4:%.*]] = insertelement <2 x double> poison, double [[TMP1]], i32 0
16+ ; CHECK-NEXT: [[TMP5:%.*]] = insertelement <2 x double> [[TMP4]], double [[TMP3]], i32 1
17+ ; CHECK-NEXT: [[TMP6:%.*]] = fmul <2 x double> [[TMP5]], <double 2.000000e+00, double 2.000000e+00>
18+ ; CHECK-NEXT: [[TMP7:%.*]] = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> [[TMP6]], <2 x double> [[TMP6]], <2 x double> zeroinitializer)
19+ ; CHECK-NEXT: [[TMP8:%.*]] = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> [[TMP6]], <2 x double> [[TMP6]], <2 x double> [[TMP7]])
20+ ; CHECK-NEXT: [[TMP9:%.*]] = call <2 x double> @llvm.sqrt.v2f64(<2 x double> [[TMP8]])
21+ ; CHECK-NEXT: [[TMP10:%.*]] = extractelement <2 x double> [[TMP9]], i32 0
22+ ; CHECK-NEXT: [[TMP11:%.*]] = extractelement <2 x double> [[TMP9]], i32 1
23+ ; CHECK-NEXT: [[TMP12:%.*]] = fadd double [[TMP10]], [[TMP11]]
24+ ; CHECK-NEXT: store double [[TMP12]], ptr [[TMP0]], align 8
25+ ; CHECK-NEXT: ret void
1626;
1727; REMARK-LABEL: Function: fun0
1828; REMARK: Args:
@@ -38,19 +48,26 @@ define void @fun0(ptr nocapture %0, double %1) {
3848; getVectorInstrCost().
3949define void @fun1 (double %0 ) {
4050; CHECK-LABEL: define void @fun1(
41- ; CHECK: phi <2 x double>
42- ; CHECK-NEXT: phi <2 x double>
43- ; CHECK-NEXT: phi <2 x double>
44- ; CHECK-NEXT: fsub <2 x double>
45- ; CHECK-NEXT: fsub <2 x double>
46- ; CHECK-NEXT: fsub <2 x double>
47- ; CHECK: fmul <2 x double>
48- ; CHECK-NEXT: call <2 x double> @llvm.fmuladd.v2f64(
49- ; CHECK-NEXT: call <2 x double> @llvm.fmuladd.v2f64(
50- ; CHECK-NEXT: fcmp olt <2 x double>
51- ; CHECK-NEXT: extractelement <2 x i1>
52- ; CHECK-NEXT: extractelement <2 x i1>
53- ; CHECK-NEXT: or i1
51+ ; CHECK-SAME: double [[TMP0:%.*]]) #[[ATTR0]] {
52+ ; CHECK-NEXT: [[TMP2:%.*]] = insertelement <2 x double> <double 0.000000e+00, double poison>, double [[TMP0]], i32 1
53+ ; CHECK-NEXT: br label %[[BB3:.*]]
54+ ; CHECK: [[BB3]]:
55+ ; CHECK-NEXT: [[TMP4:%.*]] = phi <2 x double> [ <double poison, double undef>, [[TMP1:%.*]] ], [ poison, %[[BB3]] ]
56+ ; CHECK-NEXT: [[TMP5:%.*]] = phi <2 x double> [ zeroinitializer, [[TMP1]] ], [ poison, %[[BB3]] ]
57+ ; CHECK-NEXT: [[TMP6:%.*]] = phi <2 x double> [ zeroinitializer, [[TMP1]] ], [ [[TMP18:%.*]], %[[BB3]] ]
58+ ; CHECK-NEXT: [[TMP7:%.*]] = fsub <2 x double> zeroinitializer, [[TMP6]]
59+ ; CHECK-NEXT: [[TMP8:%.*]] = fsub <2 x double> zeroinitializer, [[TMP5]]
60+ ; CHECK-NEXT: [[TMP9:%.*]] = fsub <2 x double> zeroinitializer, [[TMP4]]
61+ ; CHECK-NEXT: [[TMP10:%.*]] = load double, ptr null, align 8
62+ ; CHECK-NEXT: [[TMP11:%.*]] = fmul <2 x double> [[TMP7]], zeroinitializer
63+ ; CHECK-NEXT: [[TMP12:%.*]] = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> [[TMP8]], <2 x double> [[TMP8]], <2 x double> [[TMP11]])
64+ ; CHECK-NEXT: [[TMP13:%.*]] = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> [[TMP9]], <2 x double> [[TMP9]], <2 x double> [[TMP12]])
65+ ; CHECK-NEXT: [[TMP14:%.*]] = fcmp olt <2 x double> [[TMP13]], [[TMP2]]
66+ ; CHECK-NEXT: [[TMP15:%.*]] = extractelement <2 x i1> [[TMP14]], i32 0
67+ ; CHECK-NEXT: [[TMP16:%.*]] = extractelement <2 x i1> [[TMP14]], i32 1
68+ ; CHECK-NEXT: [[TMP17:%.*]] = or i1 [[TMP15]], [[TMP16]]
69+ ; CHECK-NEXT: [[TMP18]] = insertelement <2 x double> poison, double [[TMP10]], i32 1
70+ ; CHECK-NEXT: br label %[[BB3]]
5471;
5572; REMARK-LABEL: Function: fun1
5673; REMARK: Args:
@@ -91,8 +108,18 @@ declare double @llvm.fmuladd.f64(double, double, double)
91108; which is recognized in SystemZTTImpl::getScalarizationOverhead().
92109define void @fun2 (ptr %0 , ptr %Dst ) {
93110; CHECK-LABEL: define void @fun2(
94- ; CHECK: store i64
95- ; CHECK: store i64
111+ ; CHECK-SAME: ptr [[TMP0:%.*]], ptr [[DST:%.*]]) #[[ATTR0]] {
112+ ; CHECK-NEXT: [[TMP2:%.*]] = load i64, ptr [[TMP0]], align 8
113+ ; CHECK-NEXT: [[TMP3:%.*]] = icmp eq i64 [[TMP2]], 0
114+ ; CHECK-NEXT: br i1 [[TMP3]], label %[[BB4:.*]], label %[[BB5:.*]]
115+ ; CHECK: [[BB4]]:
116+ ; CHECK-NEXT: ret void
117+ ; CHECK: [[BB5]]:
118+ ; CHECK-NEXT: [[TMP6:%.*]] = getelementptr i8, ptr [[DST]], i64 24
119+ ; CHECK-NEXT: store i64 [[TMP2]], ptr [[TMP6]], align 8
120+ ; CHECK-NEXT: [[TMP7:%.*]] = getelementptr i8, ptr [[DST]], i64 16
121+ ; CHECK-NEXT: store i64 0, ptr [[TMP7]], align 8
122+ ; CHECK-NEXT: br label %[[BB4]]
96123;
97124; REMARK-NOT: Function: fun2
98125
0 commit comments