}
// LHS == Inf
- if (Pred == FCmpInst::FCMP_OEQ &&
- isKnownNeverInfinity(LHS, Q.DL, Q.TLI, 0, Q.AC, Q.CxtI, Q.DT))
+ if (Pred == FCmpInst::FCMP_OEQ && isKnownNeverInfinity(LHS, Q.DL, Q.TLI))
return getFalse(RetTy);
// LHS != Inf
- if (Pred == FCmpInst::FCMP_UNE &&
- isKnownNeverInfinity(LHS, Q.DL, Q.TLI, 0, Q.AC, Q.CxtI, Q.DT))
+ if (Pred == FCmpInst::FCMP_UNE && isKnownNeverInfinity(LHS, Q.DL, Q.TLI))
return getTrue(RetTy);
// LHS == Inf || LHS == NaN
- if (Pred == FCmpInst::FCMP_UEQ &&
- isKnownNeverInfOrNaN(LHS, Q.DL, Q.TLI, 0, Q.AC, Q.CxtI, Q.DT))
+ if (Pred == FCmpInst::FCMP_UEQ && isKnownNeverInfOrNaN(LHS, Q.DL, Q.TLI))
return getFalse(RetTy);
// LHS != Inf && LHS != NaN
- if (Pred == FCmpInst::FCMP_ONE &&
- isKnownNeverInfOrNaN(LHS, Q.DL, Q.TLI, 0, Q.AC, Q.CxtI, Q.DT))
+ if (Pred == FCmpInst::FCMP_ONE && isKnownNeverInfOrNaN(LHS, Q.DL, Q.TLI))
return getTrue(RetTy);
}
if (C->isNegative() && !C->isNegZero()) {
; ANY-NEXT: call void @llvm.assume(i1 [[NOT_INF]])
; ANY-NEXT: [[SQRTF:%.*]] = call float @sqrtf(float [[X]])
; ANY-NEXT: [[ABS:%.*]] = call float @llvm.fabs.f32(float [[SQRTF]])
-; ANY-NEXT: ret float [[ABS]]
+; ANY-NEXT: [[ISINF:%.*]] = fcmp oeq float [[X]], 0xFFF0000000000000
+; ANY-NEXT: [[RETVAL:%.*]] = select i1 [[ISINF]], float 0x7FF0000000000000, float [[ABS]]
+; ANY-NEXT: ret float [[RETVAL]]
;
; VC32-LABEL: define float @powf_libcall_half_assume_ninf
; VC32-SAME: (float [[X:%.*]]) {
; VC64-NEXT: call void @llvm.assume(i1 [[NOT_INF]])
; VC64-NEXT: [[SQRTF:%.*]] = call float @sqrtf(float [[X]])
; VC64-NEXT: [[ABS:%.*]] = call float @llvm.fabs.f32(float [[SQRTF]])
-; VC64-NEXT: ret float [[ABS]]
+; VC64-NEXT: [[ISINF:%.*]] = fcmp oeq float [[X]], 0xFFF0000000000000
+; VC64-NEXT: [[RETVAL:%.*]] = select i1 [[ISINF]], float 0x7FF0000000000000, float [[ABS]]
+; VC64-NEXT: ret float [[RETVAL]]
;
; VC83-LABEL: define float @powf_libcall_half_assume_ninf
; VC83-SAME: (float [[X:%.*]]) {
; VC83-NEXT: call void @llvm.assume(i1 [[NOT_INF]])
; VC83-NEXT: [[SQRTF:%.*]] = call float @sqrtf(float [[X]])
; VC83-NEXT: [[ABS:%.*]] = call float @llvm.fabs.f32(float [[SQRTF]])
-; VC83-NEXT: ret float [[ABS]]
+; VC83-NEXT: [[ISINF:%.*]] = fcmp oeq float [[X]], 0xFFF0000000000000
+; VC83-NEXT: [[RETVAL:%.*]] = select i1 [[ISINF]], float 0x7FF0000000000000, float [[ABS]]
+; VC83-NEXT: ret float [[RETVAL]]
;
; NOLIB-LABEL: define float @powf_libcall_half_assume_ninf
; NOLIB-SAME: (float [[X:%.*]]) {
ret i1 %r
}
-define i1 @is_infinite_assumed_finite(float %x) {
-; CHECK-LABEL: @is_infinite_assumed_finite(
-; CHECK-NEXT: [[XABS:%.*]] = call float @llvm.fabs.f32(float [[X:%.*]])
-; CHECK-NEXT: [[NOT_INF:%.*]] = fcmp one float [[XABS]], 0x7FF0000000000000
-; CHECK-NEXT: call void @llvm.assume(i1 [[NOT_INF]])
-; CHECK-NEXT: ret i1 false
-;
- %xabs = call float @llvm.fabs.f32(float %x)
- %not.inf = fcmp one float %xabs, 0x7FF0000000000000
- call void @llvm.assume(i1 %not.inf)
- %r = fcmp oeq float %xabs, 0x7FF0000000000000
- ret i1 %r
-}
-
-define i1 @une_inf_assumed_not_inf(float %x) {
-; CHECK-LABEL: @une_inf_assumed_not_inf(
-; CHECK-NEXT: [[XABS:%.*]] = call float @llvm.fabs.f32(float [[X:%.*]])
-; CHECK-NEXT: [[NOT_INF:%.*]] = fcmp one float [[XABS]], 0x7FF0000000000000
-; CHECK-NEXT: call void @llvm.assume(i1 [[NOT_INF]])
-; CHECK-NEXT: ret i1 true
-;
- %xabs = call float @llvm.fabs.f32(float %x)
- %not.inf = fcmp one float %xabs, 0x7FF0000000000000
- call void @llvm.assume(i1 %not.inf)
- %r = fcmp une float %xabs, 0x7FF0000000000000
- ret i1 %r
-}
-
define <2 x i1> @is_infinite_neg(<2 x float> %x) {
; CHECK-LABEL: @is_infinite_neg(
; CHECK-NEXT: ret <2 x i1> zeroinitializer
ret i1 %r
}
-define i1 @is_infinite_or_nan2_assume(float %x) {
-; CHECK-LABEL: @is_infinite_or_nan2_assume(
-; CHECK-NEXT: [[XABS:%.*]] = call float @llvm.fabs.f32(float [[X:%.*]])
-; CHECK-NEXT: [[IS_INF_OR_NAN:%.*]] = fcmp one float [[XABS]], 0x7FF0000000000000
-; CHECK-NEXT: call void @llvm.assume(i1 [[IS_INF_OR_NAN]])
-; CHECK-NEXT: ret i1 false
-;
- %xabs = call float @llvm.fabs.f32(float %x)
- %is.inf.or.nan = fcmp one float %xabs, 0x7FF0000000000000
- call void @llvm.assume(i1 %is.inf.or.nan)
- %r = fcmp ueq float %xabs, 0x7FF0000000000000
- ret i1 %r
-}
-
define <2 x i1> @is_infinite_neg_or_nan(<2 x float> %x) {
; CHECK-LABEL: @is_infinite_neg_or_nan(
; CHECK-NEXT: ret <2 x i1> zeroinitializer
ret i1 %r
}
-define i1 @is_finite_assume(i1 %c, double %x) {
-; CHECK-LABEL: @is_finite_assume(
-; CHECK-NEXT: [[XABS:%.*]] = call double @llvm.fabs.f64(double [[X:%.*]])
-; CHECK-NEXT: [[IS_INF_OR_NAN:%.*]] = fcmp one double [[XABS]], 0x7FF0000000000000
-; CHECK-NEXT: call void @llvm.assume(i1 [[IS_INF_OR_NAN]])
-; CHECK-NEXT: ret i1 true
-;
- %xabs = call double @llvm.fabs.f64(double %x)
- %is.inf.or.nan = fcmp one double %xabs, 0x7FF0000000000000
- call void @llvm.assume(i1 %is.inf.or.nan)
- %s = select i1 %c, double 42.0, double %x
- %r = fcmp one double %s, 0x7FF0000000000000
- ret i1 %r
-}
-
define <2 x i1> @is_finite_commute(<2 x i8> %x) {
; CHECK-LABEL: @is_finite_commute(
; CHECK-NEXT: ret <2 x i1> <i1 true, i1 true>