diff options
| author | Sanjay Patel <spatel@rotateright.com> | 2016-01-12 17:00:38 +0000 |
|---|---|---|
| committer | Sanjay Patel <spatel@rotateright.com> | 2016-01-12 17:00:38 +0000 |
| commit | dc19b8de76504986222db201b6186681bc65f9c1 (patch) | |
| tree | 2663e4ffd3b9efce1401d295bd14098c24b3a724 /llvm/test/Transforms | |
| parent | 8dca45efa8148c41556c3b03fe6536e97b67a89a (diff) | |
| download | bcm5719-llvm-dc19b8de76504986222db201b6186681bc65f9c1.tar.gz bcm5719-llvm-dc19b8de76504986222db201b6186681bc65f9c1.zip | |
consolidate exp/exp2 tests
The transform is identical, so keep the tests together and save some overhead.
llvm-svn: 257484
Diffstat (limited to 'llvm/test/Transforms')
| -rw-r--r-- | llvm/test/Transforms/InstCombine/pow-exp.ll | 12 | ||||
| -rw-r--r-- | llvm/test/Transforms/InstCombine/pow-exp2.ll | 19 |
2 files changed, 12 insertions, 19 deletions
diff --git a/llvm/test/Transforms/InstCombine/pow-exp.ll b/llvm/test/Transforms/InstCombine/pow-exp.ll index 7e36eadb402..f1b4a3a0195 100644 --- a/llvm/test/Transforms/InstCombine/pow-exp.ll +++ b/llvm/test/Transforms/InstCombine/pow-exp.ll @@ -11,6 +11,17 @@ define double @pow_exp(double %x, double %y) #0 { ; CHECK-NEXT: %exp = call fast double @exp(double %mul) ; CHECK-NEXT: ret double %exp +define double @pow_exp2(double %x, double %y) #0 { + %call = call fast double @exp2(double %x) #0 + %pow = call fast double @llvm.pow.f64(double %call, double %y) + ret double %pow +} + +; CHECK-LABEL: define double @pow_exp2( +; CHECK-NEXT: %mul = fmul fast double %x, %y +; CHECK-NEXT: %exp2 = call fast double @exp2(double %mul) +; CHECK-NEXT: ret double %exp2 + ; FIXME: This should not be transformed because the 'exp' call is not fast. define double @pow_exp_not_fast(double %x, double %y) #0 { %call = call double @exp(double %x) @@ -35,6 +46,7 @@ define double @function_pointer(double ()* %fptr, double %p1) #0 { ; CHECK-NEXT: %pow = call fast double @llvm.pow.f64(double %call1, double %p1) declare double @exp(double) +declare double @exp2(double) declare double @llvm.pow.f64(double, double) attributes #0 = { "unsafe-fp-math"="true" nounwind readnone } diff --git a/llvm/test/Transforms/InstCombine/pow-exp2.ll b/llvm/test/Transforms/InstCombine/pow-exp2.ll deleted file mode 100644 index c42cab391e6..00000000000 --- a/llvm/test/Transforms/InstCombine/pow-exp2.ll +++ /dev/null @@ -1,19 +0,0 @@ -; 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 fast 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" } |

