summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCraig Topper <craig.topper@gmail.com>2017-06-04 07:30:23 +0000
committerCraig Topper <craig.topper@gmail.com>2017-06-04 07:30:23 +0000
commit97f113e79551484257d040f0bb84b1b8efa06249 (patch)
tree39e64a6fd7769996d04534e8c993d98d0956f9a5
parentfccd2eac1637641b5701cb15476b60d353c1d758 (diff)
downloadbcm5719-llvm-97f113e79551484257d040f0bb84b1b8efa06249.tar.gz
bcm5719-llvm-97f113e79551484257d040f0bb84b1b8efa06249.zip
[InstSimplify] Add test case demonstrating that we fail to constant fold vector llvm.powi intrinsics due to the second argument not being a vector.
llvm-svn: 304678
-rw-r--r--llvm/test/Transforms/InstSimplify/call.ll24
1 files changed, 24 insertions, 0 deletions
diff --git a/llvm/test/Transforms/InstSimplify/call.ll b/llvm/test/Transforms/InstSimplify/call.ll
index 994ff6b8c0d..364fd643691 100644
--- a/llvm/test/Transforms/InstSimplify/call.ll
+++ b/llvm/test/Transforms/InstSimplify/call.ll
@@ -420,3 +420,27 @@ define <8 x i32> @masked_load_undef_mask(<8 x i32>* %V) {
declare noalias i8* @malloc(i64)
declare <8 x i32> @llvm.masked.load.v8i32.p0v8i32(<8 x i32>*, i32, <8 x i1>, <8 x i32>)
+
+declare double @llvm.powi.f64(double, i32)
+declare <2 x double> @llvm.powi.v2f64(<2 x double>, i32)
+
+define double @constant_fold_powi() nounwind uwtable ssp {
+; CHECK-LABEL: @constant_fold_powi(
+; CHECK-NEXT: entry:
+; CHECK-NEXT: ret double 9.000000e+00
+;
+entry:
+ %0 = call double @llvm.powi.f64(double 3.00000e+00, i32 2)
+ ret double %0
+}
+
+define <2 x double> @constant_fold_powi_vec() nounwind uwtable ssp {
+; CHECK-LABEL: @constant_fold_powi_vec(
+; CHECK-NEXT: entry:
+; CHECK-NEXT: [[TMP0:%.*]] = call <2 x double> @llvm.powi.v2f64(<2 x double> <double 3.000000e+00, double 5.000000e+00>, i32 2)
+; CHECK-NEXT: ret <2 x double> [[TMP0]]
+;
+entry:
+ %0 = call <2 x double> @llvm.powi.v2f64(<2 x double> <double 3.00000e+00, double 5.00000e+00>, i32 2)
+ ret <2 x double> %0
+}
OpenPOWER on IntegriCloud