[llvm] 47f5066 - Precommit new test cases for D79413 [InstCombine] Allow denormal C in pow(C,y) -> exp2(log2(C)*y)

Jay Foad via llvm-commits llvm-commits at lists.llvm.org
Tue May 5 08:08:37 PDT 2020


Author: Jay Foad
Date: 2020-05-05T16:08:09+01:00
New Revision: 47f5066553240b1559eed06706688ed8cce56fe7

URL: https://github.com/llvm/llvm-project/commit/47f5066553240b1559eed06706688ed8cce56fe7
DIFF: https://github.com/llvm/llvm-project/commit/47f5066553240b1559eed06706688ed8cce56fe7.diff

LOG: Precommit new test cases for D79413 [InstCombine] Allow denormal C in pow(C,y) -> exp2(log2(C)*y)

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/llvm/test/Transforms/InstCombine/pow-exp.ll b/llvm/test/Transforms/InstCombine/pow-exp.ll
index 7fc00527288d..dac926c9deba 100644
--- a/llvm/test/Transforms/InstCombine/pow-exp.ll
+++ b/llvm/test/Transforms/InstCombine/pow-exp.ll
@@ -261,6 +261,15 @@ define double @pow_ok_ten_base(double %e) {
   ret double %call
 }
 
+define double @pow_ok_denorm_base(double %e) {
+; CHECK-LABEL: @pow_ok_denorm_base(
+; CHECK-NEXT:    [[CALL:%.*]] = tail call nnan ninf afn double @pow(double 0xFFFFFFFF, double [[E:%.*]])
+; CHECK-NEXT:    ret double [[CALL]]
+;
+  %call = tail call afn nnan ninf double @pow(double 0x00000000FFFFFFFF, double %e)
+  ret double %call
+}
+
 define float @powf_ok_base(float %e) {
 ; CHECK-LABEL: @powf_ok_base(
 ; CHECK-NEXT:    [[MUL:%.*]] = fmul nnan ninf afn float [[E:%.*]], 0xBFE07762{{.*}}
@@ -301,6 +310,15 @@ define float @powf_ok_ten_base(float %e) {
   ret float %call
 }
 
+define float @powf_ok_denorm_base(float %e) {
+; CHECK-LABEL: @powf_ok_denorm_base(
+; CHECK-NEXT:    [[CALL:%.*]] = tail call nnan ninf afn float @powf(float 0x3780000000000000, float [[E:%.*]])
+; CHECK-NEXT:    ret float [[CALL]]
+;
+  %call = tail call afn nnan ninf float @powf(float 0x3780000000000000, float %e)
+  ret float %call
+}
+
 ; Negative tests
 
 define double @pow_zero_base(double %e) {


        


More information about the llvm-commits mailing list