|
LLVM 24.0.0git
|
#include "llvm/Support/KnownFPClass.h"
Public Types | |
| enum class | MinMaxKind { minimum , maximum , minimumnum , maximumnum , minnum , maxnum } |
Public Member Functions | |
| FPClassTest | getKnownFPClasses () const |
| Floating-point classes the value could be one of. | |
| void | setKnownFPClasses (FPClassTest Classes) |
| std::optional< bool > | getSignBit () const |
| 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. | |
| void | setSignBit (std::optional< bool > Sign) |
| 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 | cannotBeOrderedLessEqZero (DenormalMode Mode) const |
| Return true if it's known this can never be a positive value or a logical 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 () |
| LLVM_ABI KnownBits | toKnownBits (const fltSemantics &FltSemantics) const |
| Report known bits for a float with provided semantics. | |
| 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 | propagateNonSNaN (const KnownFPClass &Src) |
| void | propagateNonSNaN (const KnownFPClass &LHS, const KnownFPClass &RHS) |
| void | propagateNonNaN (const KnownFPClass &Src) |
| void | propagateNonNaN (const KnownFPClass &LHS, const KnownFPClass &RHS) |
| void | propagateXorSign (const KnownFPClass &LHS, const KnownFPClass &RHS, DenormalMode Mode) |
| 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 | KnownFPClassesValue = fcAllFlags |
| std::optional< bool > | SignBitValue |
Static Public Attributes | |
| static constexpr FPClassTest | OrderedLessThanZeroMask |
| static constexpr FPClassTest | OrderedGreaterThanZeroMask |
Definition at line 27 of file KnownFPClass.h.
|
strong |
| Enumerator | |
|---|---|
| minimum | |
| maximum | |
| minimumnum | |
| maximumnum | |
| minnum | |
| maxnum | |
Definition at line 243 of file KnownFPClass.h.
|
inline |
Definition at line 42 of file KnownFPClass.h.
References llvm::fcAllFlags, and llvm::Known.
Referenced by acos(), applyInputDenormalMode(), applyOutputDenormalMode(), asin(), atan(), atan2(), bitcast(), canonicalize(), copysign(), copysign(), cos(), cosh(), exp(), fabs(), fadd(), fadd_self(), fdiv(), fdiv_self(), fma(), fma_square(), fmul(), fmul(), fneg(), fpext(), fptrunc(), frem(), frem_self(), frexp_mant(), fsub(), intersectWith(), ldexp(), ldexp(), log(), minMaxLike(), operator==(), operator|=(), pow(), powi(), propagateCanonicalizingSrc(), propagateDenormal(), propagateNonNaN(), propagateNonNaN(), propagateNonSNaN(), propagateNonSNaN(), propagateXorSign(), resetAll(), roundToIntegral(), sin(), sinh(), sqrt(), square(), tan(), tanh(), and unionWith().
Definition at line 21 of file KnownFPClass.cpp.
References C(), KnownFPClassesValue, and setSignBit().
|
static |
Report known values for acos.
Definition at line 921 of file KnownFPClass.cpp.
References llvm::fcInf, llvm::fcNegative, llvm::fcPosNormal, llvm::fcSubnormal, llvm::fcZero, isKnownNever(), llvm::Known, and KnownFPClass().
Referenced by computeKnownFPClass().
|
static |
Return the known classes of Src after passing through an input that may flush subnormals to zero according to Mode.
Definition at line 26 of file KnownFPClass.cpp.
References llvm::fcNegSubnormal, llvm::fcNegZero, llvm::fcPosSubnormal, llvm::fcPosZero, llvm::fcSubnormal, getKnownFPClasses(), llvm::DenormalMode::IEEE, llvm::Known, KnownFPClass(), llvm_unreachable, llvm::DenormalMode::PositiveZero, and llvm::DenormalMode::PreserveSign.
Referenced by atan2(), isKnownNeverLogicalNegZero(), isKnownNeverLogicalPosZero(), isKnownNeverLogicalZero(), and ldexp().
|
static |
Return the known classes of Src after producing an output that may flush subnormals to zero according to Mode.
Definition at line 59 of file KnownFPClass.cpp.
References llvm::fcNegSubnormal, llvm::fcNegZero, llvm::fcPosSubnormal, llvm::fcPosZero, llvm::fcSubnormal, getKnownFPClasses(), llvm::DenormalMode::IEEE, llvm::Known, KnownFPClass(), llvm_unreachable, llvm::DenormalMode::PositiveZero, and llvm::DenormalMode::PreserveSign.
|
static |
Report known values for asin.
Definition at line 904 of file KnownFPClass.cpp.
References llvm::fcInf, llvm::fcNegFinite, isKnownNever(), llvm::Known, and KnownFPClass().
Referenced by computeKnownFPClass().
|
static |
Report known values for atan.
Definition at line 942 of file KnownFPClass.cpp.
References llvm::fcInf, llvm::fcNegative, isKnownNever(), llvm::Known, and KnownFPClass().
Referenced by computeKnownFPClass().
|
static |
Report known values for atan2.
Definition at line 957 of file KnownFPClass.cpp.
References applyInputDenormalMode(), applyOutputDenormalMode(), llvm::fcInf, llvm::fcNegative, llvm::fcPositive, llvm::fcSubnormal, llvm::fcZero, isKnownNever(), llvm::Known, and KnownFPClass().
Referenced by computeKnownFPClass().
|
static |
Report known values for a bitcast into a float with provided semantics.
Definition at line 268 of file KnownFPClass.cpp.
References assert(), llvm::fcInf, llvm::fcNan, llvm::fcNormal, llvm::fcQNan, llvm::fcSNan, llvm::fcSubnormal, llvm::fcZero, llvm::APInt::getBitsSet(), llvm::APInt::getLowBitsSet(), llvm::APFloatBase::isIEEELikeFP(), isZero(), llvm::Known, KnownFPClass(), llvm::fltSemantics::precision, llvm::APFloatBase::S_BFloat, llvm::APFloatBase::S_IEEEdouble, llvm::APFloatBase::S_IEEEhalf, llvm::APFloatBase::S_IEEEquad, llvm::APFloatBase::S_IEEEsingle, llvm::APFloatBase::S_x87DoubleExtended, llvm::APFloatBase::SemanticsToEnum(), and llvm::fltSemantics::sizeInBits.
Referenced by computeKnownFPClass(), llvm::SelectionDAG::computeKnownFPClass(), and tryReduceF64CompareToHiHalf().
|
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 159 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 137 of file KnownFPClass.h.
References isKnownNever(), and OrderedGreaterThanZeroMask.
Referenced by fadd_impl(), and ldexp().
|
inline |
Return true if it's known this can never be a positive value or a logical 0.
NaN --> true
x <= +0 --> false psub --> true if mode is ieee, false otherwise. x > +0 --> true
Definition at line 148 of file KnownFPClass.h.
References llvm::fcNegative, isKnownNever(), isKnownNeverLogicalPosZero(), and Mode.
|
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 126 of file KnownFPClass.h.
References isKnownNever(), and OrderedLessThanZeroMask.
Referenced by computeKnownFPClass(), fadd_impl(), fptrunc(), ldexp(), log(), simplifyFCmpInst(), simplifyUnaryIntrinsic(), and sqrt().
|
static |
Apply the canonicalize intrinsic to this value.
This is essentially a stronger form of propagateCanonicalizingSrc.
Definition at line 212 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(), getKnownFPClasses(), llvm::DenormalMode::getPreserveSign(), llvm::DenormalMode::IEEE, llvm::DenormalMode::Input, llvm::DenormalMode::inputsAreZero(), isKnownNever(), isKnownNeverNaN(), llvm::Known, KnownFPClass(), llvm::DenormalMode::Output, llvm::DenormalMode::outputsAreZero(), and llvm::DenormalMode::PositiveZero.
Referenced by computeKnownFPClass(), and llvm::InstCombinerImpl::SimplifyDemandedUseFPClass().
|
inlinestatic |
Definition at line 420 of file KnownFPClass.h.
References llvm::Known, and KnownFPClass().
|
inline |
Definition at line 396 of file KnownFPClass.h.
References llvm::fcInf, llvm::fcNan, llvm::fcNegative, llvm::fcNormal, llvm::fcPositive, llvm::fcSubnormal, llvm::fcZero, getKnownFPClasses(), getSignBit(), isKnownNever(), KnownFPClass(), setKnownFPClasses(), and setSignBit().
Referenced by llvm::InstCombinerImpl::SimplifyDemandedUseFPClass(), and llvm::InstCombinerImpl::SimplifyMultipleUseDemandedFPClass().
|
static |
Report known values for cos.
Definition at line 846 of file KnownFPClass.cpp.
References KnownFPClass(), and sin().
Referenced by computeKnownFPClass().
|
static |
Report known values for cosh.
Definition at line 877 of file KnownFPClass.cpp.
References llvm::fcNegative, llvm::fcSubnormal, llvm::fcZero, llvm::Known, and KnownFPClass().
Referenced by computeKnownFPClass().
|
static |
Report known values for exp, exp2 and exp10.
This function assumes that exp10(-1.0) = +0.1 and exp10(+1.0) = +10.0 are both finite normal values, which holds for formats with a corresponding LLVM IR type (e.g. does not hold for Float4E2M1FN).
Definition at line 759 of file KnownFPClass.cpp.
References llvm::fcNegative, llvm::fcNegInf, llvm::fcNegNormal, llvm::fcPosInf, llvm::fcPosNormal, llvm::fcPosSubnormal, llvm::fcPosZero, isKnownNever(), llvm::Known, and KnownFPClass().
Referenced by computeKnownFPClass(), and llvm::InstCombinerImpl::SimplifyDemandedUseFPClass().
|
inline |
Definition at line 220 of file KnownFPClass.h.
References llvm::fcNegInf, llvm::fcNegNormal, llvm::fcNegSubnormal, llvm::fcNegZero, llvm::fcPosInf, llvm::fcPosNormal, llvm::fcPosSubnormal, llvm::fcPosZero, getKnownFPClasses(), setKnownFPClasses(), and signBitMustBeZero().
Referenced by simplifyDemandedFPClassFabs(), and simplifyDemandedFPClassFnegFabs().
|
inlinestatic |
Definition at line 236 of file KnownFPClass.h.
References llvm::Known, and KnownFPClass().
|
static |
Report known values for fadd.
Definition at line 500 of file KnownFPClass.cpp.
References fadd_impl(), llvm::fcNegZero, llvm::DenormalMode::IEEE, isKnownNeverLogicalNegZero(), llvm::Known, KnownFPClass(), 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 518 of file KnownFPClass.cpp.
References fadd(), llvm::fcPosZero, llvm::DenormalMode::IEEE, isKnownNeverLogicalPosZero(), isKnownNeverPosSubnormal(), isKnownNeverSubnormal(), llvm::Known, KnownFPClass(), llvm::DenormalMode::PositiveZero, and llvm::DenormalMode::PreserveSign.
Referenced by computeKnownFPClass(), and llvm::InstCombinerImpl::SimplifyDemandedUseFPClass().
|
static |
Report known values for fdiv.
Definition at line 603 of file KnownFPClass.cpp.
References llvm::fcFinite, llvm::fcInf, llvm::fcNan, llvm::fcNegNormal, llvm::fcNegSubnormal, llvm::fcNormal, llvm::fcPosNormal, llvm::fcPosSubnormal, llvm::fcSubnormal, llvm::fcZero, isKnownAlways(), isKnownNever(), isKnownNeverInfinity(), isKnownNeverLogicalZero(), isKnownNeverNaN(), llvm::Known, and KnownFPClass().
Referenced by computeKnownFPClass(), and llvm::InstCombinerImpl::SimplifyDemandedUseFPClass().
|
static |
Report known values for fdiv x, x.
Definition at line 646 of file KnownFPClass.cpp.
References llvm::fcNan, llvm::fcPosNormal, isKnownNeverInfOrNaN(), isKnownNeverLogicalZero(), llvm::Known, and KnownFPClass().
Referenced by computeKnownFPClass().
|
static |
Report known values for fma.
Definition at line 718 of file KnownFPClass.cpp.
References fadd_impl(), llvm::fcSNan, fmul(), isKnownNever(), llvm::Known, KnownFPClass(), and llvm::Mul.
Referenced by computeKnownFPClass(), and llvm::InstCombinerImpl::SimplifyDemandedUseFPClass().
|
static |
Report known values for fma squared, squared, addend.
Definition at line 739 of file KnownFPClass.cpp.
References fadd_impl(), llvm::fcNan, llvm::fcNegInf, isKnownNever(), llvm::Known, KnownFPClass(), and square().
Referenced by computeKnownFPClass(), and llvm::InstCombinerImpl::SimplifyDemandedUseFPClass().
|
static |
Definition at line 575 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(), llvm::Known, KnownFPClass(), and llvm::APFloatBase::semanticsPrecision().
|
static |
Report known values for fmul.
Definition at line 540 of file KnownFPClass.cpp.
References llvm::fcInf, llvm::fcNan, llvm::fcNormal, llvm::fcSubnormal, llvm::fcZero, isKnownAlways(), isKnownNeverInfinity(), isKnownNeverLogicalZero(), isKnownNeverNaN(), llvm::Known, and KnownFPClass().
Referenced by computeKnownFPClass(), fma(), fmul(), llvm::InstCombinerImpl::SimplifyDemandedUseFPClass(), and square().
|
inline |
Definition at line 208 of file KnownFPClass.h.
References llvm::fneg(), getKnownFPClasses(), getSignBit(), setKnownFPClasses(), and setSignBit().
Referenced by fsub(), and simplifyDemandedFPClassFnegFabs().
|
inlinestatic |
Definition at line 214 of file KnownFPClass.h.
References llvm::Known, and KnownFPClass().
|
static |
Propagate known class for fpext.
Definition at line 989 of file KnownFPClass.cpp.
References llvm::fcNegNormal, llvm::fcNegSubnormal, llvm::fcPosNormal, llvm::fcPosSubnormal, llvm::fcSubnormal, llvm::APFloatBase::isRepresentableAsNormalIn(), llvm::Known, and KnownFPClass().
Referenced by computeKnownFPClass(), and llvm::InstCombinerImpl::SimplifyDemandedUseFPClass().
|
static |
Propagate known class for fptrunc.
Definition at line 1011 of file KnownFPClass.cpp.
References cannotBeOrderedLessThanZero(), llvm::Known, KnownFPClass(), and OrderedLessThanZeroMask.
Referenced by computeKnownFPClassForFPTrunc(), and simplifyDemandedUseFPClassFPTrunc().
|
static |
Report known values for frem.
Definition at line 659 of file KnownFPClass.cpp.
References llvm::fcInf, llvm::fcNan, llvm::fcNegFinite, llvm::fcNegNormal, llvm::fcNegSubnormal, llvm::fcNegZero, llvm::fcPosFinite, llvm::fcPosNormal, llvm::fcPosSubnormal, llvm::fcPosZero, isKnownNever(), isKnownNeverInfOrNaN(), isKnownNeverLogicalPosZero(), isKnownNeverLogicalZero(), isKnownNeverNaN(), llvm::Known, and KnownFPClass().
Referenced by computeKnownFPClass().
|
static |
Report known values for frem x, x.
Definition at line 697 of file KnownFPClass.cpp.
References llvm::fcNan, llvm::fcNegNormal, llvm::fcNegSubnormal, llvm::fcNegZero, llvm::fcPosNormal, llvm::fcPosSubnormal, llvm::fcPosZero, llvm::fcZero, isKnownNever(), isKnownNeverInfOrNaN(), isKnownNeverLogicalZero(), llvm::Known, and KnownFPClass().
Referenced by computeKnownFPClass().
|
static |
Propagate known class for mantissa component of frexp.
Definition at line 1063 of file KnownFPClass.cpp.
References llvm::fcNegInf, llvm::fcNegNormal, llvm::fcNegSubnormal, llvm::fcNegZero, llvm::fcPosInf, llvm::fcPosNormal, llvm::fcPosSubnormal, llvm::fcPosZero, llvm::fcSubnormal, isKnownNever(), isKnownNeverLogicalNegZero(), isKnownNeverLogicalPosZero(), isKnownNeverNegInfinity(), isKnownNeverPosInfinity(), llvm::Known, and KnownFPClass().
Referenced by computeKnownFPClass(), and llvm::InstCombinerImpl::SimplifyDemandedUseFPClass().
|
static |
Report known values for fsub.
Definition at line 534 of file KnownFPClass.cpp.
References fadd(), fneg(), and KnownFPClass().
Referenced by computeKnownFPClass(), and llvm::InstCombinerImpl::SimplifyDemandedUseFPClass().
|
inline |
Floating-point classes the value could be one of.
Definition at line 32 of file KnownFPClass.h.
References KnownFPClassesValue.
Referenced by applyInputDenormalMode(), applyOutputDenormalMode(), canonicalize(), computeKnownFPClass(), copysign(), fabs(), fneg(), intersectWith(), isKnownNever(), isUnknown(), knownNot(), ldexp(), minMaxLike(), operator==(), operator|=(), printGISelValueTracking(), propagateDenormal(), signBitMustBeOne(), signBitMustBeZero(), simplifyDemandedFPClassMinMax(), toKnownBits(), and unionWith().
|
inline |
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 38 of file KnownFPClass.h.
References SignBitValue.
Referenced by computeKnownFPClass(), copysign(), fneg(), intersectWith(), isUnknown(), knownNot(), minMaxLike(), operator==(), operator|=(), printGISelValueTracking(), simplifyDemandedFPClassCopysignMag(), simplifyDemandedFPClassFabs(), simplifyDemandedFPClassFnegFabs(), llvm::InstCombinerImpl::SimplifyDemandedUseFPClass(), llvm::InstCombinerImpl::SimplifyMultipleUseDemandedFPClass(), simplifyUnaryIntrinsic(), toKnownBits(), and unionWith().
|
inline |
Definition at line 173 of file KnownFPClass.h.
References getKnownFPClasses(), getSignBit(), KnownFPClass(), and RHS.
Referenced by llvm::SelectionDAG::computeKnownFPClass(), llvm::InstCombinerImpl::SimplifyDemandedUseFPClass(), and llvm::InstCombinerImpl::SimplifyMultipleUseDemandedFPClass().
|
inline |
Definition at line 56 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 66 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 52 of file KnownFPClass.h.
References llvm::fcNone, and getKnownFPClasses().
Referenced by acos(), addNoUndefAttrs(), asin(), atan(), atan2(), cannotBeOrderedGreaterEqZero(), cannotBeOrderedGreaterThanZero(), cannotBeOrderedLessEqZero(), cannotBeOrderedLessThanZero(), canonicalize(), computeKnownBitsFromOperator(), computeKnownFPClass(), copysign(), exp(), fadd_impl(), fdiv(), fma(), fma_square(), fmul(), foldFPtoI(), frem(), frem_self(), frexp_mant(), isKnownAlways(), isKnownNeverInfinity(), isKnownNeverInfOrNaN(), llvm::GISelValueTracking::isKnownNeverNaN(), isKnownNeverNaN(), isKnownNeverNegInfinity(), isKnownNeverNegSubnormal(), isKnownNeverNegZero(), isKnownNeverPosInfinity(), isKnownNeverPosSubnormal(), isKnownNeverPosZero(), isKnownNeverSubnormal(), isKnownNeverZero(), knownNot(), ldexp(), pow(), powi(), roundToIntegral(), signBitIsZeroOrNaN(), simplifyDemandedFPClassFabs(), simplifyDemandedFPClassFnegFabs(), simplifyDemandedFPClassMinMax(), llvm::InstCombinerImpl::SimplifyDemandedUseFPClass(), llvm::InstCombinerImpl::SimplifyMultipleUseDemandedFPClass(), simplifyX86FPMaxMin(), sinh(), tanh(), and toKnownBits().
|
inline |
Return true if it's known this can never be an infinity.
Definition at line 69 of file KnownFPClass.h.
References llvm::fcInf, and isKnownNever().
Referenced by fdiv(), fmul(), inferFastMathValueFlags(), sin(), and tan().
|
inline |
Return true if it's known this can never be an infinity or nan.
Definition at line 72 of file KnownFPClass.h.
References llvm::fcInf, llvm::fcNan, and isKnownNever().
Referenced by llvm::GCNTTIImpl::canSimplifyLegacyMulToMul(), llvm::computeConstantRange(), computeKnownFPClass(), fdiv_self(), frem(), 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 96 of file KnownFPClass.cpp.
References applyInputDenormalMode(), and isKnownNeverNegZero().
Referenced by cannotBeOrderedGreaterEqZero(), computeKnownFPClass(), fadd(), frexp_mant(), 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 100 of file KnownFPClass.cpp.
References applyInputDenormalMode(), and isKnownNeverPosZero().
Referenced by cannotBeOrderedLessEqZero(), computeKnownFPClass(), fadd_self(), frem(), frexp_mant(), 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 92 of file KnownFPClass.cpp.
References applyInputDenormalMode(), and isKnownNeverZero().
Referenced by llvm::GCNTTIImpl::canSimplifyLegacyMulToMul(), llvm::computeConstantRange(), fdiv(), fdiv_self(), fmul(), frem(), frem_self(), log(), and llvm::InstCombinerImpl::SimplifyDemandedUseFPClass().
|
inline |
Return true if it's known this can never be a nan.
Definition at line 63 of file KnownFPClass.h.
References llvm::fcNan, and isKnownNever().
Referenced by canonicalize(), computeKnownFPClass(), fadd_impl(), fdiv(), fmul(), llvm::InstCombinerImpl::foldSelectIntoOp(), frem(), inferFastMathValueFlags(), llvm::GISelValueTracking::isKnownNeverNaN(), log(), minMaxLike(), pow(), llvm::InstCombinerImpl::SimplifyDemandedUseFPClass(), simplifyFCmpInst(), simplifyUnaryIntrinsic(), sin(), sqrt(), tan(), and tryReduceF64CompareToHiHalf().
|
inline |
Return true if it's known this can never be -infinity.
Definition at line 78 of file KnownFPClass.h.
References llvm::fcNegInf, and isKnownNever().
Referenced by frexp_mant(), ldexp(), and roundToIntegral().
|
inline |
Return true if it's known this can never be a negative subnormal.
Definition at line 87 of file KnownFPClass.h.
References llvm::fcNegSubnormal, and isKnownNever().
Referenced by 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 98 of file KnownFPClass.h.
References llvm::fcNegZero, and isKnownNever().
Referenced by isKnownNeverLogicalNegZero(), ldexp(), and minMaxLike().
|
inline |
Return true if it's known this can never be +infinity.
Definition at line 75 of file KnownFPClass.h.
References llvm::fcPosInf, and isKnownNever().
Referenced by computeKnownFPClass(), frexp_mant(), ldexp(), log(), roundToIntegral(), and sqrt().
|
inline |
Return true if it's known this can never be a positive subnormal.
Definition at line 84 of file KnownFPClass.h.
References llvm::fcPosSubnormal, and isKnownNever().
Referenced by fadd_self(), and ldexp().
|
inline |
Return true if it's known this can never be a literal positive zero.
Definition at line 94 of file KnownFPClass.h.
References llvm::fcPosZero, and isKnownNever().
Referenced by isKnownNeverLogicalPosZero(), ldexp(), and minMaxLike().
|
inline |
Return true if it's known this can never be a subnormal.
Definition at line 81 of file KnownFPClass.h.
References llvm::fcSubnormal, and isKnownNever().
Referenced by llvm::computeConstantRange(), fadd_self(), 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 91 of file KnownFPClass.h.
References llvm::fcZero, and isKnownNever().
Referenced by isKnownNeverLogicalZero(), and llvm::LegalizerHelper::lowerFMinimumMaximum().
|
inline |
Definition at line 58 of file KnownFPClass.h.
References llvm::fcAllFlags, getKnownFPClasses(), and getSignBit().
Referenced by llvm::adjustKnownFPClassForSelectArm(), computeKnownFPClass(), llvm::SelectionDAG::computeKnownFPClass(), and llvm::InstCombinerImpl::SimplifyMultipleUseDemandedFPClass().
|
inline |
Definition at line 198 of file KnownFPClass.h.
References llvm::fcNan, llvm::fcNegative, llvm::fcPositive, getKnownFPClasses(), getSignBit(), isKnownNever(), setKnownFPClasses(), and setSignBit().
Referenced by computeKnownFPClass(), computeKnownFPClassFromCond(), propagateNonNaN(), propagateNonNaN(), propagateNonSNaN(), propagateNonSNaN(), propagateXorSign(), simplifyDemandedFPClassFabs(), simplifyDemandedFPClassFnegFabs(), llvm::InstCombinerImpl::SimplifyDemandedUseFPClass(), and llvm::InstCombinerImpl::SimplifyMultipleUseDemandedFPClass().
|
static |
Propagate known class for ldexp, assuming the exponent is known to be within [ConstantRangeMin, ConstantRangeMax].
Definition at line 1094 of file KnownFPClass.cpp.
References applyInputDenormalMode(), applyOutputDenormalMode(), cannotBeOrderedGreaterThanZero(), cannotBeOrderedLessThanZero(), llvm::fcNan, llvm::fcNegative, llvm::fcNegInf, llvm::fcNegSubnormal, llvm::fcNegZero, llvm::fcPosInf, llvm::fcPositive, llvm::fcPosSubnormal, llvm::fcPosZero, llvm::fcSubnormal, getKnownFPClasses(), isKnownNever(), isKnownNeverNegInfinity(), isKnownNeverNegSubnormal(), isKnownNeverNegZero(), isKnownNeverPosInfinity(), isKnownNeverPosSubnormal(), isKnownNeverPosZero(), llvm::APInt::isNonNegative(), llvm::APInt::isNonPositive(), llvm::APInt::isZero(), llvm::Known, KnownFPClass(), OrderedGreaterThanZeroMask, OrderedLessThanZeroMask, llvm::APFloatBase::PPCDoubleDouble(), llvm::APFloatBase::semanticsPrecision(), and llvm::APInt::sge().
Referenced by computeKnownFPClass(), ldexp(), and llvm::InstCombinerImpl::SimplifyDemandedUseFPClass().
|
static |
Definition at line 1152 of file KnownFPClass.cpp.
References llvm::KnownBits::getSignedMaxValue(), llvm::KnownBits::getSignedMinValue(), KnownFPClass(), and ldexp().
|
static |
Propagate known class for log/log2/log10.
Definition at line 789 of file KnownFPClass.cpp.
References cannotBeOrderedLessThanZero(), llvm::fcNan, llvm::fcNegInf, llvm::fcNegZero, llvm::fcPosInf, llvm::fcSubnormal, isKnownNeverLogicalZero(), isKnownNeverNaN(), isKnownNeverPosInfinity(), llvm::Known, and KnownFPClass().
Referenced by computeKnownFPClass(), and llvm::InstCombinerImpl::SimplifyDemandedUseFPClass().
|
static |
Definition at line 131 of file KnownFPClass.cpp.
References llvm::fcNan, llvm::fcNone, llvm::fcZero, llvm::DenormalMode::getIEEE(), getKnownFPClasses(), getSignBit(), isKnownNeverNaN(), isKnownNeverNegZero(), isKnownNeverPosZero(), llvm::Known, KnownFPClass(), llvm_unreachable, maximum, maximumnum, maxnum, minimum, minimumnum, minnum, llvm::orderedStrictlyGreater(), llvm::orderedStrictlyLess(), and setSignBit().
Referenced by computeKnownFPClass(), and simplifyDemandedFPClassMinMax().
|
inline |
Definition at line 46 of file KnownFPClass.h.
References getKnownFPClasses(), getSignBit(), KnownFPClass(), and llvm::Other.
|
inline |
Definition at line 190 of file KnownFPClass.h.
References getKnownFPClasses(), getSignBit(), KnownFPClass(), RHS, setKnownFPClasses(), and setSignBit().
|
static |
Propagate known class for pow.
Definition at line 1159 of file KnownFPClass.cpp.
References llvm::fcNan, llvm::fcNegative, llvm::fcNegInf, llvm::fcNegNormal, llvm::fcNegSubnormal, llvm::fcNegZero, llvm::fcPosNormal, isKnownNever(), isKnownNeverNaN(), llvm::Known, and KnownFPClass().
Referenced by computeKnownFPClass().
|
static |
Propagate known class for powi.
Definition at line 1201 of file KnownFPClass.cpp.
References llvm::fcInf, llvm::fcNan, llvm::fcNegative, llvm::fcNegInf, llvm::fcNegNormal, llvm::fcNegSubnormal, llvm::fcNegZero, llvm::fcNormal, llvm::fcPosNormal, llvm::fcSNan, llvm::fcSubnormal, llvm::fcZero, llvm::KnownBits::getSignedMaxValue(), llvm::KnownBits::getSignedMinValue(), llvm::KnownBits::isEven(), isKnownNever(), llvm::APInt::isNegative(), llvm::KnownBits::isNegative(), llvm::KnownBits::isNonNegative(), llvm::APInt::isStrictlyPositive(), llvm::APInt::isZero(), llvm::KnownBits::isZero(), llvm::Known, KnownFPClass(), llvm::APInt::sgt(), llvm::APInt::slt(), and llvm::KnownBits::Zero.
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 783 of file KnownFPClass.cpp.
References KnownFPClass(), propagateDenormal(), and propagateNonNaN().
| 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 104 of file KnownFPClass.cpp.
References llvm::DenormalMode::Dynamic, llvm::fcNegZero, llvm::fcPosZero, llvm::DenormalMode::getIEEE(), getKnownFPClasses(), llvm::DenormalMode::getPositiveZero(), KnownFPClass(), llvm::DenormalMode::PositiveZero, and setKnownFPClasses().
Referenced by propagateCanonicalizingSrc().
|
inline |
Definition at line 448 of file KnownFPClass.h.
References llvm::fcNan, KnownFPClass(), knownNot(), LHS, propagateNonSNaN(), and RHS.
|
inline |
Definition at line 442 of file KnownFPClass.h.
References llvm::fcNan, KnownFPClass(), knownNot(), and propagateNonSNaN().
Referenced by propagateCanonicalizingSrc().
|
inline |
Definition at line 434 of file KnownFPClass.h.
References llvm::fcSNan, KnownFPClass(), knownNot(), LHS, and RHS.
|
inline |
Definition at line 428 of file KnownFPClass.h.
References llvm::fcSNan, KnownFPClass(), and knownNot().
Referenced by propagateNonNaN(), and propagateNonNaN().
|
inline |
Definition at line 457 of file KnownFPClass.h.
References llvm::fcNegative, llvm::fcPosInf, llvm::fcPositive, llvm::fcPosNormal, llvm::fcPosSubnormal, llvm::fcPosZero, KnownFPClass(), knownNot(), LHS, Mode, and RHS.
|
inline |
Definition at line 533 of file KnownFPClass.h.
References KnownFPClass().
|
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 1025 of file KnownFPClass.cpp.
References llvm::fcNegFinite, llvm::fcNegInf, llvm::fcNegNormal, llvm::fcNegSubnormal, llvm::fcNegZero, llvm::fcPosFinite, llvm::fcPosInf, llvm::fcPosNormal, llvm::fcPosSubnormal, llvm::fcPosZero, llvm::fcSubnormal, isKnownNever(), isKnownNeverNegInfinity(), isKnownNeverPosInfinity(), llvm::Known, and KnownFPClass().
Referenced by computeKnownFPClass(), and llvm::InstCombinerImpl::SimplifyDemandedUseFPClass().
|
inline |
Definition at line 34 of file KnownFPClass.h.
References KnownFPClassesValue.
Referenced by copysign(), fabs(), fneg(), knownNot(), operator|=(), propagateDenormal(), signBitMustBeOne(), and signBitMustBeZero().
|
inline |
Definition at line 40 of file KnownFPClass.h.
References SignBitValue.
Referenced by copysign(), fneg(), KnownFPClass(), knownNot(), minMaxLike(), operator|=(), signBitMustBeOne(), and signBitMustBeZero().
|
inline |
Return true if the sign bit must be 0, ignoring the sign of nans.
Definition at line 382 of file KnownFPClass.h.
References llvm::fcNegative, and isKnownNever().
Referenced by llvm::AMDGPUTargetLowering::lowerFPOW().
|
inline |
Assume the sign bit is one.
Definition at line 391 of file KnownFPClass.h.
References llvm::fcNan, llvm::fcNegative, getKnownFPClasses(), setKnownFPClasses(), and setSignBit().
Referenced by computeKnownFPClassFromCond().
|
inline |
Assume the sign bit is zero.
Definition at line 385 of file KnownFPClass.h.
References llvm::fcNan, llvm::fcPositive, getKnownFPClasses(), setKnownFPClasses(), and setSignBit().
Referenced by computeKnownFPClassFromCond(), and fabs().
|
static |
Report known values for sin.
Definition at line 833 of file KnownFPClass.cpp.
References llvm::fcInf, llvm::fcNan, isKnownNeverInfinity(), isKnownNeverNaN(), llvm::Known, and KnownFPClass().
Referenced by computeKnownFPClass(), and cos().
|
static |
Report known values for sinh.
Definition at line 865 of file KnownFPClass.cpp.
References llvm::fcNegative, isKnownNever(), llvm::Known, and KnownFPClass().
Referenced by computeKnownFPClass().
|
static |
Propagate known class for sqrt.
Definition at line 808 of file KnownFPClass.cpp.
References cannotBeOrderedLessThanZero(), llvm::fcNan, llvm::fcNegInf, llvm::fcNegNormal, llvm::fcNegSubnormal, llvm::fcNegZero, llvm::fcPosInf, llvm::fcPosSubnormal, isKnownNeverLogicalNegZero(), isKnownNeverNaN(), isKnownNeverPosInfinity(), llvm::Known, and KnownFPClass().
Referenced by computeKnownFPClass(), and llvm::InstCombinerImpl::SimplifyDemandedUseFPClass().
|
inlinestatic |
Definition at line 290 of file KnownFPClass.h.
References llvm::fcNegative, fmul(), llvm::DenormalMode::getDynamic(), llvm::Known, KnownFPClass(), and Mode.
Referenced by computeKnownFPClass(), fma_square(), and llvm::InstCombinerImpl::SimplifyDemandedUseFPClass().
|
static |
Report known values for tan.
Definition at line 850 of file KnownFPClass.cpp.
References llvm::fcInf, llvm::fcNan, isKnownNeverInfinity(), isKnownNeverNaN(), llvm::Known, and KnownFPClass().
Referenced by computeKnownFPClass().
|
static |
Report known values for tanh.
Definition at line 889 of file KnownFPClass.cpp.
References llvm::fcInf, llvm::fcNegative, isKnownNever(), llvm::Known, and KnownFPClass().
Referenced by computeKnownFPClass().
| KnownBits KnownFPClass::toKnownBits | ( | const fltSemantics & | FltSemantics | ) | const |
Report known bits for a float with provided semantics.
Definition at line 350 of file KnownFPClass.cpp.
References llvm::BitWidth, llvm::APInt::clearBit(), llvm::fcInf, llvm::fcNan, llvm::fcNone, llvm::fcNormal, llvm::fcQNan, llvm::fcSNan, llvm::fcSubnormal, llvm::fcZero, llvm::APInt::getBitsSet(), llvm::APFloat::getInf(), getKnownFPClasses(), llvm::APInt::getLowBitsSet(), getSignBit(), llvm::APInt::getZero(), isKnownNever(), llvm::Known, llvm_unreachable, llvm::KnownBits::makeConstant(), llvm::fltSemantics::precision, llvm::APFloatBase::S_BFloat, llvm::APFloatBase::S_IEEEdouble, llvm::APFloatBase::S_IEEEhalf, llvm::APFloatBase::S_IEEEquad, llvm::APFloatBase::S_IEEEsingle, llvm::APFloatBase::S_x87DoubleExtended, llvm::APFloatBase::SemanticsToEnum(), and llvm::fltSemantics::sizeInBits.
|
inline |
Definition at line 179 of file KnownFPClass.h.
References getKnownFPClasses(), getSignBit(), KnownFPClass(), and RHS.
Referenced by llvm::adjustKnownFPClassForSelectArm().
| FPClassTest llvm::KnownFPClass::KnownFPClassesValue = fcAllFlags |
Definition at line 28 of file KnownFPClass.h.
Referenced by getKnownFPClasses(), KnownFPClass(), and setKnownFPClasses().
|
staticconstexpr |
Definition at line 115 of file KnownFPClass.h.
Referenced by cannotBeOrderedGreaterThanZero(), fadd_impl(), ldexp(), and simplifyDemandedFPClassFnegFabs().
|
staticconstexpr |
Definition at line 113 of file KnownFPClass.h.
Referenced by llvm::cannotBeOrderedLessThanZero(), cannotBeOrderedLessThanZero(), computeKnownFPClass(), computeKnownFPClassForFPTrunc(), fadd_impl(), fptrunc(), ldexp(), simplifyDemandedFPClassFabs(), llvm::InstCombinerImpl::SimplifyDemandedUseFPClass(), and simplifyFCmpInst().
| std::optional<bool> llvm::KnownFPClass::SignBitValue |
Definition at line 29 of file KnownFPClass.h.
Referenced by getSignBit(), and setSignBit().