LLVM 20.0.0git |
LLVM Basic Block Representation.More...
#include "llvm/IR/BasicBlock.h"
Classes | |
class | phi_iterator_impl |
Iterator to walk just the phi nodes in the basic block.More... | |
Public Types | |
using | InstListType =SymbolTableList<Instruction,ilist_iterator_bits<true >,ilist_parent<BasicBlock > > |
using | iterator =InstListType::iterator |
Instruction iterators... | |
using | const_iterator =InstListType::const_iterator |
using | reverse_iterator =InstListType::reverse_iterator |
using | const_reverse_iterator =InstListType::const_reverse_iterator |
using | phi_iterator =phi_iterator_impl<> |
using | const_phi_iterator =phi_iterator_impl<constPHINode,BasicBlock::const_iterator > |
![]() | |
enum | ValueTy |
Concrete subclass of this.More... | |
using | use_iterator = use_iterator_impl<Use > |
using | const_use_iterator = use_iterator_impl<constUse > |
using | user_iterator = user_iterator_impl<User > |
using | const_user_iterator = user_iterator_impl<constUser > |
Public Member Functions | |
DbgMarker * | createMarker (Instruction *I) |
Attach aDbgMarker to the given instruction. | |
DbgMarker * | createMarker (InstListType::iterator It) |
void | convertToNewDbgValues () |
Convert variable location debugging information stored in dbg.value intrinsics into DbgMarkers / DbgRecords. | |
void | convertFromNewDbgValues () |
Convert variable location debugging information stored in DbgMarkers and DbgRecords into the dbg.value intrinsic representation. | |
void | setIsNewDbgInfoFormat (bool NewFlag) |
Ensure the block is in "old" dbg.value format (NewFlag == false) or in the new format (NewFlag == true), converting to the desired format if necessary. | |
void | setNewDbgInfoFormatFlag (bool NewFlag) |
unsigned | getNumber ()const |
void | setTrailingDbgRecords (DbgMarker *M) |
Record that the collection of DbgRecords inM "trails" after the last instruction of this block. | |
DbgMarker * | getTrailingDbgRecords () |
Fetch the collection of DbgRecords that "trail" after the last instruction of this block, seesetTrailingDbgRecords. | |
void | deleteTrailingDbgRecords () |
Delete any trailing DbgRecords at the end of this block, seesetTrailingDbgRecords. | |
void | dumpDbgValues ()const |
DbgMarker * | getMarker (InstListType::iterator It) |
Return theDbgMarker for the position given byIt , so that DbgRecords can be inserted there. | |
DbgMarker * | getNextMarker (Instruction *I) |
Return theDbgMarker for the position that comes afterI . | |
void | insertDbgRecordAfter (DbgRecord *DR,Instruction *I) |
Insert aDbgRecord into a block at the position given byI . | |
void | insertDbgRecordBefore (DbgRecord *DR,InstListType::iterator Here) |
Insert aDbgRecord into a block at the position given byHere . | |
void | flushTerminatorDbgRecords () |
Eject any debug-info trailing at the end of a block. | |
void | reinsertInstInDbgRecords (Instruction *I, std::optional<DbgRecord::self_iterator > Pos) |
In rare circumstances instructions can be speculatively removed from blocks, and then be re-inserted back into that position later. | |
BasicBlock (constBasicBlock &)=delete | |
BasicBlock & | operator= (constBasicBlock &)=delete |
~BasicBlock () | |
LLVMContext & | getContext ()const |
Get the context in which this basic block lives. | |
constFunction * | getParent ()const |
Return the enclosing method, or null if none. | |
Function * | getParent () |
constModule * | getModule ()const |
Return the module owning the function this basic block belongs to, or nullptr if the function does not have a module. | |
Module * | getModule () |
constDataLayout & | getDataLayout ()const |
Get the data layout of the module this basic block belongs to. | |
constInstruction * | getTerminator ()constLLVM_READONLY |
Returns the terminator instruction if the block is well formed or null if the block is not well formed. | |
Instruction * | getTerminator () |
constCallInst * | getTerminatingDeoptimizeCall ()const |
Returns the call instruction calling @llvm.experimental.deoptimize prior to the terminating return instruction of this basic block, if such a call is present. | |
CallInst * | getTerminatingDeoptimizeCall () |
constCallInst * | getPostdominatingDeoptimizeCall ()const |
Returns the call instruction calling @llvm.experimental.deoptimize that is present either in current basic block or in block that is a unique successor to current block, if such call is present. | |
CallInst * | getPostdominatingDeoptimizeCall () |
constCallInst * | getTerminatingMustTailCall ()const |
Returns the call instruction marked 'musttail' prior to the terminating return instruction of this basic block, if such a call is present. | |
CallInst * | getTerminatingMustTailCall () |
constInstruction * | getFirstNonPHI ()const |
Returns a pointer to the first instruction in this block that is not aPHINode instruction. | |
LLVM_DEPRECATED ("Use iterators as instruction positions instead", "getFirstNonPHIIt")Instruction *getFirstNonPHI() | |
InstListType::const_iterator | getFirstNonPHIIt ()const |
Returns an iterator to the first instruction in this block that is not aPHINode instruction. | |
InstListType::iterator | getFirstNonPHIIt () |
InstListType::const_iterator | getFirstNonPHIOrDbg (bool SkipPseudoOp=true)const |
Returns a pointer to the first instruction in this block that is not aPHINode or a debug intrinsic, or any pseudo operation ifSkipPseudoOp is true. | |
InstListType::iterator | getFirstNonPHIOrDbg (bool SkipPseudoOp=true) |
InstListType::const_iterator | getFirstNonPHIOrDbgOrLifetime (bool SkipPseudoOp=true)const |
Returns a pointer to the first instruction in this block that is not aPHINode, a debug intrinsic, or a lifetime intrinsic, or any pseudo operation ifSkipPseudoOp is true. | |
InstListType::iterator | getFirstNonPHIOrDbgOrLifetime (bool SkipPseudoOp=true) |
const_iterator | getFirstInsertionPt ()const |
Returns an iterator to the first instruction in this block that is suitable for inserting a non-PHI instruction. | |
iterator | getFirstInsertionPt () |
const_iterator | getFirstNonPHIOrDbgOrAlloca ()const |
Returns an iterator to the first instruction in this block that is not aPHINode, a debug intrinsic, a static alloca or any pseudo operation. | |
iterator | getFirstNonPHIOrDbgOrAlloca () |
constInstruction * | getFirstMayFaultInst ()const |
Returns the first potential AsynchEH faulty instruction currently it checks for loads/stores (which may dereference a null pointer) and calls/invokes (which may propagate exceptions) | |
Instruction * | getFirstMayFaultInst () |
iterator_range<filter_iterator<BasicBlock::const_iterator, std::function<bool(constInstruction &)> > > | instructionsWithoutDebug (bool SkipPseudoOp=true)const |
Return a const iterator range over the instructions in the block, skipping any debug instructions. | |
iterator_range<filter_iterator<BasicBlock::iterator, std::function<bool(Instruction &)> > > | instructionsWithoutDebug (bool SkipPseudoOp=true) |
Return an iterator range over the instructions in the block, skipping any debug instructions. | |
filter_iterator<BasicBlock::const_iterator, std::function<bool(constInstruction &)> >::difference_type | sizeWithoutDebug ()const |
Return the size of the basic block ignoring debug instructions. | |
void | removeFromParent () |
Unlink 'this' from the containing function, but do not delete it. | |
SymbolTableList<BasicBlock >::iterator | eraseFromParent () |
Unlink 'this' from the containing function and delete it. | |
void | moveBefore (BasicBlock *MovePos) |
Unlink this basic block from its current function and insert it into the function thatMovePos lives in, right beforeMovePos . | |
void | moveBefore (SymbolTableList<BasicBlock >::iterator MovePos) |
void | moveAfter (BasicBlock *MovePos) |
Unlink this basic block from its current function and insert it right afterMovePos in the functionMovePos lives in. | |
void | insertInto (Function *Parent,BasicBlock *InsertBefore=nullptr) |
Insert unlinked basic block into a function. | |
constBasicBlock * | getSinglePredecessor ()const |
Return the predecessor of this block if it has a single predecessor block. | |
BasicBlock * | getSinglePredecessor () |
constBasicBlock * | getUniquePredecessor ()const |
Return the predecessor of this block if it has a unique predecessor block. | |
BasicBlock * | getUniquePredecessor () |
bool | hasNPredecessors (unsignedN)const |
Return true if this block has exactly N predecessors. | |
bool | hasNPredecessorsOrMore (unsignedN)const |
Return true if this block has N predecessors or more. | |
constBasicBlock * | getSingleSuccessor ()const |
Return the successor of this block if it has a single successor. | |
BasicBlock * | getSingleSuccessor () |
constBasicBlock * | getUniqueSuccessor ()const |
Return the successor of this block if it has a unique successor. | |
BasicBlock * | getUniqueSuccessor () |
void | print (raw_ostream &OS,AssemblyAnnotationWriter *AAW=nullptr,bool ShouldPreserveUseListOrder=false,bool IsForDebug=false)const |
Print the basic block to an output stream with an optionalAssemblyAnnotationWriter. | |
iterator | begin () |
Instruction iterator methods. | |
const_iterator | begin ()const |
iterator | end () |
const_iterator | end ()const |
reverse_iterator | rbegin () |
const_reverse_iterator | rbegin ()const |
reverse_iterator | rend () |
const_reverse_iterator | rend ()const |
size_t | size ()const |
bool | empty ()const |
constInstruction & | front ()const |
Instruction & | front () |
constInstruction & | back ()const |
Instruction & | back () |
iterator_range<const_phi_iterator > | phis ()const |
Returns a range that iterates over the phis in the basic block. | |
iterator_range<phi_iterator > | phis () |
ValueSymbolTable * | getValueSymbolTable () |
Returns a pointer to the symbol table if one exists. | |
void | dropAllReferences () |
Cause all subinstructions to "let go" of all the references that said subinstructions are maintaining. | |
void | removePredecessor (BasicBlock *Pred,bool KeepOneInputPHIs=false) |
Update PHI nodes in thisBasicBlock before removal of predecessorPred . | |
bool | canSplitPredecessors ()const |
BasicBlock * | splitBasicBlock (iteratorI,constTwine &BBName="",boolBefore=false) |
Split the basic block into two basic blocks at the specified instruction. | |
BasicBlock * | splitBasicBlock (Instruction *I,constTwine &BBName="",boolBefore=false) |
BasicBlock * | splitBasicBlockBefore (iteratorI,constTwine &BBName="") |
Split the basic block into two basic blocks at the specified instruction and insert the new basic blocks as the predecessor of the current block. | |
BasicBlock * | splitBasicBlockBefore (Instruction *I,constTwine &BBName="") |
void | splice (BasicBlock::iterator ToIt,BasicBlock *FromBB) |
Transfer all instructions fromFromBB to this basic block atToIt . | |
void | splice (BasicBlock::iterator ToIt,BasicBlock *FromBB,BasicBlock::iterator FromIt) |
Transfer one instruction fromFromBB atFromIt to this basic block atToIt . | |
void | splice (BasicBlock::iterator ToIt,BasicBlock *FromBB,BasicBlock::iterator FromBeginIt,BasicBlock::iterator FromEndIt) |
Transfer a range of instructions that belong toFromBB fromFromBeginIt toFromEndIt , to this basic block atToIt . | |
BasicBlock::iterator | erase (BasicBlock::iterator FromIt,BasicBlock::iterator ToIt) |
Erases a range of instructions fromFromIt to (not including)ToIt . | |
bool | hasAddressTaken ()const |
Returns true if there are any uses of this basic block other than direct branches, switches, etc. | |
void | replacePhiUsesWith (BasicBlock *Old,BasicBlock *New) |
Update all phi nodes in this basic block to refer to basic blockNew instead of basic blockOld . | |
void | replaceSuccessorsPhiUsesWith (BasicBlock *Old,BasicBlock *New) |
Update all phi nodes in this basic block's successors to refer to basic blockNew instead of basic blockOld . | |
void | replaceSuccessorsPhiUsesWith (BasicBlock *New) |
Update all phi nodes in this basic block's successors to refer to basic blockNew instead of to it. | |
bool | isEHPad ()const |
Return true if this basic block is an exception handling block. | |
bool | isLandingPad ()const |
Return true if this basic block is a landing pad. | |
constLandingPadInst * | getLandingPadInst ()const |
Return the landingpad instruction associated with the landing pad. | |
LandingPadInst * | getLandingPadInst () |
bool | isLegalToHoistInto ()const |
Return true if it is legal to hoist instructions into this block. | |
bool | isEntryBlock ()const |
Return true if this is the entry block of the containing function. | |
std::optional<uint64_t > | getIrrLoopHeaderWeight ()const |
bool | isInstrOrderValid ()const |
Returns true if the Order field of child Instructions is valid. | |
void | invalidateOrders () |
Mark instruction ordering invalid. Done on every instruction insert. | |
void | renumberInstructions () |
Renumber instructions and mark the ordering as valid. | |
void | validateInstrOrdering ()const |
Asserts that instruction order numbers are marked invalid, or that they are in ascending order. | |
![]() | |
Value (constValue &)=delete | |
Value & | operator= (constValue &)=delete |
void | deleteValue () |
Delete a pointer to a genericValue. | |
void | dump ()const |
Support for debugging, callable in GDB: V->dump() | |
Type * | getType ()const |
All values are typed, get the type of this value. | |
LLVMContext & | getContext ()const |
All values hold a context through their type. | |
bool | hasName ()const |
ValueName * | getValueName ()const |
void | setValueName (ValueName *VN) |
StringRef | getName ()const |
Return a constant reference to the value's name. | |
void | setName (constTwine &Name) |
Change the name of the value. | |
void | takeName (Value *V) |
Transfer the name from V to this value. | |
std::string | getNameOrAsOperand ()const |
void | replaceAllUsesWith (Value *V) |
Change all uses of this to point to a newValue. | |
void | replaceNonMetadataUsesWith (Value *V) |
Change non-metadata uses of this to point to a newValue. | |
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 givenUse. | |
void | replaceUsesOutsideBlock (Value *V,BasicBlock *BB) |
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. | |
void | assertModuleIsMaterializedImpl ()const |
void | assertModuleIsMaterialized ()const |
bool | use_empty ()const |
bool | materialized_use_empty ()const |
use_iterator | materialized_use_begin () |
const_use_iterator | materialized_use_begin ()const |
use_iterator | use_begin () |
const_use_iterator | use_begin ()const |
use_iterator | use_end () |
const_use_iterator | use_end ()const |
iterator_range<use_iterator > | materialized_uses () |
iterator_range<const_use_iterator > | materialized_uses ()const |
iterator_range<use_iterator > | uses () |
iterator_range<const_use_iterator > | uses ()const |
bool | user_empty ()const |
user_iterator | materialized_user_begin () |
const_user_iterator | materialized_user_begin ()const |
user_iterator | user_begin () |
const_user_iterator | user_begin ()const |
user_iterator | user_end () |
const_user_iterator | user_end ()const |
User * | user_back () |
constUser * | user_back ()const |
iterator_range<user_iterator > | materialized_users () |
iterator_range<const_user_iterator > | materialized_users ()const |
iterator_range<user_iterator > | users () |
iterator_range<const_user_iterator > | users ()const |
bool | hasOneUse ()const |
Return true if there is exactly one use of this value. | |
bool | hasNUses (unsignedN)const |
Return true if thisValue has exactly N uses. | |
bool | hasNUsesOrMore (unsignedN)const |
Return true if this value has N uses or more. | |
bool | hasOneUser ()const |
Return true if there is exactly one user of this value. | |
Use * | getSingleUndroppableUse () |
Return true if there is exactly one use of this value that cannot be dropped. | |
constUse * | getSingleUndroppableUse ()const |
User * | getUniqueUndroppableUser () |
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). | |
constUser * | getUniqueUndroppableUser ()const |
bool | hasNUndroppableUses (unsignedN)const |
Return true if there this value. | |
bool | hasNUndroppableUsesOrMore (unsignedN)const |
Return true if this value has N uses or more. | |
void | dropDroppableUses (llvm::function_ref<bool(constUse *)> ShouldDrop=[](constUse *) { returntrue;}) |
Remove every uses that can safely be removed. | |
void | dropDroppableUsesIn (User &Usr) |
Remove every use of this value inUser that can safely be removed. | |
bool | isUsedInBasicBlock (constBasicBlock *BB)const |
Check if this value is used in the specified basic block. | |
unsigned | getNumUses ()const |
This method computes the number of uses of thisValue. | |
void | addUse (Use &U) |
This method should only be used by theUse class. | |
unsigned | getValueID ()const |
Return an ID for the concrete type of this object. | |
unsigned | getRawSubclassOptionalData ()const |
Return the raw optional flags value contained in this value. | |
void | clearSubclassOptionalData () |
Clear the optional flags contained in this value. | |
bool | hasSameSubclassOptionalData (constValue *V)const |
Check the optional flags for equality. | |
bool | hasValueHandle ()const |
Return true if there is a value handle associated with this value. | |
bool | isUsedByMetadata ()const |
Return true if there is metadata referencing this value. | |
bool | isSwiftError ()const |
Return true if this value is a swifterror value. | |
constValue * | stripPointerCasts ()const |
Strip off pointer casts, all-zero GEPs and address space casts. | |
Value * | stripPointerCasts () |
constValue * | stripPointerCastsAndAliases ()const |
Strip off pointer casts, all-zero GEPs, address space casts, and aliases. | |
Value * | stripPointerCastsAndAliases () |
constValue * | stripPointerCastsSameRepresentation ()const |
Strip off pointer casts, all-zero GEPs and address space casts but ensures the representation of the result stays the same. | |
Value * | stripPointerCastsSameRepresentation () |
constValue * | stripPointerCastsForAliasAnalysis ()const |
Strip off pointer casts, all-zero GEPs, single-argument phi nodes and invariant group info. | |
Value * | stripPointerCastsForAliasAnalysis () |
constValue * | stripInBoundsConstantOffsets ()const |
Strip off pointer casts and all-constant inbounds GEPs. | |
Value * | stripInBoundsConstantOffsets () |
constValue * | stripAndAccumulateConstantOffsets (constDataLayout &DL,APInt &Offset,bool AllowNonInbounds,bool AllowInvariantGroup=false,function_ref<bool(Value &Value,APInt &Offset)> ExternalAnalysis=nullptr)const |
Accumulate the constant offset this value has compared to a base pointer. | |
Value * | stripAndAccumulateConstantOffsets (constDataLayout &DL,APInt &Offset,bool AllowNonInbounds,bool AllowInvariantGroup=false,function_ref<bool(Value &Value,APInt &Offset)> ExternalAnalysis=nullptr) |
constValue * | stripAndAccumulateInBoundsConstantOffsets (constDataLayout &DL,APInt &Offset)const |
This is a wrapper around stripAndAccumulateConstantOffsets with the in-bounds requirement set to false. | |
Value * | stripAndAccumulateInBoundsConstantOffsets (constDataLayout &DL,APInt &Offset) |
constValue * | stripInBoundsOffsets (function_ref< void(constValue *)> Func=[](constValue *) {})const |
Strip off pointer casts and inbounds GEPs. | |
Value * | stripInBoundsOffsets (function_ref< void(constValue *)> Func=[](constValue *) {}) |
std::optional< int64_t > | getPointerOffsetFrom (constValue *Other,constDataLayout &DL)const |
If this ptr is provably equal toOther plus a constant offset, return that offset in bytes. | |
bool | canBeFreed ()const |
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. | |
uint64_t | getPointerDereferenceableBytes (constDataLayout &DL,bool &CanBeNull,bool &CanBeFreed)const |
Returns the number of bytes known to be dereferenceable for the pointer value. | |
Align | getPointerAlignment (constDataLayout &DL)const |
Returns an alignment of the pointer value. | |
constValue * | DoPHITranslation (constBasicBlock *CurBB,constBasicBlock *PredBB)const |
Translate PHI node to its predecessor from the given basic block. | |
Value * | DoPHITranslation (constBasicBlock *CurBB,constBasicBlock *PredBB) |
void | mutateType (Type *Ty) |
Mutate the type of thisValue to be of the specified type. | |
template<class Compare > | |
void | sortUseList (Compare Cmp) |
Sort the use-list. | |
void | reverseUseList () |
Reverse the use-list. | |
void | print (raw_ostream &O,bool IsForDebug=false)const |
Implement operator<< onValue. | |
void | print (raw_ostream &O,ModuleSlotTracker &MST,bool IsForDebug=false)const |
void | printAsOperand (raw_ostream &O,bool PrintType=true,constModule *M=nullptr)const |
Print the name of thisValue out to the specifiedraw_ostream. | |
void | printAsOperand (raw_ostream &O,bool PrintType,ModuleSlotTracker &MST)const |
![]() | |
BasicBlock * | getPrevNode () |
constBasicBlock * | getPrevNode ()const |
Get the previous node, ornullptr for the list head. | |
BasicBlock * | getNextNode () |
Get the next node, ornullptr for the list tail. | |
constBasicBlock * | getNextNode ()const |
Get the next node, ornullptr for the list tail. | |
![]() | |
self_iterator | getIterator () |
const_self_iterator | getIterator ()const |
reverse_self_iterator | getReverseIterator () |
const_reverse_self_iterator | getReverseIterator ()const |
bool | isSentinel ()const |
Check whether this is the sentinel node. | |
![]() | |
const ParentTy * | getParent ()const |
ParentTy * | getParent () |
void | setParent (ParentTy *Parent) |
Static Public Member Functions | |
staticBasicBlock * | Create (LLVMContext &Context,constTwine &Name="",Function *Parent=nullptr,BasicBlock *InsertBefore=nullptr) |
Creates a newBasicBlock. | |
staticbool | classof (constValue *V) |
Methods for support type inquiry through isa, cast, and dyn_cast. | |
![]() | |
static void | dropDroppableUse (Use &U) |
Remove the droppable useU . | |
Public Attributes | |
bool | IsNewDbgInfoFormat |
Flag recording whether or not this block stores debug-info in the form of intrinsic instructions (false) or non-instruction records (true). | |
Additional Inherited Members | |
![]() | |
static constexprunsigned | MaxAlignmentExponent = 32 |
The maximum alignment for instructions. | |
static constexpruint64_t | MaximumAlignment = 1ULL <<MaxAlignmentExponent |
![]() | |
enum | : unsigned {NumUserOperandsBits = 27 } |
The number of operands in the subclass.More... | |
![]() | |
using | self_iterator = typenameilist_select_iterator_type< OptionsT::has_iterator_bits,ilist_detail::compute_node_options<T, Options... >::type, false, false >::type |
using | const_self_iterator = typenameilist_select_iterator_type< OptionsT::has_iterator_bits,ilist_detail::compute_node_options<T, Options... >::type, false,true >::type |
using | reverse_self_iterator = typenameilist_select_iterator_type< OptionsT::has_iterator_bits,ilist_detail::compute_node_options<T, Options... >::type,true, false >::type |
using | const_reverse_self_iterator = typenameilist_select_iterator_type< OptionsT::has_iterator_bits,ilist_detail::compute_node_options<T, Options... >::type,true,true >::type |
![]() | |
Value (Type *Ty,unsigned scid) | |
~Value () | |
Value's destructor should be virtual by design, but that would require thatValue and all of its subclasses have a vtable that effectively duplicates the information in the value ID. | |
void | getAllMetadata (SmallVectorImpl< std::pair<unsigned,MDNode * > > &MDs)const |
Appends all metadata attached to this value toMDs , sorting by KindID. | |
bool | hasMetadata ()const |
Return true if this value has any metadata attached to it. | |
bool | eraseMetadata (unsigned KindID) |
Erase all metadata attachments with the given kind. | |
void | eraseMetadataIf (function_ref<bool(unsigned,MDNode *)> Pred) |
Erase all metadata attachments matching the given predicate. | |
void | clearMetadata () |
Erase all metadata attached to thisValue. | |
MDNode * | getMetadataImpl (unsigned KindID)const |
Get metadata for the given kind, if any. | |
unsigned short | getSubclassDataFromValue ()const |
void | setValueSubclassData (unsigned shortD) |
MDNode * | getMetadata (unsigned KindID)const |
Get the current metadata attachments for the given kind, if any. | |
MDNode * | getMetadata (StringRef Kind)const |
void | getMetadata (unsigned KindID,SmallVectorImpl<MDNode * > &MDs)const |
Appends all attachments with the given ID toMDs in insertion order. | |
void | getMetadata (StringRef Kind,SmallVectorImpl<MDNode * > &MDs)const |
bool | hasMetadata (unsigned KindID)const |
Return true if this value has the given type of metadata attached. | |
bool | hasMetadata (StringRef Kind)const |
void | setMetadata (unsigned KindID,MDNode *Node) |
Set a particular kind of metadata attachment. | |
void | setMetadata (StringRef Kind,MDNode *Node) |
void | addMetadata (unsigned KindID,MDNode &MD) |
Add a metadata attachment. | |
void | addMetadata (StringRef Kind,MDNode &MD) |
![]() | |
ilist_node_with_parent ()=default | |
![]() | |
ilist_node_impl ()=default | |
![]() | |
unsignedchar | SubclassOptionalData: 7 |
Hold subclass data that can be dropped. | |
unsigned | NumUserOperands:NumUserOperandsBits |
unsigned | IsUsedByMD: 1 |
unsigned | HasName: 1 |
unsigned | HasMetadata: 1 |
unsigned | HasHungOffUses: 1 |
unsigned | HasDescriptor: 1 |
LLVM Basic Block Representation.
This represents a single basic block in LLVM. A basic block is simply a container of instructions that execute sequentially. Basic blocks are Values because they are referenced by instructions such as branches and switch tables. The type of aBasicBlock is "Type::LabelTy" because the basic block represents a label to which a branch can jump.
A well formed basic block is formed of a list of non-terminating instructions followed by a single terminator instruction. Terminator instructions may not occur in the middle of basic blocks, and must terminate the blocks. TheBasicBlock class allows malformed basic blocks to occur because it may be useful in the intermediate stage of constructing or modifying a program. However, the verifier will ensure that basic blocks are "well formed".
Definition at line60 of fileBasicBlock.h.
Definition at line178 of fileBasicBlock.h.
usingllvm::BasicBlock::const_phi_iterator =phi_iterator_impl<constPHINode,BasicBlock::const_iterator> |
Definition at line524 of fileBasicBlock.h.
Definition at line180 of fileBasicBlock.h.
usingllvm::BasicBlock::InstListType =SymbolTableList<Instruction,ilist_iterator_bits<true>,ilist_parent<BasicBlock> > |
Definition at line63 of fileBasicBlock.h.
Instruction iterators...
Definition at line177 of fileBasicBlock.h.
Definition at line523 of fileBasicBlock.h.
Definition at line179 of fileBasicBlock.h.
| delete |
BasicBlock::~BasicBlock | ( | ) |
Definition at line210 of fileBasicBlock.cpp.
| inline |
Definition at line487 of fileBasicBlock.h.
| inline |
Definition at line486 of fileBasicBlock.h.
Referenced byllvm::AAResults::canBasicBlockModify(),llvm::changeToInvokeAndSplitBasicBlock(),llvm::CloneAndPruneIntoFromInst(),llvm::OpenMPIRBuilder::createTask(),llvm::FastISel::fastEmitBranch(),findUnwindDestinations(),llvm::MergeBlockIntoPredecessor(),scanInlinedCode(),llvm::SimplifyInstructionsInBlock(),llvm::TryToSimplifyUncondBranchFromEmptyBlock(), andllvm::UnrollAndJamLoop().
| inline |
Instruction iterator methods.
Definition at line461 of fileBasicBlock.h.
Referenced byllvm::sandboxir::BasicBlock::begin(),llvm::calculateWasmEHInfo(),llvm::Interpreter::callFunction(),canLoopBeDeleted(),CanPropagatePredecessorsForPHIs(),canSplitCallSite(),llvm::CloneAndPruneIntoFromInst(),cloneInstructionInExitBlock(),llvm::FunctionComparator::cmpBasicBlocks(),llvm::IRSimilarity::IRInstructionMapper::convertToUnsignedVec(),llvm::SSAUpdaterTraits< SSAUpdater >::CreateEmptyPHI(),llvm::EpilogueVectorizerEpilogueLoop::createEpilogueVectorizedLoopSkeleton(),createOutlinedFunction(),llvm::OpenMPIRBuilder::createParallel(),llvm::createPHIsForSplitLoopExit(),createRetBitCast(),createRetPHINode(),llvm::OpenMPIRBuilder::createSections(),llvm::OpenMPIRBuilder::createTask(),llvm::OpenMPIRBuilder::createTeams(),llvm::TileInfo::CreateTiledLoops(),llvm::VPlan::createVPIRBasicBlock(),despeculateCountZeros(),llvm::PostDominatorTree::dominates(),llvm::JumpThreadingPass::duplicateCondBranchOnPHIIntoPred(),llvm::DuplicateInstructionsInSplitBetween(),EliminateDuplicatePHINodesNaiveImpl(),EliminateDuplicatePHINodesSetBasedImpl(),llvm::OpenMPIRBuilder::emitCancelationCheckImpl(),llvm::OpenMPIRBuilder::emitTargetTask(),ensureValueAvailableInSuccessor(),llvm::Evaluator::EvaluateFunction(),llvm::findAvailablePtrLoadStore(),findDependencies(),findDuplicateOutputBlock(),llvm::CodeExtractor::findOrCreateBlockForHoisting(),findOrCreatePHIInBlock(),llvm::SSAUpdaterTraits< SSAUpdater >::FindPredecessorBlocks(),foldCondBranchOnValueKnownInPredecessorImpl(),foldMemChr(),llvm::FoldSingleEntryPHINodes(),foldTwoEntryPHINode(),formLCSSAForInstructionsImpl(),llvm::ScalarEvolution::getAddExpr(),llvm::CanonicalLoopInfo::getBodyIP(),llvm::MemoryDependenceResults::getDependency(),llvm::GetIfCondition(),llvm::MemoryDependenceResults::getNonLocalCallDependency(),llvm::MemoryDependenceResults::getSimplePointerDependencyFrom(),getStrlenWithNull(),llvm::SSAUpdater::GetValueInMiddleOfBlock(),HandleByValArgumentInit(),HandleInlinedEHPad(),llvm::hoistAllInstructionsInto(),llvm::InlineFunction(),InsertSafepointPoll(),insertSinCosCall(),insertSpills(),insertTrivialPHIs(),llvm::instrs(),isBlockValidForExtraction(),makeStatepointExplicitImpl(),llvm::MergeBasicBlockIntoOnlyPred(),llvm::MergeBlockIntoPredecessor(),llvm::InstCombinerImpl::mergeStoreIntoSuccessor(),moveBBContents(),movePHIValuesToInsertedBlock(),llvm::InsertPHIStrategy::mutate(),llvm::sandboxir::BBIterator::operator--(),optimizeBlock(),optimizeSQRT(),ProcessBlock(),programUndefinedIfUndefOrPoison(),promoteMemoryToRegister(),reconnectPhis(),rewritePHINodesForExitAndUnswitchedBlocks(),RewriteUsesOfClonedInstructions(),runPass(),scalarizeMaskedCompressStore(),scalarizeMaskedExpandLoad(),scalarizeMaskedGather(),scalarizeMaskedLoad(),scalarizeMaskedScatter(),scalarizeMaskedStore(),scalarizeMaskedVectorHistogram(),scanInlinedCode(),SimplifyCondBranchToCondBranch(),llvm::SimplifyInstructionsInBlock(),llvm::JumpThreadingPass::simplifyPartiallyRedundantLoad(),splice(),SplitBlockPredecessorsImpl(),splitCallSite(),llvm::OutlinableRegion::splitCandidate(),llvm::SplitIndirectBrCriticalEdges(),llvm::SplitKnownCriticalEdge(),llvm::splitLoopBound(),llvm::JumpThreadingPass::threadEdge(),llvm::JumpThreadingPass::threadGuard(),llvm::JumpThreadingPass::threadThroughTwoBasicBlocks(),tryToMergeLandingPad(),llvm::TryToSimplifyUncondBranchFromEmptyBlock(),llvm::JumpThreadingPass::tryToUnfoldSelectInCurrBB(),llvm::JumpThreadingPass::unfoldSelectInstr(),llvm::UnrollLoop(),unswitchTrivialSwitch(),UpdatePHINodes(),llvm::InstVisitor< SubClass, RetTy >::visit(),llvm::Interpreter::visitIntrinsicInst(), andworkshareLoopTargetCallback().
| inline |
Definition at line469 of fileBasicBlock.h.
bool BasicBlock::canSplitPredecessors | ( | ) | const |
Definition at line567 of fileBasicBlock.cpp.
Referenced bycanSplitCallSite(),canSplitPredecessors(), andSplitBlockPredecessorsImpl().
Methods for support type inquiry through isa, cast, and dyn_cast.
Definition at line572 of fileBasicBlock.h.
void BasicBlock::convertFromNewDbgValues | ( | ) |
Convert variable location debugging information stored in DbgMarkers and DbgRecords into the dbg.value intrinsic representation.
Sets IsNewDbgInfoFormat = false.
Definition at line115 of fileBasicBlock.cpp.
void BasicBlock::convertToNewDbgValues | ( | ) |
Convert variable location debugging information stored in dbg.value intrinsics into DbgMarkers / DbgRecords.
Deletes all dbg.values in the process and sets IsNewDbgInfoFormat = true. Only takes effect if the UseNewDbgInfoFormat LLVM command line option is given.
Definition at line76 of fileBasicBlock.cpp.
| inlinestatic |
Creates a newBasicBlock.
If the Parent parameter is specified, the basic block is automatically inserted at either the end of the function (if InsertBefore is 0), or before the specified basic block.
Definition at line213 of fileBasicBlock.h.
ReferencesName.
Referenced byaddBoundsChecking(),assureFPCallStub(),llvm::CloneBasicBlock(),convertToGuardPredicates(),createAndInsertBasicBlocks(),llvm::OpenMPIRBuilder::createCopyinClauseBlocks(),llvm::MIRParserImpl::createDummyFunction(),CreateFailBB(),createFPFnStub(),createFrameHelperMachineFunction(),llvm::RandomIRBuilder::createFunctionDefinition(),llvm::OpenMPIRBuilder::createLoopSkeleton(),llvm::createMemCpyLoopKnownSize(),createMemMoveLoopUnknownSize(),createMemSetLoop(),createOutlinedFunction(),llvm::OpenMPIRBuilder::createReductions(),llvm::OpenMPIRBuilder::createReductionsGPU(),llvm::createSanitizerCtor(),llvm::createSanitizerCtorAndInitFunctions(),llvm::OpenMPIRBuilder::createSections(),llvm::Attributor::createShallowWrapper(),llvm::OpenMPIRBuilder::createTargetData(),llvm::OpenMPIRBuilder::createTargetInit(),createThunk(),llvm::ThunkInserter< Derived, InsertedThunksTy >::createThunkFunction(),createUnreachableSwitchDefault(),createWrapper(),llvm::ehAwareSplitEdge(),llvm::orc::IRSpeculationLayer::emit(),llvm::emitAMDGPUPrintfCall(),llvm::OpenMPIRBuilder::emitCancelationCheckImpl(),llvm::SITargetLowering::emitExpandAtomicAddrSpacePredicate(),llvm::OpenMPIRBuilder::emitIfClause(),llvm::OpenMPIRBuilder::emitKernelLaunch(),emitTargetTaskProxyFunction(),llvm::OpenMPIRBuilder::emitUserDefinedMapper(),expandFPToI(),expandIToFP(),expandToSwitch(),findOrCreatePHIBlock(),llvm::SanitizerStatReport::finish(),foldMemChr(),generateReproducer(),generateUnsignedDivisionCode(),getStrlenWithNull(),injectPendingInvariantConditions(),insertUniqueBackedgeBlock(),LLVMAppendBasicBlockInContext(),LLVMCreateBasicBlockInContext(),LLVMInsertBasicBlockInContext(),lowerFunnelShifts(),llvm::lowerGlobalIFuncUsersAsGlobalCtor(),lowerIntrinsicToFunction(),llvm::lowerUnaryVectorIntrinsicAsLoop(),makeFunctionBodyUnreachable(),llvm::orc::makeStub(),markAliveBlocks(),mergeCompatibleInvokesImpl(),llvm::InsertCFGStrategy::mutate(),llvm::EscapeEnumerator::Next(),performBlockTailMerging(),processSwitch(),llvm::SCCPSolver::removeNonFeasibleEdges(),removeUndefIntroducingPredecessor(),rewritePHIsForCleanupPad(),runImpl(),llvm::SPIRVMergeRegionExitTargets::runOnConvergenceRegionNoRecurse(),SimplifyCondBranchToCondBranch(),llvm::splitBB(),llvm::SplitBlockAndInsertIfThenElse(),SplitBlockPredecessorsImpl(),llvm::coro::AsyncABI::splitCoroutine(),llvm::coro::AnyRetconABI::splitCoroutine(),llvm::SplitKnownCriticalEdge(),SplitLandingPadPredecessorsImpl(),switchToLookupTable(),llvm::JumpThreadingPass::threadEdge(),llvm::JumpThreadingPass::threadThroughTwoBasicBlocks(), andllvm::JumpThreadingPass::unfoldSelectInstr().
DbgMarker * BasicBlock::createMarker | ( | InstListType::iterator | It | ) |
Definition at line63 of fileBasicBlock.cpp.
Referencesllvm::sandboxir::Value::Ctx,llvm::enumerate(),llvm::sandboxir::Context::getOrCreateValue(), andI.
DbgMarker * BasicBlock::createMarker | ( | Instruction * | I | ) |
Attach aDbgMarker to the given instruction.
Enables the storage of any debug-info at this position in the program.
Definition at line52 of fileBasicBlock.cpp.
Referenced byllvm::JumpThreadingPass::cloneInstructions().
void BasicBlock::deleteTrailingDbgRecords | ( | ) |
Delete any trailing DbgRecords at the end of this block, seesetTrailingDbgRecords.
Definition at line1185 of fileBasicBlock.cpp.
void BasicBlock::dropAllReferences | ( | ) |
Cause all subinstructions to "let go" of all the references that said subinstructions are maintaining.
This allows one to 'delete' a whole class at a time, even though there may be circular references... first all references are dropped, and all use counts go to zero. Then everything is delete'd for real. Note that no operations are valid on an object that has "dropped all references", except operator delete.
Definition at line476 of fileBasicBlock.cpp.
void BasicBlock::dumpDbgValues | ( | ) | const |
Definition at line141 of fileBasicBlock.cpp.
| inline |
Definition at line483 of fileBasicBlock.h.
Referenced byllvm::sandboxir::BasicBlock::begin(),llvm::OpenMPIRBuilder::finalize(), andrewritePHIs().
| inline |
Definition at line474 of fileBasicBlock.h.
Referenced bybuildPartialInvariantUnswitchConditionalBranch(),llvm::MemorySSAUpdater::changeToUnreachable(),llvm::changeToUnreachable(),llvm::CloneBasicBlock(),llvm::JumpThreadingPass::cloneInstructions(),llvm::FunctionComparator::cmpBasicBlocks(),llvm::ConvertDebugDeclareToDebugValue(),llvm::IRSimilarity::IRInstructionMapper::convertToUnsignedVec(),llvm::convertUsersOfConstantsToInstructions(),llvm::OpenMPIRBuilder::createReductions(),createSwitchStatement(),createTargetLoopWorkshareCall(),createWrapper(),detectPopcountIdiom(),detectShiftUntilLessThanIdiom(),detectShiftUntilZeroIdiom(),llvm::JumpThreadingPass::duplicateCondBranchOnPHIIntoPred(),llvm::OpenMPIRBuilder::emitCancelationCheckImpl(),llvm::SITargetLowering::emitExpandAtomicAddrSpacePredicate(),llvm::CodeExtractor::findOrCreateBlockForHoisting(),llvm::InstCombinerImpl::foldIntegerTypedPHI(),llvm::FoldReturnIntoUncondBranch(),getConvergenceEntry(),getInsertionRange(),getInsertPt(),getInstrBB(),llvm::MemoryDependenceResults::getNonLocalCallDependency(),llvm::CanonicalLoopInfo::getPreheaderIP(),llvm::SSAUpdater::GetValueInMiddleOfBlock(),llvm::objcarc::BottomUpPtrState::HandlePotentialUse(),llvm::hoistAllInstructionsInto(),llvm::DIBuilder::insertDbgAssign(),insertDbgVariableRecordsForPHIs(),llvm::insertDebugValuesForPHIs(),llvm::sandboxir::Instruction::insertInto(),InsertSafepointPoll(),llvm::instrs(),llvm::SampleProfileProber::instrumentOneFunc(),isBlockValidForExtraction(),llvm::isInTailCallPosition(),llvm::MergeBlockIntoPredecessor(),mergeCompatibleInvokesImpl(),moveBBContents(),llvm::RandomIRBuilder::newSource(),llvm::sandboxir::BBIterator::operator++(),optimizeBlock(),OptimizeExtractBits(),performBlockTailMerging(),llvm::PrepareToSplitEntryBlock(),ProcessBlock(),programUndefinedIfUndefOrPoison(),promoteMemoryToRegister(),reconnectPhis(),replaceArgumentUses(),RewriteUsesOfClonedInstructions(),llvm::IRBuilderBase::SetInsertPoint(),shouldInstrumentBlock(),llvm::SimplifyInstructionsInBlock(),llvm::JumpThreadingPass::simplifyPartiallyRedundantLoad(),simplifyUsingControlFlow(),SinkCast(),sinkCmpExpression(),SinkShiftAndTruncate(),splice(),llvm::spliceBB(),llvm::VPBasicBlock::splitAt(),llvm::JumpThreadingPass::threadEdge(),llvm::JumpThreadingPass::threadGuard(),llvm::JumpThreadingPass::threadThroughTwoBasicBlocks(),llvm::JumpThreadingPass::unfoldSelectInstr(),unswitchTrivialBranch(),updateScopeLine(),llvm::slpvectorizer::BoUpSLP::vectorizeTree(),llvm::InstVisitor< SubClass, RetTy >::visit(), andworkshareLoopTargetCallback().
| inline |
Definition at line475 of fileBasicBlock.h.
BasicBlock::iterator BasicBlock::erase | ( | BasicBlock::iterator | FromIt, |
BasicBlock::iterator | ToIt | ||
) |
Erases a range of instructions fromFromIt
to (not including)ToIt
.
\ReturnsToIt
.
Definition at line666 of fileBasicBlock.cpp.
Unlink 'this' from the containing function and delete it.
Definition at line279 of fileBasicBlock.cpp.
Referenced byanalyzeAndPruneOutputBlocks(),llvm::CloneAndPruneIntoFromInst(),createSwitchStatement(),llvm::DomTreeUpdater::deleteBB(),llvm::OpenMPIRBuilder::emitBlock(),llvm::OpenMPIRBuilder::finalize(),llvm::InlineFunction(),LLVMDeleteBasicBlock(),llvm::MergeBasicBlockIntoOnlyPred(), andllvm::OutlinableRegion::reattachCandidate().
void BasicBlock::flushTerminatorDbgRecords | ( | ) |
Eject any debug-info trailing at the end of a block.
DbgRecords can transiently be located "off the end" of a block if the blocks terminator is temporarily removed. Once a terminator is re-inserted this method will move such DbgRecords back to the right place (ahead of the terminator).
Definition at line739 of fileBasicBlock.cpp.
Referenced byllvm::changeToUnreachable().
| inline |
Definition at line485 of fileBasicBlock.h.
| inline |
Definition at line484 of fileBasicBlock.h.
Referenced byllvm::CanonicalLoopInfo::assertOK(),calculateStateNumbersForInvokes(),llvm::AAResults::canBasicBlockModify(),llvm::CloneAndPruneFunctionInto(),llvm::CloneAndPruneIntoFromInst(),llvm::FastISel::fastEmitBranch(),findArgParts(),formLCSSAForInstructionsImpl(),llvm::MustBeExecutedContextExplorer::getMustBeExecutedNextInstruction(),llvm::InstCombinerImpl::handlePotentiallyDeadBlocks(),insertCallAtFunctionEntryPoint(),llvm::ScalarEvolution::isBasicBlockEntryGuardedByCond(),isPotentiallyReachable(),llvm::coro::isSuspendBlock(),llvm::MergeBlockIntoPredecessor(),mergeCleanupPad(),mergeNestedCondBranch(),llvm::moveInstructionsToTheEnd(),movePHIValuesToInsertedBlock(),llvm::JumpThreadingPass::processBranchOnXOR(),llvm::removeAllNonTerminatorAndEHPadInstructions(),runSanitizeRealtimeBlocking(),sinkLastInstruction(),llvm::SplitEdge(),llvm::splitLoopBound(), andllvm::TryToSimplifyUncondBranchFromEmptyBlock().
LLVMContext & BasicBlock::getContext | ( | ) | const |
Get the context in which this basic block lives.
Definition at line168 of fileBasicBlock.cpp.
Referenced byaddBasicBlockMetadata(),llvm::addStringMetadataToLoop(),llvm::LoopVersioning::annotateInstWithNoAlias(),llvm::CloneBasicBlock(),llvm::JumpThreadingPass::cloneInstructions(),llvm::ConstantFoldTerminator(),llvm::createMemCpyLoopKnownSize(),createMemMoveLoopKnownSize(),createMemMoveLoopUnknownSize(),createStringMetadata(),llvm::OpenMPIRBuilder::createTargetInit(),createUnreachableSwitchDefault(),llvm::ehAwareSplitEdge(),llvm::OpenMPIRBuilder::emitCancelationCheckImpl(),llvm::VPlan::execute(),llvm::LoopVectorizationPlanner::executePlan(),findOrCreatePHIBlock(),llvm::DbgRecord::getContext(),llvm::HardwareLoopInfo::HardwareLoopInfo(),llvm::BPFCoreSharedInfo::insertPassThrough(),LLVMGetCurrentDebugLocation(),LLVMGetMDNodeOperands(),LLVMGetNamedMetadataOperands(),llvm::lowerUnaryVectorIntrinsicAsLoop(),llvm::MergeBasicBlockIntoOnlyPred(),llvm::MergeBlockIntoPredecessor(),llvm::parseWidenableBranch(),llvm::LoopVersioning::prepareNoAliasMetadata(),llvm::JumpThreadingPass::processBranchOnXOR(),processSwitch(),llvm::SCCPSolver::removeNonFeasibleEdges(),removeUndefIntroducingPredecessor(),rewritePHIsForCleanupPad(),llvm::LoopVectorizeHints::setAlreadyVectorized(),llvm::Loop::setLoopAlreadyUnrolled(),llvm::Loop::setLoopMustProgress(),SimplifyCondBranchToCondBranch(),llvm::splitBB(),llvm::SplitBlockAndInsertIfThenElse(),SplitBlockPredecessorsImpl(),SplitLandingPadPredecessorsImpl(),llvm::splitLoopBound(),llvm::JumpThreadingPass::threadEdge(),llvm::JumpThreadingPass::threadThroughTwoBasicBlocks(),llvm::TryToSimplifyUncondBranchFromEmptyBlock(),llvm::JumpThreadingPass::unfoldSelectInstr(), andllvm::LoopVersioning::versionLoop().
constDataLayout & BasicBlock::getDataLayout | ( | ) | const |
Get the data layout of the module this basic block belongs to.
Requires the basic block to have a parent module.
Definition at line296 of fileBasicBlock.cpp.
Referenced bycomputeAllocaDefaultAlign(),computeLoadStoreDefaultAlign(),computeUnlikelySuccessors(),llvm::JumpThreadingPass::computeValueKnownInPredecessorsImpl(),llvm::IRBuilderBase::CreateAlignedLoad(),llvm::IRBuilderBase::CreateAlignedStore(),llvm::IRBuilderBase::CreateAlloca(),llvm::IRBuilderBase::CreateAtomicCmpXchg(),llvm::IRBuilderBase::CreateAtomicRMW(),llvm::IRBuilderBase::CreateStackSave(),createWrapper(),llvm::JumpThreadingPass::duplicateCondBranchOnPHIIntoPred(),llvm::VPInterleaveRecipe::execute(),llvm::VPExpandSCEVRecipe::execute(),llvm::findAvailablePtrLoadStore(),getGEPIndexTy(),llvm::MemoryDependenceResults::getNonLocalPointerDependency(),llvm::getPtrStride(),llvm::MemoryDependenceResults::getSimplePointerDependencyFrom(),llvm::getStartAndEndForAccess(),llvm::SSAUpdater::GetValueInMiddleOfBlock(),llvm::JumpThreadingPass::maybethreadThroughTwoBasicBlocks(),llvm::LoopStructure::parseLoopStructure(),llvm::JumpThreadingPass::processBlock(),llvm::JumpThreadingPass::processImpliedCondition(),processNonStringArg(),llvm::promoteLoopAccessesToScalars(),reuseTableCompare(),llvm::simplifyCFG(),llvm::SimplifyInstructionsInBlock(),llvm::JumpThreadingPass::threadGuard(), andllvm::LoopVersioning::versionLoop().
| inline |
Definition at line337 of fileBasicBlock.h.
ReferencesgetFirstInsertionPt().
BasicBlock::const_iterator BasicBlock::getFirstInsertionPt | ( | ) | const |
Returns an iterator to the first instruction in this block that is suitable for inserting a non-PHI instruction.
In particular, it skips all PHIs and LandingPad instructions.
Definition at line437 of fileBasicBlock.cpp.
Referenced bycloneInstructionInExitBlock(),llvm::ConvertDebugDeclareToDebugValue(),llvm::convertUsersOfConstantsToInstructions(),llvm::OpenMPIRBuilder::createParallel(),llvm::RandomIRBuilder::createStackMemory(),llvm::OpenMPIRBuilder::createTargetInit(),DbgInserterHelper(),llvm::VPWidenIntOrFpInductionRecipe::execute(),llvm::VPFirstOrderRecurrencePHIRecipe::execute(),llvm::VPReductionPHIRecipe::execute(),llvm::RandomIRBuilder::findOrCreateSource(),foldDependentIVs(),foldGuardedFunnelShift(),llvm::InstCombinerImpl::foldIntegerTypedPHI(),getFirstInsertionPt(),getInsertionRange(),getInsertPt(),getInstrBB(),llvm::coro::getSpillInsertionPt(),llvm::objcarc::BottomUpPtrState::HandlePotentialUse(),llvm::objcarc::BundledRetainClaimRVs::insertAfterInvokes(),insertDbgVariableRecordsForPHIs(),llvm::insertDebugValuesForPHIs(),insertSpills(),llvm::SampleProfileProber::instrumentOneFunc(),llvm::invertCondition(),makeStatepointExplicitImpl(),mergeConditionalStoreToAddress(),llvm::InstCombinerImpl::mergeStoreIntoSuccessor(),llvm::ShuffleBlockStrategy::mutate(),llvm::InstDeleterIRStrategy::mutate(),llvm::RandomIRBuilder::newSource(),OptimizeExtractBits(),llvm::InstCombinerImpl::run(),setInsertionPoint(),shouldInstrumentBlock(),simplifyUsingControlFlow(),SinkCast(),sinkCmpExpression(),SinkInstruction(),sinkInstruction(),SinkShiftAndTruncate(),llvm::OutlinableRegion::splitCandidate(),llvm::SplitIndirectBrCriticalEdges(),SplitLandingPadPredecessorsImpl(),targetParallelCallback(),llvm::JumpThreadingPass::threadGuard(),llvm::InstCombinerImpl::tryToSinkInstruction(), andllvm::ObjectSizeOffsetEvaluator::visitPHINode().
| inline |
Definition at line355 of fileBasicBlock.h.
ReferencesgetFirstMayFaultInst().
constInstruction * BasicBlock::getFirstMayFaultInst | ( | ) | const |
Returns the first potential AsynchEH faulty instruction currently it checks for loads/stores (which may dereference a null pointer) and calls/invokes (which may propagate exceptions)
Definition at line358 of fileBasicBlock.cpp.
Referenced bygetFirstMayFaultInst().
Instruction * BasicBlock::getFirstNonPHI | ( | ) | const |
Returns a pointer to the first instruction in this block that is not aPHINode instruction.
When adding instructions to the beginning of the basic block, they should be added before the returned value, not before the first instruction, which might be PHI. Returns 0 is there's no non-PHI instruction.
Deprecated in favour of getFirstNonPHIIt, which returns an iterator that preserves some debugging information.
Definition at line367 of fileBasicBlock.cpp.
| inline |
Definition at line302 of fileBasicBlock.h.
ReferencesgetFirstNonPHIIt().
BasicBlock::const_iterator BasicBlock::getFirstNonPHIIt | ( | ) | const |
Returns an iterator to the first instruction in this block that is not aPHINode instruction.
When adding instructions to the beginning of the basic block, they should be added before the returned value, not before the first instruction, which might be PHI. Returnsend() if there's no non-PHI instruction.
Avoid unwrapping the iterator to an Instruction* before inserting here, as important debug-info is preserved in the iterator.
Definition at line381 of fileBasicBlock.cpp.
Referenced byllvm::MachineFunction::addLandingPad(),llvm::calculateClrEHStateNumbers(),llvm::calculateCXXStateForAsynchEH(),llvm::calculateSEHStateForAsynchEH(),calculateStateNumbersForInvokes(),llvm::calculateWasmEHInfo(),canSplitPredecessors(),cloneInstructionInExitBlock(),CloneLoopBlocks(),llvm::colorEHFunclets(),ConnectEpilog(),ConnectProlog(),llvm::EpilogueVectorizerEpilogueLoop::createEpilogueVectorizedLoopSkeleton(),llvm::createMemCpyLoopKnownSize(),createMemMoveLoopKnownSize(),createOutlinedFunction(),llvm::createPHIsForSplitLoopExit(),detectPopcountIdiom(),detectShiftUntilLessThanIdiom(),detectShiftUntilZeroIdiom(),llvm::ehAwareSplitEdge(),llvm::VPIRInstruction::execute(),llvm::CodeExtractor::findOrCreateBlockForHoisting(),findPHIForConditionForwarding(),findUnwindDestinations(),findWasmUnwindDestinations(),getConvergenceEntry(),getFirstNonPHIIt(),getSuccPad(),getUnwindDestTokenHelper(),llvm::SSAUpdater::GetValueInMiddleOfBlock(),HandleInlinedEHPad(),hoist(),llvm::InlineFunction(),insertDbgVariableRecordsForPHIs(),llvm::insertDebugValuesForPHIs(),isEHPad(),markAliveBlocks(),moveLCSSAPhis(),preparePlanForEpilogueVectorLoop(),programUndefinedIfUndefOrPoison(),raiseUserConstantDataAllocasToEntryBlock(),relocationViaAlloca(),removeEmptyCleanup(),rewritePHIs(),llvm::InstCombinerImpl::run(),runMoveAutoInit(),llvm::SplitBlockAndInsertSimpleForLoop(),SplitLandingPadPredecessorsImpl(), andllvm::TryToSimplifyUncondBranchFromEmptyBlock().
| inline |
Definition at line314 of fileBasicBlock.h.
ReferencesgetFirstNonPHIOrDbg().
BasicBlock::const_iterator BasicBlock::getFirstNonPHIOrDbg | ( | bool | SkipPseudoOp =true | ) | const |
Returns a pointer to the first instruction in this block that is not aPHINode or a debug intrinsic, or any pseudo operation ifSkipPseudoOp
is true.
Definition at line398 of fileBasicBlock.cpp.
Referenced byllvm::ConstantFoldTerminator(),createOutlinedFunction(),llvm::OutlinableRegion::findCorrespondingBlockIn(),getFirstNonPHIOrDbg(),initializeUniqueCases(),isPredicatedOnPHI(),llvm::moveInstructionsToTheBeginning(),NegateValue(),processSwitch(),SplitBlockPredecessorsImpl(), andllvm::InstCombinerImpl::visitAllocaInst().
| inline |
Definition at line345 of fileBasicBlock.h.
ReferencesgetFirstNonPHIOrDbgOrAlloca().
BasicBlock::const_iterator BasicBlock::getFirstNonPHIOrDbgOrAlloca | ( | ) | const |
Returns an iterator to the first instruction in this block that is not aPHINode, a debug intrinsic, a static alloca or any pseudo operation.
Definition at line450 of fileBasicBlock.cpp.
Referenced byllvm::InstCombinerImpl::freezeOtherUses(),getFirstNonPHIOrDbgOrAlloca(),getFreezeInsertPt(), andllvm::IRBuilderBase::SetInsertPointPastAllocas().
| inline |
Definition at line326 of fileBasicBlock.h.
ReferencesgetFirstNonPHIOrDbgOrLifetime().
BasicBlock::const_iterator BasicBlock::getFirstNonPHIOrDbgOrLifetime | ( | bool | SkipPseudoOp =true | ) | const |
Returns a pointer to the first instruction in this block that is not aPHINode, a debug intrinsic, or a lifetime intrinsic, or any pseudo operation ifSkipPseudoOp
is true.
Definition at line416 of fileBasicBlock.cpp.
Referenced bygetFirstNonPHIOrDbgOrLifetime(),shouldInstrumentBlock(), andllvm::SplitKnownCriticalEdge().
std::optional<uint64_t > BasicBlock::getIrrLoopHeaderWeight | ( | ) | const |
Definition at line707 of fileBasicBlock.cpp.
| inline |
Definition at line698 of fileBasicBlock.h.
ReferencesgetLandingPadInst().
constLandingPadInst * BasicBlock::getLandingPadInst | ( | ) | const |
Return the landingpad instruction associated with the landing pad.
Definition at line703 of fileBasicBlock.cpp.
Referenced bygetLandingPadInst(),makeStatepointExplicitImpl(), andSplitLandingPadPredecessorsImpl().
DbgMarker * BasicBlock::getMarker | ( | InstListType::iterator | It | ) |
Return theDbgMarker for the position given byIt
, so that DbgRecords can be inserted there.
This will either be nullptr if not present, aDbgMarker, or TrailingDbgRecords if It isend().
Definition at line1100 of fileBasicBlock.cpp.
Referenced byllvm::JumpThreadingPass::cloneInstructions(),formLCSSAForInstructionsImpl(), andRewriteUsesOfClonedInstructions().
| inline |
Definition at line228 of fileBasicBlock.h.
ReferencesgetModule().
Return the module owning the function this basic block belongs to, or nullptr if the function does not have a module.
Note: this is undefined behavior if the block does not have a parent.
Definition at line292 of fileBasicBlock.cpp.
Referenced bycallAppendArgs(),callAppendStringN(),callBufferedPrintfArgPush(),callBufferedPrintfStart(),callPrintfBegin(),CanProveNotTakenFirstIteration(),llvm::IRBuilderBase::CreateBinaryIntrinsic(),llvm::IRBuilderBase::CreateIntrinsic(),llvm::IRBuilderBase::CreateUnaryIntrinsic(),llvm::emitAMDGPUPrintfCall(),llvm::AtomicInfo::EmitAtomicLibcall(),llvm::AtomicInfo::EmitAtomicLoadLibcall(),emitTargetTaskProxyFunction(),llvm::VPWidenIntrinsicRecipe::execute(),llvm::FastISel::fastEmitBranch(),llvm::LazyValueInfo::getConstant(),llvm::LazyValueInfo::getConstantOnEdge(),llvm::LazyValueInfo::getConstantRange(),llvm::LazyValueInfo::getConstantRangeOnEdge(),llvm::RISCVTargetLowering::getIRStackGuard(),getModule(),llvm::VectorBuilder::getModule(),llvm::LazyValueInfo::getPredicateOnEdge(),performBranchToCommonDestFolding(),print(), anduseTpOffset().
DbgMarker * BasicBlock::getNextMarker | ( | Instruction * | I | ) |
Return theDbgMarker for the position that comes afterI
.
Definition at line1096 of fileBasicBlock.cpp.
| inline |
Definition at line104 of fileBasicBlock.h.
Referencesassert(),getParent(), andNumber.
Referenced byemitBasicBlockLoopComments(),llvm::FunctionLoweringInfo::getMBB(),llvm::GraphTraits< BasicBlock * >::getNumber(),llvm::GraphTraits< const BasicBlock * >::getNumber(),llvm::GraphTraits< Inverse< BasicBlock * > >::getNumber(),llvm::GraphTraits< Inverse< const BasicBlock * > >::getNumber(),PrintParentLoopComment(), andllvm::IRTranslator::runOnMachineFunction().
| inline |
Definition at line221 of fileBasicBlock.h.
Return the enclosing method, or null if none.
Definition at line220 of fileBasicBlock.h.
Referenced byaddReplicateRegions(),llvm::CodeMetrics::analyzeBasicBlock(),calculateCXXStateNumbers(),calculateSEHStateNumbers(),canProveExitOnFirstIteration(),llvm::JumpThreadingPass::cloneInstructions(),llvm::cloneLoopWithPreheader(),llvm::OpenMPIRBuilder::collapseLoops(),llvm::colorEHFunclets(),CompareValueComplexity(),computeAllocaDefaultAlign(),llvm::LoopSafetyInfo::computeBlockColors(),computeLoadStoreDefaultAlign(),llvm::RandomIRBuilder::connectToSink(),convertToRelLookupTable(),copyMustTailReturn(),llvm::coro::BaseCloner::create(),createAllocaInstAtEntry(),llvm::IRBuilderBase::CreateAssumption(),llvm::OpenMPIRBuilder::createCanonicalLoop(),llvm::IRSimilarity::IRSimilarityCandidate::createCanonicalRelationFrom(),llvm::OpenMPIRBuilder::createCopyinClauseBlocks(),llvm::IRBuilderBase::CreateFree(),CreateGCStatepointCallCommon(),CreateGCStatepointInvokeCommon(),llvm::IRBuilderBase::CreateGlobalString(),llvm::IRBuilderBase::CreateLaunderInvariantGroup(),llvm::IRBuilderBase::CreateMalloc(),llvm::createMemCpyLoopKnownSize(),createMemMoveLoopKnownSize(),createMemMoveLoopUnknownSize(),createMemSetLoop(),createOutlinedFunction(),llvm::OpenMPIRBuilder::createParallel(),llvm::OpenMPIRBuilder::createReductions(),llvm::OpenMPIRBuilder::createReductionsGPU(),llvm::IRBuilderBase::CreateStripInvariantGroup(),llvm::OpenMPIRBuilder::createTargetData(),llvm::OpenMPIRBuilder::createTargetDeinit(),llvm::OpenMPIRBuilder::createTargetInit(),llvm::OpenMPIRBuilder::createTask(),llvm::OpenMPIRBuilder::createTeams(),createUnreachableSwitchDefault(),llvm::IRBuilderBase::CreateVectorReverse(),llvm::IRBuilderBase::CreateVectorSplice(),llvm::ehAwareSplitEdge(),llvm::orc::IRSpeculationLayer::emit(),llvm::emitAMDGPUPrintfCall(),llvm::OpenMPIRBuilder::emitBlock(),llvm::OpenMPIRBuilder::emitCancelationCheckImpl(),llvm::SITargetLowering::emitExpandAtomicAddrSpacePredicate(),llvm::OpenMPIRBuilder::emitIfClause(),llvm::OpenMPIRBuilder::emitKernelLaunch(),llvm::AArch64TargetLowering::emitLoadLinked(),llvm::ARMTargetLowering::emitLoadLinked(),llvm::PPCTargetLowering::emitMaskedAtomicCmpXchgIntrinsic(),llvm::PPCTargetLowering::emitMaskedAtomicRMWIntrinsic(),llvm::InnerLoopVectorizer::emitMemRuntimeChecks(),llvm::InnerLoopVectorizer::emitSCEVChecks(),llvm::AArch64TargetLowering::emitStoreConditional(),llvm::ARMTargetLowering::emitStoreConditional(),llvm::HexagonTargetLowering::emitStoreConditional(),llvm::OpenMPIRBuilder::emitTargetTask(),emitTaskDependencies(),expandToSwitch(),llvm::CodeExtractor::extractCodeRegion(),llvm::CodeExtractor::findAllocas(),llvm::MustBeExecutedContextExplorer::findBackwardJoinPoint(),llvm::OutlinableRegion::findCorrespondingBlockIn(),llvm::MustBeExecutedContextExplorer::findForwardJoinPoint(),findOrCreatePHIBlock(),llvm::RandomIRBuilder::findOrCreateSource(),llvm::InstCombinerImpl::foldAggregateConstructionIntoAggregateReuse(),llvm::foldBranchToCommonDest(),llvm::InstCombinerImpl::foldIntegerTypedPHI(),foldLogOpOfMaskedICmps_NotAllZeros_BMask_Mixed(),foldMemChr(),formLCSSAForInstructionsImpl(),generateUnsignedDivisionCode(),llvm::BlockAddress::get(),llvm::AddrLabelMap::getAddrLabelSymbolToEmit(),getAllocaPos(),llvm::memtag::getAndroidSlotPtr(),llvm::IRBuilderBase::getCurrentFunctionReturnType(),llvm::TargetLoweringBase::getDefaultSafeStackPointerLocation(),llvm::BlockCoverageInference::getDependencies(),llvm::MemoryDependenceResults::getDependency(),getDominatees(),getDominators(),llvm::memtag::getFP(),llvm::IRSimilarity::IRSimilarityCandidate::getFunction(),llvm::DbgRecord::getFunction(),llvm::Trace::getFunction(),llvm::OpenMPIRBuilder::OutlineInfo::getFunction(),llvm::ValueEnumerator::getGlobalBasicBlockID(),llvm::TargetLoweringBase::getIRStackGuard(),llvm::X86TargetLowering::getIRStackGuard(),llvm::Loop::getLocStr(),getModuleFromDPI(),llvm::MemoryDependenceResults::getNonLocalCallDependency(),getNumber(),llvm::OpenMPIRBuilder::getOrCreateSrcLocStr(),llvm::memtag::getPC(),llvm::getPtrStride(),llvm::TargetLoweringBase::getSafeStackPointerLocation(),llvm::MemoryDependenceResults::getSimplePointerDependencyFrom(),llvm::GCProjectionInst::getStatepoint(),llvm::slpvectorizer::BoUpSLP::getTreeCost(),HandleByValArgumentInit(),HandleInlinedEHPad(),HandleInlinedLandingPad(),hostParallelCallback(),llvm::InlineFunction(),insertBoundsCheck(),InsertCall(),InsertSafepointPoll(),insertSpills(),InsertTrap(),llvm::InstrumentationIRBuilder::InstrumentationIRBuilder(),llvm::invertCondition(),llvm::Attributor::isAssumedDead(),llvm::ScalarEvolution::isBasicBlockEntryGuardedByCond(),isExplicitVecOuterLoop(),llvm::isInTailCallPosition(),llvm::EarliestEscapeAnalysis::isNotCapturedBefore(),llvm::isPresplitCoroSuspendExitEdge(),LLVMBuildLandingPad(),LLVMInsertBasicBlockInContext(),LLVMInsertExistingBasicBlockAfterInsertBlock(),llvm::BlockAddress::lookup(),llvm::lowerUnaryVectorIntrinsicAsLoop(),memoryIsNotModifiedBetween(),llvm::MergeBasicBlockIntoOnlyPred(),mergeCompatibleInvokesImpl(),moveLCSSAPhis(),llvm::InsertFunctionStrategy::mutate(),llvm::InsertCFGStrategy::mutate(),llvm::InsertPHIStrategy::mutate(),llvm::RandomIRBuilder::newSink(),llvm::RandomIRBuilder::newSource(),nullifySetjmp(),placeSplitBlockCarefully(),preparePlanForEpilogueVectorLoop(),llvm::PrepareToSplitEntryBlock(),llvm::MemorySSA::print(),print(),llvm::DbgLabelRecord::print(),llvm::DbgVariableRecord::print(),printBBName(),llvm::EpilogueVectorizerMainLoop::printDebugTracesAtEnd(),llvm::EpilogueVectorizerEpilogueLoop::printDebugTracesAtEnd(),printIRBlockReference(),llvm::JumpThreadingPass::processBlock(),processSwitch(),programUndefinedIfUndefOrPoison(),llvm::memtag::readRegister(),llvm::SCCPSolver::removeNonFeasibleEdges(),llvm::RemoveRedundantDbgInstrs(),removeUndefIntroducingPredecessor(),replaceConstantExprOp(),replaceExtractElements(),llvm::SSAUpdaterBulk::RewriteAllUses(),rewritePHIsForCleanupPad(),llvm::SPIRVMergeRegionExitTargets::runOnConvergenceRegionNoRecurse(),scanOneBB(),llvm::LoopVectorizationPlanner::selectEpilogueVectorizationFactor(),llvm::IRBuilderBase::setConstrainedFPFunctionAttr(),llvm::VPTransformState::setDebugLocFrom(),llvm::IRBuilderBase::SetInsertPoint(),llvm::BlockCoverageInference::shouldInstrumentBlock(),llvm::shouldOptimizeForSize(),SimplifyCondBranchToCondBranch(),sinkLifetimeStartMarkers(),sinkLoopInvariantInstructions(),llvm::splitBB(),llvm::SplitBlockAndInsertIfThenElse(),llvm::SplitBlockAndInsertSimpleForLoop(),SplitBlockPredecessorsImpl(),llvm::SplitKnownCriticalEdge(),SplitLandingPadPredecessorsImpl(),llvm::SuspendCrossingInfo::SuspendCrossingInfo(),switchToLookupTable(),targetParallelCallback(),llvm::JumpThreadingPass::threadEdge(),llvm::JumpThreadingPass::threadThroughTwoBasicBlocks(),llvm::OpenMPIRBuilder::tileLoops(),llvm::TryToSimplifyUncondBranchFromEmptyBlock(),llvm::JumpThreadingPass::tryToUnfoldSelectInCurrBB(),llvm::JumpThreadingPass::unfoldSelectInstr(),UpdateAnalysisInformation(),llvm::AddrLabelMap::UpdateForDeletedBlock(),useFuncSeen(),UseTlsOffset(),validateAndCostRequiredSelects(),llvm::InstCombinerImpl::visitAnd(),llvm::InstCombinerImpl::visitOr(), andllvm::InstCombinerImpl::visitXor().
| inline |
Definition at line263 of fileBasicBlock.h.
ReferencesgetPostdominatingDeoptimizeCall().
Returns the call instruction calling @llvm.experimental.deoptimize that is present either in current basic block or in block that is a unique successor to current block, if such call is present.
Otherwise, returns null.
Definition at line346 of fileBasicBlock.cpp.
Referenced bycanRotateDeoptimizingLatchExit(), andgetPostdominatingDeoptimizeCall().
| inline |
Definition at line409 of fileBasicBlock.h.
ReferencesgetSinglePredecessor().
constBasicBlock * BasicBlock::getSinglePredecessor | ( | ) | const |
Return the predecessor of this block if it has a single predecessor block.
Otherwise return a null pointer.
Definition at line481 of fileBasicBlock.cpp.
Referenced byllvm::CanonicalLoopInfo::assertOK(),CanGenerateTest(),CanPropagatePredecessorsForPHIs(),CanProveNotTakenFirstIteration(),llvm::CloneAndPruneIntoFromInst(),llvm::EpilogueVectorizerEpilogueLoop::createEpilogueVectorizedLoopSkeleton(),llvm::OpenMPIRBuilder::createSection(),llvm::TileInfo::CreateTiledLoops(),llvm::JumpThreadingPass::evaluateOnPredecessorEdge(),llvm::VPPredInstPHIRecipe::execute(),findDominatingValue(),findPHIForConditionForwarding(),FindWidenableTerminatorAboveLoop(),foldICmpWithDominatingICmp(),getDomPredecessorCondition(),llvm::GetIfCondition(),getSinglePredecessor(),handlePhiDef(),llvm::objcarc::BundledRetainClaimRVs::insertAfterInvokes(),llvm::ScalarEvolution::isBasicBlockEntryGuardedByCond(),llvm::SuspendCrossingInfo::isDefinitionAcrossSuspend(),llvm::ScalarEvolution::isLoopBackedgeGuardedByCond(),isOnlyReachableViaThisEdge(),loadCSE(),llvm::JumpThreadingPass::maybeMergeBasicBlockIntoOnlyPred(),llvm::JumpThreadingPass::maybethreadThroughTwoBasicBlocks(),llvm::MergeBasicBlockIntoOnlyPred(),mergeBlocksIntoPredecessors(),mergeCleanupPad(),mergeConditionalStores(),mergeConditionalStoreToAddress(),llvm::JumpThreadingPass::processGuards(),llvm::JumpThreadingPass::processImpliedCondition(),llvm::OutlinableRegion::reattachCandidate(),llvm::InstCombinerImpl::replacedSelectWithOperand(),shouldInstrumentBlock(),SimplifyCondBranchToCondBranch(),llvm::JumpThreadingPass::simplifyPartiallyRedundantLoad(),llvm::SplitEdge(),tryToMoveFreeBeforeNullTest(), andllvm::TryToSimplifyUncondBranchFromEmptyBlock().
| inline |
Definition at line437 of fileBasicBlock.h.
ReferencesgetSingleSuccessor().
constBasicBlock * BasicBlock::getSingleSuccessor | ( | ) | const |
Return the successor of this block if it has a single successor.
Otherwise return a null pointer.
This method is analogous to getSinglePredecessor above.
Definition at line511 of fileBasicBlock.cpp.
Referenced byllvm::CanonicalLoopInfo::assertOK(),llvm::LoopVectorizationCostModel::collectValuesToIgnore(),llvm::TileInfo::CreateTiledLoops(),ensureValueAvailableInSuccessor(),llvm::VPlan::execute(),FindWidenableTerminatorAboveLoop(),getSingleSuccessor(),llvm::isProfitableToTransform(),llvm::orc::SpeculateQuery::isStraightLine(),mergeBlocksIntoPredecessors(),llvm::MergeBlockSuccessorsIntoGivenBlocks(),mergeConditionalStores(),optimizeDivRem(),programUndefinedIfUndefOrPoison(),sinkLifetimeStartMarkers(),llvm::UnrollLoop(), andllvm::UnrollRuntimeLoopRemainder().
| inline |
Definition at line254 of fileBasicBlock.h.
ReferencesgetTerminatingDeoptimizeCall().
Returns the call instruction calling @llvm.experimental.deoptimize prior to the terminating return instruction of this basic block, if such a call is present.
Otherwise, returns null.
Definition at line331 of fileBasicBlock.cpp.
Referenced bygetTerminatingDeoptimizeCall(),llvm::IsBlockFollowedByDeoptOrUnreachable(),tryWidenCondBranchToCondBranch(), andviolatesLegacyMultiExitLoopCheck().
| inline |
Definition at line272 of fileBasicBlock.h.
ReferencesgetTerminatingMustTailCall().
Returns the call instruction marked 'musttail' prior to the terminating return instruction of this basic block, if such a call is present.
Otherwise, returns null.
Definition at line300 of fileBasicBlock.cpp.
Referenced bygetInsertionRange(),getTerminatingMustTailCall(), andllvm::EscapeEnumerator::Next().
| inline |
Definition at line245 of fileBasicBlock.h.
ReferencesgetTerminator().
| inline |
Returns the terminator instruction if the block is well formed or null if the block is not well formed.
Definition at line240 of fileBasicBlock.h.
Referenced byaddBasicBlockMetadata(),Prefetch::addInstruction(),addNoUndefAttrs(),llvm::CodeMetrics::analyzeBasicBlock(),analyzeLoopUnrollCost(),llvm::CanonicalLoopInfo::assertOK(),basicBlockCanReturn(),llvm::PredicateInfoBuilder::buildPredicateInfo(),llvm::BranchProbabilityInfo::calculate(),llvm::calculateCXXStateForAsynchEH(),llvm::calculateSEHStateForAsynchEH(),canFoldTermCondOfLoop(),CanGenerateTest(),CanRedirectPredsOfEmptyBBToSucc(),canRotateDeoptimizingLatchExit(),llvm::canSplitLoopBound(),checkBasicSSA(),llvm::CloneAndPruneIntoFromInst(),llvm::CloneFunctionBodyInto(),cloneInstructionsIntoPredecessorBlockAndUpdateSSAUses(),cloneLoopBlocks(),CloneLoopBlocks(),llvm::colorEHFunclets(),llvm::FunctionComparator::compare(),ComputeNumSignBitsImpl(),ComputePostOrders(),computeUnlikelySuccessors(),ConnectEpilog(),ConnectProlog(),llvm::VPBasicBlock::connectToPredecessors(),llvm::ConstantFoldTerminator(),copyMustTailReturn(),llvm::coro::BaseCloner::create(),llvm::OpenMPIRBuilder::createAtomicCompare(),llvm::OpenMPIRBuilder::createCopyinClauseBlocks(),llvm::EpilogueVectorizerEpilogueLoop::createEpilogueVectorizedLoopSkeleton(),llvm::SPIRVMergeRegionExitTargets::createExitVariable(),createFoldedExitCond(),llvm::VPlan::createInitialVPlan(),createInvariantCond(),llvm::createMemCpyLoopKnownSize(),createMemMoveLoopKnownSize(),createMemMoveLoopUnknownSize(),createMemSetLoop(),llvm::SPIRVStructurizer::createOpSelectMerge(),llvm::OpenMPIRBuilder::createParallel(),llvm::createPHIsForSplitLoopExit(),llvm::OpenMPIRBuilder::createReductions(),createReplacement(),llvm::createSanitizerCtorAndInitFunctions(),llvm::OpenMPIRBuilder::createSection(),createSwitchStatement(),llvm::OpenMPIRBuilder::createTargetInit(),llvm::InnerLoopVectorizer::createVectorLoopSkeleton(),llvm::VPlan::createVPIRBasicBlock(),despeculateCountZeros(),detectPopcountIdiom(),detectShiftUntilBitTestIdiom(),detectShiftUntilLessThanIdiom(),detectShiftUntilZeroIdiom(),DoFlattenLoopPair(),dominatesMergePoint(),llvm::JumpThreadingPass::duplicateCondBranchOnPHIIntoPred(),llvm::DuplicateInstructionsInSplitBetween(),llvm::ehAwareSplitEdge(),llvm::OpenMPIRBuilder::emitBranch(),llvm::OpenMPIRBuilder::emitCancelationCheckImpl(),llvm::InnerLoopVectorizer::emitIterationCountCheck(),llvm::EpilogueVectorizerMainLoop::emitIterationCountCheck(),llvm::EpilogueVectorizerEpilogueLoop::emitMinimumVectorEpilogueIterCountCheck(),emitTaskDependencies(),llvm::Evaluator::EvaluateFunction(),llvm::VPWidenIntOrFpInductionRecipe::execute(),llvm::VPFirstOrderRecurrencePHIRecipe::execute(),llvm::VPReductionPHIRecipe::execute(),llvm::VPBranchOnMaskRecipe::execute(),llvm::VPWidenCanonicalIVRecipe::execute(),llvm::VPlan::execute(),llvm::LoopVectorizationPlanner::executePlan(),expandToSwitch(),findBasePointer(),llvm::orc::SpeculateQuery::findCalles(),findDominatingValue(),findLoopComponents(),FindLoopCounter(),llvm::DominatorTree::findNearestCommonDominator(),llvm::CodeExtractor::findOrCreateBlockForHoisting(),llvm::RandomIRBuilder::findOrCreateSource(),findPHIForConditionForwarding(),FlattenLoopPair(),llvm::InstCombinerImpl::foldBinopWithPhiOperands(),foldCondBranchOnValueKnownInPredecessorImpl(),foldExit(),llvm::InstCombinerImpl::foldFreezeIntoRecurrence(),foldGuardedFunnelShift(),foldICmpWithDominatingICmp(),foldMemChr(),llvm::InstCombinerImpl::foldOpIntoPhi(),llvm::FoldReturnIntoUncondBranch(),llvm::SPIRVMergeRegionExitTargets::gatherSuccessors(),generateUnsignedDivisionCode(),genLoopLimit(),llvm::VPTransformState::get(),getBestDestForJumpOnUndef(),getBranchHint(),getBranchInsertPoint(),llvm::Loop::LoopBounds::getCanonicalPredicate(),getDomPredecessorCondition(),getEHPadFromPredecessor(),getExpectedExitLoopLatchBranch(),llvm::DenseMapInfo< const SwitchSuccWrapper * >::getHashValue(),llvm::GetIfCondition(),getInsertPointForUses(),getInstrBB(),getJumpThreadDuplicationCost(),llvm::Loop::getLoopGuardBranch(),llvm::MachineLoop::getLoopID(),llvm::RegionTraits< Function >::getNumSuccessors(),getOnlyLiveSuccessor(),llvm::InnerLoopVectorizer::getOrCreateVectorTripCount(),getOuterLoopLatchCmp(),getOutliningBenefit(),getOutliningPenalty(),VectorSlice::getSlicedVal(),llvm::coro::getSpillInsertionPt(),llvm::GCProjectionInst::getStatepoint(),getStrlenWithNull(),llvm::GetSuccessorNumber(),getSuccState(),getTerminator(),llvm::coro::BaseCloner::handleFinalSuspend(),handlePhiDef(),llvm::VPlanTransforms::handleUncountableEarlyExit(),llvm::InstCombinerImpl::handleUnreachableFrom(),hasProfileData(),hasSideeffectFreeStaticResolution(),hoist(),hoistAdd(),llvm::hoistAllInstructionsInto(),hoistBOAssociation(),hoistGEP(),hoistMinMax(),hoistMulAddAssociation(),llvm::hoistRegion(),hoistSub(),injectPendingInvariantConditions(),llvm::InlineFunction(),insertBoundsCheck(),llvm::DIBuilder::insertDeclare(),insertUniqueBackedgeBlock(),llvm::SampleProfileProber::instrumentOneFunc(),llvm::Attributor::isAssumedDead(),llvm::IsBlockFollowedByDeoptOrUnreachable(),isChainSelectCmpBranch(),llvm::isInlineViable(),llvm::isInTailCallPosition(),llvm::ScalarEvolution::isLoopBackedgeGuardedByCond(),isLoopDead(),isLoopExitTestBasedOn(),isNotUsedOrFoldableInLoop(),isPowerOfTwoRecurrence(),isSafePHIToSpeculate(),llvm::isSafeToMoveBefore(),llvm::isUniformLoop(),isUniformlyReached(),llvm::lowerUnaryVectorIntrinsicAsLoop(),llvm::Loop::makeLoopInvariant(),llvm::gvn::AvailableValueInBlock::MaterializeAdjustedValue(),llvm::JumpThreadingPass::maybeMergeBasicBlockIntoOnlyPred(),llvm::JumpThreadingPass::maybethreadThroughTwoBasicBlocks(),llvm::MergeBasicBlockIntoOnlyPred(),llvm::MergeBlockIntoPredecessor(),mergeConditionalStoreToAddress(),mergeNestedCondBranch(),llvm::InstCombinerImpl::mergeStoreIntoSuccessor(),moveBBContents(),llvm::moveInstructionsToTheEnd(),llvm::MemorySSAUpdater::moveToPlace(),llvm::ShuffleBlockStrategy::mutate(),needsLFTR(),llvm::RandomIRBuilder::newSource(),llvm::EscapeEnumerator::Next(),optimizeDivRem(),llvm::slpvectorizer::BoUpSLP::optimizeGatherSequence(),OptimizeNonTrivialIFuncs(),optimizeSQRT(),llvm::LoopStructure::parseLoopStructure(),llvm::peelLoop(),peelToTurnInvariantLoadsDerefencebale(),performBranchToCommonDestFolding(),llvm::VPlan::prepareToExecute(),llvm::InstCombinerImpl::prepareWorklist(),llvm::JumpThreadingPass::processBlock(),llvm::JumpThreadingPass::processBranchOnPHI(),llvm::JumpThreadingPass::processBranchOnXOR(),llvm::JumpThreadingPass::processImpliedCondition(),llvm::JumpThreadingPass::processThreadableEdges(),llvm::promoteLoopAccessesToScalars(),llvm::OutlinableRegion::reattachCandidate(),redirectToHub(),llvm::removeAllNonTerminatorAndEHPadInstructions(),llvm::MemorySSAUpdater::removeBlocks(),llvm::SCCPSolver::removeNonFeasibleEdges(),removeUndefIntroducingPredecessor(),llvm::removeUnwindEdge(),llvm::SPIRVMergeRegionExitTargets::replaceBranchTargets(),replaceConstantExprOp(),rewriteMaterializableInstructions(),rewriteMemOpOfSelect(),rewritePHIs(),llvm::LoopConstrainer::run(),llvm::InstCombinerImpl::run(),llvm::PlaceSafepointsPass::runImpl(),llvm::SLPVectorizerPass::runImpl(),RunTermFold(),scalarizeMaskedCompressStore(),scalarizeMaskedExpandLoad(),scalarizeMaskedGather(),scalarizeMaskedLoad(),scalarizeMaskedScatter(),scalarizeMaskedStore(),scalarizeMaskedVectorHistogram(),separateNestedLoop(),llvm::SSPLayoutInfo::shouldEmitSDCheck(),simplifyInstructionWithPHI(),simplifyOneLoop(),llvm::JumpThreadingPass::simplifyPartiallyRedundantLoad(),SinkCast(),sinkLastInstruction(),llvm::InstCombinerImpl::SliceUpIllegalIntegerPHI(),speculatePHINodeLoads(),llvm::spliceBB(),llvm::splitBB(),llvm::SplitBlockAndInsertIfElse(),llvm::SplitBlockAndInsertIfThen(),llvm::SplitBlockAndInsertIfThenElse(),llvm::SplitBlockAndInsertSimpleForLoop(),SplitBlockPredecessorsImpl(),splitCallSite(),llvm::OutlinableRegion::splitCandidate(),llvm::SplitEdge(),llvm::SplitKnownCriticalEdge(),SplitLandingPadPredecessorsImpl(),llvm::splitLoopBound(),llvm::succ_begin(),llvm::succ_end(),swapBBContents(),threadBinOpOverPHI(),threadCmpOverPHI(),llvm::JumpThreadingPass::threadEdge(),llvm::JumpThreadingPass::threadThroughTwoBasicBlocks(),llvm::OpenMPIRBuilder::tileLoops(),llvm::JumpThreadingPass::tryThreadEdge(),tryToMergeLandingPad(),tryToMoveFreeBeforeNullTest(),llvm::TryToSimplifyUncondBranchFromEmptyBlock(),llvm::InstCombinerImpl::tryToSinkInstruction(),llvm::JumpThreadingPass::tryToUnfoldSelect(),llvm::JumpThreadingPass::tryToUnfoldSelectInCurrBB(),tryUnmergingGEPsAcrossIndirectBr(),turnGuardIntoBranch(),turnSelectIntoBranch(),turnToExplicitForm(),llvm::JumpThreadingPass::unfoldSelectInstr(),llvm::UnrollAndJamLoop(),llvm::UnrollLoop(),llvm::UnrollRuntimeLoopRemainder(),unswitchAllTrivialConditions(),unswitchTrivialBranch(),unswitchTrivialSwitch(),updatePredecessorProfileMetadata(),llvm::LoopVersioning::versionLoop(),violatesLegacyMultiExitLoopCheck(),llvm::InstCombinerImpl::visitPHINode(), andworkshareLoopTargetCallback().
DbgMarker * BasicBlock::getTrailingDbgRecords | ( | ) |
Fetch the collection of DbgRecords that "trail" after the last instruction of this block, seesetTrailingDbgRecords.
If there are none, returns nullptr.
Definition at line1181 of fileBasicBlock.cpp.
| inline |
Definition at line421 of fileBasicBlock.h.
ReferencesgetUniquePredecessor().
constBasicBlock * BasicBlock::getUniquePredecessor | ( | ) | const |
Return the predecessor of this block if it has a unique predecessor block.
Otherwise return a null pointer.
Note that unique predecessor doesn't mean single edge, there can be multiple edges from the unique predecessor to this block (for example a switch statement with multiple cases having the same destination).
Definition at line489 of fileBasicBlock.cpp.
Referenced byareInnerLoopLatchPHIsSupported(),areOuterLoopExitPHIsSupported(),llvm::MustBeExecutedContextExplorer::findBackwardJoinPoint(),findLocationForEntrySafepoint(),llvm::Loop::getLoopGuardBranch(),getUniquePredecessor(),IsAcceptableTarget(),makeStatepointExplicitImpl(),llvm::MergeBlockIntoPredecessor(),llvm::MergeBlockSuccessorsIntoGivenBlocks(),normalizeForInvokeSafepoint(),optimizeDivRem(),reuseTableCompare(),llvm::InstCombinerImpl::run(),runMoveAutoInit(),llvm::LoopNest::skipEmptyBlockUntil(),llvm::InstCombinerImpl::tryToSinkInstruction(), andllvm::UnrollLoop().
| inline |
Definition at line447 of fileBasicBlock.h.
ReferencesgetUniqueSuccessor().
constBasicBlock * BasicBlock::getUniqueSuccessor | ( | ) | const |
Return the successor of this block if it has a unique successor.
Otherwise return a null pointer.
This method is analogous to getUniquePredecessor above.
Definition at line519 of fileBasicBlock.cpp.
Referenced byllvm::OpenMPIRBuilder::finalize(),llvm::MustBeExecutedContextExplorer::findForwardJoinPoint(),getUniqueSuccessor(),IsBackEdge(),llvm::IsBlockFollowedByDeoptOrUnreachable(),llvm::MergeBlockIntoPredecessor(),llvm::OutlinableRegion::reattachCandidate(),llvm::LoopNest::skipEmptyBlockUntil(), andtryToMergeLandingPad().
ValueSymbolTable * BasicBlock::getValueSymbolTable | ( | ) |
Returns a pointer to the symbol table if one exists.
Definition at line162 of fileBasicBlock.cpp.
| inline |
Returns true if there are any uses of this basic block other than direct branches, switches, etc.
to it.
Definition at line671 of fileBasicBlock.h.
Referenced byllvm::AsmPrinter::emitBasicBlockStart(),foldTwoEntryPHINode(),llvm::AddrLabelMap::getAddrLabelSymbolToEmit(),hasAddressTakenAndUsed(),isBlockValidForExtraction(),llvm::isInlineViable(),llvm::BlockAddress::lookup(),llvm::MergeBasicBlockIntoOnlyPred(),llvm::MergeBlockIntoPredecessor(), andllvm::IRTranslator::runOnMachineFunction().
Return true if this block has exactly N predecessors.
Definition at line503 of fileBasicBlock.cpp.
Referenced byensureValueAvailableInSuccessor(),introduceTooManyPhiEntries(),llvm::InstCombinerImpl::mergeStoreIntoSuccessor(),llvm::JumpThreadingPass::processThreadableEdges(),llvm::OutlinableRegion::reattachCandidate(), andllvm::MemorySSAUpdater::wireOldPredecessorsToNewImmediatePredecessor().
Return true if this block has N predecessors or more.
Definition at line507 of fileBasicBlock.cpp.
Referenced byCanRedirectPredsOfEmptyBBToSucc(), andllvm::OutlinableRegion::reattachCandidate().
void BasicBlock::insertDbgRecordAfter | ( | DbgRecord * | DR, |
Instruction * | I | ||
) |
Insert aDbgRecord into a block at the position given byI
.
Definition at line1079 of fileBasicBlock.cpp.
Referenced byDbgInserterHelper().
void BasicBlock::insertDbgRecordBefore | ( | DbgRecord * | DR, |
InstListType::iterator | Here | ||
) |
Insert aDbgRecord into a block at the position given byHere
.
Definition at line1088 of fileBasicBlock.cpp.
Referenced byDbgInserterHelper(), andinsertDbgVariableRecordsForPHIs().
voidBasicBlock::insertInto | ( | Function * | Parent, |
BasicBlock * | InsertBefore =nullptr | ||
) |
Insert unlinked basic block into a function.
Inserts an unlinked basic block intoParent
. IfInsertBefore
is provided, inserts before that basic block, otherwise inserts at the end.
nullptr
.Definition at line198 of fileBasicBlock.cpp.
Referenced bymoveFunctionAdaptingType().
iterator_range<filter_iterator<BasicBlock::iterator, std::function<bool(Instruction &)> > > BasicBlock::instructionsWithoutDebug | ( | bool | SkipPseudoOp =true | ) |
Return an iterator range over the instructions in the block, skipping any debug instructions.
Skip and any pseudo operations as well ifSkipPseudoOp
is true.
Definition at line260 of fileBasicBlock.cpp.
iterator_range<filter_iterator<BasicBlock::const_iterator, std::function<bool(constInstruction &)> > > BasicBlock::instructionsWithoutDebug | ( | bool | SkipPseudoOp =true | ) | const |
Return a const iterator range over the instructions in the block, skipping any debug instructions.
Skip any pseudo operations as well ifSkipPseudoOp
is true.
Definition at line250 of fileBasicBlock.cpp.
Referenced byblockIsSimpleEnoughToThreadThrough(),llvm::orc::SpeculateQuery::findCalles(),getCaseResults(),getOutliningBenefit(),isSafeToSpeculateStore(),mergeConditionalStoreToAddress(),SimplifyCondBranchToCondBranch(), andtryToMoveFreeBeforeNullTest().
| inline |
Mark instruction ordering invalid. Done on every instruction insert.
Definition at line718 of fileBasicBlock.h.
ReferencesvalidateInstrOrdering().
| inline |
Return true if this basic block is an exception handling block.
Definition at line688 of fileBasicBlock.h.
ReferencesgetFirstNonPHIIt().
Referenced bycalculateCXXStateNumbers(),calculateSEHStateNumbers(),llvm::calculateWasmEHInfo(),canSplitCallSite(),deleteLoopIfDead(),getPredState(),IsAcceptableTarget(),llvm::JumpThreadingPass::maybethreadThroughTwoBasicBlocks(),llvm::InjectorIRStrategy::mutate(),llvm::JumpThreadingPass::processBranchOnXOR(),llvm::SLPVectorizerPass::runImpl(),llvm::JumpThreadingPass::simplifyPartiallyRedundantLoad(),llvm::SplitEdge(), andllvm::SplitKnownCriticalEdge().
bool BasicBlock::isEntryBlock | ( | ) | const |
Return true if this is the entry block of the containing function.
This method can only be used on blocks that have a parent function.
Definition at line593 of fileBasicBlock.cpp.
Referenced byDbgVariableRecordsRemoveUndefDbgAssignsFromEntryBlock(),llvm::SelectionDAGBuilder::isExportableFromCurrentBlock(),llvm::isPotentiallyReachable(),llvm::AllocaInst::isStaticAlloca(),llvm::MergeBasicBlockIntoOnlyPred(),llvm::InstCombinerImpl::prepareWorklist(),printBBName(),llvm::RemoveRedundantDbgInstrs(),removeRedundantDbgLocs(),removeUndefDbgAssignsFromEntryBlock(),removeUndefDbgLocsFromEntryBlock(), andUpdateAnalysisInformation().
| inline |
Returns true if the Order field of child Instructions is valid.
Definition at line713 of fileBasicBlock.h.
bool BasicBlock::isLandingPad | ( | ) | const |
Return true if this basic block is a landing pad.
Being a `‘landing pad’' means that the basic block is the destination of the 'unwind' edge of an invoke instruction.
Definition at line699 of fileBasicBlock.cpp.
Referenced byllvm::createPHIsForSplitLoopExit(),mergeCompatibleInvokes(),SplitBlockPredecessorsImpl(), andSplitLandingPadPredecessorsImpl().
bool BasicBlock::isLegalToHoistInto | ( | ) | const |
Return true if it is legal to hoist instructions into this block.
Definition at line579 of fileBasicBlock.cpp.
llvm::BasicBlock::LLVM_DEPRECATED | ( | "Use iterators as instruction positions instead" | , |
"getFirstNonPHIIt" | |||
) |
void BasicBlock::moveAfter | ( | BasicBlock * | MovePos | ) |
Unlink this basic block from its current function and insert it right afterMovePos
in the functionMovePos
lives in.
Definition at line287 of fileBasicBlock.cpp.
Referenced byInsertStackProtectors(),LLVMMoveBasicBlockAfter(),llvm::MergeBasicBlockIntoOnlyPred(),placeSplitBlockCarefully(),llvm::sortBlocks(),llvm::JumpThreadingPass::threadEdge(), andllvm::JumpThreadingPass::threadThroughTwoBasicBlocks().
| inline |
Unlink this basic block from its current function and insert it into the function thatMovePos
lives in, right beforeMovePos
.
Definition at line389 of fileBasicBlock.h.
Referencesllvm::ilist_node_impl< OptionsT >::getIterator(), andmoveBefore().
Referenced bybuildClonedLoopBlocks(),llvm::CloneAndPruneIntoFromInst(),LLVMMoveBasicBlockBefore(), andmoveBefore().
void BasicBlock::moveBefore | ( | SymbolTableList<BasicBlock >::iterator | MovePos | ) |
Definition at line283 of fileBasicBlock.cpp.
| delete |
iterator_range<BasicBlock::phi_iterator > BasicBlock::phis | ( | ) |
Definition at line533 of fileBasicBlock.cpp.
| inline |
Returns a range that iterates over the phis in the basic block.
Note that this cannot be used with basic blocks that have no terminator.
Definition at line530 of fileBasicBlock.h.
Referencesphis().
Referenced byllvm::InstCombinerImpl::addDeadEdge(),addPHINodeEntriesForMappedBlock(),addPredecessorToBlock(),analyzeExitPHIsForOutputUses(),areInnerLoopExitPHIsSupported(),areInnerLoopLatchPHIsSupported(),areOuterLoopExitPHIsSupported(),CanRedirectPredsOfEmptyBBToSucc(),llvm::LoopVectorizationCostModel::collectValuesToIgnore(),ConnectEpilog(),llvm::EpilogueVectorizerEpilogueLoop::createEpilogueVectorizedLoopSkeleton(),llvm::createPHIsForSplitLoopExit(),llvm::DeleteDeadPHIs(),deleteLoopIfDead(),llvm::EliminateDuplicatePHINodes(),findOrCreatePHIInBlock(),findPHIForConditionForwarding(),fixupPHINodeForNormalDest(),fixupPHINodeForUnwindDest(),forwardSwitchConditionToPHI(),llvm::DenseMapInfo< const SwitchSuccWrapper * >::getHashValue(),llvm::SSAUpdater::GetValueInMiddleOfBlock(),HandleInlinedEHPad(),incomingValuesAreCompatible(),introduceTooManyPhiEntries(),llvm::DenseMapInfo< const SwitchSuccWrapper * >::isEqual(),isExistingPhi(),isLoopDead(),isPredicatedOnPHI(),isSafeToHoistInvoke(),llvm::MergeBlockIntoPredecessor(),moveLCSSAPhis(),phis(),removeEmptyCleanup(),removeUndefIntroducingPredecessor(),replaceTargetsFromPHINode(),rewritePHINodesForExitAndUnswitchedBlocks(),rewritePHINodesForUnswitchedExitBlock(),SimplifyCondBranchToCondBranch(),sinkCommonCodeFromPredecessors(),splitCallSite(),llvm::splitLoopBound(),tryWidenCondBranchToCondBranch(),llvm::updatePhiNodes(), andvalidateAndCostRequiredSelects().
void BasicBlock::print | ( | raw_ostream & | OS, |
AssemblyAnnotationWriter * | AAW =nullptr , | ||
bool | ShouldPreserveUseListOrder =false , | ||
bool | IsForDebug =false | ||
) | const |
Print the basic block to an output stream with an optionalAssemblyAnnotationWriter.
Definition at line4901 of fileAsmWriter.cpp.
ReferencesgetModule(),getParent(), andOS.
Referenced byllvm::DOTGraphTraits< DOTFuncMSSAInfo * >::getNodeLabel(),LLVMDumpModule(),LLVMDumpType(),LLVMDumpValue(),LLVMGetDiagInfoDescription(),LLVMPrintDbgRecordToString(),LLVMPrintModuleToFile(),LLVMPrintModuleToString(),LLVMPrintTypeToString(), andLLVMPrintValueToString().
| inline |
Definition at line477 of fileBasicBlock.h.
Referenced byllvm::OpenMPIRBuilder::finalize(), andfindLiveSetAtInst().
| inline |
Definition at line478 of fileBasicBlock.h.
void BasicBlock::reinsertInstInDbgRecords | ( | Instruction * | I, |
std::optional<DbgRecord::self_iterator > | Pos | ||
) |
In rare circumstances instructions can be speculatively removed from blocks, and then be re-inserted back into that position later.
When this happens in RemoveDIs debug-info mode, some special patching-up needs to occur: inserting into the middle of a sequence of dbg.value intrinsics does not have an equivalent with DbgRecords.
Definition at line1108 of fileBasicBlock.cpp.
Unlink 'this' from the containing function, but do not delete it.
Definition at line275 of fileBasicBlock.cpp.
Referenced byllvm::DomTreeUpdater::callbackDeleteBB(),LLVMRemoveBasicBlockFromParent(), andmoveFunctionAdaptingType().
void BasicBlock::removePredecessor | ( | BasicBlock * | Pred, |
bool | KeepOneInputPHIs =false | ||
) |
Update PHI nodes in thisBasicBlock before removal of predecessorPred
.
Note that this function does not actually remove the predecessor.
IfKeepOneInputPHIs
is true then don't remove PHIs that are left with zero or one incoming values, and don't simplify PHIs with all incoming values the same.
Definition at line538 of fileBasicBlock.cpp.
Referenced byllvm::changeToCall(),llvm::ConstantFoldTerminator(),llvm::JumpThreadingPass::duplicateCondBranchOnPHIIntoPred(),foldCondBranchOnValueKnownInPredecessorImpl(),llvm::FoldReturnIntoUncondBranch(),HandleInlinedEHPad(),HandleInlinedLandingPad(),markAliveBlocks(),mergeNestedCondBranch(),llvm::JumpThreadingPass::processBlock(),llvm::JumpThreadingPass::processImpliedCondition(),processSwitch(),redirectTo(),removeEmptyCleanup(),llvm::SCCPSolver::removeNonFeasibleEdges(),removeSwitchAfterSelectFold(),removeUndefIntroducingPredecessor(),llvm::removeUnwindEdge(),simplifyOneLoop(),simplifySwitchOfCmpIntrinsic(),llvm::SplitKnownCriticalEdge(),switchToLookupTable(),llvm::JumpThreadingPass::threadEdge(),llvm::JumpThreadingPass::threadThroughTwoBasicBlocks(),tryToMergeLandingPad(),tryWidenCondBranchToCondBranch(),llvm::UnrollLoop(),unswitchNontrivialInvariants(), andunswitchTrivialSwitch().
| inline |
Definition at line479 of fileBasicBlock.h.
Referenced byllvm::OpenMPIRBuilder::finalize(),llvm::FindAvailableLoadedValue(), andsplitCallSite().
| inline |
Definition at line480 of fileBasicBlock.h.
void BasicBlock::renumberInstructions | ( | ) |
Renumber instructions and mark the ordering as valid.
Definition at line726 of fileBasicBlock.cpp.
void BasicBlock::replacePhiUsesWith | ( | BasicBlock * | Old, |
BasicBlock * | New | ||
) |
Update all phi nodes in this basic block to refer to basic blockNew
instead of basic blockOld
.
Definition at line673 of fileBasicBlock.cpp.
Referenced bymoveLCSSAPhis().
void BasicBlock::replaceSuccessorsPhiUsesWith | ( | BasicBlock * | New | ) |
Update all phi nodes in this basic block's successors to refer to basic blockNew
instead of to it.
Definition at line695 of fileBasicBlock.cpp.
void BasicBlock::replaceSuccessorsPhiUsesWith | ( | BasicBlock * | Old, |
BasicBlock * | New | ||
) |
Update all phi nodes in this basic block's successors to refer to basic blockNew
instead of basic blockOld
.
Definition at line684 of fileBasicBlock.cpp.
Referenced byllvm::OutlinableRegion::reattachCandidate(), andllvm::OutlinableRegion::splitCandidate().
void BasicBlock::setIsNewDbgInfoFormat | ( | bool | NewFlag | ) |
Ensure the block is in "old" dbg.value format (NewFlag
== false) or in the new format (NewFlag
== true), converting to the desired format if necessary.
Definition at line152 of fileBasicBlock.cpp.
Referenced byllvm::Function::insert(), andLLVMSetIsNewDbgInfoFormat().
void BasicBlock::setNewDbgInfoFormatFlag | ( | bool | NewFlag | ) |
Definition at line158 of fileBasicBlock.cpp.
ReferencesI.
void BasicBlock::setTrailingDbgRecords | ( | DbgMarker * | M | ) |
Record that the collection of DbgRecords inM
"trails" after the last instruction of this block.
These are equivalent to dbg.value intrinsics that exist at the end of a basic block with no terminator (a transient state that occurs regularly).
Definition at line1177 of fileBasicBlock.cpp.
Referenced byllvm::DbgMarker::removeMarker().
| inline |
Definition at line482 of fileBasicBlock.h.
Referenced byanalyzeAndPruneOutputBlocks(),createSwitchStatement(),findDuplicateOutputBlock(),llvm::DenseMapInfo< const SwitchSuccWrapper * >::getHashValue(),LLVMGetNumOperandBundleArgs(),llvm::MergeBasicBlockIntoOnlyPred(),llvm::moveInstructionsToTheEnd(),remapOperands(),tryToMoveFreeBeforeNullTest(), andunswitchTrivialSwitch().
filter_iterator<BasicBlock::const_iterator, std::function<bool(constInstruction &)> >::difference_type BasicBlock::sizeWithoutDebug | ( | ) | const |
Return the size of the basic block ignoring debug instructions.
Definition at line270 of fileBasicBlock.cpp.
Referenced byllvm::FastISel::fastEmitBranch().
| inline |
Transfer all instructions fromFromBB
to this basic block atToIt
.
Definition at line644 of fileBasicBlock.h.
Referencesbegin(),end(), andsplice().
Referenced byllvm::hoistAllInstructionsInto(),llvm::InlineFunction(),llvm::MergeBasicBlockIntoOnlyPred(),llvm::MergeBlockIntoPredecessor(),moveBBContents(),splice(),llvm::TryToSimplifyUncondBranchFromEmptyBlock(), andworkshareLoopTargetCallback().
void BasicBlock::splice | ( | BasicBlock::iterator | ToIt, |
BasicBlock * | FromBB, | ||
BasicBlock::iterator | FromBeginIt, | ||
BasicBlock::iterator | FromEndIt | ||
) |
Transfer a range of instructions that belong toFromBB
fromFromBeginIt
toFromEndIt
, to this basic block atToIt
.
Definition at line1051 of fileBasicBlock.cpp.
| inline |
Transfer one instruction fromFromBB
atFromIt
to this basic block atToIt
.
Definition at line650 of fileBasicBlock.h.
Referencessplice().
| inline |
Definition at line616 of fileBasicBlock.h.
ReferencesBefore,I, andsplitBasicBlock().
BasicBlock * BasicBlock::splitBasicBlock | ( | iterator | I, |
constTwine & | BBName ="" , | ||
bool | Before =false | ||
) |
Split the basic block into two basic blocks at the specified instruction.
IfBefore
is true, splitBasicBlockBefore handles the block splitting. Otherwise, execution proceeds as described below.
Note that all instructions BEFORE the specified iterator stay as part of the original basic block, an unconditional branch is added to the original BB, and the rest of the instructions in the BB are moved to the new BB, including the old terminator. The newly formed basic block is returned. This function invalidates the specified iterator.
Note that this only works on well formed basic blocks (must have a terminator), and'I'
must not be the end of instruction list (which would cause a degenerate basic block to be formed, having a terminator inside of the basic block).
Also note that this doesn't preserve any passes. To split blocks while keeping loop information consistent, use the SplitBlock utility function.
Definition at line599 of fileBasicBlock.cpp.
Referenced byllvm::coro::BaseCloner::create(),llvm::OpenMPIRBuilder::createAtomicCompare(),llvm::OpenMPIRBuilder::createCopyinClauseBlocks(),llvm::createMemCpyLoopKnownSize(),createMemMoveLoopKnownSize(),createMemSetLoop(),llvm::OpenMPIRBuilder::createParallel(),llvm::OpenMPIRBuilder::createReductions(),llvm::OpenMPIRBuilder::createTargetInit(),despeculateCountZeros(),llvm::SITargetLowering::emitExpandAtomicAddrSpacePredicate(),llvm::CodeExtractor::findOrCreateBlockForHoisting(),generateUnsignedDivisionCode(),getStrlenWithNull(),llvm::coro::BaseCloner::handleFinalSuspend(),llvm::InlineFunction(),insertBoundsCheck(),insertSpills(),llvm::lowerUnaryVectorIntrinsicAsLoop(),splitBasicBlock(),llvm::SplitBlockAndInsertIfThenElse(),llvm::splitBlockBefore(),SplitBlockImpl(), andllvm::OutlinableRegion::splitCandidate().
| inline |
Definition at line639 of fileBasicBlock.h.
ReferencesI, andsplitBasicBlockBefore().
BasicBlock * BasicBlock::splitBasicBlockBefore | ( | iterator | I, |
constTwine & | BBName ="" | ||
) |
Split the basic block into two basic blocks at the specified instruction and insert the new basic blocks as the predecessor of the current block.
This function ensures all instructions AFTER and including the specified iteratorI
are part of the original basic block. All Instructions BEFORE the iteratorI
are moved to the new BB and an unconditional branch is added to the new BB. The new basic block is returned.
Note that this only works on well formed basic blocks (must have a terminator), and'I'
must not be the end of instruction list (which would cause a degenerate basic block to be formed, having a terminator inside of the basic block).'I'
cannot be a iterator for aPHINode with multiple incoming blocks.
Also note that this doesn't preserve any passes. To split blocks while keeping loop information consistent, use the SplitBlockBefore utility function.
Definition at line630 of fileBasicBlock.cpp.
Referenced bysplitBasicBlockBefore().
void BasicBlock::validateInstrOrdering | ( | ) | const |
Asserts that instruction order numbers are marked invalid, or that they are in ascending order.
In asserts builds, this checks the numbering.
This is constant time if the ordering is invalid, and linear in the number of instructions if the ordering is valid. Callers should be careful not to call this in ways that make common operations O(n^2). For example, it takes O(n) time to assign order numbers to instructions, so the order should be validated no more than once after each ordering to ensure that transforms have the same algorithmic complexity when asserts are enabled as when they are disabled.
In non-asserts builds, it is defined as a no-op inline function in BasicBlock.h.
Definition at line1165 of fileBasicBlock.cpp.
Referenced byinvalidateOrders().
| friend |
Definition at line75 of fileBasicBlock.h.
| friend |
Definition at line71 of fileBasicBlock.h.
| friend |
| friend |
| friend |
| friend |
| friend |
| friend |
| friend |
| friend |
Definition at line185 of fileBasicBlock.h.
| friend |
Definition at line185 of fileBasicBlock.h.
| friend |
Definition at line75 of fileBasicBlock.h.
bool llvm::BasicBlock::IsNewDbgInfoFormat |
Flag recording whether or not this block stores debug-info in the form of intrinsic instructions (false) or non-instruction records (true).
Definition at line67 of fileBasicBlock.h.
Referenced byllvm::CloneBasicBlock(),LLVMIsNewDbgInfoFormat(),performBranchToCommonDestFolding(),removeRedundantDbgInstrsUsingBackwardScan(),removeRedundantDbgInstrsUsingForwardScan(), andremoveUndefDbgAssignsFromEntryBlock().