summaryrefslogtreecommitdiffstats
path: root/llvm/test
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/test')
-rw-r--r--llvm/test/Transforms/InstCombine/pow-exp-nofastmath.ll17
-rw-r--r--llvm/test/Transforms/InstCombine/pow-exp.ll19
-rw-r--r--llvm/test/Transforms/InstCombine/pow-exp2.ll19
3 files changed, 55 insertions, 0 deletions
diff --git a/llvm/test/Transforms/InstCombine/pow-exp-nofastmath.ll b/llvm/test/Transforms/InstCombine/pow-exp-nofastmath.ll
new file mode 100644
index 00000000000..9e596fa3a72
--- /dev/null
+++ b/llvm/test/Transforms/InstCombine/pow-exp-nofastmath.ll
@@ -0,0 +1,17 @@
+; RUN: opt < %s -instcombine -S | FileCheck %s
+
+define double @mypow(double %x, double %y) #0 {
+entry:
+ %call = call double @exp(double %x)
+ %pow = call double @llvm.pow.f64(double %call, double %y)
+ ret double %pow
+}
+
+; CHECK-LABEL: define double @mypow(
+; CHECK: %call = call double @exp(double %x)
+; CHECK: %pow = call double @llvm.pow.f64(double %call, double %y)
+; CHECK: ret double %pow
+; CHECK: }
+
+declare double @exp(double) #1
+declare double @llvm.pow.f64(double, double)
diff --git a/llvm/test/Transforms/InstCombine/pow-exp.ll b/llvm/test/Transforms/InstCombine/pow-exp.ll
new file mode 100644
index 00000000000..62e6fb4f3a3
--- /dev/null
+++ b/llvm/test/Transforms/InstCombine/pow-exp.ll
@@ -0,0 +1,19 @@
+; RUN: opt < %s -instcombine -S | FileCheck %s
+
+define double @mypow(double %x, double %y) #0 {
+entry:
+ %call = call double @exp(double %x)
+ %pow = call double @llvm.pow.f64(double %call, double %y)
+ ret double %pow
+}
+
+; CHECK-LABEL: define double @mypow(
+; CHECK: %mul = fmul fast double %x, %y
+; CHECK: %exp = call double @exp(double %mul) #0
+; CHECK: ret double %exp
+; CHECK: }
+
+declare double @exp(double) #1
+declare double @llvm.pow.f64(double, double)
+attributes #0 = { "unsafe-fp-math"="true" }
+attributes #1 = { "unsafe-fp-math"="true" }
diff --git a/llvm/test/Transforms/InstCombine/pow-exp2.ll b/llvm/test/Transforms/InstCombine/pow-exp2.ll
new file mode 100644
index 00000000000..ad7931c07a6
--- /dev/null
+++ b/llvm/test/Transforms/InstCombine/pow-exp2.ll
@@ -0,0 +1,19 @@
+; RUN: opt < %s -instcombine -S | FileCheck %s
+
+define double @mypow(double %x, double %y) #0 {
+entry:
+ %call = call double @exp2(double %x)
+ %pow = call double @llvm.pow.f64(double %call, double %y)
+ ret double %pow
+}
+
+; CHECK-LABEL: define double @mypow(
+; CHECK: %mul = fmul fast double %x, %y
+; CHECK: %exp2 = call double @exp2(double %mul) #0
+; CHECK: ret double %exp2
+; CHECK: }
+
+declare double @exp2(double) #1
+declare double @llvm.pow.f64(double, double)
+attributes #0 = { "unsafe-fp-math"="true" }
+attributes #1 = { "unsafe-fp-math"="true" }
OpenPOWER on IntegriCloud