From 51ea8ac88780f78b734d482a6a681f3853791456 Mon Sep 17 00:00:00 2001 From: Sanjay Patel Date: Tue, 12 Jan 2016 17:00:38 +0000 Subject: [PATCH] consolidate exp/exp2 tests The transform is identical, so keep the tests together and save some overhead. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257484 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/Transforms/InstCombine/pow-exp.ll | 12 ++++++++++++ test/Transforms/InstCombine/pow-exp2.ll | 19 ------------------- 2 files changed, 12 insertions(+), 19 deletions(-) delete mode 100644 test/Transforms/InstCombine/pow-exp2.ll diff --git a/test/Transforms/InstCombine/pow-exp.ll b/test/Transforms/InstCombine/pow-exp.ll index 7e36eadb402..f1b4a3a0195 100644 --- a/test/Transforms/InstCombine/pow-exp.ll +++ b/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/test/Transforms/InstCombine/pow-exp2.ll b/test/Transforms/InstCombine/pow-exp2.ll deleted file mode 100644 index c42cab391e6..00000000000 --- a/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" } -- 2.34.1