class Instruction

Declaration

class Instruction : public User, public ilist_node_with_parent { /* full declaration omitted */ };

Description

LLVM Value Representation This is a very important LLVM class. It is the base class of all values computed by a program that may be used as operands to other values. Value is the super class of other important classes such as Instruction and Function. All Values have a Type. Type is not a subclass of Value. Some values can have a name and they belong to some Module. Setting the name on the Value automatically updates the module's symbol table. Every value has a "use list" that keeps track of which other Values are using this Value. A Value can also have an arbitrary number of ValueHandle objects that watch it and listen to RAUW and Destroy events. See llvm/IR/ValueHandle.h for details.

Declared at: llvm/include/llvm/IR/Instruction.h:42

Inherits from: User, ilist_node_with_parent

Member Variables

private llvm::BasicBlock* Parent
private llvm::DebugLoc DbgLoc
private unsigned int Order = 0
Relative order of this instruction in its parent basic block. Used for O(1) local dominance checks between instructions.

Inherited from Value:

protected SubclassOptionalData
protected NumUserOperands
protected IsUsedByMD
protected HasName
protected HasMetadata
protected HasHungOffUses
protected HasDescriptor
public static MaxAlignmentExponent = 32
public static MaximumAlignment = 1ULL << MaxAlignmentExponent

Method Overview

Inherited from User:

Inherited from Value:

Methods

Instruction(const llvm::Instruction&)

Declared at: llvm/include/llvm/IR/Instruction.h:83

Parameters

const llvm::Instruction&

Instruction(llvm::Type* Ty,
            unsigned int iType,
            llvm::Use* Ops,
            unsigned int NumOps,
            llvm::BasicBlock* InsertAtEnd)

Declared at: llvm/include/llvm/IR/Instruction.h:848

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)

Declared at: llvm/include/llvm/IR/Instruction.h:846

Parameters

llvm::Type* Ty
unsigned int iType
llvm::Use* Ops
unsigned int NumOps
llvm::Instruction* InsertBefore = nullptr

void addAnnotationMetadata(
    llvm::StringRef Annotation)

Description

Adds an !annotation metadata node with \p Annotation to this instruction. If this instruction already has !annotation metadata, append \p Annotation to the existing node.

Declared at: llvm/include/llvm/IR/Instruction.h:330

Parameters

llvm::StringRef Annotation

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:478

Parameters

const llvm::Value* V

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:493

Parameters

const llvm::DILocation* LocA
const llvm::DILocation* LocB

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:750

Parameters

const llvm::Value* V

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:697

llvm::Instruction* cloneImpl() const

Description

Create a copy of this instruction.

Declared at: llvm/include/llvm/IR/Instruction.h:853

bool comesBefore(
    const llvm::Instruction* Other) const

Description

Given an instruction Other in the same basic block as this instruction, return true if this instruction comes before Other. In this worst case, this takes linear time in the number of instructions in the block. The results are cached, so in common cases when the block remains unmodified, it takes constant time.

Declared at: llvm/include/llvm/IR/Instruction.h:150

Parameters

const llvm::Instruction* Other

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:438

Parameters

llvm::FastMathFlags FMF

void copyFastMathFlags(const llvm::Instruction* I)

Description

Copy I's fast-math flags

Declared at: llvm/include/llvm/IR/Instruction.h:470

Parameters

const llvm::Instruction* I

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:474

Parameters

const llvm::Value* V
bool IncludeWrapFlags = true

void copyMetadata(
    const llvm::Instruction& SrcInst,
    ArrayRef<unsigned int> WL =
        llvm::ArrayRef<unsigned int>())

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:300

Parameters

const llvm::Instruction& SrcInst
ArrayRef<unsigned int> WL = llvm::ArrayRef<unsigned int>()

void dropLocation()

Description

Drop the instruction's debug location. This does not guarantee removal of the !dbg source location attachment, as it must set a line 0 location with scope information attached on call instructions. To guarantee removal of the !dbg attachment, use the \ref setDebugLoc() API. 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:507

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:378

void dropUndefImplyingAttrsAndUnknownMetadata(
    ArrayRef<unsigned int> KnownIDs = {})

Description

This function drops non-debug unknown metadata (through dropUnknownNonDebugMetadata). For calls, it also drops parameter and return attributes that can cause undefined behaviour. Both of these should be done by passes which move instructions in IR.

Declared at: llvm/include/llvm/IR/Instruction.h:385

Parameters

ArrayRef<unsigned int> KnownIDs = {}

void dropUnknownNonDebugMetadata(unsigned int ID1,
                                 unsigned int ID2)

Declared at: llvm/include/llvm/IR/Instruction.h:321

Parameters

unsigned int ID1
unsigned int ID2

void dropUnknownNonDebugMetadata(unsigned int ID1)

Declared at: llvm/include/llvm/IR/Instruction.h:318

Parameters

unsigned int ID1

void dropUnknownNonDebugMetadata()

Declared at: llvm/include/llvm/IR/Instruction.h:315

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. dropUndefImplyingAttrsAndUnknownMetadata should be used instead of this API if the Instruction being modified is a call.

Declared at: llvm/include/llvm/IR/Instruction.h:314

Parameters

ArrayRef<unsigned int> KnownIDs

SymbolTableList<Instruction>::iterator
eraseFromParent()

Description

This method unlinks 'this' from the containing basic block and deletes it.

Declared at: llvm/include/llvm/IR/Instruction.h:122

Returns

an iterator pointing to the element after the erased one

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:341

Parameters

uint64_t& TrueVal
uint64_t& FalseVal

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:346

Parameters

uint64_t& TotalVal

llvm::AAMDNodes getAAMetadata() const

Description

Returns the AA metadata for this instruction.

Declared at: llvm/include/llvm/IR/Instruction.h:333

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:280

Parameters

SmallVectorImpl<std::pair<unsigned int, MDNode*>>& MDs

void getAllMetadataImpl(
    SmallVectorImpl<
        std::pair<unsigned int, MDNode*>>&) const

Declared at: llvm/include/llvm/IR/Instruction.h:514

Parameters

SmallVectorImpl<std::pair<unsigned int, MDNode*>>&

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:287

Parameters

SmallVectorImpl<std::pair<unsigned int, MDNode*>>& MDs

const llvm::DebugLoc& getDebugLoc() const

Description

Return the debug location for this node as a DebugLoc.

Declared at: llvm/include/llvm/IR/Instruction.h:352

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:467

llvm::Function* getFunction()

Declared at: llvm/include/llvm/IR/Instruction.h:110

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:109

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:271

Parameters

llvm::StringRef Kind

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:264

Parameters

unsigned int KindID

llvm::MDNode* getMetadataImpl(
    llvm::StringRef Kind) const

Declared at: llvm/include/llvm/IR/Instruction.h:512

Parameters

llvm::StringRef Kind

llvm::MDNode* getMetadataImpl(
    unsigned int KindID) const

Declared at: llvm/include/llvm/IR/Instruction.h:511

Parameters

unsigned int KindID

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:99

llvm::Module* getModule()

Declared at: llvm/include/llvm/IR/Instruction.h:100

llvm::Instruction* getNextNonDebugInstruction(
    bool SkipPseudoOp = false)

Declared at: llvm/include/llvm/IR/Instruction.h:675

Parameters

bool SkipPseudoOp = false

const llvm::Instruction*
getNextNonDebugInstruction(
    bool SkipPseudoOp = false) 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. Skip any pseudo operations if \c SkipPseudoOp is true.

Declared at: llvm/include/llvm/IR/Instruction.h:674

Parameters

bool SkipPseudoOp = false

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:736

unsigned int getOpcode() const

Description

Returns a member of one of the enums like Instruction::Add.

Declared at: llvm/include/llvm/IR/Instruction.h:157

static const char* getOpcodeName(
    unsigned int OpCode)

Declared at: llvm/include/llvm/IR/Instruction.h:175

Parameters

unsigned int OpCode

const char* getOpcodeName() const

Declared at: llvm/include/llvm/IR/Instruction.h:159

inline llvm::BasicBlock* getParent()

Declared at: llvm/include/llvm/IR/Instruction.h:92

inline const llvm::BasicBlock* getParent() const

Declared at: llvm/include/llvm/IR/Instruction.h:91

const llvm::Instruction*
getPrevNonDebugInstruction(
    bool SkipPseudoOp = false) 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. Skip any pseudo operations if \c SkipPseudoOp is true.

Declared at: llvm/include/llvm/IR/Instruction.h:685

Parameters

bool SkipPseudoOp = false

llvm::Instruction* getPrevNonDebugInstruction(
    bool SkipPseudoOp = false)

Declared at: llvm/include/llvm/IR/Instruction.h:686

Parameters

bool SkipPseudoOp = false

template <typename BitfieldElement>
typename BitfieldElement::Type getSubclassData()
    const

Declared at: llvm/include/llvm/IR/Instruction.h:827

Templates

BitfieldElement

unsigned short getSubclassDataFromValue() const

Declared at: llvm/include/llvm/IR/Instruction.h:816

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:739

Parameters

unsigned int Idx

bool hasAllowContract() const

Description

Determine whether the allow-contract flag is set.

Declared at: llvm/include/llvm/IR/Instruction.h:459

bool hasAllowReassoc() const

Description

Determine whether the allow-reassociation flag is set.

Declared at: llvm/include/llvm/IR/Instruction.h:444

bool hasAllowReciprocal() const

Description

Determine whether the allow-reciprocal flag is set.

Declared at: llvm/include/llvm/IR/Instruction.h:456

bool hasApproxFunc() const

Description

Determine whether the approximate-math-functions flag is set.

Declared at: llvm/include/llvm/IR/Instruction.h:462

bool hasAtomicLoad() const

Description

Return true if this atomic instruction loads from memory.

Declared at: llvm/include/llvm/IR/Instruction.h:593

bool hasAtomicStore() const

Description

Return true if this atomic instruction stores to memory.

Declared at: llvm/include/llvm/IR/Instruction.h:596

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:258

Parameters

llvm::StringRef Kind

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:253

Parameters

unsigned int KindID

bool hasMetadata() const

Description

Return true if this instruction has any metadata attached to it.

Declared at: llvm/include/llvm/IR/Instruction.h:246

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:250

bool hasNoInfs() const

Description

Determine whether the no-infs flag is set.

Declared at: llvm/include/llvm/IR/Instruction.h:450

bool hasNoNaNs() const

Description

Determine whether the no-NaNs flag is set.

Declared at: llvm/include/llvm/IR/Instruction.h:447

bool hasNoSignedWrap() const

Description

Determine whether the no signed wrap flag is set.

Declared at: llvm/include/llvm/IR/Instruction.h:370

bool hasNoSignedZeros() const

Description

Determine whether the no-signed-zeros flag is set.

Declared at: llvm/include/llvm/IR/Instruction.h:453

bool hasNoUnsignedWrap() const

Description

Determine whether the no unsigned wrap flag is set.

Declared at: llvm/include/llvm/IR/Instruction.h:367

bool hasPoisonGeneratingFlags() const

Description

Return true if this operator has flags which may cause this instruction to evaluate to poison despite having non-poison inputs.

Declared at: llvm/include/llvm/IR/Instruction.h:374

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:130

Parameters

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:126

Parameters

llvm::Instruction* InsertPos

inline bool isArithmeticShift() const

Description

Return true if this is an arithmetic shift right.

Declared at: llvm/include/llvm/IR/Instruction.h:203

static bool isAssociative(unsigned int Opcode)

Declared at: llvm/include/llvm/IR/Instruction.h:528

Parameters

unsigned int Opcode

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:527

bool isAtomic() const

Description

Return true if this instruction has an AtomicOrdering of unordered or higher.

Declared at: llvm/include/llvm/IR/Instruction.h:590

bool isBinaryOp() const

Declared at: llvm/include/llvm/IR/Instruction.h:162

static inline bool isBinaryOp(unsigned int Opcode)

Declared at: llvm/include/llvm/IR/Instruction.h:184

Parameters

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:208

Parameters

unsigned int Opcode

inline bool isBitwiseLogicOp() const

Description

Return true if this is and/or/xor.

Declared at: llvm/include/llvm/IR/Instruction.h:213

bool isCast() const

Declared at: llvm/include/llvm/IR/Instruction.h:165

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:218

Parameters

unsigned int OpCode

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:540

static bool isCommutative(unsigned int Opcode)

Declared at: llvm/include/llvm/IR/Instruction.h:541

Parameters

unsigned int Opcode

bool isDebugOrPseudoInst() const

Description

Return true if the instruction is a DbgInfoIntrinsic or PseudoProbeInst.

Declared at: llvm/include/llvm/IR/Instruction.h:668

bool isEHPad() const

Description

Return true if the instruction is a variety of EH-block.

Declared at: llvm/include/llvm/IR/Instruction.h:647

bool isExact() const

Description

Determine whether the exact flag is set.

Declared at: llvm/include/llvm/IR/Instruction.h:388

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:228

Parameters

unsigned int OpCode

bool isExceptionalTerminator() const

Declared at: llvm/include/llvm/IR/Instruction.h:167

bool isFast() const

Description

Determine whether all fast-math-flags are set.

Declared at: llvm/include/llvm/IR/Instruction.h:441

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:606

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:223

Parameters

unsigned int OpCode

bool isFuncletPad() const

Declared at: llvm/include/llvm/IR/Instruction.h:166

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:558

static bool isIdempotent(unsigned int Opcode)

Declared at: llvm/include/llvm/IR/Instruction.h:559

Parameters

unsigned int Opcode

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:702

Parameters

const llvm::Instruction* I

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:707

Parameters

const llvm::Instruction* I

static inline bool isIntDivRem(
    unsigned int Opcode)

Declared at: llvm/include/llvm/IR/Instruction.h:188

Parameters

unsigned int Opcode

bool isIntDivRem() const

Declared at: llvm/include/llvm/IR/Instruction.h:163

bool isLaunderOrStripInvariantGroup() const

Description

Return true if the instruction is a llvm.launder.invariant.group or llvm.strip.invariant.group.

Declared at: llvm/include/llvm/IR/Instruction.h:665

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:661

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:198

static bool isNilpotent(unsigned int Opcode)

Declared at: llvm/include/llvm/IR/Instruction.h:573

Parameters

unsigned int Opcode

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:572

bool isOnlyUserOfAnyOperand()

Description

It checks if this instruction is the only user of at least one of its operands.

Declared at: llvm/include/llvm/IR/Instruction.h:173

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:640

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:727

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)

Description

Determine if the Opcode is one of the shift instructions.

Declared at: llvm/include/llvm/IR/Instruction.h:193

Parameters

unsigned int Opcode

bool isShift() const

Declared at: llvm/include/llvm/IR/Instruction.h:164

static inline bool isTerminator(
    unsigned int OpCode)

Declared at: llvm/include/llvm/IR/Instruction.h:177

Parameters

unsigned int OpCode

bool isTerminator() const

Declared at: llvm/include/llvm/IR/Instruction.h:160

bool isUnaryOp() const

Declared at: llvm/include/llvm/IR/Instruction.h:161

static inline bool isUnaryOp(unsigned int Opcode)

Declared at: llvm/include/llvm/IR/Instruction.h:181

Parameters

unsigned int Opcode

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:732

Parameters

const llvm::BasicBlock* BB

bool isVolatile() const

Description

Return true if this instruction has a volatile memory access.

Declared at: llvm/include/llvm/IR/Instruction.h:599

bool mayHaveSideEffects() const

Description

Return true if the instruction may have side effects. Side effects are: * Writing to memory. * Unwinding. * Not returning (e.g. an infinite loop). 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:632

bool mayReadFromMemory() const

Description

Return true if this instruction may read memory.

Declared at: llvm/include/llvm/IR/Instruction.h:581

bool mayReadOrWriteMemory() const

Description

Return true if this instruction may read or write memory.

Declared at: llvm/include/llvm/IR/Instruction.h:584

bool mayThrow() const

Description

Return true if this instruction may throw an exception.

Declared at: llvm/include/llvm/IR/Instruction.h:602

bool mayWriteToMemory() const

Description

Return true if this instruction may modify memory.

Declared at: llvm/include/llvm/IR/Instruction.h:578

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:143

Parameters

llvm::Instruction* MovePos

void moveBefore(
    llvm::BasicBlock& BB,
    SymbolTableList<Instruction>::iterator I)

Description

Unlink this instruction and insert into BB before I.

Declared at: llvm/include/llvm/IR/Instruction.h:139

Parameters

llvm::BasicBlock& BB
SymbolTableList<Instruction>::iterator I

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:134

Parameters

llvm::Instruction* MovePos

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:117

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:747

Parameters

llvm::BasicBlock* OldBB
llvm::BasicBlock* NewBB

void setAAMetadata(const llvm::AAMDNodes& N)

Description

Sets the AA metadata on this instruction from the AAMDNodes structure.

Declared at: llvm/include/llvm/IR/Instruction.h:336

Parameters

const llvm::AAMDNodes& N

void setDebugLoc(llvm::DebugLoc Loc)

Description

Set the debug location information for this instruction.

Declared at: llvm/include/llvm/IR/Instruction.h:349

Parameters

llvm::DebugLoc Loc

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:393

Parameters

bool B

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:433

Parameters

llvm::FastMathFlags FMF

void setHasAllowContract(bool B)

Description

Set or clear the allow-contract 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:423

Parameters

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:398

Parameters

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:418

Parameters

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:428

Parameters

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:408

Parameters

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:403

Parameters

bool B

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:360

Parameters

bool b = true

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:413

Parameters

bool B

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:356

Parameters

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:364

Parameters

bool b = true

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:294

Parameters

unsigned int KindID
llvm::MDNode* Node

void setMetadata(llvm::StringRef Kind,
                 llvm::MDNode* Node)

Declared at: llvm/include/llvm/IR/Instruction.h:295

Parameters

llvm::StringRef Kind
llvm::MDNode* Node

void setParent(llvm::BasicBlock* P)

Declared at: llvm/include/llvm/IR/Instruction.h:820

Parameters

llvm::BasicBlock* P

template <typename BitfieldElement>
void setSubclassData(
    typename BitfieldElement::Type Value)

Declared at: llvm/include/llvm/IR/Instruction.h:836

Templates

BitfieldElement

Parameters

typename BitfieldElement::Type Value

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:743

Parameters

unsigned int Idx
llvm::BasicBlock* BB

void setValueSubclassData(unsigned short D)

Declared at: llvm/include/llvm/IR/Instruction.h:812

Parameters

unsigned short D

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:306

void updateLocationAfterHoist()

Description

Updates the debug location given that the instruction has been hoisted from a block to a predecessor of that block. 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:499

const llvm::Instruction* user_back() const

Declared at: llvm/include/llvm/IR/Instruction.h:89

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:88

bool willReturn() const

Description

Return true if the instruction will return (unwinding is considered as a form of returning control flow here).

Declared at: llvm/include/llvm/IR/Instruction.h:644

~Instruction()

Declared at: llvm/include/llvm/IR/Instruction.h:80