|
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 | 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(), ceil(), copysign(), copysign(), cos(), cosh(), exp(), fabs(), fadd(), fadd_self(), fdiv(), fdiv_self(), floor(), fma(), fma_square(), fmul(), fmul(), fmuladd(), fmuladd_square(), fneg(), fpext(), fptrunc(), frem(), frem_self(), frexp_mant(), fsub(), intersectWith(), ldexp(), ldexp(), log(), minMaxLike(), operator==(), operator|=(), pow(), powi(), propagateNonNaN(), propagateNonNaN(), propagateNonSNaN(), propagateNonSNaN(), resetAll(), roundToIntegral(), sin(), sinh(), sqrt(), square(), tan(), tanh(), trunc(), and unionWith().
Definition at line 21 of file KnownFPClass.cpp.
References C(), KnownFPClassesValue, and setSignBit().
|
static |
Report known values for acos.
Definition at line 1029 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(), fadd(), fadd_self(), fdiv(), fmul(), fsub(), isKnownNeverLogicalNegZero(), isKnownNeverLogicalPosZero(), isKnownNeverLogicalZero(), ldexp(), and minMaxLike().
|
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.
Referenced by atan2(), fadd(), fadd_self(), fdiv(), fmul(), fsub(), ldexp(), and minMaxLike().
|
static |
Report known values for asin.
Definition at line 1009 of file KnownFPClass.cpp.
References llvm::fcInf, llvm::fcNegFinite, llvm::fcPosNormal, llvm::fcPosSubnormal, isKnownNever(), llvm::Known, and KnownFPClass().
Referenced by computeKnownFPClass().
|
static |
Report known values for atan.
Definition at line 1050 of file KnownFPClass.cpp.
References llvm::fcInf, llvm::fcNegInf, llvm::fcNegNormal, llvm::fcNegSubnormal, llvm::fcNegZero, llvm::fcPosInf, llvm::fcPosNormal, llvm::fcPosSubnormal, isKnownNever(), llvm::Known, and KnownFPClass().
Referenced by computeKnownFPClass().
|
static |
Report known values for atan2.
Definition at line 1075 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 234 of file KnownFPClass.cpp.
References assert(), llvm::BitWidth, llvm::fcInf, llvm::fcNan, llvm::fcNormal, llvm::fcQNan, llvm::fcSNan, llvm::fcSubnormal, llvm::fcZero, llvm::APInt::getBitsSet(), llvm::APInt::getLowBitsSet(), isZero(), llvm::Known, KnownFPClass(), llvm_unreachable, 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.
Definition at line 182 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().
|
static |
Propagate known class for ceil.
IsMultiUnitFPType if this is for a multi-unit floating-point type.
Definition at line 1204 of file KnownFPClass.cpp.
References llvm::fcNegInf, isKnownNeverNegInfinity(), llvm::Known, KnownFPClass(), and roundToIntegral().
Referenced by computeKnownFPClass(), and llvm::InstCombinerImpl::SimplifyDemandedUseFPClass().
|
inlinestatic |
Definition at line 432 of file KnownFPClass.h.
References llvm::Known, and KnownFPClass().
|
inline |
Definition at line 408 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 935 of file KnownFPClass.cpp.
References KnownFPClass(), and sin().
Referenced by computeKnownFPClass().
|
static |
Report known values for cosh.
Definition at line 972 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 850 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 553 of file KnownFPClass.cpp.
References applyInputDenormalMode(), applyOutputDenormalMode(), fadd_impl(), llvm::Known, and KnownFPClass().
Referenced by computeKnownFPClass(), fmuladd(), fmuladd_square(), and llvm::InstCombinerImpl::SimplifyDemandedUseFPClass().
|
static |
Report known values for fadd x, x.
Definition at line 564 of file KnownFPClass.cpp.
References applyInputDenormalMode(), applyOutputDenormalMode(), fadd_impl(), llvm::fcNegSubnormal, llvm::fcPosSubnormal, llvm::fcPosZero, isKnownNever(), llvm::Known, and KnownFPClass().
Referenced by computeKnownFPClass(), and llvm::InstCombinerImpl::SimplifyDemandedUseFPClass().
|
static |
Report known values for fdiv.
Definition at line 666 of file KnownFPClass.cpp.
References applyInputDenormalMode(), applyOutputDenormalMode(), llvm::fcFinite, llvm::fcInf, llvm::fcNan, llvm::fcNegative, llvm::fcNegNormal, llvm::fcNegSubnormal, llvm::fcNormal, llvm::fcPositive, llvm::fcPosNormal, llvm::fcPosSubnormal, llvm::fcSubnormal, llvm::fcZero, isKnownAlways(), isKnownNever(), isKnownNeverInfinity(), isKnownNeverNaN(), isKnownNeverZero(), llvm::Known, and KnownFPClass().
Referenced by computeKnownFPClass(), and llvm::InstCombinerImpl::SimplifyDemandedUseFPClass().
|
static |
Report known values for fdiv x, x.
Definition at line 718 of file KnownFPClass.cpp.
References llvm::fcNan, llvm::fcPosNormal, isKnownNeverInfOrNaN(), isKnownNeverLogicalZero(), llvm::Known, and KnownFPClass().
Referenced by computeKnownFPClass().
|
static |
Propagate known class for floor.
IsMultiUnitFPType if this is for a multi-unit floating-point type.
Definition at line 1193 of file KnownFPClass.cpp.
References llvm::fcPosInf, isKnownNeverPosInfinity(), llvm::Known, KnownFPClass(), and roundToIntegral().
Referenced by computeKnownFPClass(), and llvm::InstCombinerImpl::SimplifyDemandedUseFPClass().
|
static |
Report known values for fma.
Definition at line 790 of file KnownFPClass.cpp.
References fadd_impl(), llvm::fcSNan, fmul(), isKnownNever(), llvm::Known, KnownFPClass(), and llvm::Mul.
Referenced by computeKnownFPClass(), fmuladd(), and llvm::InstCombinerImpl::SimplifyDemandedUseFPClass().
|
static |
Report known values for fma squared, squared, addend.
Definition at line 822 of file KnownFPClass.cpp.
References fadd_impl(), llvm::fcNan, llvm::fcNegInf, isKnownNever(), llvm::Known, KnownFPClass(), and square().
Referenced by computeKnownFPClass(), fmuladd_square(), and llvm::InstCombinerImpl::SimplifyDemandedUseFPClass().
|
static |
Definition at line 638 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 597 of file KnownFPClass.cpp.
References applyInputDenormalMode(), applyOutputDenormalMode(), llvm::fcInf, llvm::fcNan, llvm::fcNegative, llvm::fcNormal, llvm::fcPositive, llvm::fcSubnormal, llvm::fcZero, isKnownAlways(), isKnownNever(), isKnownNeverInfinity(), isKnownNeverNaN(), isKnownNeverZero(), llvm::Known, and KnownFPClass().
Referenced by computeKnownFPClass(), fma(), fmul(), fmuladd(), llvm::InstCombinerImpl::SimplifyDemandedUseFPClass(), and square().
|
static |
Report known values for fmuladd.
Definition at line 811 of file KnownFPClass.cpp.
References fadd(), fma(), fmul(), and KnownFPClass().
Referenced by computeKnownFPClass().
|
static |
Report known values for fmuladd squared, squared, addend.
Definition at line 842 of file KnownFPClass.cpp.
References fadd(), fma_square(), KnownFPClass(), and square().
Referenced by computeKnownFPClass().
|
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 1107 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 1129 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 731 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 769 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 1215 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 582 of file KnownFPClass.cpp.
References applyInputDenormalMode(), applyOutputDenormalMode(), fadd_impl(), fneg(), llvm::Known, 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(), 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(), 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(), fadd_self(), fdiv(), fma(), fma_square(), fmul(), 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(), 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(), 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_self(), 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 ceil(), frexp_mant(), ldexp(), roundToIntegral(), and trunc().
|
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 tanh().
|
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(), floor(), frexp_mant(), ldexp(), log(), roundToIntegral(), sqrt(), and trunc().
|
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 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(), and ldexp().
|
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(), 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 fdiv(), fmul(), 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(), 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 1246 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 1304 of file KnownFPClass.cpp.
References llvm::KnownBits::getSignedMaxValue(), llvm::KnownBits::getSignedMinValue(), KnownFPClass(), and ldexp().
|
static |
Propagate known class for log/log2/log10.
IsMultiUnitFPType if this is for a multi-unit floating-point type.
Definition at line 874 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 104 of file KnownFPClass.cpp.
References applyInputDenormalMode(), applyOutputDenormalMode(), llvm::fcNan, getKnownFPClasses(), isKnownNeverNaN(), llvm::Known, KnownFPClass(), maximum, maximumnum, maxnum, minimum, minimumnum, minnum, llvm::orderedStrictlyGreater(), and llvm::orderedStrictlyLess().
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 1311 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 1353 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().
|
inline |
Definition at line 460 of file KnownFPClass.h.
References llvm::fcNan, KnownFPClass(), knownNot(), LHS, propagateNonSNaN(), and RHS.
|
inline |
Definition at line 454 of file KnownFPClass.h.
References llvm::fcNan, KnownFPClass(), knownNot(), and propagateNonSNaN().
|
inline |
Definition at line 446 of file KnownFPClass.h.
References llvm::fcSNan, KnownFPClass(), knownNot(), LHS, and RHS.
|
inline |
Definition at line 440 of file KnownFPClass.h.
References llvm::fcSNan, KnownFPClass(), and knownNot().
Referenced by propagateNonNaN(), and propagateNonNaN().
|
inline |
Definition at line 524 of file KnownFPClass.h.
References KnownFPClass().
|
static |
Propagate known class for rounding intrinsics (rint, nearbyint, round, roundeven).
IsMultiUnitFPType if this is for a multi-unit floating-point type.
Definition at line 1143 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 ceil(), computeKnownFPClass(), floor(), llvm::InstCombinerImpl::SimplifyDemandedUseFPClass(), and trunc().
|
inline |
Definition at line 34 of file KnownFPClass.h.
References KnownFPClassesValue.
Referenced by copysign(), fabs(), fneg(), knownNot(), operator|=(), signBitMustBeOne(), and signBitMustBeZero().
|
inline |
Definition at line 40 of file KnownFPClass.h.
References SignBitValue.
Referenced by copysign(), fneg(), KnownFPClass(), knownNot(), operator|=(), signBitMustBeOne(), and signBitMustBeZero().
|
inline |
Return true if the sign bit must be 0, ignoring the sign of nans.
Definition at line 394 of file KnownFPClass.h.
References llvm::fcNegative, and isKnownNever().
Referenced by llvm::AMDGPUTargetLowering::lowerFPOW().
|
inline |
Assume the sign bit is one.
Definition at line 403 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 397 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 922 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 954 of file KnownFPClass.cpp.
References llvm::fcNegative, llvm::fcPosInf, llvm::fcPosNormal, llvm::fcPosSubnormal, isKnownNever(), llvm::Known, and KnownFPClass().
Referenced by computeKnownFPClass().
|
static |
Propagate known class for sqrt.
Definition at line 897 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 289 of file KnownFPClass.h.
References llvm::fcNegative, fmul(), llvm::DenormalMode::getDynamic(), llvm::Known, KnownFPClass(), and Mode.
Referenced by computeKnownFPClass(), fma_square(), fmuladd_square(), and llvm::InstCombinerImpl::SimplifyDemandedUseFPClass().
|
static |
Report known values for tan.
Definition at line 939 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 984 of file KnownFPClass.cpp.
References llvm::fcInf, llvm::fcNegInf, llvm::fcNegNormal, llvm::fcNegSubnormal, llvm::fcNegZero, llvm::fcPosInf, llvm::fcPosNormal, llvm::fcPosSubnormal, isKnownNever(), isKnownNeverNegZero(), 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 395 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.
|
static |
Propagate known class for trunc.
Definition at line 1180 of file KnownFPClass.cpp.
References llvm::fcNegInf, llvm::fcPosInf, isKnownNeverNegInfinity(), isKnownNeverPosInfinity(), llvm::Known, KnownFPClass(), and roundToIntegral().
Referenced by computeKnownFPClass(), and llvm::InstCombinerImpl::SimplifyDemandedUseFPClass().
|
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().