diff options
-rw-r--r-- | llvm/test/Transforms/InstSimplify/call.ll | 24 |
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 +} |