class ConstantFP
Declaration
class ConstantFP : public ConstantData { /* full declaration omitted */ };
Declared at: llvm/include/llvm/IR/Constants.h:263
Inherits from: ConstantData
Member Variables
Inherited from Value:
- protected SubclassOptionalData
- protected NumUserOperands
- protected IsUsedByMD
- protected HasName
- protected HasHungOffUses
- protected HasDescriptor
- public static MaxAlignmentExponent = 29
- public static MaximumAlignment = 1U << MaxAlignmentExponent
Method Overview
- public ConstantFP(const llvm::ConstantFP &)
- public static bool classof(const llvm::Value * V)
- public static llvm::Constant * get(llvm::Type * Ty, double V)
- public static llvm::Constant * get(llvm::Type * Ty, const llvm::APFloat & V)
- public static llvm::Constant * get(llvm::Type * Ty, llvm::StringRef Str)
- public static llvm::ConstantFP * get(llvm::LLVMContext & Context, const llvm::APFloat & V)
- public static llvm::Constant * getInfinity(llvm::Type * Ty, bool Negative = false)
- public static llvm::Constant * getNaN(llvm::Type * Ty, bool Negative = false, uint64_t Payload = 0)
- public static llvm::Constant * getNegativeZero(llvm::Type * Ty)
- public static llvm::Constant * getQNaN(llvm::Type * Ty, bool Negative = false, llvm::APInt * Payload = nullptr)
- public static llvm::Constant * getSNaN(llvm::Type * Ty, bool Negative = false, llvm::APInt * Payload = nullptr)
- public inline const llvm::APFloat & getValueAPF() const
- public static llvm::Constant * getZeroValueForNegation(llvm::Type * Ty)
- public bool isExactlyValue(const llvm::APFloat & V) const
- public bool isExactlyValue(double V) const
- public bool isInfinity() const
- public bool isNaN() const
- public bool isNegative() const
- public static bool isValueValidForType(llvm::Type * Ty, const llvm::APFloat & V)
- public bool isZero() const
Inherited from ConstantData:
Inherited from Constant:
- public canTrap
- public classof
- public containsConstantExpression
- public containsUndefElement
- public destroyConstant
- public getAggregateElement
- public getAggregateElement
- public getAllOnesValue
- public getIntegerValue
- public getNullValue
- public getSplatValue
- public getUniqueInteger
- public handleOperandChange
- public hasExactInverseFP
- public isAllOnesValue
- public isConstantUsed
- public isDLLImportDependent
- public isElementWiseEqual
- public isFiniteNonZeroFP
- public isMinSignedValue
- public isNaN
- public isNegativeZeroValue
- public isNormalFP
- public isNotMinSignedValue
- public isNotOneValue
- public isNullValue
- public isOneValue
- public isThreadDependent
- public isZeroValue
- public needsRelocation
- public removeDeadConstantUsers
- public replaceUndefsWith
- public stripPointerCasts
- public stripPointerCasts
Inherited from User:
- protected Op
- protected Op
- protected OpFrom
- protected allocHungoffUses
- public classof
- public dropAllReferences
- public getDescriptor
- public getDescriptor
- public getNumOperands
- public getOperand
- public getOperandList
- public getOperandList
- public getOperandUse
- public getOperandUse
- protected growHungoffUses
- public op_begin
- public op_begin
- public op_end
- public op_end
- public operand_values
- public operand_values
- public operands
- public operands
- public replaceUsesOfWith
- public setGlobalVariableNumOperands
- public setNumHungOffUseOperands
- public setOperand
- public value_op_begin
- public value_op_begin
- public value_op_end
- public value_op_end
Inherited from Value:
- public DoPHITranslation
- public DoPHITranslation
- public addUse
- public assertModuleIsMaterialized
- public assertModuleIsMaterializedImpl
- public clearSubclassOptionalData
- public deleteValue
- public dump
- public getContext
- public getName
- public getNumUses
- public getPointerAlignment
- public getPointerDereferenceableBytes
- public getRawSubclassOptionalData
- protected getSubclassDataFromValue
- public getType
- public getValueID
- public getValueName
- public hasNUses
- public hasNUsesOrMore
- public hasName
- public hasOneUse
- public hasSameSubclassOptionalData
- public hasValueHandle
- public isSwiftError
- public isUsedByMetadata
- public isUsedInBasicBlock
- public materialized_use_begin
- public materialized_use_begin
- public materialized_use_empty
- public materialized_user_begin
- public materialized_user_begin
- public materialized_users
- public materialized_users
- public materialized_uses
- public materialized_uses
- public mutateType
- public print
- public print
- public printAsOperand
- public printAsOperand
- public replaceAllUsesWith
- public replaceNonMetadataUsesWith
- public replaceUsesOutsideBlock
- public replaceUsesWithIf
- public reverseUseList
- public setName
- public setValueName
- protected setValueSubclassData
- public sortUseList
- public stripAndAccumulateConstantOffsets
- public stripAndAccumulateConstantOffsets
- public stripAndAccumulateInBoundsConstantOffsets
- public stripAndAccumulateInBoundsConstantOffsets
- public stripInBoundsConstantOffsets
- public stripInBoundsConstantOffsets
- public stripInBoundsOffsets
- public stripInBoundsOffsets
- public stripPointerCasts
- public stripPointerCasts
- public stripPointerCastsAndAliases
- public stripPointerCastsAndAliases
- public stripPointerCastsAndInvariantGroups
- public stripPointerCastsAndInvariantGroups
- public stripPointerCastsSameRepresentation
- public stripPointerCastsSameRepresentation
- public takeName
- public use_begin
- public use_begin
- public use_empty
- public use_end
- public use_end
- public user_back
- public user_back
- public user_begin
- public user_begin
- public user_empty
- public user_end
- public user_end
- public users
- public users
- public uses
- public uses
Methods
¶ConstantFP(const llvm::ConstantFP&)
ConstantFP(const llvm::ConstantFP&)
Declared at: llvm/include/llvm/IR/Constants.h:273
Parameters
- const llvm::ConstantFP&
¶static bool classof(const llvm::Value* V)
static bool classof(const llvm::Value* V)
Description
Methods for support type inquiry through isa, cast, and dyn_cast:
Declared at: llvm/include/llvm/IR/Constants.h:332
Parameters
- const llvm::Value* V
¶static llvm::Constant* get(llvm::Type* Ty,
double V)
static llvm::Constant* get(llvm::Type* Ty,
double V)
Description
This returns a ConstantFP, or a vector containing a splat of a ConstantFP, for the specified value in the specified type. This should only be used for simple constant values like 2.0/1.0 etc, that are known-valid both as host double and as the target format.
Declared at: llvm/include/llvm/IR/Constants.h:284
Parameters
- llvm::Type* Ty
- double V
¶static llvm::Constant* get(llvm::Type* Ty,
const llvm::APFloat& V)
static llvm::Constant* get(llvm::Type* Ty,
const llvm::APFloat& V)
Description
If Ty is a vector type, return a Constant with a splat of the given value. Otherwise return a ConstantFP for the given value.
Declared at: llvm/include/llvm/IR/Constants.h:288
Parameters
- llvm::Type* Ty
- const llvm::APFloat& V
¶static llvm::Constant* get(llvm::Type* Ty,
llvm::StringRef Str)
static llvm::Constant* get(llvm::Type* Ty,
llvm::StringRef Str)
Declared at: llvm/include/llvm/IR/Constants.h:290
Parameters
- llvm::Type* Ty
- llvm::StringRef Str
¶static llvm::ConstantFP* get(
llvm::LLVMContext& Context,
const llvm::APFloat& V)
static llvm::ConstantFP* get(
llvm::LLVMContext& Context,
const llvm::APFloat& V)
Declared at: llvm/include/llvm/IR/Constants.h:291
Parameters
- llvm::LLVMContext& Context
- const llvm::APFloat& V
¶static llvm::Constant* getInfinity(
llvm::Type* Ty,
bool Negative = false)
static llvm::Constant* getInfinity(
llvm::Type* Ty,
bool Negative = false)
Declared at: llvm/include/llvm/IR/Constants.h:298
Parameters
- llvm::Type* Ty
- bool Negative = false
¶static llvm::Constant* getNaN(
llvm::Type* Ty,
bool Negative = false,
uint64_t Payload = 0)
static llvm::Constant* getNaN(
llvm::Type* Ty,
bool Negative = false,
uint64_t Payload = 0)
Declared at: llvm/include/llvm/IR/Constants.h:292
Parameters
- llvm::Type* Ty
- bool Negative = false
- uint64_t Payload = 0
¶static llvm::Constant* getNegativeZero(
llvm::Type* Ty)
static llvm::Constant* getNegativeZero(
llvm::Type* Ty)
Declared at: llvm/include/llvm/IR/Constants.h:297
Parameters
- llvm::Type* Ty
¶static llvm::Constant* getQNaN(
llvm::Type* Ty,
bool Negative = false,
llvm::APInt* Payload = nullptr)
static llvm::Constant* getQNaN(
llvm::Type* Ty,
bool Negative = false,
llvm::APInt* Payload = nullptr)
Declared at: llvm/include/llvm/IR/Constants.h:293
Parameters
- llvm::Type* Ty
- bool Negative = false
- llvm::APInt* Payload = nullptr
¶static llvm::Constant* getSNaN(
llvm::Type* Ty,
bool Negative = false,
llvm::APInt* Payload = nullptr)
static llvm::Constant* getSNaN(
llvm::Type* Ty,
bool Negative = false,
llvm::APInt* Payload = nullptr)
Declared at: llvm/include/llvm/IR/Constants.h:295
Parameters
- llvm::Type* Ty
- bool Negative = false
- llvm::APInt* Payload = nullptr
¶inline const llvm::APFloat& getValueAPF() const
inline const llvm::APFloat& getValueAPF() const
Declared at: llvm/include/llvm/IR/Constants.h:302
¶static llvm::Constant* getZeroValueForNegation(
llvm::Type* Ty)
static llvm::Constant* getZeroValueForNegation(
llvm::Type* Ty)
Description
Floating point negation must be implemented with f(x) = -0.0 - x. This method returns the negative zero constant for floating point or vector floating point types; for all other types, it returns the null value.
Declared at: llvm/include/llvm/IR/Constants.h:278
Parameters
- llvm::Type* Ty
¶bool isExactlyValue(const llvm::APFloat& V) const
bool isExactlyValue(const llvm::APFloat& V) const
Description
We don't rely on operator== working on double values, as it returns true for things that are clearly not equal, like -0.0 and 0.0. As such, this method can be used to do an exact bit-for-bit comparison of two floating point values. The version with a double operand is retained because it's so convenient to write isExactlyValue(2.0), but please use it only for simple constants.
Declared at: llvm/include/llvm/IR/Constants.h:322
Parameters
- const llvm::APFloat& V
¶bool isExactlyValue(double V) const
bool isExactlyValue(double V) const
Declared at: llvm/include/llvm/IR/Constants.h:324
Parameters
- double V
¶bool isInfinity() const
bool isInfinity() const
Description
Return true if the value is infinity
Declared at: llvm/include/llvm/IR/Constants.h:311
¶bool isNaN() const
bool isNaN() const
Description
Return true if the value is a NaN.
Declared at: llvm/include/llvm/IR/Constants.h:314
¶bool isNegative() const
bool isNegative() const
Description
Return true if the sign bit is set.
Declared at: llvm/include/llvm/IR/Constants.h:308
¶static bool isValueValidForType(
llvm::Type* Ty,
const llvm::APFloat& V)
static bool isValueValidForType(
llvm::Type* Ty,
const llvm::APFloat& V)
Description
Return true if Ty is big enough to represent V.
Declared at: llvm/include/llvm/IR/Constants.h:301
Parameters
- llvm::Type* Ty
- const llvm::APFloat& V
¶bool isZero() const
bool isZero() const
Description
Return true if the value is positive or negative zero.
Declared at: llvm/include/llvm/IR/Constants.h:305