summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms/InstCombine/pow-sqrt.ll
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/test/Transforms/InstCombine/pow-sqrt.ll')
-rw-r--r--llvm/test/Transforms/InstCombine/pow-sqrt.ll11
1 files changed, 10 insertions, 1 deletions
diff --git a/llvm/test/Transforms/InstCombine/pow-sqrt.ll b/llvm/test/Transforms/InstCombine/pow-sqrt.ll
index 1e6166c5f11..52175f1b124 100644
--- a/llvm/test/Transforms/InstCombine/pow-sqrt.ll
+++ b/llvm/test/Transforms/InstCombine/pow-sqrt.ll
@@ -9,5 +9,14 @@ define double @pow_half(double %x) {
; CHECK-NEXT: %sqrt = call fast double @sqrt(double %x)
; CHECK-NEXT: ret double %sqrt
-declare double @llvm.pow.f64(double, double)
+define double @pow_neghalf(double %x) {
+ %pow = call fast double @llvm.pow.f64(double %x, double -5.000000e-01)
+ ret double %pow
+}
+; CHECK-LABEL: define double @pow_neghalf(
+; CHECK-NEXT: %sqrt = call fast double @sqrt(double %x) #0
+; CHECK-NEXT: %sqrtrecip = fdiv fast double 1.000000e+00, %sqrt
+; CHECK-NEXT: ret double %sqrtrecip
+
+declare double @llvm.pow.f64(double, double)
OpenPOWER on IntegriCloud