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