From: Jay Foad Date: Tue, 5 May 2020 12:28:14 +0000 (+0100) Subject: Precommit new test cases for D79413 [InstCombine] Allow denormal C in pow(C,y) -... X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=47f5066553240b1559eed06706688ed8cce56fe7;p=platform%2Fupstream%2Fllvm.git Precommit new test cases for D79413 [InstCombine] Allow denormal C in pow(C,y) -> exp2(log2(C)*y) --- diff --git a/llvm/test/Transforms/InstCombine/pow-exp.ll b/llvm/test/Transforms/InstCombine/pow-exp.ll index 7fc0052..dac926c 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) {