consolidate exp/exp2 tests
authorSanjay Patel <spatel@rotateright.com>
Tue, 12 Jan 2016 17:00:38 +0000 (17:00 +0000)
committerSanjay Patel <spatel@rotateright.com>
Tue, 12 Jan 2016 17:00:38 +0000 (17:00 +0000)
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
test/Transforms/InstCombine/pow-exp2.ll [deleted file]

index 7e36eadb4026328cfe5a110e1052a50dbb1ad192..f1b4a3a019593e676717a61fcc54001a1692e49b 100644 (file)
@@ -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
 
 ; 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)
 ; 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)
 ; 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 }
 
 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 (file)
index c42cab3..0000000
+++ /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" }