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

Inherited from User:

Inherited from Value:

Methods

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)

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)

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)

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)

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)

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

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)

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

llvm::FastMathFlags FMF

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)

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>)

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()

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()

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

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)

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

Parameters

unsigned int ID1
unsigned int ID2

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()

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

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

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

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

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

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

Description

Return the debug location for this node as a DebugLoc.

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

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()

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

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

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

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()

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

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

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()

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

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

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)

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

Parameters

unsigned int OpCode

const char* getOpcodeName() const

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

inline const llvm::BasicBlock* getParent() const

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

inline llvm::BasicBlock* getParent()

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

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()

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

unsigned int getSubclassDataFromInstruction()
    const

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

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

Description

Determine whether the allow-contract flag is set.

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

bool hasAllowReassoc() const

Description

Determine whether the allow-reassociation flag is set.

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

bool hasAllowReciprocal() const

Description

Determine whether the allow-reciprocal flag is set.

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

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

Description

Return true if this atomic instruction loads from memory.

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

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

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

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

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

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

Description

Determine whether the no-infs flag is set.

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

bool hasNoNaNs() const

Description

Determine whether the no-NaNs flag is set.

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

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

Description

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

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

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)

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)

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

Description

Return true if this is an arithmetic shift right.

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

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)

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

Parameters

unsigned int Opcode

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)

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

Parameters

unsigned int Opcode

bool isBinaryOp() const

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

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)

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)

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

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

static bool isCommutative(unsigned int Opcode)

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

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

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

Description

Determine whether the exact flag is set.

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

bool isExceptionalTerminator() const

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

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

Description

Determine whether all fast-math-flags are set.

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

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)

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

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

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)

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

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

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

Parameters

const llvm::Instruction* I

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

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

bool isIntDivRem() const

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

static inline bool isIntDivRem(
    unsigned int Opcode)

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

Parameters

unsigned int Opcode

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

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

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)

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

Parameters

unsigned int Opcode

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

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)

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

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

bool isTerminator() const

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

static inline bool isTerminator(
    unsigned int OpCode)

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

Parameters

unsigned int OpCode

bool isUnaryOp() const

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

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

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

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

Description

Return true if this instruction may read memory.

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

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

Description

Return true if this instruction may throw an exception.

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

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)

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)

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

Parameters

llvm::BasicBlock& BB
int 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:109

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

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)

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)

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)

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)

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

llvm::FastMathFlags FMF

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)

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)

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)

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)

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)

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)

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)

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)

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

Parameters

unsigned short D

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)

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

Parameters

llvm::StringRef Kind
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)

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)

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()

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

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

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()

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