[llvm] r304678 - [InstSimplify] Add test case demonstrating that we fail to constant fold vector llvm.powi intrinsics due to the second argument not being a vector.
Craig Topper via llvm-commits
llvm-commits at lists.llvm.org
Sun Jun 4 00:30:23 PDT 2017
Author: ctopper
Date: Sun Jun 4 02:30:23 2017
New Revision: 304678
URL: http://llvm.org/viewvc/llvm-project?rev=304678&view=rev
Log:
[InstSimplify] Add test case demonstrating that we fail to constant fold vector llvm.powi intrinsics due to the second argument not being a vector.
Modified:
llvm/trunk/test/Transforms/InstSimplify/call.ll
Modified: llvm/trunk/test/Transforms/InstSimplify/call.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/InstSimplify/call.ll?rev=304678&r1=304677&r2=304678&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/InstSimplify/call.ll (original)
+++ llvm/trunk/test/Transforms/InstSimplify/call.ll Sun Jun 4 02:30:23 2017
@@ -420,3 +420,27 @@ define <8 x i32> @masked_load_undef_mask
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
+}
More information about the llvm-commits
mailing list