Go to the documentation of this file.
13 #ifndef LLVM_IR_CONSTANT_H
14 #define LLVM_IR_CONSTANT_H
44 :
User(ty, vty, Ops, NumOps) {}
168 static_assert(ConstantFirstVal == 0,
"V->getValueID() >= ConstantFirstVal always succeeds");
237 enum PossibleRelocationsTy {
248 GlobalRelocation = 2,
252 PossibleRelocationsTy getRelocationInfo()
const;
254 bool hasNLiveUses(
unsigned N)
const;
259 #endif // LLVM_IR_CONSTANT_H
bool isAllOnesValue() const
Return true if this is the value that would be returned by getAllOnesValue.
bool isFiniteNonZeroFP() const
Return true if this is a finite and non-zero floating-point scalar constant or a fixed width vector c...
This is an optimization pass for GlobalISel generic memory operations.
bool isNormalFP() const
Return true if this is a normal (as opposed to denormal, infinity, nan, or zero) floating-point scala...
bool isNaN() const
Return true if this is a floating-point NaN constant or a vector floating-point constant with all NaN...
bool containsPoisonElement() const
Return true if this is a vector constant that includes any poison elements.
The instances of the Type class are immutable: once they are created, they are never changed.
bool isNotOneValue() const
Return true if the value is not the one value, or, for vectors, does not contain one value elements.
bool needsDynamicRelocation() const
bool needsRelocation() const
This method classifies the entry according to whether or not it may generate a relocation entry (eith...
static bool classof(const Value *V)
bool isOneValue() const
Returns true if the value is one.
bool isThreadDependent() const
Return true if the value can vary between threads.
bool containsConstantExpression() const
Return true if this is a fixed width vector constant that includes any constant expressions.
bool isNullValue() const
Return true if this is the value that would be returned by getNullValue.
(vector float) vec_cmpeq(*A, *B) C
static GCMetadataPrinterRegistry::Add< OcamlGCMetadataPrinter > Y("ocaml", "ocaml 3.10-compatible collector")
unsigned getValueID() const
Return an ID for the concrete type of this object.
static Constant * getAllOnesValue(Type *Ty)
Constant(Type *ty, ValueTy vty, Use *Ops, unsigned NumOps)
Constant * stripPointerCasts()
bool isMinSignedValue() const
Return true if the value is the smallest signed value.
bool isDLLImportDependent() const
Return true if the value is dependent on a dllimport variable.
bool hasZeroLiveUses() const
Return true if the constant has no live uses.
This is an important base class in LLVM.
bool isElementWiseEqual(Value *Y) const
Return true if this constant and a constant 'Y' are element-wise equal.
static Constant * replaceUndefsWith(Constant *C, Constant *Replacement)
Try to replace undefined constant C or undefined elements in C with Replacement.
bool hasOneLiveUse() const
Return true if the constant has exactly one live use.
bool isNegativeZeroValue() const
Return true if the value is what would be returned by getZeroValueForNegation.
bool isManifestConstant() const
Return true if a constant is ConstantData or a ConstantAggregate or ConstantExpr that contain only Co...
void handleOperandChange(Value *, Value *)
This method is a special form of User::replaceUsesOfWith (which does not work on constants) that does...
Class for arbitrary precision integers.
ValueTy
Concrete subclass of this.
void removeDeadConstantUsers() const
If there are any dead constant users dangling off of this constant, remove them.
Constant * getAggregateElement(unsigned Elt) const
For aggregates (struct/array/vector) return the constant that corresponds to the specified element if...
const Constant * stripPointerCasts() const
const Value * stripPointerCasts() const
Strip off pointer casts, all-zero GEPs and address space casts.
static Constant * getNullValue(Type *Ty)
Constructor to create a '0' constant of arbitrary type.
void operator=(const Constant &)=delete
bool isZeroValue() const
Return true if the value is negative zero or null value.
static Constant * mergeUndefsWith(Constant *C, Constant *Other)
Merges undefs of a Constant with another Constant, along with the undefs already present.
static Constant * getIntegerValue(Type *Ty, const APInt &V)
Return the value for an integer or pointer constant, or a vector thereof, with the given scalar value...
bool hasExactInverseFP() const
Return true if this scalar has an exact multiplicative inverse or this vector has an exact multiplica...
const APInt & getUniqueInteger() const
If C is a constant integer then return its value, otherwise C must be a vector of constant integers,...
bool containsUndefOrPoisonElement() const
Return true if this is a vector constant that includes any undef or poison elements.
bool canTrap() const
Return true if evaluation of this constant could trap.
Constant * getSplatValue(bool AllowUndefs=false) const
If all elements of the vector constant have the same value, return that value.
bool isNotMinSignedValue() const
Return true if the value is not the smallest signed value, or, for vectors, does not contain smallest...
bool isConstantUsed() const
Return true if the constant has users other than constant expressions and other dangling things.
LLVM Value Representation.
void destroyConstant()
Called if some element of this constant is no longer valid.
A Use represents the edge between a Value definition and its users.