[llvm] a60852e - [InstCombine][NFC][tests] Add ninf base value case to pow-sqrt.ll

Hubert Tong via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 22 16:00:01 PDT 2020


Author: Hubert Tong
Date: 2020-09-22T18:58:05-04:00
New Revision: a60852e9d692e3c38d9b58b7ec1679e07af2b8f7

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

LOG: [InstCombine][NFC][tests] Add ninf base value case to pow-sqrt.ll

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/llvm/test/Transforms/InstCombine/pow-sqrt.ll b/llvm/test/Transforms/InstCombine/pow-sqrt.ll
index 38f64d5584ff..11fd5767473a 100644
--- a/llvm/test/Transforms/InstCombine/pow-sqrt.ll
+++ b/llvm/test/Transforms/InstCombine/pow-sqrt.ll
@@ -70,6 +70,18 @@ define float @powf_intrinsic_half_fast(float %x) {
 
 ; If we can disregard INFs, no need for a select.
 
+define double @pow_libcall_half_no_FMF_base_ninf(i32 %x) {
+; CHECK-LABEL: @pow_libcall_half_no_FMF_base_ninf(
+; CHECK-NEXT:    [[CONV:%.*]] = uitofp i32 [[X:%.*]] to double
+; CHECK-NEXT:    [[SQRT:%.*]] = call double @sqrt(double [[CONV]])
+; CHECK-NEXT:    [[ABS:%.*]] = call double @llvm.fabs.f64(double [[SQRT]])
+; CHECK-NEXT:    ret double [[ABS]]
+;
+  %conv = uitofp i32 %x to double
+  %pow = call double @pow(double %conv, double 5.0e-01)
+  ret double %pow
+}
+
 define double @pow_libcall_half_ninf(double %x) {
 ; CHECK-LABEL: @pow_libcall_half_ninf(
 ; CHECK-NEXT:    [[SQRT:%.*]] = call ninf double @sqrt(double [[X:%.*]])


        


More information about the llvm-commits mailing list