LLVM 22.0.0git
Public Member Functions | Static Public Member Functions | Protected Member Functions | Friends | List of all members
llvm::LoadInst Class Reference

An instruction for reading from memory. More...

#include "llvm/IR/Instructions.h"

Inheritance diagram for llvm::LoadInst:
[フレーム]
[legend]

Public Member Functions

LLVM_ABI  LoadInst (Type *Ty, Value *Ptr, const Twine &NameStr, InsertPosition InsertBefore)
LLVM_ABI  LoadInst (Type *Ty, Value *Ptr, const Twine &NameStr, bool isVolatile, InsertPosition InsertBefore)
LLVM_ABI  LoadInst (Type *Ty, Value *Ptr, const Twine &NameStr, bool isVolatile, Align Align, InsertPosition InsertBefore=nullptr)
  Return true if this is a load from a volatile memory location.
void  setVolatile (bool V)
  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.
void  setOrdering (AtomicOrdering Ordering)
  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.
Public Member Functions inherited from llvm::UnaryInstruction
void *  operator new (size_t S)
void  operator delete (void *Ptr)
  Transparently provide more efficient getOperand methods.
Public Member Functions inherited from llvm::Instruction
LLVM_ABI iterator_range< simple_ilist< DbgRecord >::iteratorcloneDebugInfoFrom (const Instruction *From, std::optional< simple_ilist< DbgRecord >::iterator > FromHere=std::nullopt, bool InsertAtHead=false)
  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.
LLVM_ABI  LLVM_DEPRECATED ("Use iterators as instruction positions", "") void insertBefore(Instruction *InsertPos)
  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.
LLVM_ABI void  insertAfter (Instruction *InsertPos)
  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.
LLVM_ABI  LLVM_DEPRECATED ("Use iterators as instruction positions", "") void moveBefore(Instruction *MovePos)
  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.
LLVM_ABI  LLVM_DEPRECATED ("Use iterators as instruction positions", "") void moveBeforePreserving(Instruction *MovePos)
  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.
LLVM_ABI void  moveAfter (Instruction *MovePos)
  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.
void  getAllMetadata (SmallVectorImpl< std::pair< unsigned, MDNode * > > &MDs) const
  Get all metadata 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.
void  setDebugLoc (DebugLoc Loc)
  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.
LLVM_ABI void  setIsExact (bool b=true)
  Set or clear the exact flag on this instruction, which must be an operator which supports this flag.
LLVM_ABI void  setNonNeg (bool b=true)
  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.
LLVM_ABI void  copyIRFlags (const Value *V, bool IncludeWrapFlags=true)
  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.
LLVM_ABI void  mergeDIAssignID (ArrayRef< const Instruction * > SourceInstructions)
  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.
LLVM_ABI bool  mayThrow (bool IncludePhaseOneUnwind=false) const LLVM_READONLY
  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.
  Return true if the instruction is a DbgInfoIntrinsic or PseudoProbeInst.
  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.
LLVM_ABI bool  hasSameSpecialState (const Instruction *I2, bool IgnoreAlignment=false, bool IntersectAttrs=false) const LLVM_READONLY
  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.
Public Member Functions inherited from llvm::User
  User (const User &)=delete
LLVM_ABI void  operator delete (void *Usr)
  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.
void  setOperand (unsigned i, Value *Val)
  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.
Public Member Functions inherited from llvm::Value
  Value (const Value &)=delete
Valueoperator= (const Value &)=delete
  Delete a pointer to a generic Value.
LLVM_ABI void  dump () const
  Support for debugging, callable in GDB: V->dump()
TypegetType () const
  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.
LLVM_ABI void  setName (const Twine &Name)
  Change the name of the value.
LLVM_ABI void  takeName (Value *V)
  Transfer the name from V to this value.
LLVM_ABI std::string  getNameOrAsOperand () const
  Change all uses of this to point to a new Value.
  Change non-metadata uses of this to point to a new Value.
LLVM_ABI void  replaceUsesWithIf (Value *New, llvm::function_ref< bool(Use &U)> ShouldReplace)
  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.
  Check if this Value has a use-list.
Useruser_back ()
  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.
LLVM_ABI void  dropDroppableUses (llvm::function_ref< bool(const Use *)> ShouldDrop=[](const Use *) { return true;})
  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.
void  addUse (Use &U)
  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.
LLVM_ABI const ValuestripAndAccumulateConstantOffsets (const DataLayout &DL, APInt &Offset, bool AllowNonInbounds, bool AllowInvariantGroup=false, function_ref< bool(Value &Value, APInt &Offset)> ExternalAnalysis=nullptr, bool LookThroughIntToPtr=false) const
  Accumulate the constant offset this value has compared to a base pointer.
ValuestripAndAccumulateConstantOffsets (const DataLayout &DL, APInt &Offset, bool AllowNonInbounds, bool AllowInvariantGroup=false, function_ref< bool(Value &Value, APInt &Offset)> ExternalAnalysis=nullptr, bool LookThroughIntToPtr=false)
  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.
void  mutateType (Type *Ty)
  Mutate the type of this Value to be of the specified type.
template<class Compare>
void  sortUseList (Compare Cmp)
  Sort the use-list.
  Reverse the use-list.
LLVM_ABI void  print (raw_ostream &O, bool IsForDebug=false) const
  Implement operator<< on Value.
LLVM_ABI void  print (raw_ostream &O, ModuleSlotTracker &MST, bool IsForDebug=false) const
LLVM_ABI void  printAsOperand (raw_ostream &O, bool PrintType=true, const Module *M=nullptr) const
  Print the name of this Value out to the specified raw_ostream.
  Get the next node, or nullptr for the list tail.
std::enable_if_t< T::is_sentinel_tracking_explicit, boolisSentinel () const
  Check whether this is the sentinel node.
const ilist_detail::compute_node_options< Instruction, Options... >::type::parent_ty *  getParent () const
void  setParent (ilist_detail::compute_node_options< Instruction, Options... >::type::parent_ty *Parent)

Static Public Member Functions

static bool  classof (const Value *V)
Static Public Member Functions inherited from llvm::UnaryInstruction
static bool  classof (const Value *V)
Static Public Member Functions inherited from llvm::Instruction
static bool  isTerminator (unsigned Opcode)
static bool  isUnaryOp (unsigned Opcode)
static bool  isBinaryOp (unsigned Opcode)
static bool  isIntDivRem (unsigned Opcode)
static bool  isFPDivRem (unsigned Opcode)
static bool  isShift (unsigned Opcode)
  Determine if the Opcode is one of the shift instructions.
static bool  isBitwiseLogicOp (unsigned Opcode)
  Determine if the Opcode is and/or/xor.
static bool  isCast (unsigned Opcode)
  Determine if the Opcode is one of the CastInst instructions.
static bool  isFuncletPad (unsigned Opcode)
  Determine if the Opcode is one of the FuncletPadInst instructions.
static bool  isSpecialTerminator (unsigned Opcode)
  Returns true if the Opcode is a "special" terminator that does more than branch to a successor (e.g.
static bool  isAssociative (unsigned Opcode)
static bool  isCommutative (unsigned Opcode)
static bool  isIdempotent (unsigned Opcode)
static bool  isNilpotent (unsigned Opcode)
static bool  classof (const Value *V)
  Methods for support type inquiry through isa, cast, and dyn_cast:
Static Public Member Functions inherited from llvm::User
static bool  classof (const Value *V)
Static Public Member Functions inherited from llvm::Value
static LLVM_ABI void  dropDroppableUse (Use &U)
  Remove the droppable use U.

Protected Member Functions

Protected Member Functions inherited from llvm::UnaryInstruction
  UnaryInstruction (Type *Ty, unsigned iType, Value *V, InsertPosition InsertBefore=nullptr)
Protected Member Functions inherited from llvm::Instruction
template<typename BitfieldElement>
BitfieldElement::Type  getSubclassData () const
template<typename BitfieldElement>
void  setSubclassData (typename BitfieldElement::Type Value)
LLVM_ABI  Instruction (Type *Ty, unsigned iType, AllocInfo AllocInfo, InsertPosition InsertBefore=nullptr)
Protected Member Functions inherited from llvm::User
void *  operator new (size_t Size)=delete
  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.
LLVM_ABI void  allocHungoffUses (unsigned N, bool IsPhi=false)
  Allocate the array of Uses, followed by a pointer (with bottom bit set) to the User.
LLVM_ABI void  growHungoffUses (unsigned N, bool IsPhi=false)
  Grow the number of hung off uses.
  ~User ()=default
template<int Idx>
UseOp ()
template<int Idx>
const UseOp () const
Protected Member Functions inherited from llvm::Value
LLVM_ABI  Value (Type *Ty, unsigned scid)
  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.
LLVM_ABI void  getAllMetadata (SmallVectorImpl< std::pair< unsigned, MDNode * > > &MDs) const
  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.
LLVM_ABI void  addMetadata (unsigned KindID, MDNode &MD)
  Add a metadata attachment.
LLVM_ABI void  addMetadata (StringRef Kind, MDNode &MD)
  ilist_node_with_parent ()=default
  ilist_node_impl ()=default

Friends

class  Instruction
  Iterator for Instruction s in a `BasicBlock.

Additional Inherited Members

Public Types inherited from llvm::Instruction
  When checking for operation equivalence (using isSameOperationAs) it is sometimes useful to ignore certain attributes. More...
enum   TermOps
enum   UnaryOps
enum   BinaryOps
enum   MemoryOps
enum   CastOps
enum   FuncletPadOps
enum   OtherOps
using  InstListType
Public Types inherited from llvm::User
using  op_iterator = Use*
Public Types inherited from llvm::Value
enum   ValueTy
  Concrete subclass of this. More...
using  use_iterator = use_iterator_impl<Use>
using  const_use_iterator = use_iterator_impl<const Use>
using  user_iterator = user_iterator_impl<User>
using  const_user_iterator = user_iterator_impl<const User>
Public Attributes inherited from llvm::Instruction
DbgMarkerDebugMarker = nullptr
  Optional marker recording the position for debugging information that takes effect immediately before this instruction.
Static Public Attributes inherited from llvm::Value
static constexpr unsigned  MaxAlignmentExponent = 32
  The maximum alignment for instructions.
static constexpr uint64_t  MaximumAlignment = 1ULL << MaxAlignmentExponent
Protected Types inherited from llvm::Instruction
template<unsigned Offset>
template<unsigned Offset>
template<unsigned Offset>
Protected Types inherited from llvm::Value
enum   : unsigned { NumUserOperandsBits = 27 }
  The number of operands in the subclass. More...
using  self_iterator
Static Protected Member Functions inherited from llvm::User
template<int Idx, typename U>
static UseOpFrom (const U *that)
Protected Attributes inherited from llvm::Value
  Hold subclass data that can be dropped.

Detailed Description

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.

Constructor & Destructor Documentation

◆  LoadInst() [1/4]

LoadInst::LoadInst ( Type * Ty,
Value * Ptr,
const Twine & NameStr,
InsertPosition InsertBefore )

Definition at line 1331 of file Instructions.cpp.

References LoadInst(), and Ptr.

Referenced by cloneImpl(), Instruction, LoadInst(), LoadInst(), and LoadInst().

◆  LoadInst() [2/4]

LoadInst::LoadInst ( Type * Ty,
Value * Ptr,
const Twine & NameStr,
bool isVolatile,
InsertPosition InsertBefore )

Definition at line 1335 of file Instructions.cpp.

References computeLoadStoreDefaultAlign(), isVolatile(), LoadInst(), and Ptr.

◆  LoadInst() [3/4]

LoadInst::LoadInst ( Type * Ty,
Value * Ptr,
const Twine & NameStr,
bool isVolatile,
Align Align,
InsertPosition InsertBefore = nullptr )

Definition at line 1340 of file Instructions.cpp.

References isVolatile(), LoadInst(), llvm::NotAtomic, and Ptr.

◆  LoadInst() [4/4]

LoadInst::LoadInst ( Type * Ty,
Value * Ptr,
const Twine & NameStr,
bool isVolatile,
Align Align,
InsertPosition InsertBefore = nullptr )

Definition at line 1345 of file Instructions.cpp.

References isVolatile(), Ptr, setAlignment(), setAtomic(), llvm::Value::setName(), setVolatile(), and llvm::UnaryInstruction::UnaryInstruction().

Member Function Documentation

◆  classof() [1/2]

bool llvm::LoadInst::classof ( const Instruction * I )
inlinestatic

Definition at line 271 of file Instructions.h.

References I, and Instruction.

Referenced by classof().

◆  classof() [2/2]

bool llvm::LoadInst::classof ( const Value * V )
inlinestatic

Definition at line 274 of file Instructions.h.

References llvm::cast(), classof(), and llvm::isa().

◆  cloneImpl()

LoadInst * LoadInst::cloneImpl ( ) const
protected

Definition at line 4363 of file Instructions.cpp.

References getAlign(), llvm::User::getOperand(), getOrdering(), getSyncScopeID(), llvm::Value::getType(), isVolatile(), and LoadInst().

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

AtomicOrdering llvm::LoadInst::getOrdering ( ) const
inline

Returns the ordering constraint of this load instruction.

Definition at line 225 of file Instructions.h.

References llvm::Instruction::getSubclassData().

Referenced by llvm::AliasSetTracker::add(), areLoadsReorderable(), cloneImpl(), llvm::InstCombinerImpl::combineLoadToNewType(), isUnordered(), OptimizeGlobalAddressOfAllocation(), llvm::JumpThreadingPass::simplifyPartiallyRedundantLoad(), TryToShrinkGlobalToBoolean(), and llvm::InstCombinerImpl::visitLoadInst().

◆  getPointerAddressSpace()

unsigned llvm::LoadInst::getPointerAddressSpace ( ) const
inline

Returns the address space of the pointer operand.

Definition at line 266 of file Instructions.h.

References llvm::Type::getPointerAddressSpace(), and getPointerOperandType().

Referenced by canSimplifyNullLoadOrGEP(), llvm::SITargetLowering::emitExpandAtomicLoad(), foldLoadsRecursive(), llvm::InstCombinerImpl::foldPHIArgLoadIntoPHI(), isInvariantLoad(), llvm::SITargetLowering::shouldExpandAtomicLoadInIR(), and llvm::InstCombinerImpl::visitLoadInst().

◆  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

Definition at line 261 of file Instructions.h.

References llvm::User::getOperand().

◆  getPointerOperandIndex()

unsigned llvm::LoadInst::getPointerOperandIndex ( )
inlinestatic

Definition at line 262 of file Instructions.h.

Referenced by doPromotion(), llvm::SITargetLowering::emitExpandAtomicLoad(), sinkCommonCodeFromPredecessors(), and DataScalarizerVisitor::visitLoadInst().

◆  getPointerOperandType()

Type * llvm::LoadInst::getPointerOperandType ( ) const
inline

Definition at line 263 of file Instructions.h.

References getPointerOperand(), and llvm::Value::getType().

Referenced by llvm::LoopVectorizationCostModel::getInstructionCost(), and getPointerAddressSpace().

◆  getSyncScopeID()

SyncScope::ID llvm::LoadInst::getSyncScopeID ( ) const
inline

Returns the synchronization scope ID of this load instruction.

Definition at line 235 of file Instructions.h.

Referenced by cloneImpl(), llvm::InstCombinerImpl::combineLoadToNewType(), OptimizeGlobalAddressOfAllocation(), llvm::JumpThreadingPass::simplifyPartiallyRedundantLoad(), TryToShrinkGlobalToBoolean(), and llvm::InstCombinerImpl::visitLoadInst().

◆  isSimple()

bool llvm::LoadInst::isSimple ( ) const
inline

Definition at line 252 of file Instructions.h.

References llvm::Instruction::isAtomic(), and isVolatile().

Referenced by foldLoadsRecursive(), isSafeLoadOfSelectToSpeculate(), isSafePHIToSpeculate(), speculateSelectInstLoads(), and unpackLoadToAggregate().

◆  isUnordered()

bool llvm::LoadInst::isUnordered ( ) const
inline

Definition at line 254 of file Instructions.h.

References getOrdering(), isVolatile(), llvm::NotAtomic, and llvm::Unordered.

Referenced by llvm::PPCTargetLowering::isProfitableToHoist(), llvm::mustSuppressSpeculation(), llvm::JumpThreadingPass::simplifyPartiallyRedundantLoad(), and llvm::InstCombinerImpl::visitLoadInst().

◆  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

Definition at line 220 of file Instructions.h.

References llvm::Log2().

Referenced by LoadInst(), llvm::promoteLoopAccessesToScalars(), speculateSelectInstLoads(), DataScalarizerVisitor::visitLoadInst(), and llvm::InstCombinerImpl::visitLoadInst().

◆  setAtomic()

void llvm::LoadInst::setAtomic ( AtomicOrdering Ordering,
inline

Sets the ordering constraint and the synchronization scope ID of this load instruction.

Definition at line 246 of file Instructions.h.

References setOrdering(), setSyncScopeID(), and llvm::SyncScope::System.

Referenced by llvm::InstCombinerImpl::combineLoadToNewType(), LoadInst(), llvm::SITargetLowering::lowerIdempotentRMWIntoFencedLoad(), LowerLoadInst(), and llvm::InstCombinerImpl::visitLoadInst().

◆  setOrdering()

void llvm::LoadInst::setOrdering ( AtomicOrdering Ordering )
inline

Sets the ordering constraint of this load instruction.

May not be Release or AcquireRelease.

Definition at line 230 of file Instructions.h.

Referenced by llvm::promoteLoopAccessesToScalars(), and setAtomic().

◆  setSyncScopeID()

void llvm::LoadInst::setSyncScopeID ( SyncScope::ID SSID )
inline

Sets the synchronization scope ID of this load instruction.

Definition at line 240 of file Instructions.h.

Referenced by setAtomic().

◆  setVolatile()

void llvm::LoadInst::setVolatile ( bool V )
inline

Specify whether this is a volatile load or not.

Definition at line 213 of file Instructions.h.

Referenced by LoadInst().

◆  Instruction

friend class Instruction
friend

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:

Generated on for LLVM by doxygen 1.14.0

AltStyle によって変換されたページ (->オリジナル) /