An instruction for reading from memory.
More...
#include "llvm/IR/Instructions.h"
Inheritance diagram for llvm::LoadInst:
Return true if this is a load from a volatile memory location.
Specify whether this is a volatile load or not.
Return the alignment of the access that is being performed.
Returns the ordering constraint of this load instruction.
Sets the ordering constraint of this load instruction.
Returns the synchronization scope
ID of this load instruction.
Sets the synchronization scope
ID of this load instruction.
Sets the ordering constraint and the synchronization scope
ID of this load instruction.
Returns the address space of the pointer operand.
Transparently provide more efficient getOperand methods.
Clone any debug-info attached to From onto this instruction.
Return a range over the DbgRecords attached to this instruction.
Return an iterator to the position of the "Next"
DbgRecord after this instruction, or std::nullopt.
Returns true if any DbgRecords are attached to this instruction.
Transfer any DbgRecords on the position It onto this instruction, by simply adopting the sequence of DbgRecords (which is efficient) if possible, by merging two sequences otherwise.
Erase any DbgRecords attached to this instruction.
Erase a single
DbgRecord I that is attached to this instruction.
Handle the debug-info implications of this instruction being removed.
Specialize the methods defined in
Value, as we know that an instruction can only be used by other instructions.
Return the module owning the function this instruction belongs to or nullptr it the function does not have a module.
Return the function this instruction belongs to.
Get the data layout of the module this instruction belongs to.
This method unlinks 'this' from the containing basic block, but does not delete it.
This method unlinks 'this' from the containing basic block and deletes it.
Insert an unlinked instruction into a basic block immediately before the specified instruction.
Insert an unlinked instruction into a basic block immediately before the specified position.
Insert an unlinked instruction into a basic block immediately after the specified instruction.
Insert an unlinked instruction into a basic block immediately after the specified position.
Inserts an unlinked instruction into ParentBB at position It and returns the iterator of the inserted instruction.
Unlink this instruction from its current basic block and insert it into the basic block that MovePos lives in, right before MovePos.
Unlink this instruction from its current basic block and insert it into the basic block that MovePos lives in, right before MovePos.
Perform a
moveBefore operation, while signalling that the caller intends to preserve the original ordering of instructions.
Perform a
moveBefore operation, while signalling that the caller intends to preserve the original ordering of instructions.
Perform a
moveBefore operation, while signalling that the caller intends to preserve the original ordering of instructions.
Unlink this instruction and insert into BB before I.
Unlink this instruction from its current basic block and insert it into the basic block that MovePos lives in, right after MovePos.
Unlink this instruction from its current basic block and insert it into the basic block that MovePos lives in, right after MovePos.
Given an instruction Other in the same basic block as this instruction, return true if this instruction comes before Other.
Get the first insertion point at which the result of this instruction is defined.
Returns a member of one of the enums like Instruction::Add.
It checks if this instruction is the only user of at least one of its operands.
Return true if this is a logical shift left or a logical shift right.
Return true if this is an arithmetic shift right.
Return true if this is and/or/xor.
Return true if this instruction has any metadata attached to it.
Return true if this instruction has metadata attached to it other than a debug location.
Return true if this instruction has the given type of metadata attached.
Return true if this instruction has the given type of metadata attached.
Get the metadata of given kind attached to this
Instruction.
Get the metadata of given kind attached to this
Instruction.
This does the same thing as getAllMetadata, except that it filters out the debug location.
Set the metadata of the specified kind to the specified node.
Copy metadata from SrcInst to this instruction.
Erase all metadata that matches the predicate.
If the instruction has "branch_weights" MD_prof metadata and the
MDNode has three operands (including name string), swap the order of the metadata.
Adds an !annotation metadata node with Annotation to this instruction.
Adds an !annotation metadata node with an array of
Annotations as a tuple to this instruction.
Returns the
AA metadata for this instruction.
Sets the
AA metadata on this instruction from the
AAMDNodes structure.
Sets the nosanitize metadata on this instruction.
Retrieve total raw weight values of a branch.
Set the debug location information for this instruction.
Return the debug location for this node as a
DebugLoc.
Fetch the debug location for this node, unless this is a debug intrinsic, in which case fetch the debug location of the next non-debug node.
Set or clear the nuw flag on this instruction, which must be an operator which supports this flag.
Set or clear the nsw flag on this instruction, which must be an operator which supports this flag.
Set or clear the exact flag on this instruction, which must be an operator which supports this flag.
Set or clear the nneg flag on this instruction, which must be a zext instruction.
Determine whether the no unsigned wrap flag is set.
Determine whether the no signed wrap flag is set.
Determine whether the the nneg flag is set.
Return true if this operator has flags which may cause this instruction to evaluate to poison despite having non-poison inputs.
Drops flags that may cause this instruction to evaluate to poison despite having non-poison inputs.
Return true if this instruction has poison-generating metadata.
Drops metadata that may generate poison.
Return true if this instruction has poison-generating attribute.
Drops return attributes that may generate poison.
Return true if this instruction has poison-generating flags, return attributes or metadata.
Drops flags, return attributes and metadata that may generate poison.
This function drops non-debug unknown metadata (through dropUnknownNonDebugMetadata).
Drop any attributes or metadata that can cause immediate undefined behavior.
Return true if this instruction has UB-implying attributes that can cause immediate undefined behavior.
Determine whether the exact flag is set.
Set or clear all fast-math-flags on this instruction, which must be an operator which supports this flag.
Set or clear the reassociation flag on this instruction, which must be an operator which supports this flag.
Set or clear the no-nans flag on this instruction, which must be an operator which supports this flag.
Set or clear the no-infs flag on this instruction, which must be an operator which supports this flag.
Set or clear the no-signed-zeros flag on this instruction, which must be an operator which supports this flag.
Set or clear the allow-reciprocal flag on this instruction, which must be an operator which supports this flag.
Set or clear the allow-contract flag on this instruction, which must be an operator which supports this flag.
Set or clear the approximate-math-functions flag on this instruction, which must be an operator which supports this flag.
Convenience function for setting multiple fast-math flags on this instruction, which must be an operator which supports these flags.
Convenience function for transferring all fast-math flag values to this instruction, which must be an operator which supports these flags.
Determine whether all fast-math-flags are set.
Determine whether the allow-reassociation flag is set.
Determine whether the no-NaNs flag is set.
Determine whether the no-infs flag is set.
Determine whether the no-signed-zeros flag is set.
Determine whether the allow-reciprocal flag is set.
Determine whether the allow-contract flag is set.
Determine whether the approximate-math-functions flag is set.
Convenience function for getting all the fast-math flags, which must be an operator which supports these flags.
Copy I's fast-math flags.
Convenience method to copy supported exact, fast-math, and (optionally) wrapping flags from V to this instruction.
Logical 'and' of any supported wrapping, exact, and fast-math flags of V and this instruction.
Merge 2 debug locations and apply it to the
Instruction.
Updates the debug location given that the instruction has been hoisted from a block to a predecessor of that block.
Drop the instruction's debug location.
Merge the
DIAssignID metadata from this instruction and those attached to instructions in
SourceInstructions.
Return true if the instruction is associative:
Return true if the instruction is commutative:
Return true if the instruction is idempotent:
Return true if the instruction is nilpotent:
Return true if this instruction may modify memory.
Return true if this instruction may read memory.
Return true if this instruction may read or write memory.
Return true if this instruction has an
AtomicOrdering of unordered or higher.
Return true if this atomic instruction loads from memory.
Return true if this atomic instruction stores to memory.
Return true if this instruction has a volatile memory access.
Return the type this instruction accesses in memory, if any.
Return true if this instruction may throw an exception.
Return true if this instruction behaves like a memory fence: it can load or store to memory location without being given a memory location.
Return true if the instruction may have side effects.
Return true if the instruction can be removed if the result is unused.
Return true if the instruction will return (unwinding is considered as a form of returning control flow here).
Return true if the instruction is a variety of EH-block.
Return true if the instruction is a llvm.lifetime.start or llvm.lifetime.end marker.
Return true if the instruction is a llvm.launder.invariant.group or llvm.strip.invariant.group.
Create a copy of 'this' instruction that is identical in all ways except the following:
Return true if the specified instruction is exactly identical to the current one.
This is like isIdenticalTo, except that it ignores the SubclassOptionalData flags, which may specify conditions under which the instruction's result is undefined.
This function determines if the specified instruction executes the same operation as the current one.
This function determines if the speficied instruction has the same "special" characteristics as the current one.
Return true if there are any uses of this instruction in blocks other than the specified block.
Return the number of successors that this instruction has.
Return the specified successor. This instruction must be a terminator.
Update the specified successor to point at the provided block.
Replace specified successor OldBB to point at the provided block.
Drop all unknown metadata except for debug locations.
Free memory allocated for
User and
Use objects.
Placement delete - required by std, called if the ctor throws.
Placement delete - required by std, called if the ctor throws.
Placement delete - required by std, called if the ctor throws.
Returns the descriptor co-allocated with this
User instance.
Returns the descriptor co-allocated with this
User instance.
Subclasses with hung off uses need to manage the operand count themselves.
A droppable user is a user for which uses can be dropped without affecting correctness and should be dropped rather than preventing a transformation from happening.
Drop all references to operands.
Replace uses of one
Value with another.
Delete a pointer to a generic
Value.
Support for debugging, callable in GDB: V->
dump()
All values are typed, get the type of this value.
All values hold a context through their type.
Return a constant reference to the value's name.
Change the name of the value.
Transfer the name from V to this value.
Change all uses of this to point to a new
Value.
Change non-metadata uses of this to point to a new
Value.
Go through the uses list for this definition and make each use point to "V" if the callback ShouldReplace returns true for the given
Use.
replaceUsesOutsideBlock - Go through the uses list for this definition and make each use point to "V" instead of "this" when the use is outside the block.
Return true if there is exactly one use of this value.
Return true if this
Value has exactly N uses.
Return true if this value has N uses or more.
Return true if there is exactly one user of this value.
Return true if there is exactly one use of this value that cannot be dropped.
Return true if there is exactly one unique user of this value that cannot be dropped (that user can have multiple uses of this value).
Return true if there this value.
Return true if this value has N uses or more.
Remove every uses that can safely be removed.
Remove every use of this value in
User that can safely be removed.
Check if this value is used in the specified basic block.
This method computes the number of uses of this
Value.
This method should only be used by the
Use class.
Return an
ID for the concrete type of this object.
Return the raw optional flags value contained in this value.
Clear the optional flags contained in this value.
Check the optional flags for equality.
Return true if there is a value handle associated with this value.
Return true if there is metadata referencing this value.
Return true if this value is a swifterror value.
Strip off pointer casts, all-zero GEPs and address space casts.
Strip off pointer casts, all-zero GEPs, address space casts, and aliases.
Strip off pointer casts, all-zero GEPs and address space casts but ensures the representation of the result stays the same.
Strip off pointer casts, all-zero GEPs, single-argument phi nodes and invariant group info.
Strip off pointer casts and all-constant inbounds GEPs.
Accumulate the constant offset this value has compared to a base pointer.
This is a wrapper around stripAndAccumulateConstantOffsets with the in-bounds requirement set to false.
Strip off pointer casts and inbounds GEPs.
If this ptr is provably equal to Other plus a constant offset, return that offset in bytes.
Return true if the memory object referred to by V can by freed in the scope for which the SSA value defining the allocation is statically defined.
Returns the number of bytes known to be dereferenceable for the pointer value.
Returns an alignment of the pointer value.
Translate PHI node to its predecessor from the given basic block.
Mutate the type of this
Value to be of the specified type.
template<class Compare>
Sort the use-list.
Reverse the use-list.
Implement operator<< on
Value.
Get the next node, or nullptr for the list tail.
Check whether this is the sentinel node.
Determine if the Opcode is one of the shift instructions.
Determine if the Opcode is and/or/xor.
Determine if the Opcode is one of the
CastInst instructions.
Returns true if the Opcode is a "special" terminator that does more than branch to a successor (e.g.
Methods for support type inquiry through isa, cast, and dyn_cast:
Static Public Member Functions inherited from
llvm::User
Static Public Member Functions inherited from
llvm::Value
Remove the droppable use U.
template<typename BitfieldElement>
template<typename BitfieldElement>
Protected Member Functions inherited from
llvm::User
Allocate a
User with an operand pointer co-allocated.
Allocate a
User with the operands co-allocated.
Allocate a
User with the operands co-allocated.
Allocate the array of Uses, followed by a pointer (with bottom bit set) to the
User.
Grow the number of hung off uses.
template<int Idx>
template<int Idx>
Value's destructor should be virtual by design, but that would require that
Value and all of its subclasses have a vtable that effectively duplicates the information in the value
ID.
Appends all metadata attached to this value to MDs, sorting by KindID.
Return true if this value has any metadata attached to it.
Erase all metadata attachments with the given kind.
Erase all metadata attachments matching the given predicate.
Erase all metadata attached to this
Value.
Get metadata for the given kind, if any.
Get the current metadata attachments for the given kind, if any.
Appends all attachments with the given
ID to
MDs in insertion order.
Return true if this value has the given type of metadata attached.
Set a particular kind of metadata attachment.
Add a metadata attachment.
When checking for operation equivalence (using isSameOperationAs) it is sometimes useful to ignore certain attributes.
More...
Optional marker recording the position for debugging information that takes effect immediately before this instruction.
The maximum alignment for instructions.
The number of operands in the subclass.
More...
Static Protected Member Functions inherited from
llvm::User
template<int Idx, typename U>
Hold subclass data that can be dropped.
An instruction for reading from memory.
This uses the SubclassData field in Value to store whether or not the load is volatile.
Definition at line 181 of file Instructions.h.
◆ LoadInst() [1/4]
LoadInst::LoadInst
(
Type *
Ty,
◆ LoadInst() [2/4]
LoadInst::LoadInst
(
Type *
Ty,
◆ LoadInst() [3/4]
LoadInst::LoadInst
(
Type *
Ty,
◆ LoadInst() [4/4]
LoadInst::LoadInst
(
Type *
Ty,
◆ classof() [1/2]
◆ classof() [2/2]
◆ cloneImpl()
LoadInst * LoadInst::cloneImpl
(
)
const
protected
◆ getAlign()
Align llvm::LoadInst::getAlign
(
)
const
inline
Return the alignment of the access that is being performed.
Definition at line 216 of file Instructions.h.
References llvm::Instruction::getSubclassData().
Referenced by cloneImpl(), llvm::InstCombinerImpl::combineLoadToNewType(), llvm::InstCombinerImpl::foldPHIArgLoadIntoPHI(), llvm::TargetLoweringBase::getLoadMemOperandFlags(), llvm::isDereferenceableAndAlignedInLoop(), isSafeLoadOfSelectToSpeculate(), isSafePHIToSpeculate(), llvm::isSafeToSpeculativelyExecuteWithOpcode(), llvm::JumpThreadingPass::simplifyPartiallyRedundantLoad(), speculatePHINodeLoads(), speculateSelectInstLoads(), unpackLoadToAggregate(), DataScalarizerVisitor::visitLoadInst(), and llvm::InstCombinerImpl::visitLoadInst().
◆ getOrdering()
◆ getPointerAddressSpace()
unsigned llvm::LoadInst::getPointerAddressSpace
(
)
const
inline
◆ getPointerOperand() [1/2]
Value * llvm::LoadInst::getPointerOperand
(
)
inline
Definition at line 260 of file Instructions.h.
References llvm::User::getOperand().
Referenced by llvm::MemoryDepChecker::addAccess(), llvm::VNCoercion::analyzeLoadFromClobberingLoad(), llvm::InstCombinerImpl::combineLoadToNewType(), llvm::copyNonnullMetadata(), diagnoseHandleNotFound(), doesInTreeUserNeedToExtract(), foldLoadsRecursive(), gatherPossiblyVectorizableLoads(), llvm::MemoryLocation::get(), getFalkorUnrollingPreferences(), llvm::MemoryDependenceResults::getInvariantGroupPointerDependency(), llvm::TargetLoweringBase::getLoadMemOperandFlags(), getPointerOperandType(), isAllocSiteRemovable(), llvm::isDereferenceableAndAlignedInLoop(), isInvariantLoad(), isLoadInvariantInLoop(), isReportingError(), llvm::isSafeToSpeculativelyExecuteWithOpcode(), replaceLoad(), llvm::PGOIndirectCallVisitor::tryGetVTableInstruction(), llvm::tryPromoteCall(), tryToRecognizeTableBasedCttz(), unpackLoadToAggregate(), and DataScalarizerVisitor::visitLoadInst().
◆ getPointerOperand() [2/2]
const Value * llvm::LoadInst::getPointerOperand
(
)
const
inline
◆ getPointerOperandIndex()
unsigned llvm::LoadInst::getPointerOperandIndex
(
)
inlinestatic
◆ getPointerOperandType()
Type * llvm::LoadInst::getPointerOperandType
(
)
const
inline
◆ getSyncScopeID()
◆ isSimple()
bool llvm::LoadInst::isSimple
(
)
const
inline
◆ isUnordered()
bool llvm::LoadInst::isUnordered
(
)
const
inline
◆ isVolatile()
bool llvm::LoadInst::isVolatile
(
)
const
inline
Return true if this is a load from a volatile memory location.
Definition at line 210 of file Instructions.h.
References llvm::Instruction::getSubclassData().
Referenced by areLoadsReorderable(), cloneImpl(), llvm::InstCombinerImpl::combineLoadToNewType(), llvm::InstCombinerImpl::foldCmpLoadFromIndexedGlobal(), llvm::InstCombinerImpl::foldPHIArgLoadIntoPHI(), llvm::TargetLoweringBase::getLoadMemOperandFlags(), Instruction, isAllocSiteRemovable(), isIntegerWideningViableForSlice(), isSimple(), isUnordered(), isVectorPromotionViableForSlice(), LoadInst(), LoadInst(), LoadInst(), llvm::simplifyLoadInst(), and llvm::FastISel::tryToFoldLoad().
◆ setAlignment()
void llvm::LoadInst::setAlignment
(
Align Align )
inline
◆ setAtomic()
◆ setOrdering()
◆ setSyncScopeID()
◆ setVolatile()
void llvm::LoadInst::setVolatile
(
bool V )
inline
◆ Instruction
Iterator for Instruction s in a `BasicBlock.
/ \Returns an sandboxir::Instruction & when derereferenced. class BBIterator { public: using difference_type = std::ptrdiff_t; using value_type = Instruction; using pointer = value_type *; using reference = value_type &; using iterator_category = std::bidirectional_iterator_tag;
private: llvm::BasicBlock *BB; llvm::BasicBlock::iterator It; Context *Ctx; LLVM_ABI pointer getInstr(llvm::BasicBlock::iterator It) const;
public: BBIterator() : BB(nullptr), Ctx(nullptr) {} BBIterator(llvm::BasicBlock <em>BB, llvm::BasicBlock::iterator It, Context *Ctx) : BB(BB), It(It), Ctx(Ctx) {} reference operator() const { return *getInstr(It); } LLVM_ABI BBIterator &operator++(); BBIterator operator++(int) { auto Copy = *this; ++*this; return Copy; } LLVM_ABI BBIterator &operator--(); BBIterator operator--(int) { auto Copy = *this; –*this; return Copy; } bool operator==(const BBIterator &Other) const { assert(Ctx == Other.Ctx && "BBIterators in different context!"); return It == Other.It; } bool operator!=(const BBIterator &Other) const { return !(*this == Other); } / \Returns the SBInstruction that corresponds to this iterator, or null if / the instruction is not found in the IR-to-SandboxIR tables. pointer get() const { return getInstr(It); } / \Returns the parent BB. LLVM_ABI BasicBlock *getNodeParent() const; };
/ Contains a list of sandboxir::Instruction's. class BasicBlock : public Value { / Builds a graph that contains all values in BB in their original form / i.e., no vectorization is taking place here. LLVM_ABI void buildBasicBlockFromLLVMIR(llvm::BasicBlock *LLVMBB); friend class Context; // For buildBasicBlockFromIR
Definition at line 193 of file Instructions.h.
References Instruction, isVolatile(), LLVM_ABI, LoadInst(), Ptr, and llvm::SyncScope::System.
Referenced by classof(), and Instruction.
The documentation for this class was generated from the following files: