Precommit new test cases for D79413 [InstCombine] Allow denormal C in pow(C,y) -...
authorJay Foad <jay.foad@amd.com>
Tue, 5 May 2020 12:28:14 +0000 (13:28 +0100)
committerJay Foad <jay.foad@amd.com>
Tue, 5 May 2020 15:08:09 +0000 (16:08 +0100)
llvm/test/Transforms/InstCombine/pow-exp.ll

index 7fc0052..dac926c 100644 (file)
@@ -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) {