[InstCombine][NFC][tests] Add ninf base value case to pow-sqrt.ll
authorHubert Tong <hubert.reinterpretcast@gmail.com>
Tue, 22 Sep 2020 22:52:47 +0000 (18:52 -0400)
committerHubert Tong <hubert.reinterpretcast@gmail.com>
Tue, 22 Sep 2020 22:58:05 +0000 (18:58 -0400)
llvm/test/Transforms/InstCombine/pow-sqrt.ll

index 38f64d5..11fd576 100644 (file)
@@ -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:%.*]])