|
LLVM 23.0.0git
|
#include "llvm/Support/KnownFPClass.h"
Public Types | |
| enum class | MinMaxKind { minimum , maximum , minimumnum , maximumnum , minnum , maxnum } |
Public Member Functions | |
| KnownFPClass (FPClassTest Known=fcAllFlags, std::optional< bool > Sign={}) | |
| LLVM_ABI | KnownFPClass (const APFloat &C) |
| bool | operator== (KnownFPClass Other) const |
| bool | isKnownNever (FPClassTest Mask) const |
| Return true if it's known this can never be one of the mask entries. | |
| bool | isKnownAlways (FPClassTest Mask) const |
| bool | isUnknown () const |
| bool | isKnownNeverNaN () const |
| Return true if it's known this can never be a nan. | |
| bool | isKnownAlwaysNaN () const |
| Return true if it's known this must always be a nan. | |
| bool | isKnownNeverInfinity () const |
| Return true if it's known this can never be an infinity. | |
| bool | isKnownNeverInfOrNaN () const |
| Return true if it's known this can never be an infinity or nan. | |
| bool | isKnownNeverPosInfinity () const |
| Return true if it's known this can never be +infinity. | |
| bool | isKnownNeverNegInfinity () const |
| Return true if it's known this can never be -infinity. | |
| bool | isKnownNeverSubnormal () const |
| Return true if it's known this can never be a subnormal. | |
| bool | isKnownNeverPosSubnormal () const |
| Return true if it's known this can never be a positive subnormal. | |
| bool | isKnownNeverNegSubnormal () const |
| Return true if it's known this can never be a negative subnormal. | |
| bool | isKnownNeverZero () const |
| Return true if it's known this can never be a zero. | |
| bool | isKnownNeverPosZero () const |
| Return true if it's known this can never be a literal positive zero. | |
| bool | isKnownNeverNegZero () const |
| Return true if it's known this can never be a negative zero. | |
| LLVM_ABI bool | isKnownNeverLogicalZero (DenormalMode Mode) const |
| Return true if it's known this can never be interpreted as a zero. | |
| LLVM_ABI bool | isKnownNeverLogicalNegZero (DenormalMode Mode) const |
| Return true if it's known this can never be interpreted as a negative zero. | |
| LLVM_ABI bool | isKnownNeverLogicalPosZero (DenormalMode Mode) const |
| Return true if it's known this can never be interpreted as a positive zero. | |
| bool | cannotBeOrderedLessThanZero () const |
| Return true if we can prove that the analyzed floating-point value is either NaN or never less than -0.0. | |
| bool | cannotBeOrderedGreaterThanZero () const |
| Return true if we can prove that the analyzed floating-point value is either NaN or never greater than -0.0. | |
| bool | cannotBeOrderedGreaterEqZero (DenormalMode Mode) const |
| Return true if it's know this can never be a negative value or a logical 0. | |
| KnownFPClass | intersectWith (const KnownFPClass &RHS) const |
| KnownFPClass | unionWith (const KnownFPClass &RHS) const |
| KnownFPClass & | operator|= (const KnownFPClass &RHS) |
| void | knownNot (FPClassTest RuleOut) |
| void | fneg () |
| void | fabs () |
| bool | signBitIsZeroOrNaN () const |
| Return true if the sign bit must be 0, ignoring the sign of nans. | |
| void | signBitMustBeZero () |
| Assume the sign bit is zero. | |
| void | signBitMustBeOne () |
| Assume the sign bit is one. | |
| void | copysign (const KnownFPClass &Sign) |
| void | propagateNaN (const KnownFPClass &Src, bool PreserveSign=false) |
| LLVM_ABI void | propagateDenormal (const KnownFPClass &Src, DenormalMode Mode) |
| Propagate knowledge from a source value that could be a denormal or zero. | |
| LLVM_ABI void | propagateCanonicalizingSrc (const KnownFPClass &Src, DenormalMode Mode) |
Report known classes if Src is evaluated through a potentially canonicalizing operation. | |
| void | resetAll () |
Public Attributes | |
| FPClassTest | KnownFPClasses = fcAllFlags |
| Floating-point classes the value could be one of. | |
| std::optional< bool > | SignBit |
| std::nullopt if the sign bit is unknown, true if the sign bit is definitely set or false if the sign bit is definitely unset. | |
Static Public Attributes | |
| static constexpr FPClassTest | OrderedLessThanZeroMask |
| static constexpr FPClassTest | OrderedGreaterThanZeroMask |
Definition at line 26 of file KnownFPClass.h.
|
strong |
| Enumerator | |
|---|---|
| minimum | |
| maximum | |
| minimumnum | |
| maximumnum | |
| minnum | |
| maxnum | |
Definition at line 209 of file KnownFPClass.h.
|
inline |
Definition at line 34 of file KnownFPClass.h.
References llvm::fcAllFlags.
Referenced by canonicalize(), copysign(), copysign(), cos(), exp(), fabs(), fadd(), fadd_self(), fdiv(), fdiv_self(), fma(), fma_square(), fmul(), fmul(), fneg(), fpext(), fptrunc(), frem_self(), frexp_mant(), fsub(), intersectWith(), ldexp(), log(), minMaxLike(), operator==(), operator|=(), powi(), propagateCanonicalizingSrc(), propagateDenormal(), propagateNaN(), resetAll(), roundToIntegral(), sin(), sqrt(), square(), and unionWith().
Definition at line 21 of file KnownFPClass.cpp.
References llvm::CallingConv::C, KnownFPClasses, and SignBit.
|
inline |
Return true if it's know this can never be a negative value or a logical 0.
NaN --> true
x >= -0 --> false nsub --> true if mode is ieee, false otherwise. x < -0 --> true
Definition at line 137 of file KnownFPClass.h.
References llvm::fcPositive, isKnownNever(), isKnownNeverLogicalNegZero(), and Mode.
Referenced by llvm::InstCombinerImpl::SimplifyDemandedUseFPClass().
|
inline |
Return true if we can prove that the analyzed floating-point value is either NaN or never greater than -0.0.
NaN --> true +0 --> true -0 --> true x > +0 --> false x < -0 --> true
Definition at line 126 of file KnownFPClass.h.
References isKnownNever(), and OrderedGreaterThanZeroMask.
Referenced by computeKnownFPClass(), exp(), fadd_impl(), ldexp(), and minMaxLike().
|
inline |
Return true if we can prove that the analyzed floating-point value is either NaN or never less than -0.0.
NaN --> true +0 --> true -0 --> true
x > +0 --> true x < -0 --> false
Definition at line 115 of file KnownFPClass.h.
References isKnownNever(), and OrderedLessThanZeroMask.
Referenced by llvm::cannotBeOrderedLessThanZero(), computeKnownFPClass(), exp(), fadd_impl(), fptrunc(), ldexp(), log(), minMaxLike(), simplifyFCmpInst(), simplifyUnaryIntrinsic(), and sqrt().
|
static |
Apply the canonicalize intrinsic to this value.
This is essentially a stronger form of propagateCanonicalizingSrc.
Definition at line 187 of file KnownFPClass.cpp.
References llvm::fcNan, llvm::fcNegSubnormal, llvm::fcNegZero, llvm::fcPosSubnormal, llvm::fcPosZero, llvm::fcQNan, llvm::fcSNan, llvm::fcSubnormal, llvm::fcZero, llvm::DenormalMode::getIEEE(), llvm::DenormalMode::getPreserveSign(), llvm::DenormalMode::IEEE, llvm::DenormalMode::Input, llvm::DenormalMode::inputsAreZero(), isKnownNever(), isKnownNeverNaN(), KnownFPClass(), KnownFPClasses, knownNot(), llvm::DenormalMode::Output, llvm::DenormalMode::outputsAreZero(), and llvm::DenormalMode::PositiveZero.
Referenced by computeKnownFPClass(), and llvm::InstCombinerImpl::SimplifyDemandedUseFPClass().
|
inlinestatic |
Definition at line 335 of file KnownFPClass.h.
References copysign(), and KnownFPClass().
|
inline |
Definition at line 313 of file KnownFPClass.h.
References llvm::fcInf, llvm::fcNan, llvm::fcNegative, llvm::fcNormal, llvm::fcPositive, llvm::fcSubnormal, llvm::fcZero, isKnownNever(), KnownFPClass(), KnownFPClasses, and SignBit.
Referenced by computeKnownFPClass(), copysign(), llvm::InstCombinerImpl::SimplifyDemandedUseFPClass(), and llvm::InstCombinerImpl::SimplifyMultipleUseDemandedFPClass().
|
static |
Report known values for cos.
Definition at line 558 of file KnownFPClass.cpp.
References KnownFPClass(), and sin().
Referenced by computeKnownFPClass().
|
static |
Report known values for exp, exp2 and exp10.
Definition at line 478 of file KnownFPClass.cpp.
References cannotBeOrderedGreaterThanZero(), cannotBeOrderedLessThanZero(), llvm::fcNegative, llvm::fcPosInf, llvm::fcPosSubnormal, llvm::fcPosZero, KnownFPClass(), knownNot(), and propagateNaN().
Referenced by computeKnownFPClass(), and llvm::InstCombinerImpl::SimplifyDemandedUseFPClass().
|
inline |
Definition at line 186 of file KnownFPClass.h.
References llvm::fcNegInf, llvm::fcNegNormal, llvm::fcNegSubnormal, llvm::fcNegZero, llvm::fcPosInf, llvm::fcPosNormal, llvm::fcPosSubnormal, llvm::fcPosZero, KnownFPClasses, and signBitMustBeZero().
Referenced by computeKnownFPClass(), fabs(), simplifyDemandedFPClassFabs(), and simplifyDemandedFPClassFnegFabs().
|
inlinestatic |
Definition at line 202 of file KnownFPClass.h.
References fabs(), and KnownFPClass().
|
static |
Report known values for fadd.
Definition at line 271 of file KnownFPClass.cpp.
References fadd_impl(), llvm::fcNegZero, llvm::DenormalMode::IEEE, isKnownNeverLogicalNegZero(), KnownFPClass(), knownNot(), and llvm::DenormalMode::PositiveZero.
Referenced by computeKnownFPClass(), fadd_self(), fsub(), and llvm::InstCombinerImpl::SimplifyDemandedUseFPClass().
|
static |
Report known values for fadd x, x.
Definition at line 287 of file KnownFPClass.cpp.
References fadd(), llvm::fcPosZero, llvm::DenormalMode::IEEE, isKnownNeverLogicalPosZero(), isKnownNeverPosSubnormal(), isKnownNeverSubnormal(), KnownFPClass(), knownNot(), llvm::DenormalMode::PositiveZero, and llvm::DenormalMode::PreserveSign.
Referenced by computeKnownFPClass(), and llvm::InstCombinerImpl::SimplifyDemandedUseFPClass().
|
static |
Report known values for fdiv.
Definition at line 384 of file KnownFPClass.cpp.
References llvm::fcFinite, llvm::fcInf, llvm::fcNan, llvm::fcNegative, llvm::fcNormal, llvm::fcPositive, llvm::fcSubnormal, llvm::fcZero, isKnownAlways(), isKnownNever(), isKnownNeverInfinity(), isKnownNeverLogicalZero(), isKnownNeverNaN(), KnownFPClass(), and knownNot().
Referenced by computeKnownFPClass(), and llvm::InstCombinerImpl::SimplifyDemandedUseFPClass().
|
static |
Report known values for fdiv x, x.
Definition at line 421 of file KnownFPClass.cpp.
References llvm::fcNan, llvm::fcPosNormal, llvm::fcSNan, isKnownNever(), isKnownNeverInfOrNaN(), isKnownNeverLogicalZero(), KnownFPClass(), and knownNot().
Referenced by computeKnownFPClass().
|
static |
Report known values for fma.
Definition at line 446 of file KnownFPClass.cpp.
References fadd_impl(), fmul(), KnownFPClass(), and llvm::Mul.
Referenced by computeKnownFPClass(), and llvm::InstCombinerImpl::SimplifyDemandedUseFPClass().
|
static |
Report known values for fma squared, squared, addend.
Definition at line 460 of file KnownFPClass.cpp.
References fadd_impl(), llvm::fcNan, llvm::fcNegInf, isKnownNever(), KnownFPClass(), knownNot(), and square().
Referenced by computeKnownFPClass(), and llvm::InstCombinerImpl::SimplifyDemandedUseFPClass().
|
static |
Definition at line 356 of file KnownFPClass.cpp.
References llvm::APFloatBase::cmpEqual, llvm::APFloat::compareAbsoluteValue(), llvm::fcInf, llvm::fcSubnormal, fmul(), llvm::APFloat::getOne(), llvm::APFloat::getSemantics(), llvm::ilogb(), isKnownNever(), KnownFPClass(), knownNot(), and llvm::APFloatBase::semanticsPrecision().
|
static |
Report known values for fmul.
Definition at line 309 of file KnownFPClass.cpp.
References llvm::fcInf, llvm::fcNan, llvm::fcNegative, llvm::fcNormal, llvm::fcPositive, llvm::fcSubnormal, llvm::fcZero, isKnownAlways(), isKnownNever(), isKnownNeverInfinity(), isKnownNeverLogicalZero(), isKnownNeverNaN(), KnownFPClass(), and knownNot().
Referenced by computeKnownFPClass(), fma(), fmul(), llvm::InstCombinerImpl::SimplifyDemandedUseFPClass(), and square().
|
inline |
Definition at line 174 of file KnownFPClass.h.
References llvm::fneg(), KnownFPClasses, and SignBit.
Referenced by computeKnownFPClass(), fneg(), fsub(), simplifyDemandedFPClassFnegFabs(), and llvm::InstCombinerImpl::SimplifyDemandedUseFPClass().
|
inlinestatic |
Definition at line 180 of file KnownFPClass.h.
References fneg(), and KnownFPClass().
|
static |
Propagate known class for fpext.
Definition at line 562 of file KnownFPClass.cpp.
References llvm::fcNegNormal, llvm::fcNegSubnormal, llvm::fcPosNormal, llvm::fcPosSubnormal, llvm::fcSubnormal, isKnownNeverNaN(), llvm::APFloatBase::isRepresentableAsNormalIn(), KnownFPClass(), KnownFPClasses, knownNot(), and SignBit.
Referenced by computeKnownFPClass(), and llvm::InstCombinerImpl::SimplifyDemandedUseFPClass().
|
static |
Propagate known class for fptrunc.
Definition at line 584 of file KnownFPClass.cpp.
References cannotBeOrderedLessThanZero(), KnownFPClass(), knownNot(), OrderedLessThanZeroMask, and propagateNaN().
Referenced by computeKnownFPClassForFPTrunc(), and simplifyDemandedUseFPClassFPTrunc().
|
static |
Report known values for frem.
Definition at line 433 of file KnownFPClass.cpp.
References llvm::fcNan, llvm::fcSNan, llvm::fcZero, isKnownNever(), isKnownNeverInfOrNaN(), isKnownNeverLogicalZero(), KnownFPClass(), and knownNot().
Referenced by computeKnownFPClass().
|
static |
Propagate known class for mantissa component of frexp.
Definition at line 626 of file KnownFPClass.cpp.
References llvm::fcNegative, llvm::fcNegInf, llvm::fcNegZero, llvm::fcPosInf, llvm::fcPositive, llvm::fcPosZero, llvm::fcSubnormal, isKnownNever(), isKnownNeverLogicalNegZero(), isKnownNeverLogicalPosZero(), KnownFPClass(), knownNot(), and propagateNaN().
Referenced by computeKnownFPClass(), and llvm::InstCombinerImpl::SimplifyDemandedUseFPClass().
|
static |
Report known values for fsub.
Definition at line 303 of file KnownFPClass.cpp.
References fadd(), fneg(), and KnownFPClass().
Referenced by computeKnownFPClass(), and llvm::InstCombinerImpl::SimplifyDemandedUseFPClass().
|
inline |
Definition at line 141 of file KnownFPClass.h.
References KnownFPClass(), KnownFPClasses, RHS, and SignBit.
Referenced by computeKnownFPClass(), llvm::InstCombinerImpl::SimplifyDemandedUseFPClass(), and llvm::InstCombinerImpl::SimplifyMultipleUseDemandedFPClass().
|
inline |
Definition at line 47 of file KnownFPClass.h.
References isKnownNever().
Referenced by fdiv(), fmul(), isKnownAlwaysNaN(), simplifyDemandedFPClassCopysignMag(), and llvm::InstCombinerImpl::SimplifyDemandedUseFPClass().
|
inline |
Return true if it's known this must always be a nan.
Definition at line 55 of file KnownFPClass.h.
References llvm::fcNan, and isKnownAlways().
Referenced by simplifyFCmpInst().
|
inline |
Return true if it's known this can never be one of the mask entries.
Definition at line 43 of file KnownFPClass.h.
References llvm::fcNone, and KnownFPClasses.
Referenced by cannotBeOrderedGreaterEqZero(), cannotBeOrderedGreaterThanZero(), cannotBeOrderedLessThanZero(), canonicalize(), computeKnownFPClass(), copysign(), fadd_impl(), fdiv(), fdiv_self(), fma_square(), fmul(), fmul(), foldFPtoI(), frem_self(), frexp_mant(), isKnownAlways(), isKnownNeverInfinity(), isKnownNeverInfOrNaN(), isKnownNeverNaN(), isKnownNeverNegInfinity(), isKnownNeverNegSubnormal(), isKnownNeverNegZero(), isKnownNeverPosInfinity(), isKnownNeverPosSubnormal(), isKnownNeverPosZero(), isKnownNeverSubnormal(), isKnownNeverZero(), knownNot(), ldexp(), powi(), roundToIntegral(), signBitIsZeroOrNaN(), simplifyDemandedFPClassFabs(), simplifyDemandedFPClassFnegFabs(), simplifyDemandedFPClassMinMax(), llvm::InstCombinerImpl::SimplifyDemandedUseFPClass(), simplifyFMAFMul(), llvm::InstCombinerImpl::SimplifyMultipleUseDemandedFPClass(), simplifyX86FPMaxMin(), and sqrt().
|
inline |
Return true if it's known this can never be an infinity.
Definition at line 58 of file KnownFPClass.h.
References llvm::fcInf, and isKnownNever().
Referenced by computeKnownFPClass(), fadd_impl(), fdiv(), fmul(), inferFastMathValueFlags(), llvm::isKnownNeverInfinity(), llvm::isKnownNeverInfOrNaN(), and sin().
|
inline |
Return true if it's known this can never be an infinity or nan.
Definition at line 61 of file KnownFPClass.h.
References llvm::fcInf, llvm::fcNan, and isKnownNever().
Referenced by computeKnownFPClass(), fdiv_self(), frem_self(), and llvm::InstCombinerImpl::SimplifyDemandedUseFPClass().
| bool KnownFPClass::isKnownNeverLogicalNegZero | ( | DenormalMode | Mode | ) | const |
Return true if it's known this can never be interpreted as a negative zero.
Definition at line 40 of file KnownFPClass.cpp.
References inputDenormalIsIEEEOrPosZero(), isKnownNeverNegSubnormal(), and isKnownNeverNegZero().
Referenced by cannotBeOrderedGreaterEqZero(), computeKnownFPClass(), fadd(), frexp_mant(), ldexp(), llvm::InstCombinerImpl::SimplifyDemandedUseFPClass(), and sqrt().
| bool KnownFPClass::isKnownNeverLogicalPosZero | ( | DenormalMode | Mode | ) | const |
Return true if it's known this can never be interpreted as a positive zero.
Definition at line 45 of file KnownFPClass.cpp.
References llvm::DenormalMode::IEEE, isKnownNeverPosSubnormal(), isKnownNeverPosZero(), isKnownNeverSubnormal(), llvm_unreachable, llvm::DenormalMode::PositiveZero, and llvm::DenormalMode::PreserveSign.
Referenced by computeKnownFPClass(), fadd_self(), frexp_mant(), ldexp(), and llvm::InstCombinerImpl::SimplifyDemandedUseFPClass().
| bool KnownFPClass::isKnownNeverLogicalZero | ( | DenormalMode | Mode | ) | const |
Return true if it's known this can never be interpreted as a zero.
This extends isKnownNeverZero to cover the case where the assumed floating-point mode for the function interprets denormals as zero.
Definition at line 35 of file KnownFPClass.cpp.
References inputDenormalIsIEEE(), isKnownNeverSubnormal(), and isKnownNeverZero().
Referenced by computeKnownFPClass(), fdiv(), fdiv_self(), fmul(), frem_self(), log(), and llvm::InstCombinerImpl::SimplifyDemandedUseFPClass().
|
inline |
Return true if it's known this can never be a nan.
Definition at line 52 of file KnownFPClass.h.
References llvm::fcNan, and isKnownNever().
Referenced by canonicalize(), computeKnownFPClass(), fadd_impl(), fdiv(), fmul(), llvm::InstCombinerImpl::foldSelectIntoOp(), fpext(), inferFastMathValueFlags(), llvm::isKnownNeverInfOrNaN(), llvm::isKnownNeverNaN(), log(), minMaxLike(), llvm::InstCombinerImpl::SimplifyDemandedUseFPClass(), simplifyFCmpInst(), simplifyUnaryIntrinsic(), sin(), and sqrt().
|
inline |
Return true if it's known this can never be -infinity.
Definition at line 67 of file KnownFPClass.h.
References llvm::fcNegInf, and isKnownNever().
Referenced by ldexp(), and roundToIntegral().
|
inline |
Return true if it's known this can never be a negative subnormal.
Definition at line 76 of file KnownFPClass.h.
References llvm::fcNegSubnormal, and isKnownNever().
Referenced by isKnownNeverLogicalNegZero(), and ldexp().
|
inline |
Return true if it's known this can never be a negative zero.
This means a literal -0 and does not include denormal inputs implicitly treated as -0.
Definition at line 87 of file KnownFPClass.h.
References llvm::fcNegZero, and isKnownNever().
Referenced by llvm::cannotBeNegativeZero(), isKnownNeverLogicalNegZero(), and minMaxLike().
|
inline |
Return true if it's known this can never be +infinity.
Definition at line 64 of file KnownFPClass.h.
References llvm::fcPosInf, and isKnownNever().
Referenced by computeKnownFPClass(), ldexp(), log(), roundToIntegral(), and sqrt().
|
inline |
Return true if it's known this can never be a positive subnormal.
Definition at line 73 of file KnownFPClass.h.
References llvm::fcPosSubnormal, and isKnownNever().
Referenced by fadd_self(), isKnownNeverLogicalPosZero(), and ldexp().
|
inline |
Return true if it's known this can never be a literal positive zero.
Definition at line 83 of file KnownFPClass.h.
References llvm::fcPosZero, and isKnownNever().
Referenced by isKnownNeverLogicalPosZero(), and minMaxLike().
|
inline |
Return true if it's known this can never be a subnormal.
Definition at line 70 of file KnownFPClass.h.
References llvm::fcSubnormal, and isKnownNever().
Referenced by fadd_self(), isKnownNeverLogicalPosZero(), isKnownNeverLogicalZero(), minMaxLike(), and llvm::InstCombinerImpl::SimplifyDemandedUseFPClass().
|
inline |
Return true if it's known this can never be a zero.
This means a literal [+-]0, and does not include denormal inputs implicitly treated as [+-]0.
Definition at line 80 of file KnownFPClass.h.
References llvm::fcZero, and isKnownNever().
Referenced by isKnownNeverLogicalZero(), and llvm::LegalizerHelper::lowerFMinimumMaximum().
|
inline |
Definition at line 49 of file KnownFPClass.h.
References llvm::fcAllFlags, KnownFPClasses, and SignBit.
Referenced by llvm::adjustKnownFPClassForSelectArm(), computeKnownFPClass(), and llvm::InstCombinerImpl::SimplifyMultipleUseDemandedFPClass().
|
inline |
Definition at line 164 of file KnownFPClass.h.
References llvm::fcNan, llvm::fcNegative, llvm::fcPositive, isKnownNever(), KnownFPClasses, and SignBit.
Referenced by canonicalize(), computeKnownFPClass(), computeKnownFPClassFromCond(), exp(), fadd(), fadd_impl(), fadd_self(), fdiv(), fdiv_self(), fma_square(), fmul(), fmul(), fpext(), fptrunc(), frem_self(), frexp_mant(), ldexp(), log(), minMaxLike(), powi(), propagateNaN(), roundToIntegral(), llvm::InstCombinerImpl::SimplifyDemandedFPClass(), simplifyDemandedFPClassFabs(), simplifyDemandedFPClassFnegFabs(), simplifyDemandedFPClassMinMax(), llvm::InstCombinerImpl::SimplifyDemandedUseFPClass(), simplifyDemandedUseFPClassFPTrunc(), llvm::InstCombinerImpl::SimplifyMultipleUseDemandedFPClass(), sin(), sqrt(), and square().
|
static |
Propagate known class for ldexp.
Definition at line 653 of file KnownFPClass.cpp.
References cannotBeOrderedGreaterThanZero(), cannotBeOrderedLessThanZero(), llvm::fcNegative, llvm::fcNegInf, llvm::fcNegSubnormal, llvm::fcNegZero, llvm::fcPosInf, llvm::fcPositive, llvm::fcPosSubnormal, llvm::fcPosZero, llvm::fcSubnormal, llvm::KnownBits::getConstant(), llvm::KnownBits::getSignedMinValue(), llvm::KnownBits::isConstant(), isKnownNever(), isKnownNeverLogicalNegZero(), isKnownNeverLogicalPosZero(), isKnownNeverNegInfinity(), isKnownNeverNegSubnormal(), isKnownNeverPosInfinity(), isKnownNeverPosSubnormal(), llvm::KnownBits::isNegative(), llvm::KnownBits::isNonNegative(), llvm::APInt::isZero(), KnownFPClass(), knownNot(), OrderedGreaterThanZeroMask, OrderedLessThanZeroMask, propagateCanonicalizingSrc(), propagateNaN(), llvm::APFloatBase::semanticsPrecision(), and llvm::APInt::sge().
Referenced by computeKnownFPClass(), and llvm::InstCombinerImpl::SimplifyDemandedUseFPClass().
|
static |
Propagate known class for log/log2/log10.
Definition at line 505 of file KnownFPClass.cpp.
References cannotBeOrderedLessThanZero(), llvm::fcNan, llvm::fcNegInf, llvm::fcNegZero, llvm::fcPosInf, llvm::fcSubnormal, isKnownNeverLogicalZero(), isKnownNeverNaN(), isKnownNeverPosInfinity(), KnownFPClass(), and knownNot().
Referenced by computeKnownFPClass(), and llvm::InstCombinerImpl::SimplifyDemandedUseFPClass().
|
static |
Definition at line 95 of file KnownFPClass.cpp.
References cannotBeOrderedGreaterThanZero(), cannotBeOrderedLessThanZero(), llvm::fcNan, llvm::fcNone, llvm::fcZero, llvm::DenormalMode::getIEEE(), isKnownNeverNaN(), isKnownNeverNegZero(), isKnownNeverPosZero(), isKnownNeverSubnormal(), KnownFPClass(), KnownFPClasses, knownNot(), llvm_unreachable, maximum, maximumnum, maxnum, minimum, minimumnum, minnum, OrderedGreaterThanZeroMask, OrderedLessThanZeroMask, SignBit, signBitMustBeOne(), and signBitMustBeZero().
Referenced by computeKnownFPClass(), and simplifyDemandedFPClassMinMax().
|
inline |
Definition at line 38 of file KnownFPClass.h.
References KnownFPClass(), KnownFPClasses, llvm::Other, and SignBit.
|
inline |
Definition at line 156 of file KnownFPClass.h.
References KnownFPClass(), KnownFPClasses, RHS, and SignBit.
|
static |
Propagate known class for powi.
Definition at line 701 of file KnownFPClass.cpp.
References llvm::fcNan, llvm::fcNegative, llvm::fcPosNormal, llvm::fcSNan, llvm::KnownBits::isEven(), isKnownNever(), llvm::KnownBits::isZero(), KnownFPClass(), knownNot(), and propagateNaN().
Referenced by computeKnownFPClass().
| void KnownFPClass::propagateCanonicalizingSrc | ( | const KnownFPClass & | Src, |
| DenormalMode | Mode ) |
Report known classes if Src is evaluated through a potentially canonicalizing operation.
We can assume signaling nans will not be introduced, but cannot assume a denormal will be flushed under FTZ/DAZ.
This assumes a copy-like operation and will replace any currently known information.
Definition at line 499 of file KnownFPClass.cpp.
References KnownFPClass(), propagateDenormal(), and propagateNaN().
Referenced by ldexp().
| void KnownFPClass::propagateDenormal | ( | const KnownFPClass & | Src, |
| DenormalMode | Mode ) |
Propagate knowledge from a source value that could be a denormal or zero.
We have to be conservative since output flushing is not guaranteed, so known-never-zero may not hold.
This assumes a copy-like operation and will replace any currently known information.
Definition at line 68 of file KnownFPClass.cpp.
References llvm::DenormalMode::Dynamic, llvm::fcNegZero, llvm::fcPosZero, llvm::DenormalMode::getIEEE(), llvm::DenormalMode::getPositiveZero(), KnownFPClass(), KnownFPClasses, and llvm::DenormalMode::PositiveZero.
Referenced by propagateCanonicalizingSrc().
|
inline |
Definition at line 345 of file KnownFPClass.h.
References llvm::fcNan, llvm::fcSNan, KnownFPClass(), knownNot(), and SignBit.
Referenced by computeKnownFPClass(), exp(), fptrunc(), frexp_mant(), ldexp(), powi(), propagateCanonicalizingSrc(), roundToIntegral(), and square().
|
inline |
Definition at line 407 of file KnownFPClass.h.
References KnownFPClass().
Referenced by computeKnownFPClass(), and llvm::TargetLowering::computeKnownFPClassForTargetInstr().
|
static |
Propagate known class for rounding intrinsics (trunc, floor, ceil, rint, nearbyint, round, roundeven).
This is trunc if IsTrunc. IsMultiUnitFPType if this is for a multi-unit floating-point type.
Definition at line 598 of file KnownFPClass.cpp.
References llvm::fcNegFinite, llvm::fcNegInf, llvm::fcPosFinite, llvm::fcPosInf, llvm::fcSubnormal, isKnownNever(), isKnownNeverNegInfinity(), isKnownNeverPosInfinity(), KnownFPClass(), knownNot(), and propagateNaN().
Referenced by computeKnownFPClass(), and llvm::InstCombinerImpl::SimplifyDemandedUseFPClass().
|
inline |
Return true if the sign bit must be 0, ignoring the sign of nans.
Definition at line 299 of file KnownFPClass.h.
References llvm::fcNegative, and isKnownNever().
|
inline |
Assume the sign bit is one.
Definition at line 308 of file KnownFPClass.h.
References llvm::fcNan, llvm::fcNegative, KnownFPClasses, and SignBit.
Referenced by computeKnownFPClass(), computeKnownFPClassFromCond(), and minMaxLike().
|
inline |
Assume the sign bit is zero.
Definition at line 302 of file KnownFPClass.h.
References llvm::fcNan, llvm::fcPositive, KnownFPClasses, and SignBit.
Referenced by computeKnownFPClass(), computeKnownFPClassFromCond(), fabs(), and minMaxLike().
|
static |
Report known values for sin.
Definition at line 547 of file KnownFPClass.cpp.
References llvm::fcInf, llvm::fcNan, isKnownNeverInfinity(), isKnownNeverNaN(), KnownFPClass(), and knownNot().
Referenced by computeKnownFPClass(), and cos().
|
static |
Propagate known class for sqrt.
Definition at line 522 of file KnownFPClass.cpp.
References cannotBeOrderedLessThanZero(), llvm::fcNan, llvm::fcNegInf, llvm::fcNegNormal, llvm::fcNegSubnormal, llvm::fcNegZero, llvm::fcPosInf, llvm::fcPosSubnormal, llvm::fcSNan, isKnownNever(), isKnownNeverLogicalNegZero(), isKnownNeverNaN(), isKnownNeverPosInfinity(), KnownFPClass(), and knownNot().
Referenced by computeKnownFPClass(), and llvm::InstCombinerImpl::SimplifyDemandedUseFPClass().
|
inlinestatic |
Definition at line 249 of file KnownFPClass.h.
References llvm::fcNegative, fmul(), llvm::DenormalMode::getDynamic(), KnownFPClass(), knownNot(), Mode, and propagateNaN().
Referenced by computeKnownFPClass(), fma_square(), and llvm::InstCombinerImpl::SimplifyDemandedUseFPClass().
|
inline |
Definition at line 146 of file KnownFPClass.h.
References KnownFPClass(), KnownFPClasses, RHS, and SignBit.
Referenced by llvm::adjustKnownFPClassForSelectArm().
| FPClassTest llvm::KnownFPClass::KnownFPClasses = fcAllFlags |
Floating-point classes the value could be one of.
Definition at line 28 of file KnownFPClass.h.
Referenced by canonicalize(), computeKnownFPClass(), copysign(), fabs(), fneg(), fpext(), intersectWith(), isKnownNever(), isUnknown(), KnownFPClass(), knownNot(), minMaxLike(), operator==(), operator|=(), propagateDenormal(), signBitMustBeOne(), signBitMustBeZero(), llvm::InstCombinerImpl::SimplifyDemandedFPClass(), simplifyDemandedFPClassMinMax(), simplifyDemandedFPClassResult(), llvm::InstCombinerImpl::SimplifyDemandedUseFPClass(), llvm::InstCombinerImpl::SimplifyMultipleUseDemandedFPClass(), and unionWith().
|
staticconstexpr |
Definition at line 104 of file KnownFPClass.h.
Referenced by cannotBeOrderedGreaterThanZero(), computeKnownFPClass(), fadd_impl(), ldexp(), minMaxLike(), and simplifyDemandedFPClassFnegFabs().
|
staticconstexpr |
Definition at line 102 of file KnownFPClass.h.
Referenced by llvm::cannotBeOrderedLessThanZero(), cannotBeOrderedLessThanZero(), computeKnownFPClass(), computeKnownFPClassForFPTrunc(), fadd_impl(), fptrunc(), ldexp(), minMaxLike(), simplifyDemandedFPClassFabs(), llvm::InstCombinerImpl::SimplifyDemandedUseFPClass(), and simplifyFCmpInst().
| std::optional<bool> llvm::KnownFPClass::SignBit |
std::nullopt if the sign bit is unknown, true if the sign bit is definitely set or false if the sign bit is definitely unset.
Definition at line 32 of file KnownFPClass.h.
Referenced by computeKnownFPClass(), llvm::computeKnownFPSignBit(), copysign(), fneg(), fpext(), intersectWith(), isUnknown(), KnownFPClass(), knownNot(), minMaxLike(), operator==(), operator|=(), propagateNaN(), signBitMustBeOne(), signBitMustBeZero(), simplifyDemandedFPClassCopysignMag(), simplifyDemandedFPClassFabs(), simplifyDemandedFPClassFnegFabs(), llvm::InstCombinerImpl::SimplifyDemandedUseFPClass(), simplifyFMAFMul(), llvm::InstCombinerImpl::SimplifyMultipleUseDemandedFPClass(), simplifyUnaryIntrinsic(), and unionWith().