class Instruction
Declaration
class Instruction : public User { /* full declaration omitted */ };
Declared at: llvm/include/llvm/IR/Instruction.h:43
Inherits from: User
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 Instruction(const llvm::Instruction &)
- protected Instruction(llvm::Type * Ty, unsigned int iType, llvm::Use * Ops, unsigned int NumOps, llvm::BasicBlock * InsertAtEnd)
- protected Instruction(llvm::Type * Ty, unsigned int iType, llvm::Use * Ops, unsigned int NumOps, llvm::Instruction * InsertBefore = nullptr)
- public void andIRFlags(const llvm::Value * V)
- public void applyMergedLocation(const llvm::DILocation * LocA, const llvm::DILocation * LocB)
- public static bool classof(const llvm::Value * V)
- public llvm::Instruction * clone() const
- public void copyFastMathFlags(llvm::FastMathFlags FMF)
- public void copyFastMathFlags(const llvm::Instruction * I)
- public void copyIRFlags(const llvm::Value * V, bool IncludeWrapFlags = true)
- public void copyMetadata(const llvm::Instruction & SrcInst, ArrayRef<unsigned int> WL = <null expr>)
- public void dropPoisonGeneratingFlags()
- public void dropUnknownNonDebugMetadata()
- public void dropUnknownNonDebugMetadata(unsigned int ID1)
- public void dropUnknownNonDebugMetadata(unsigned int ID1, unsigned int ID2)
- public void dropUnknownNonDebugMetadata(ArrayRef<unsigned int> KnownIDs)
- public int eraseFromParent()
- public bool extractProfMetadata(uint64_t & TrueVal, uint64_t & FalseVal) const
- public bool extractProfTotalWeight(uint64_t & TotalVal) const
- public void getAAMetadata(llvm::AAMDNodes & N, bool Merge = false) const
- public void getAllMetadata(SmallVectorImpl<std::pair<unsigned int, MDNode *>> & MDs) const
- public void getAllMetadataOtherThanDebugLoc(SmallVectorImpl<std::pair<unsigned int, MDNode *>> & MDs) const
- public const llvm::DebugLoc & getDebugLoc() const
- public llvm::FastMathFlags getFastMathFlags() const
- public llvm::Function * getFunction()
- public const llvm::Function * getFunction() const
- public llvm::MDNode * getMetadata(llvm::StringRef Kind) const
- public llvm::MDNode * getMetadata(unsigned int KindID) const
- public llvm::Module * getModule()
- public const llvm::Module * getModule() const
- public const llvm::Instruction * getNextNonDebugInstruction() const
- public llvm::Instruction * getNextNonDebugInstruction()
- public unsigned int getNumSuccessors() const
- public unsigned int getOpcode() const
- public static const char * getOpcodeName(unsigned int OpCode)
- public const char * getOpcodeName() const
- public inline const llvm::BasicBlock * getParent() const
- public inline llvm::BasicBlock * getParent()
- public const llvm::Instruction * getPrevNonDebugInstruction() const
- public llvm::Instruction * getPrevNonDebugInstruction()
- protected unsigned int getSubclassDataFromInstruction() const
- public llvm::BasicBlock * getSuccessor(unsigned int Idx) const
- public bool hasAllowContract() const
- public bool hasAllowReassoc() const
- public bool hasAllowReciprocal() const
- public bool hasApproxFunc() const
- public bool hasAtomicLoad() const
- public bool hasAtomicStore() const
- public bool hasMetadata() const
- public bool hasMetadata(unsigned int KindID) const
- public bool hasMetadata(llvm::StringRef Kind) const
- public bool hasMetadataOtherThanDebugLoc() const
- public bool hasNoInfs() const
- public bool hasNoNaNs() const
- public bool hasNoSignedWrap() const
- public bool hasNoSignedZeros() const
- public bool hasNoUnsignedWrap() const
- public void insertAfter(llvm::Instruction * InsertPos)
- public void insertBefore(llvm::Instruction * InsertPos)
- public inline bool isArithmeticShift() const
- public bool isAssociative() const
- public static bool isAssociative(unsigned int Opcode)
- public bool isAtomic() const
- public static inline bool isBinaryOp(unsigned int Opcode)
- public bool isBinaryOp() const
- public inline bool isBitwiseLogicOp() const
- public static inline bool isBitwiseLogicOp(unsigned int Opcode)
- public static inline bool isCast(unsigned int OpCode)
- public bool isCast() const
- public static bool isCommutative(unsigned int Opcode)
- public bool isCommutative() const
- public bool isEHPad() const
- public bool isExact() const
- public bool isExceptionalTerminator() const
- public static inline bool isExceptionalTerminator(unsigned int OpCode)
- public bool isFast() const
- public bool isFenceLike() const
- public static inline bool isFuncletPad(unsigned int OpCode)
- public bool isFuncletPad() const
- public bool isIdempotent() const
- public static bool isIdempotent(unsigned int Opcode)
- public bool isIdenticalTo(const llvm::Instruction * I) const
- public bool isIdenticalToWhenDefined(const llvm::Instruction * I) const
- public static inline bool isIndirectTerminator(unsigned int OpCode)
- public bool isIndirectTerminator() const
- public bool isIntDivRem() const
- public static inline bool isIntDivRem(unsigned int Opcode)
- public bool isLifetimeStartOrEnd() const
- public inline bool isLogicalShift() const
- public bool isNilpotent() const
- public static bool isNilpotent(unsigned int Opcode)
- public bool isSafeToRemove() const
- public bool isSameOperationAs(const llvm::Instruction * I, unsigned int flags = 0) const
- public static inline bool isShift(unsigned int Opcode)
- public bool isShift() const
- public bool isTerminator() const
- public static inline bool isTerminator(unsigned int OpCode)
- public bool isUnaryOp() const
- public static inline bool isUnaryOp(unsigned int Opcode)
- public bool isUsedOutsideOfBlock(const llvm::BasicBlock * BB) const
- public bool mayHaveSideEffects() const
- public bool mayReadFromMemory() const
- public bool mayReadOrWriteMemory() const
- public bool mayThrow() const
- public bool mayWriteToMemory() const
- public void moveAfter(llvm::Instruction * MovePos)
- public void moveBefore(llvm::BasicBlock & BB, int I)
- public void moveBefore(llvm::Instruction * MovePos)
- public void removeFromParent()
- public void replaceSuccessorWith(llvm::BasicBlock * OldBB, llvm::BasicBlock * NewBB)
- public void setAAMetadata(const llvm::AAMDNodes & N)
- public void setDebugLoc(llvm::DebugLoc Loc)
- public void setFast(bool B)
- public void setFastMathFlags(llvm::FastMathFlags FMF)
- public void setHasAllowReassoc(bool B)
- public void setHasAllowReciprocal(bool B)
- public void setHasApproxFunc(bool B)
- public void setHasNoInfs(bool B)
- public void setHasNoNaNs(bool B)
- public void setHasNoSignedWrap(bool b = true)
- public void setHasNoSignedZeros(bool B)
- public void setHasNoUnsignedWrap(bool b = true)
- protected void setInstructionSubclassData(unsigned short D)
- public void setIsExact(bool b = true)
- public void setMetadata(llvm::StringRef Kind, llvm::MDNode * Node)
- public void setMetadata(unsigned int KindID, llvm::MDNode * Node)
- public void setProfWeight(uint64_t W)
- public void setSuccessor(unsigned int Idx, llvm::BasicBlock * BB)
- public void swapProfMetadata()
- public const llvm::Instruction * user_back() const
- public llvm::Instruction * user_back()
- protected ~Instruction()
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
¶Instruction(const llvm::Instruction&)
Instruction(const llvm::Instruction&)
Declared at: llvm/include/llvm/IR/Instruction.h:58
Parameters
- const llvm::Instruction&
¶Instruction(llvm::Type* Ty,
unsigned int iType,
llvm::Use* Ops,
unsigned int NumOps,
llvm::BasicBlock* InsertAtEnd)
Instruction(llvm::Type* Ty,
unsigned int iType,
llvm::Use* Ops,
unsigned int NumOps,
llvm::BasicBlock* InsertAtEnd)
Declared at: llvm/include/llvm/IR/Instruction.h:775
Parameters
- llvm::Type* Ty
- unsigned int iType
- llvm::Use* Ops
- unsigned int NumOps
- llvm::BasicBlock* InsertAtEnd
¶Instruction(
llvm::Type* Ty,
unsigned int iType,
llvm::Use* Ops,
unsigned int NumOps,
llvm::Instruction* InsertBefore = nullptr)
Instruction(
llvm::Type* Ty,
unsigned int iType,
llvm::Use* Ops,
unsigned int NumOps,
llvm::Instruction* InsertBefore = nullptr)
Declared at: llvm/include/llvm/IR/Instruction.h:773
Parameters
- llvm::Type* Ty
- unsigned int iType
- llvm::Use* Ops
- unsigned int NumOps
- llvm::Instruction* InsertBefore = nullptr
¶void andIRFlags(const llvm::Value* V)
void andIRFlags(const llvm::Value* V)
Description
Logical 'and' of any supported wrapping, exact, and fast-math flags of V and this instruction.
Declared at: llvm/include/llvm/IR/Instruction.h:441
Parameters
- const llvm::Value* V
¶void applyMergedLocation(
const llvm::DILocation* LocA,
const llvm::DILocation* LocB)
void applyMergedLocation(
const llvm::DILocation* LocA,
const llvm::DILocation* LocB)
Description
Merge 2 debug locations and apply it to the Instruction. If the instruction is a CallIns, we need to traverse the inline chain to find the common scope. This is not efficient for N-way merging as each time you merge 2 iterations, you need to rebuild the hashmap to find the common scope. However, we still choose this API because: 1) Simplicity: it takes 2 locations instead of a list of locations. 2) In worst case, it increases the complexity from O(N*I) to O(2*N*I), where N is # of Instructions to merge, and I is the maximum level of inline stack. So it is still linear. 3) Merging of call instructions should be extremely rare in real applications, thus the N-way merging should be in code path. The DebugLoc attached to this instruction will be overwritten by the merged DebugLoc.
Declared at: llvm/include/llvm/IR/Instruction.h:456
Parameters
- const llvm::DILocation* LocA
- const llvm::DILocation* LocB
¶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/Instruction.h:683
Parameters
- const llvm::Value* V
¶llvm::Instruction* clone() const
llvm::Instruction* clone() const
Description
Create a copy of 'this' instruction that is identical in all ways except the following: * The instruction has no parent * The instruction has no name
Declared at: llvm/include/llvm/IR/Instruction.h:630
¶void copyFastMathFlags(llvm::FastMathFlags FMF)
void copyFastMathFlags(llvm::FastMathFlags FMF)
Description
Convenience function for transferring all fast-math flag values to this instruction, which must be an operator which supports these flags. See LangRef.html for the meaning of these flags.
Declared at: llvm/include/llvm/IR/Instruction.h:401
Parameters
¶void copyFastMathFlags(const llvm::Instruction* I)
void copyFastMathFlags(const llvm::Instruction* I)
Description
Copy I's fast-math flags
Declared at: llvm/include/llvm/IR/Instruction.h:433
Parameters
- const llvm::Instruction* I
¶void copyIRFlags(const llvm::Value* V,
bool IncludeWrapFlags = true)
void copyIRFlags(const llvm::Value* V,
bool IncludeWrapFlags = true)
Description
Convenience method to copy supported exact, fast-math, and (optionally) wrapping flags from V to this instruction.
Declared at: llvm/include/llvm/IR/Instruction.h:437
Parameters
- const llvm::Value* V
- bool IncludeWrapFlags = true
¶void copyMetadata(
const llvm::Instruction& SrcInst,
ArrayRef<unsigned int> WL = <null expr>)
void copyMetadata(
const llvm::Instruction& SrcInst,
ArrayRef<unsigned int> WL = <null expr>)
Description
Copy metadata from \p SrcInst to this instruction. \p WL, if not empty, specifies the list of meta data that needs to be copied. If \p WL is empty, all meta data will be copied.
Declared at: llvm/include/llvm/IR/Instruction.h:286
Parameters
- const llvm::Instruction& SrcInst
- ArrayRef<unsigned int> WL = <null expr>
¶void dropPoisonGeneratingFlags()
void dropPoisonGeneratingFlags()
Description
Drops flags that may cause this instruction to evaluate to poison despite having non-poison inputs.
Declared at: llvm/include/llvm/IR/Instruction.h:353
¶void dropUnknownNonDebugMetadata()
void dropUnknownNonDebugMetadata()
Declared at: llvm/include/llvm/IR/Instruction.h:299
¶void dropUnknownNonDebugMetadata(unsigned int ID1)
void dropUnknownNonDebugMetadata(unsigned int ID1)
Declared at: llvm/include/llvm/IR/Instruction.h:302
Parameters
- unsigned int ID1
¶void dropUnknownNonDebugMetadata(unsigned int ID1,
unsigned int ID2)
void dropUnknownNonDebugMetadata(unsigned int ID1,
unsigned int ID2)
Declared at: llvm/include/llvm/IR/Instruction.h:305
Parameters
- unsigned int ID1
- unsigned int ID2
¶void dropUnknownNonDebugMetadata(
ArrayRef<unsigned int> KnownIDs)
void dropUnknownNonDebugMetadata(
ArrayRef<unsigned int> KnownIDs)
Description
Drop all unknown metadata except for debug locations. @ { Passes are required to drop metadata they don't understand. This is a convenience method for passes to do so.
Declared at: llvm/include/llvm/IR/Instruction.h:298
Parameters
- ArrayRef<unsigned int> KnownIDs
¶int eraseFromParent()
int eraseFromParent()
Declared at: llvm/include/llvm/IR/Instruction.h:97
¶bool extractProfMetadata(uint64_t& TrueVal,
uint64_t& FalseVal) const
bool extractProfMetadata(uint64_t& TrueVal,
uint64_t& FalseVal) const
Description
Retrieve the raw weight values of a conditional branch or select. Returns true on success with profile weights filled in. Returns false if no metadata or invalid metadata was found.
Declared at: llvm/include/llvm/IR/Instruction.h:317
Parameters
- uint64_t& TrueVal
- uint64_t& FalseVal
¶bool extractProfTotalWeight(
uint64_t& TotalVal) const
bool extractProfTotalWeight(
uint64_t& TotalVal) const
Description
Retrieve total raw weight values of a branch. Returns true on success with profile total weights filled in. Returns false if no metadata was found.
Declared at: llvm/include/llvm/IR/Instruction.h:322
Parameters
- uint64_t& TotalVal
¶void getAAMetadata(llvm::AAMDNodes& N,
bool Merge = false) const
void getAAMetadata(llvm::AAMDNodes& N,
bool Merge = false) const
Description
Fills the AAMDNodes structure with AA metadata from this instruction. When Merge is true, the existing AA metadata is merged with that from this instruction providing the most-general result.
Declared at: llvm/include/llvm/IR/Instruction.h:276
Parameters
- llvm::AAMDNodes& N
- bool Merge = false
¶void getAllMetadata(
SmallVectorImpl<
std::pair<unsigned int, MDNode*>>& MDs)
const
void getAllMetadata(
SmallVectorImpl<
std::pair<unsigned int, MDNode*>>& MDs)
const
Description
Get all metadata attached to this Instruction. The first element of each pair returned is the KindID, the second element is the metadata value. This list is returned sorted by the KindID.
Declared at: llvm/include/llvm/IR/Instruction.h:260
Parameters
- SmallVectorImpl<std::pair<unsigned int, MDNode*>>& MDs
¶void getAllMetadataOtherThanDebugLoc(
SmallVectorImpl<
std::pair<unsigned int, MDNode*>>& MDs)
const
void getAllMetadataOtherThanDebugLoc(
SmallVectorImpl<
std::pair<unsigned int, MDNode*>>& MDs)
const
Description
This does the same thing as getAllMetadata, except that it filters out the debug location.
Declared at: llvm/include/llvm/IR/Instruction.h:267
Parameters
- SmallVectorImpl<std::pair<unsigned int, MDNode*>>& MDs
¶const llvm::DebugLoc& getDebugLoc() const
const llvm::DebugLoc& getDebugLoc() const
Description
Return the debug location for this node as a DebugLoc.
Declared at: llvm/include/llvm/IR/Instruction.h:331
¶llvm::FastMathFlags getFastMathFlags() const
llvm::FastMathFlags getFastMathFlags() const
Description
Convenience function for getting all the fast-math flags, which must be an operator which supports these flags. See LangRef.html for the meaning of these flags.
Declared at: llvm/include/llvm/IR/Instruction.h:430
¶llvm::Function* getFunction()
llvm::Function* getFunction()
Declared at: llvm/include/llvm/IR/Instruction.h:85
¶const llvm::Function* getFunction() const
const llvm::Function* getFunction() const
Description
Return the function this instruction belongs to. Note: it is undefined behavior to call this on an instruction not currently inserted into a function.
Declared at: llvm/include/llvm/IR/Instruction.h:84
¶llvm::MDNode* getMetadata(
llvm::StringRef Kind) const
llvm::MDNode* getMetadata(
llvm::StringRef Kind) const
Description
Get the metadata of given kind attached to this Instruction. If the metadata is not found then return null.
Declared at: llvm/include/llvm/IR/Instruction.h:251
Parameters
- llvm::StringRef Kind
¶llvm::MDNode* getMetadata(
unsigned int KindID) const
llvm::MDNode* getMetadata(
unsigned int KindID) const
Description
Get the metadata of given kind attached to this Instruction. If the metadata is not found then return null.
Declared at: llvm/include/llvm/IR/Instruction.h:244
Parameters
- unsigned int KindID
¶llvm::Module* getModule()
llvm::Module* getModule()
Declared at: llvm/include/llvm/IR/Instruction.h:75
¶const llvm::Module* getModule() const
const llvm::Module* getModule() const
Description
Return the module owning the function this instruction belongs to or nullptr it the function does not have a module. Note: this is undefined behavior if the instruction does not have a parent, or the parent basic block does not have a parent function.
Declared at: llvm/include/llvm/IR/Instruction.h:74
¶const llvm::Instruction*
getNextNonDebugInstruction() const
const llvm::Instruction*
getNextNonDebugInstruction() const
Description
Return a pointer to the next non-debug instruction in the same basic block as 'this', or nullptr if no such instruction exists.
Declared at: llvm/include/llvm/IR/Instruction.h:611
¶llvm::Instruction* getNextNonDebugInstruction()
llvm::Instruction* getNextNonDebugInstruction()
Declared at: llvm/include/llvm/IR/Instruction.h:612
¶unsigned int getNumSuccessors() const
unsigned int getNumSuccessors() const
Description
Return the number of successors that this instruction has. The instruction must be a terminator.
Declared at: llvm/include/llvm/IR/Instruction.h:669
¶unsigned int getOpcode() const
unsigned int getOpcode() const
Description
Returns a member of one of the enums like Instruction::Add.
Declared at: llvm/include/llvm/IR/Instruction.h:125
¶static const char* getOpcodeName(
unsigned int OpCode)
static const char* getOpcodeName(
unsigned int OpCode)
Declared at: llvm/include/llvm/IR/Instruction.h:142
Parameters
- unsigned int OpCode
¶const char* getOpcodeName() const
const char* getOpcodeName() const
Declared at: llvm/include/llvm/IR/Instruction.h:127
¶inline const llvm::BasicBlock* getParent() const
inline const llvm::BasicBlock* getParent() const
Declared at: llvm/include/llvm/IR/Instruction.h:66
¶inline llvm::BasicBlock* getParent()
inline llvm::BasicBlock* getParent()
Declared at: llvm/include/llvm/IR/Instruction.h:67
¶const llvm::Instruction*
getPrevNonDebugInstruction() const
const llvm::Instruction*
getPrevNonDebugInstruction() const
Description
Return a pointer to the previous non-debug instruction in the same basic block as 'this', or nullptr if no such instruction exists.
Declared at: llvm/include/llvm/IR/Instruction.h:619
¶llvm::Instruction* getPrevNonDebugInstruction()
llvm::Instruction* getPrevNonDebugInstruction()
Declared at: llvm/include/llvm/IR/Instruction.h:620
¶unsigned int getSubclassDataFromInstruction()
const
unsigned int getSubclassDataFromInstruction()
const
Declared at: llvm/include/llvm/IR/Instruction.h:769
¶llvm::BasicBlock* getSuccessor(
unsigned int Idx) const
llvm::BasicBlock* getSuccessor(
unsigned int Idx) const
Description
Return the specified successor. This instruction must be a terminator.
Declared at: llvm/include/llvm/IR/Instruction.h:672
Parameters
- unsigned int Idx
¶bool hasAllowContract() const
bool hasAllowContract() const
Description
Determine whether the allow-contract flag is set.
Declared at: llvm/include/llvm/IR/Instruction.h:422
¶bool hasAllowReassoc() const
bool hasAllowReassoc() const
Description
Determine whether the allow-reassociation flag is set.
Declared at: llvm/include/llvm/IR/Instruction.h:407
¶bool hasAllowReciprocal() const
bool hasAllowReciprocal() const
Description
Determine whether the allow-reciprocal flag is set.
Declared at: llvm/include/llvm/IR/Instruction.h:419
¶bool hasApproxFunc() const
bool hasApproxFunc() const
Description
Determine whether the approximate-math-functions flag is set.
Declared at: llvm/include/llvm/IR/Instruction.h:425
¶bool hasAtomicLoad() const
bool hasAtomicLoad() const
Description
Return true if this atomic instruction loads from memory.
Declared at: llvm/include/llvm/IR/Instruction.h:551
¶bool hasAtomicStore() const
bool hasAtomicStore() const
Description
Return true if this atomic instruction stores to memory.
Declared at: llvm/include/llvm/IR/Instruction.h:554
¶bool hasMetadata() const
bool hasMetadata() const
Description
Return true if this instruction has any metadata attached to it.
Declared at: llvm/include/llvm/IR/Instruction.h:224
¶bool hasMetadata(unsigned int KindID) const
bool hasMetadata(unsigned int KindID) const
Description
Return true if this instruction has the given type of metadata attached.
Declared at: llvm/include/llvm/IR/Instruction.h:233
Parameters
- unsigned int KindID
¶bool hasMetadata(llvm::StringRef Kind) const
bool hasMetadata(llvm::StringRef Kind) const
Description
Return true if this instruction has the given type of metadata attached.
Declared at: llvm/include/llvm/IR/Instruction.h:238
Parameters
- llvm::StringRef Kind
¶bool hasMetadataOtherThanDebugLoc() const
bool hasMetadataOtherThanDebugLoc() const
Description
Return true if this instruction has metadata attached to it other than a debug location.
Declared at: llvm/include/llvm/IR/Instruction.h:228
¶bool hasNoInfs() const
bool hasNoInfs() const
Description
Determine whether the no-infs flag is set.
Declared at: llvm/include/llvm/IR/Instruction.h:413
¶bool hasNoNaNs() const
bool hasNoNaNs() const
Description
Determine whether the no-NaNs flag is set.
Declared at: llvm/include/llvm/IR/Instruction.h:410
¶bool hasNoSignedWrap() const
bool hasNoSignedWrap() const
Description
Determine whether the no signed wrap flag is set.
Declared at: llvm/include/llvm/IR/Instruction.h:349
¶bool hasNoSignedZeros() const
bool hasNoSignedZeros() const
Description
Determine whether the no-signed-zeros flag is set.
Declared at: llvm/include/llvm/IR/Instruction.h:416
¶bool hasNoUnsignedWrap() const
bool hasNoUnsignedWrap() const
Description
Determine whether the no unsigned wrap flag is set.
Declared at: llvm/include/llvm/IR/Instruction.h:346
¶void insertAfter(llvm::Instruction* InsertPos)
void insertAfter(llvm::Instruction* InsertPos)
Description
Insert an unlinked instruction into a basic block immediately after the specified instruction.
Declared at: llvm/include/llvm/IR/Instruction.h:105
Parameters
- llvm::Instruction* InsertPos
¶void insertBefore(llvm::Instruction* InsertPos)
void insertBefore(llvm::Instruction* InsertPos)
Description
Insert an unlinked instruction into a basic block immediately before the specified instruction.
Declared at: llvm/include/llvm/IR/Instruction.h:101
Parameters
- llvm::Instruction* InsertPos
¶inline bool isArithmeticShift() const
inline bool isArithmeticShift() const
Description
Return true if this is an arithmetic shift right.
Declared at: llvm/include/llvm/IR/Instruction.h:170
¶bool isAssociative() const
bool isAssociative() const
Description
Return true if the instruction is associative: Associative operators satisfy: x op (y op z) === (x op y) op z In LLVM, the Add, Mul, And, Or, and Xor operators are associative.
Declared at: llvm/include/llvm/IR/Instruction.h:485
¶static bool isAssociative(unsigned int Opcode)
static bool isAssociative(unsigned int Opcode)
Declared at: llvm/include/llvm/IR/Instruction.h:486
Parameters
- unsigned int Opcode
¶bool isAtomic() const
bool isAtomic() const
Description
Return true if this instruction has an AtomicOrdering of unordered or higher.
Declared at: llvm/include/llvm/IR/Instruction.h:548
¶static inline bool isBinaryOp(unsigned int Opcode)
static inline bool isBinaryOp(unsigned int Opcode)
Declared at: llvm/include/llvm/IR/Instruction.h:151
Parameters
- unsigned int Opcode
¶bool isBinaryOp() const
bool isBinaryOp() const
Declared at: llvm/include/llvm/IR/Instruction.h:130
¶inline bool isBitwiseLogicOp() const
inline bool isBitwiseLogicOp() const
Description
Return true if this is and/or/xor.
Declared at: llvm/include/llvm/IR/Instruction.h:180
¶static inline bool isBitwiseLogicOp(
unsigned int Opcode)
static inline bool isBitwiseLogicOp(
unsigned int Opcode)
Description
Determine if the Opcode is and/or/xor.
Declared at: llvm/include/llvm/IR/Instruction.h:175
Parameters
- unsigned int Opcode
¶static inline bool isCast(unsigned int OpCode)
static inline bool isCast(unsigned int OpCode)
Description
Determine if the OpCode is one of the CastInst instructions.
Declared at: llvm/include/llvm/IR/Instruction.h:185
Parameters
- unsigned int OpCode
¶bool isCast() const
bool isCast() const
Declared at: llvm/include/llvm/IR/Instruction.h:133
¶static bool isCommutative(unsigned int Opcode)
static bool isCommutative(unsigned int Opcode)
Declared at: llvm/include/llvm/IR/Instruction.h:499
Parameters
- unsigned int Opcode
¶bool isCommutative() const
bool isCommutative() const
Description
Return true if the instruction is commutative: Commutative operators satisfy: (x op y) === (y op x) In LLVM, these are the commutative operators, plus SetEQ and SetNE, when applied to any type.
Declared at: llvm/include/llvm/IR/Instruction.h:498
¶bool isEHPad() const
bool isEHPad() const
Description
Return true if the instruction is a variety of EH-block.
Declared at: llvm/include/llvm/IR/Instruction.h:593
¶bool isExact() const
bool isExact() const
Description
Determine whether the exact flag is set.
Declared at: llvm/include/llvm/IR/Instruction.h:356
¶bool isExceptionalTerminator() const
bool isExceptionalTerminator() const
Declared at: llvm/include/llvm/IR/Instruction.h:135
¶static inline bool isExceptionalTerminator(
unsigned int OpCode)
static inline bool isExceptionalTerminator(
unsigned int OpCode)
Description
Returns true if the OpCode is a terminator related to exception handling.
Declared at: llvm/include/llvm/IR/Instruction.h:195
Parameters
- unsigned int OpCode
¶bool isFast() const
bool isFast() const
Description
Determine whether all fast-math-flags are set.
Declared at: llvm/include/llvm/IR/Instruction.h:404
¶bool isFenceLike() const
bool isFenceLike() const
Description
Return true if this instruction behaves like a memory fence: it can load or store to memory location without being given a memory location.
Declared at: llvm/include/llvm/IR/Instruction.h:561
¶static inline bool isFuncletPad(
unsigned int OpCode)
static inline bool isFuncletPad(
unsigned int OpCode)
Description
Determine if the OpCode is one of the FuncletPadInst instructions.
Declared at: llvm/include/llvm/IR/Instruction.h:190
Parameters
- unsigned int OpCode
¶bool isFuncletPad() const
bool isFuncletPad() const
Declared at: llvm/include/llvm/IR/Instruction.h:134
¶bool isIdempotent() const
bool isIdempotent() const
Description
Return true if the instruction is idempotent: Idempotent operators satisfy: x op x === x In LLVM, the And and Or operators are idempotent.
Declared at: llvm/include/llvm/IR/Instruction.h:516
¶static bool isIdempotent(unsigned int Opcode)
static bool isIdempotent(unsigned int Opcode)
Declared at: llvm/include/llvm/IR/Instruction.h:517
Parameters
- unsigned int Opcode
¶bool isIdenticalTo(
const llvm::Instruction* I) const
bool isIdenticalTo(
const llvm::Instruction* I) const
Description
Return true if the specified instruction is exactly identical to the current one. This means that all operands match and any extra information (e.g. load is volatile) agree.
Declared at: llvm/include/llvm/IR/Instruction.h:635
Parameters
- const llvm::Instruction* I
¶bool isIdenticalToWhenDefined(
const llvm::Instruction* I) const
bool isIdenticalToWhenDefined(
const llvm::Instruction* I) const
Description
This is like isIdenticalTo, except that it ignores the SubclassOptionalData flags, which may specify conditions under which the instruction's result is undefined.
Declared at: llvm/include/llvm/IR/Instruction.h:640
Parameters
- const llvm::Instruction* I
¶static inline bool isIndirectTerminator(
unsigned int OpCode)
static inline bool isIndirectTerminator(
unsigned int OpCode)
Description
Returns true if the OpCode is a terminator with indirect targets.
Declared at: llvm/include/llvm/IR/Instruction.h:209
Parameters
- unsigned int OpCode
¶bool isIndirectTerminator() const
bool isIndirectTerminator() const
Declared at: llvm/include/llvm/IR/Instruction.h:138
¶bool isIntDivRem() const
bool isIntDivRem() const
Declared at: llvm/include/llvm/IR/Instruction.h:131
¶static inline bool isIntDivRem(
unsigned int Opcode)
static inline bool isIntDivRem(
unsigned int Opcode)
Declared at: llvm/include/llvm/IR/Instruction.h:155
Parameters
- unsigned int Opcode
¶bool isLifetimeStartOrEnd() const
bool isLifetimeStartOrEnd() const
Description
Return true if the instruction is a llvm.lifetime.start or llvm.lifetime.end marker.
Declared at: llvm/include/llvm/IR/Instruction.h:607
¶inline bool isLogicalShift() const
inline bool isLogicalShift() const
Description
Return true if this is a logical shift left or a logical shift right.
Declared at: llvm/include/llvm/IR/Instruction.h:165
¶bool isNilpotent() const
bool isNilpotent() const
Description
Return true if the instruction is nilpotent: Nilpotent operators satisfy: x op x === Id, where Id is the identity for the operator, i.e. a constant such that x op Id === x and Id op x === x for all x. In LLVM, the Xor operator is nilpotent.
Declared at: llvm/include/llvm/IR/Instruction.h:530
¶static bool isNilpotent(unsigned int Opcode)
static bool isNilpotent(unsigned int Opcode)
Declared at: llvm/include/llvm/IR/Instruction.h:531
Parameters
- unsigned int Opcode
¶bool isSafeToRemove() const
bool isSafeToRemove() const
Description
Return true if the instruction can be removed if the result is unused. When constant folding some instructions cannot be removed even if their results are unused. Specifically terminator instructions and calls that may have side effects cannot be removed without semantically changing the generated program.
Declared at: llvm/include/llvm/IR/Instruction.h:590
¶bool isSameOperationAs(
const llvm::Instruction* I,
unsigned int flags = 0) const
bool isSameOperationAs(
const llvm::Instruction* I,
unsigned int flags = 0) const
Description
This function determines if the specified instruction executes the same operation as the current one. This means that the opcodes, type, operand types and any other factors affecting the operation must be the same. This is similar to isIdenticalTo except the operands themselves don't have to be identical.
Declared at: llvm/include/llvm/IR/Instruction.h:660
Parameters
- const llvm::Instruction* I
- unsigned int flags = 0
Returns
true if the specified instruction is the same operation as the current one. Determine if one instruction is the same operation as another.
¶static inline bool isShift(unsigned int Opcode)
static inline bool isShift(unsigned int Opcode)
Description
Determine if the Opcode is one of the shift instructions.
Declared at: llvm/include/llvm/IR/Instruction.h:160
Parameters
- unsigned int Opcode
¶bool isShift() const
bool isShift() const
Declared at: llvm/include/llvm/IR/Instruction.h:132
¶bool isTerminator() const
bool isTerminator() const
Declared at: llvm/include/llvm/IR/Instruction.h:128
¶static inline bool isTerminator(
unsigned int OpCode)
static inline bool isTerminator(
unsigned int OpCode)
Declared at: llvm/include/llvm/IR/Instruction.h:144
Parameters
- unsigned int OpCode
¶bool isUnaryOp() const
bool isUnaryOp() const
Declared at: llvm/include/llvm/IR/Instruction.h:129
¶static inline bool isUnaryOp(unsigned int Opcode)
static inline bool isUnaryOp(unsigned int Opcode)
Declared at: llvm/include/llvm/IR/Instruction.h:148
Parameters
- unsigned int Opcode
¶bool isUsedOutsideOfBlock(
const llvm::BasicBlock* BB) const
bool isUsedOutsideOfBlock(
const llvm::BasicBlock* BB) const
Description
Return true if there are any uses of this instruction in blocks other than the specified block. Note that PHI nodes are considered to evaluate their operands in the corresponding predecessor block.
Declared at: llvm/include/llvm/IR/Instruction.h:665
Parameters
- const llvm::BasicBlock* BB
¶bool mayHaveSideEffects() const
bool mayHaveSideEffects() const
Description
Return true if the instruction may have side effects. Note that this does not consider malloc and alloca to have side effects because the newly allocated memory is completely invisible to instructions which don't use the returned value. For cases where this matters, isSafeToSpeculativelyExecute may be more appropriate.
Declared at: llvm/include/llvm/IR/Instruction.h:582
¶bool mayReadFromMemory() const
bool mayReadFromMemory() const
Description
Return true if this instruction may read memory.
Declared at: llvm/include/llvm/IR/Instruction.h:539
¶bool mayReadOrWriteMemory() const
bool mayReadOrWriteMemory() const
Description
Return true if this instruction may read or write memory.
Declared at: llvm/include/llvm/IR/Instruction.h:542
¶bool mayThrow() const
bool mayThrow() const
Description
Return true if this instruction may throw an exception.
Declared at: llvm/include/llvm/IR/Instruction.h:557
¶bool mayWriteToMemory() const
bool mayWriteToMemory() const
Description
Return true if this instruction may modify memory.
Declared at: llvm/include/llvm/IR/Instruction.h:536
¶void moveAfter(llvm::Instruction* MovePos)
void moveAfter(llvm::Instruction* MovePos)
Description
Unlink this instruction from its current basic block and insert it into the basic block that MovePos lives in, right after MovePos.
Declared at: llvm/include/llvm/IR/Instruction.h:118
Parameters
- llvm::Instruction* MovePos
¶void moveBefore(llvm::BasicBlock& BB, int I)
void moveBefore(llvm::BasicBlock& BB, int I)
Declared at: llvm/include/llvm/IR/Instruction.h:114
Parameters
- llvm::BasicBlock& BB
- int I
¶void moveBefore(llvm::Instruction* MovePos)
void moveBefore(llvm::Instruction* MovePos)
Description
Unlink this instruction from its current basic block and insert it into the basic block that MovePos lives in, right before MovePos.
Declared at: llvm/include/llvm/IR/Instruction.h:109
Parameters
- llvm::Instruction* MovePos
¶void removeFromParent()
void removeFromParent()
Description
This method unlinks 'this' from the containing basic block, but does not delete it.
Declared at: llvm/include/llvm/IR/Instruction.h:92
¶void replaceSuccessorWith(llvm::BasicBlock* OldBB,
llvm::BasicBlock* NewBB)
void replaceSuccessorWith(llvm::BasicBlock* OldBB,
llvm::BasicBlock* NewBB)
Description
Replace specified successor OldBB to point at the provided block. This instruction must be a terminator.
Declared at: llvm/include/llvm/IR/Instruction.h:680
Parameters
- llvm::BasicBlock* OldBB
- llvm::BasicBlock* NewBB
¶void setAAMetadata(const llvm::AAMDNodes& N)
void setAAMetadata(const llvm::AAMDNodes& N)
Description
Sets the metadata on this instruction from the AAMDNodes structure.
Declared at: llvm/include/llvm/IR/Instruction.h:312
Parameters
- const llvm::AAMDNodes& N
¶void setDebugLoc(llvm::DebugLoc Loc)
void setDebugLoc(llvm::DebugLoc Loc)
Description
Set the debug location information for this instruction.
Declared at: llvm/include/llvm/IR/Instruction.h:328
Parameters
- llvm::DebugLoc Loc
¶void setFast(bool B)
void setFast(bool B)
Description
Set or clear all fast-math-flags on this instruction, which must be an operator which supports this flag. See LangRef.html for the meaning of this flag.
Declared at: llvm/include/llvm/IR/Instruction.h:361
Parameters
- bool B
¶void setFastMathFlags(llvm::FastMathFlags FMF)
void setFastMathFlags(llvm::FastMathFlags FMF)
Description
Convenience function for setting multiple fast-math flags on this instruction, which must be an operator which supports these flags. See LangRef.html for the meaning of these flags.
Declared at: llvm/include/llvm/IR/Instruction.h:396
Parameters
¶void setHasAllowReassoc(bool B)
void setHasAllowReassoc(bool B)
Description
Set or clear the reassociation flag on this instruction, which must be an operator which supports this flag. See LangRef.html for the meaning of this flag.
Declared at: llvm/include/llvm/IR/Instruction.h:366
Parameters
- bool B
¶void setHasAllowReciprocal(bool B)
void setHasAllowReciprocal(bool B)
Description
Set or clear the allow-reciprocal flag on this instruction, which must be an operator which supports this flag. See LangRef.html for the meaning of this flag.
Declared at: llvm/include/llvm/IR/Instruction.h:386
Parameters
- bool B
¶void setHasApproxFunc(bool B)
void setHasApproxFunc(bool B)
Description
Set or clear the approximate-math-functions flag on this instruction, which must be an operator which supports this flag. See LangRef.html for the meaning of this flag.
Declared at: llvm/include/llvm/IR/Instruction.h:391
Parameters
- bool B
¶void setHasNoInfs(bool B)
void setHasNoInfs(bool B)
Description
Set or clear the no-infs flag on this instruction, which must be an operator which supports this flag. See LangRef.html for the meaning of this flag.
Declared at: llvm/include/llvm/IR/Instruction.h:376
Parameters
- bool B
¶void setHasNoNaNs(bool B)
void setHasNoNaNs(bool B)
Description
Set or clear the no-nans flag on this instruction, which must be an operator which supports this flag. See LangRef.html for the meaning of this flag.
Declared at: llvm/include/llvm/IR/Instruction.h:371
Parameters
- bool B
¶void setHasNoSignedWrap(bool b = true)
void setHasNoSignedWrap(bool b = true)
Description
Set or clear the nsw flag on this instruction, which must be an operator which supports this flag. See LangRef.html for the meaning of this flag.
Declared at: llvm/include/llvm/IR/Instruction.h:339
Parameters
- bool b = true
¶void setHasNoSignedZeros(bool B)
void setHasNoSignedZeros(bool B)
Description
Set or clear the no-signed-zeros flag on this instruction, which must be an operator which supports this flag. See LangRef.html for the meaning of this flag.
Declared at: llvm/include/llvm/IR/Instruction.h:381
Parameters
- bool B
¶void setHasNoUnsignedWrap(bool b = true)
void setHasNoUnsignedWrap(bool b = true)
Description
Set or clear the nuw flag on this instruction, which must be an operator which supports this flag. See LangRef.html for the meaning of this flag.
Declared at: llvm/include/llvm/IR/Instruction.h:335
Parameters
- bool b = true
¶void setInstructionSubclassData(unsigned short D)
void setInstructionSubclassData(unsigned short D)
Declared at: llvm/include/llvm/IR/Instruction.h:764
Parameters
- unsigned short D
¶void setIsExact(bool b = true)
void setIsExact(bool b = true)
Description
Set or clear the exact flag on this instruction, which must be an operator which supports this flag. See LangRef.html for the meaning of this flag.
Declared at: llvm/include/llvm/IR/Instruction.h:343
Parameters
- bool b = true
¶void setMetadata(llvm::StringRef Kind,
llvm::MDNode* Node)
void setMetadata(llvm::StringRef Kind,
llvm::MDNode* Node)
Declared at: llvm/include/llvm/IR/Instruction.h:281
Parameters
- llvm::StringRef Kind
- llvm::MDNode* Node
¶void setMetadata(unsigned int KindID,
llvm::MDNode* Node)
void setMetadata(unsigned int KindID,
llvm::MDNode* Node)
Description
Set the metadata of the specified kind to the specified node. This updates or replaces metadata if already present, or removes it if Node is null.
Declared at: llvm/include/llvm/IR/Instruction.h:280
Parameters
- unsigned int KindID
- llvm::MDNode* Node
¶void setProfWeight(uint64_t W)
void setProfWeight(uint64_t W)
Description
Sets the branch_weights metadata to \p W for CallInst.
Declared at: llvm/include/llvm/IR/Instruction.h:325
Parameters
- uint64_t W
¶void setSuccessor(unsigned int Idx,
llvm::BasicBlock* BB)
void setSuccessor(unsigned int Idx,
llvm::BasicBlock* BB)
Description
Update the specified successor to point at the provided block. This instruction must be a terminator.
Declared at: llvm/include/llvm/IR/Instruction.h:676
Parameters
- unsigned int Idx
- llvm::BasicBlock* BB
¶void swapProfMetadata()
void swapProfMetadata()
Description
If the instruction has "branch_weights" MD_prof metadata and the MDNode has three operands (including name string), swap the order of the metadata.
Declared at: llvm/include/llvm/IR/Instruction.h:292
¶const llvm::Instruction* user_back() const
const llvm::Instruction* user_back() const
Declared at: llvm/include/llvm/IR/Instruction.h:64
¶llvm::Instruction* user_back()
llvm::Instruction* user_back()
Description
Specialize the methods defined in Value, as we know that an instruction can only be used by other instructions.
Declared at: llvm/include/llvm/IR/Instruction.h:63
¶~Instruction()
~Instruction()
Declared at: llvm/include/llvm/IR/Instruction.h:55