|
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 (FPClassMask Known=FPClassMask::kfcAllFlags) | |
| KnownFPClass (FPClassTest Known) | |
| KnownFPClass (FPClassTest Known, bool Sign) | |
| LLVM_ABI | KnownFPClass (const APFloat &C) |
| bool | operator== (KnownFPClass Other) const |
| bool | isKnownNever (FPClassMask Mask) const |
| Return true if it's known this can never be one of the mask entries. | |
| bool | isKnownNever (FPClassTest Mask) const |
| Return true if it's known this can never be one of the mask entries. | |
| bool | isKnownAlways (FPClassMask Mask) const |
| 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 (FPClassMask RuleOut) |
| 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 () |
Static Public Attributes | |
| static constexpr FPClassTest | OrderedLessThanZeroMask |
| static constexpr FPClassTest | OrderedGreaterThanZeroMask |
Definition at line 66 of file KnownFPClass.h.
|
strong |
| Enumerator | |
|---|---|
| minimum | |
| maximum | |
| minimumnum | |
| maximumnum | |
| minnum | |
| maxnum | |
Definition at line 428 of file KnownFPClass.h.
|
inline |
Definition at line 208 of file KnownFPClass.h.
References llvm::kfcAllFlags, 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(), KnownFPClass(), ldexp(), ldexp(), log(), minMaxLike(), operator==(), operator|=(), pow(), powi(), propagateNonNaN(), propagateNonNaN(), propagateNonSNaN(), propagateNonSNaN(), resetAll(), roundToIntegral(), sin(), sinh(), sqrt(), square(), tan(), tanh(), trunc(), and unionWith().
|
inline |
Definition at line 210 of file KnownFPClass.h.
References llvm::Known.
|
inline |
Definition at line 211 of file KnownFPClass.h.
References llvm::Known.
Definition at line 21 of file KnownFPClass.cpp.
References C(), and KnownFPClass().
|
static |
Report known values for acos.
Definition at line 1022 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 24 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(), fma(), fma_square(), fmul(), fpconvert(), 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 51 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(), fma(), fma_square(), fmul(), fpconvert(), fsub(), ldexp(), and minMaxLike().
|
static |
Report known values for asin.
Definition at line 1002 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 1043 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 1068 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 220 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 334 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 312 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 323 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 301 of file KnownFPClass.h.
References isKnownNever(), and OrderedLessThanZeroMask.
Referenced by computeKnownFPClass(), fadd_impl(), ldexp(), log(), simplifyFCmpInst(), simplifyUnaryIntrinsic(), and sqrt().
|
static |
Apply the canonicalize intrinsic to this value.
Definition at line 168 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 1290 of file KnownFPClass.cpp.
References llvm::fcNegInf, isKnownNeverNegInfinity(), llvm::Known, KnownFPClass(), and roundToIntegral().
Referenced by computeKnownFPClass(), and llvm::InstCombinerImpl::SimplifyDemandedUseFPClass().
|
inlinestatic |
Definition at line 610 of file KnownFPClass.h.
References llvm::Known, and KnownFPClass().
|
inline |
Definition at line 587 of file KnownFPClass.h.
References getSignBit(), llvm::kfcInf, llvm::kfcNegSignBit, llvm::kfcNone, llvm::kfcNormal, llvm::kfcPosSignBit, llvm::kfcQNan, llvm::kfcSNan, llvm::kfcSubnormal, llvm::kfcZero, and KnownFPClass().
Referenced by llvm::InstCombinerImpl::SimplifyDemandedUseFPClass(), and llvm::InstCombinerImpl::SimplifyMultipleUseDemandedFPClass().
|
static |
Report known values for cos.
Definition at line 928 of file KnownFPClass.cpp.
References KnownFPClass(), and sin().
Referenced by computeKnownFPClass().
|
static |
Report known values for cosh.
Definition at line 965 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 843 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 402 of file KnownFPClass.h.
References llvm::kfcInf, llvm::kfcNone, llvm::kfcNormal, llvm::kfcPosInf, llvm::kfcPosNormal, llvm::kfcPosQNan, llvm::kfcPosSNan, llvm::kfcPosSubnormal, llvm::kfcPosZero, llvm::kfcQNan, llvm::kfcSNan, llvm::kfcSubnormal, llvm::kfcZero, and llvm::Known.
Referenced by simplifyDemandedFPClassFabs(), and simplifyDemandedFPClassFnegFabs().
|
inlinestatic |
Definition at line 421 of file KnownFPClass.h.
References llvm::Known, and KnownFPClass().
|
static |
Report known values for fadd.
Definition at line 539 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 550 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 652 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 704 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 1279 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 776 of file KnownFPClass.cpp.
References applyInputDenormalMode(), applyOutputDenormalMode(), fadd_impl(), llvm::fcSNan, fmul(), llvm::DenormalMode::getIEEE(), 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 812 of file KnownFPClass.cpp.
References applyInputDenormalMode(), applyOutputDenormalMode(), fadd_impl(), llvm::fcNan, llvm::fcNegInf, llvm::DenormalMode::getIEEE(), isKnownNever(), llvm::Known, KnownFPClass(), and square().
Referenced by computeKnownFPClass(), fmuladd_square(), and llvm::InstCombinerImpl::SimplifyDemandedUseFPClass().
|
static |
Definition at line 624 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 583 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 801 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 835 of file KnownFPClass.cpp.
References fadd(), fma_square(), KnownFPClass(), and square().
Referenced by computeKnownFPClass().
|
inline |
Definition at line 365 of file KnownFPClass.h.
References llvm::kfcNegInf, llvm::kfcNegNormal, llvm::kfcNegQNan, llvm::kfcNegSNan, llvm::kfcNegSubnormal, llvm::kfcNegZero, llvm::kfcNone, llvm::kfcPosInf, llvm::kfcPosNormal, llvm::kfcPosQNan, llvm::kfcPosSNan, llvm::kfcPosSubnormal, llvm::kfcPosZero, and llvm::Known.
Referenced by fsub(), and simplifyDemandedFPClassFnegFabs().
|
inlinestatic |
Definition at line 396 of file KnownFPClass.h.
References llvm::Known, and KnownFPClass().
|
static |
Propagate known class for fpext.
DstMode and SrcMode are the denormal modes of the destination and source types.
Definition at line 1207 of file KnownFPClass.cpp.
References fpconvert(), getConvertDenormalMode(), and KnownFPClass().
Referenced by computeKnownFPClass(), and llvm::InstCombinerImpl::SimplifyDemandedUseFPClass().
|
static |
Propagate known class for fptrunc and fptrunc_round.
DstMode and SrcMode are the denormal modes of the destination and source types.
Definition at line 1220 of file KnownFPClass.cpp.
References fpconvert(), getConvertDenormalMode(), and KnownFPClass().
Referenced by computeKnownFPClassForFPTrunc(), and simplifyDemandedUseFPClassFPTrunc().
|
static |
Report known values for frem.
Definition at line 717 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 755 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 1301 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 568 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 163 of file KnownFPClass.h.
Referenced by applyInputDenormalMode(), applyOutputDenormalMode(), canonicalize(), computeKnownFPClass(), ldexp(), minMaxLike(), printGISelValueTracking(), simplifyDemandedFPClassMinMax(), and toKnownBits().
|
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.
By convention, returns false for kfcNone/poison.
Definition at line 172 of file KnownFPClass.h.
References llvm::kfcNegSignBit, llvm::kfcNone, and llvm::kfcPosSignBit.
Referenced by computeKnownFPClass(), copysign(), printGISelValueTracking(), simplifyDemandedFPClassCopysignMag(), simplifyDemandedFPClassFabs(), simplifyDemandedFPClassFnegFabs(), llvm::InstCombinerImpl::SimplifyDemandedUseFPClass(), llvm::InstCombinerImpl::SimplifyMultipleUseDemandedFPClass(), simplifyUnaryIntrinsic(), and toKnownBits().
|
inline |
Definition at line 348 of file KnownFPClass.h.
References KnownFPClass(), and RHS.
Referenced by llvm::SelectionDAG::computeKnownFPClass(), llvm::InstCombinerImpl::SimplifyDemandedUseFPClass(), and llvm::InstCombinerImpl::SimplifyMultipleUseDemandedFPClass().
|
inline |
Definition at line 229 of file KnownFPClass.h.
References isKnownNever().
Referenced by fdiv(), fmul(), isKnownAlways(), isKnownAlwaysNaN(), simplifyDemandedFPClassCopysignMag(), and llvm::InstCombinerImpl::SimplifyDemandedUseFPClass().
|
inline |
Definition at line 231 of file KnownFPClass.h.
References isKnownAlways().
|
inline |
Return true if it's known this must always be a nan.
Definition at line 241 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 220 of file KnownFPClass.h.
References llvm::kfcNone.
Referenced by acos(), addNoUndefAttrs(), asin(), atan(), atan2(), cannotBeOrderedGreaterEqZero(), cannotBeOrderedGreaterThanZero(), cannotBeOrderedLessEqZero(), cannotBeOrderedLessThanZero(), canonicalize(), computeKnownBitsFromOperator(), computeKnownFPClass(), exp(), fadd_impl(), fadd_self(), fdiv(), fma(), fma_square(), fmul(), fmul(), foldFPtoI(), fpconvert(), frem(), frem_self(), frexp_mant(), isKnownAlways(), isKnownNever(), isKnownNeverInfinity(), isKnownNeverInfOrNaN(), llvm::GISelValueTracking::isKnownNeverNaN(), isKnownNeverNaN(), isKnownNeverNegInfinity(), isKnownNeverNegSubnormal(), isKnownNeverNegZero(), isKnownNeverPosInfinity(), isKnownNeverPosSubnormal(), isKnownNeverPosZero(), isKnownNeverSubnormal(), isKnownNeverZero(), 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 one of the mask entries.
Definition at line 225 of file KnownFPClass.h.
References isKnownNever().
|
inline |
Return true if it's known this can never be an infinity.
Definition at line 244 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 247 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 82 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 86 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 78 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 238 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 253 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 262 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 273 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 250 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 259 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 269 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 256 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 266 of file KnownFPClass.h.
References llvm::fcZero, and isKnownNever().
Referenced by fdiv(), fmul(), isKnownNeverLogicalZero(), and llvm::LegalizerHelper::lowerFMinimumMaximum().
|
inline |
Definition at line 235 of file KnownFPClass.h.
References llvm::kfcAllFlags.
Referenced by llvm::adjustKnownFPClassForSelectArm(), computeKnownFPClass(), llvm::SelectionDAG::computeKnownFPClass(), and llvm::InstCombinerImpl::SimplifyMultipleUseDemandedFPClass().
|
inline |
Definition at line 361 of file KnownFPClass.h.
Referenced by computeKnownFPClass(), computeKnownFPClassFromCond(), propagateNonNaN(), propagateNonNaN(), propagateNonSNaN(), propagateNonSNaN(), simplifyDemandedFPClassFabs(), simplifyDemandedFPClassFnegFabs(), llvm::InstCombinerImpl::SimplifyDemandedUseFPClass(), and llvm::InstCombinerImpl::SimplifyMultipleUseDemandedFPClass().
|
inline |
|
static |
Propagate known class for ldexp, assuming the exponent is known to be within [ConstantRangeMin, ConstantRangeMax].
Definition at line 1332 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 1390 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 867 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 90 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 215 of file KnownFPClass.h.
References KnownFPClass(), and llvm::Other.
|
inline |
Definition at line 356 of file KnownFPClass.h.
References KnownFPClass(), and RHS.
|
static |
Propagate known class for pow.
Definition at line 1397 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 1439 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 638 of file KnownFPClass.h.
References llvm::fcNan, KnownFPClass(), knownNot(), LHS, propagateNonSNaN(), and RHS.
|
inline |
Definition at line 632 of file KnownFPClass.h.
References llvm::fcNan, KnownFPClass(), knownNot(), and propagateNonSNaN().
|
inline |
Definition at line 624 of file KnownFPClass.h.
References llvm::fcSNan, KnownFPClass(), knownNot(), LHS, and RHS.
|
inline |
Definition at line 618 of file KnownFPClass.h.
References llvm::fcSNan, KnownFPClass(), and knownNot().
Referenced by propagateNonNaN(), and propagateNonNaN().
|
inline |
Definition at line 708 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 1229 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 165 of file KnownFPClass.h.
|
inline |
Definition at line 184 of file KnownFPClass.h.
References llvm::kfcInf, llvm::kfcNegSignBit, llvm::kfcNone, llvm::kfcNormal, llvm::kfcPosSignBit, llvm::kfcQNan, llvm::kfcSNan, llvm::kfcSubnormal, and llvm::kfcZero.
|
inline |
Return true if the sign bit must be 0, ignoring the sign of nans.
Definition at line 579 of file KnownFPClass.h.
References llvm::fcNegative, and isKnownNever().
Referenced by llvm::AMDGPUTargetLowering::lowerFPOW().
|
inline |
Assume the sign bit is one.
Definition at line 585 of file KnownFPClass.h.
References llvm::kfcNegSignBit.
Referenced by computeKnownFPClassFromCond().
|
inline |
Assume the sign bit is zero.
Definition at line 582 of file KnownFPClass.h.
References llvm::kfcPosSignBit.
Referenced by computeKnownFPClassFromCond().
|
static |
Report known values for sin.
Definition at line 915 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 947 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 890 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 474 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 932 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 977 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 381 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 1266 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 352 of file KnownFPClass.h.
References KnownFPClass(), and RHS.
Referenced by llvm::adjustKnownFPClassForSelectArm().
|
staticconstexpr |
Definition at line 290 of file KnownFPClass.h.
Referenced by cannotBeOrderedGreaterThanZero(), fadd_impl(), ldexp(), and simplifyDemandedFPClassFnegFabs().
|
staticconstexpr |
Definition at line 288 of file KnownFPClass.h.
Referenced by llvm::cannotBeOrderedLessThanZero(), cannotBeOrderedLessThanZero(), computeKnownFPClass(), computeKnownFPClassForFPTrunc(), fadd_impl(), ldexp(), simplifyDemandedFPClassFabs(), llvm::InstCombinerImpl::SimplifyDemandedUseFPClass(), and simplifyFCmpInst().