[llvm] r257484 - consolidate exp/exp2 tests

Sanjay Patel via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 12 09:00:38 PST 2016


Author: spatel
Date: Tue Jan 12 11:00:38 2016
New Revision: 257484

URL: http://llvm.org/viewvc/llvm-project?rev=257484&view=rev
Log:
consolidate exp/exp2 tests

The transform is identical, so keep the tests together and save some overhead.

Removed:
    llvm/trunk/test/Transforms/InstCombine/pow-exp2.ll
Modified:
    llvm/trunk/test/Transforms/InstCombine/pow-exp.ll

Modified: llvm/trunk/test/Transforms/InstCombine/pow-exp.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/InstCombine/pow-exp.ll?rev=257484&r1=257483&r2=257484&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/InstCombine/pow-exp.ll (original)
+++ llvm/trunk/test/Transforms/InstCombine/pow-exp.ll Tue Jan 12 11:00:38 2016
@@ -11,6 +11,17 @@ define double @pow_exp(double %x, double
 ; 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 (
 ; 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 }
 

Removed: llvm/trunk/test/Transforms/InstCombine/pow-exp2.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/InstCombine/pow-exp2.ll?rev=257483&view=auto
==============================================================================
--- llvm/trunk/test/Transforms/InstCombine/pow-exp2.ll (original)
+++ llvm/trunk/test/Transforms/InstCombine/pow-exp2.ll (removed)
@@ -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" }




More information about the llvm-commits mailing list