|
LLVM
13.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 > |
| using | iterator = InstListType::iterator |
| Instruction iterators... More... | |
| 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< const PHINode, BasicBlock::const_iterator > |
Public Types inherited from llvm::Value | |
| enum | ValueTy |
| Concrete subclass of this. More... | |
| using | use_iterator = use_iterator_impl< Use > |
| using | const_use_iterator = use_iterator_impl< const Use > |
| using | user_iterator = user_iterator_impl< User > |
| using | const_user_iterator = user_iterator_impl< const User > |
Public Member Functions | |
| BasicBlock (const BasicBlock &)=delete | |
| BasicBlock & | operator= (const BasicBlock &)=delete |
| ~BasicBlock () | |
| LLVMContext & | getContext () const |
| Get the context in which this basic block lives. More... | |
| const Function * | getParent () const |
| Return the enclosing method, or null if none. More... | |
| Function * | getParent () |
| const Module * | getModule () const |
| Return the module owning the function this basic block belongs to, or nullptr if the function does not have a module. More... | |
| Module * | getModule () |
| const Instruction * | getTerminator () const LLVM_READONLY |
| Returns the terminator instruction if the block is well formed or null if the block is not well formed. More... | |
| Instruction * | getTerminator () |
| const CallInst * | 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. More... | |
| CallInst * | getTerminatingDeoptimizeCall () |
| const CallInst * | 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. More... | |
| CallInst * | getPostdominatingDeoptimizeCall () |
| const CallInst * | getTerminatingMustTailCall () const |
| Returns the call instruction marked 'musttail' prior to the terminating return instruction of this basic block, if such a call is present. More... | |
| CallInst * | getTerminatingMustTailCall () |
| const Instruction * | getFirstNonPHI () const |
| Returns a pointer to the first instruction in this block that is not a PHINode instruction. More... | |
| Instruction * | getFirstNonPHI () |
| const Instruction * | getFirstNonPHIOrDbg (bool SkipPseudoOp=false) const |
Returns a pointer to the first instruction in this block that is not a PHINode or a debug intrinsic, or any pseudo operation if SkipPseudoOp is true. More... | |
| Instruction * | getFirstNonPHIOrDbg (bool SkipPseudoOp=false) |
| const Instruction * | getFirstNonPHIOrDbgOrLifetime (bool SkipPseudoOp=false) const |
Returns a pointer to the first instruction in this block that is not a PHINode, a debug intrinsic, or a lifetime intrinsic, or any pseudo operation if SkipPseudoOp is true. More... | |
| Instruction * | getFirstNonPHIOrDbgOrLifetime (bool SkipPseudoOp=false) |
| const_iterator | getFirstInsertionPt () const |
| Returns an iterator to the first instruction in this block that is suitable for inserting a non-PHI instruction. More... | |
| iterator | getFirstInsertionPt () |
| iterator_range< filter_iterator< BasicBlock::const_iterator, std::function< bool(const Instruction &)> > > | instructionsWithoutDebug (bool SkipPseudoOp=false) const |
| Return a const iterator range over the instructions in the block, skipping any debug instructions. More... | |
| iterator_range< filter_iterator< BasicBlock::iterator, std::function< bool(Instruction &)> > > | instructionsWithoutDebug (bool SkipPseudoOp=false) |
| Return an iterator range over the instructions in the block, skipping any debug instructions. More... | |
| filter_iterator< BasicBlock::const_iterator, std::function< bool(const Instruction &)> >::difference_type | sizeWithoutDebug () const |
| Return the size of the basic block ignoring debug instructions. More... | |
| void | removeFromParent () |
| Unlink 'this' from the containing function, but do not delete it. More... | |
| SymbolTableList< BasicBlock >::iterator | eraseFromParent () |
| Unlink 'this' from the containing function and delete it. More... | |
| void | moveBefore (BasicBlock *MovePos) |
Unlink this basic block from its current function and insert it into the function that MovePos lives in, right before MovePos. More... | |
| void | moveAfter (BasicBlock *MovePos) |
Unlink this basic block from its current function and insert it right after MovePos in the function MovePos lives in. More... | |
| void | insertInto (Function *Parent, BasicBlock *InsertBefore=nullptr) |
| Insert unlinked basic block into a function. More... | |
| const BasicBlock * | getSinglePredecessor () const |
| Return the predecessor of this block if it has a single predecessor block. More... | |
| BasicBlock * | getSinglePredecessor () |
| const BasicBlock * | getUniquePredecessor () const |
| Return the predecessor of this block if it has a unique predecessor block. More... | |
| BasicBlock * | getUniquePredecessor () |
| bool | hasNPredecessors (unsigned N) const |
| Return true if this block has exactly N predecessors. More... | |
| bool | hasNPredecessorsOrMore (unsigned N) const |
| Return true if this block has N predecessors or more. More... | |
| const BasicBlock * | getSingleSuccessor () const |
| Return the successor of this block if it has a single successor. More... | |
| BasicBlock * | getSingleSuccessor () |
| const BasicBlock * | getUniqueSuccessor () const |
| Return the successor of this block if it has a unique successor. More... | |
| 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 optional AssemblyAnnotationWriter. More... | |
| iterator | begin () |
| Instruction iterator methods. More... | |
| 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 |
| const Instruction & | front () const |
| Instruction & | front () |
| const Instruction & | back () const |
| Instruction & | back () |
| iterator_range< const_phi_iterator > | phis () const |
| Returns a range that iterates over the phis in the basic block. More... | |
| iterator_range< phi_iterator > | phis () |
| const InstListType & | getInstList () const |
| Return the underlying instruction list container. More... | |
| InstListType & | getInstList () |
| ValueSymbolTable * | getValueSymbolTable () |
| Returns a pointer to the symbol table if one exists. More... | |
| void | dropAllReferences () |
| Cause all subinstructions to "let go" of all the references that said subinstructions are maintaining. More... | |
| void | removePredecessor (BasicBlock *Pred, bool KeepOneInputPHIs=false) |
Update PHI nodes in this BasicBlock before removal of predecessor Pred. More... | |
| bool | canSplitPredecessors () const |
| BasicBlock * | splitBasicBlock (iterator I, const Twine &BBName="", bool Before=false) |
| Split the basic block into two basic blocks at the specified instruction. More... | |
| BasicBlock * | splitBasicBlock (Instruction *I, const Twine &BBName="", bool Before=false) |
| BasicBlock * | splitBasicBlockBefore (iterator I, const Twine &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. More... | |
| BasicBlock * | splitBasicBlockBefore (Instruction *I, const Twine &BBName="") |
| bool | hasAddressTaken () const |
| Returns true if there are any uses of this basic block other than direct branches, switches, etc. More... | |
| void | replacePhiUsesWith (BasicBlock *Old, BasicBlock *New) |
Update all phi nodes in this basic block to refer to basic block New instead of basic block Old. More... | |
| void | replaceSuccessorsPhiUsesWith (BasicBlock *Old, BasicBlock *New) |
Update all phi nodes in this basic block's successors to refer to basic block New instead of basic block Old. More... | |
| void | replaceSuccessorsPhiUsesWith (BasicBlock *New) |
Update all phi nodes in this basic block's successors to refer to basic block New instead of to it. More... | |
| bool | isEHPad () const |
| Return true if this basic block is an exception handling block. More... | |
| bool | isLandingPad () const |
| Return true if this basic block is a landing pad. More... | |
| const LandingPadInst * | getLandingPadInst () const |
| Return the landingpad instruction associated with the landing pad. More... | |
| LandingPadInst * | getLandingPadInst () |
| bool | isLegalToHoistInto () const |
| Return true if it is legal to hoist instructions into this block. More... | |
| bool | isEntryBlock () const |
| Return true if this is the entry block of the containing function. More... | |
| Optional< uint64_t > | getIrrLoopHeaderWeight () const |
| bool | isInstrOrderValid () const |
| Returns true if the Order field of child Instructions is valid. More... | |
| void | invalidateOrders () |
| Mark instruction ordering invalid. Done on every instruction insert. More... | |
| void | renumberInstructions () |
| Renumber instructions and mark the ordering as valid. More... | |
| void | validateInstrOrdering () const |
| Asserts that instruction order numbers are marked invalid, or that they are in ascending order. More... | |
Public Member Functions inherited from llvm::Value | |
| Value (const Value &)=delete | |
| Value & | operator= (const Value &)=delete |
| void | deleteValue () |
| Delete a pointer to a generic Value. More... | |
| void | dump () const |
| Support for debugging, callable in GDB: V->dump() More... | |
| Type * | getType () const |
| All values are typed, get the type of this value. More... | |
| LLVMContext & | getContext () const |
| All values hold a context through their type. More... | |
| bool | hasName () const |
| ValueName * | getValueName () const |
| void | setValueName (ValueName *VN) |
| StringRef | getName () const |
| Return a constant reference to the value's name. More... | |
| void | setName (const Twine &Name) |
| Change the name of the value. More... | |
| void | takeName (Value *V) |
| Transfer the name from V to this value. More... | |
| std::string | getNameOrAsOperand () const |
| void | replaceAllUsesWith (Value *V) |
| Change all uses of this to point to a new Value. More... | |
| void | replaceNonMetadataUsesWith (Value *V) |
| Change non-metadata uses of this to point to a new Value. More... | |
| void | replaceUsesWithIf (Value *New, llvm::function_ref< bool(Use &U)> ShouldReplace) |
| Go through the uses list for this definition and make each use point to "V" if the callback ShouldReplace returns true for the given Use. More... | |
| 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. More... | |
| 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 () |
| const User * | 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. More... | |
| bool | hasNUses (unsigned N) const |
| Return true if this Value has exactly N uses. More... | |
| bool | hasNUsesOrMore (unsigned N) const |
| Return true if this value has N uses or more. More... | |
| bool | hasOneUser () const |
| Return true if there is exactly one user of this value. More... | |
| Use * | getSingleUndroppableUse () |
| Return true if there is exactly one use of this value that cannot be dropped. More... | |
| const Use * | getSingleUndroppableUse () const |
| bool | hasNUndroppableUses (unsigned N) const |
| Return true if there this value. More... | |
| bool | hasNUndroppableUsesOrMore (unsigned N) const |
| Return true if this value has N uses or more. More... | |
| void | dropDroppableUses (llvm::function_ref< bool(const Use *)> ShouldDrop=[](const Use *) { return true;}) |
| Remove every uses that can safely be removed. More... | |
| void | dropDroppableUsesIn (User &Usr) |
Remove every use of this value in User that can safely be removed. More... | |
| bool | isUsedInBasicBlock (const BasicBlock *BB) const |
| Check if this value is used in the specified basic block. More... | |
| unsigned | getNumUses () const |
| This method computes the number of uses of this Value. More... | |
| void | addUse (Use &U) |
| This method should only be used by the Use class. More... | |
| unsigned | getValueID () const |
| Return an ID for the concrete type of this object. More... | |
| unsigned | getRawSubclassOptionalData () const |
| Return the raw optional flags value contained in this value. More... | |
| void | clearSubclassOptionalData () |
| Clear the optional flags contained in this value. More... | |
| bool | hasSameSubclassOptionalData (const Value *V) const |
| Check the optional flags for equality. More... | |
| bool | hasValueHandle () const |
| Return true if there is a value handle associated with this value. More... | |
| bool | isUsedByMetadata () const |
| Return true if there is metadata referencing this value. More... | |
| bool | isTransitiveUsedByMetadataOnly () const |
| bool | isSwiftError () const |
| Return true if this value is a swifterror value. More... | |
| const Value * | stripPointerCasts () const |
| Strip off pointer casts, all-zero GEPs and address space casts. More... | |
| Value * | stripPointerCasts () |
| const Value * | stripPointerCastsAndAliases () const |
| Strip off pointer casts, all-zero GEPs, address space casts, and aliases. More... | |
| Value * | stripPointerCastsAndAliases () |
| const Value * | stripPointerCastsSameRepresentation () const |
| Strip off pointer casts, all-zero GEPs and address space casts but ensures the representation of the result stays the same. More... | |
| Value * | stripPointerCastsSameRepresentation () |
| const Value * | stripPointerCastsForAliasAnalysis () const |
| Strip off pointer casts, all-zero GEPs, single-argument phi nodes and invariant group info. More... | |
| Value * | stripPointerCastsForAliasAnalysis () |
| const Value * | stripInBoundsConstantOffsets () const |
| Strip off pointer casts and all-constant inbounds GEPs. More... | |
| Value * | stripInBoundsConstantOffsets () |
| const Value * | stripAndAccumulateConstantOffsets (const DataLayout &DL, APInt &Offset, bool AllowNonInbounds, function_ref< bool(Value &Value, APInt &Offset)> ExternalAnalysis=nullptr) const |
| Accumulate the constant offset this value has compared to a base pointer. More... | |
| Value * | stripAndAccumulateConstantOffsets (const DataLayout &DL, APInt &Offset, bool AllowNonInbounds) |
| const Value * | stripAndAccumulateInBoundsConstantOffsets (const DataLayout &DL, APInt &Offset) const |
| This is a wrapper around stripAndAccumulateConstantOffsets with the in-bounds requirement set to false. More... | |
| Value * | stripAndAccumulateInBoundsConstantOffsets (const DataLayout &DL, APInt &Offset) |
| const Value * | stripInBoundsOffsets (function_ref< void(const Value *)> Func=[](const Value *) {}) const |
| Strip off pointer casts and inbounds GEPs. More... | |
| Value * | stripInBoundsOffsets (function_ref< void(const Value *)> Func=[](const Value *) {}) |
| 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. More... | |
| uint64_t | getPointerDereferenceableBytes (const DataLayout &DL, bool &CanBeNull, bool &CanBeFreed) const |
| Returns the number of bytes known to be dereferenceable for the pointer value. More... | |
| Align | getPointerAlignment (const DataLayout &DL) const |
| Returns an alignment of the pointer value. More... | |
| const Value * | DoPHITranslation (const BasicBlock *CurBB, const BasicBlock *PredBB) const |
| Translate PHI node to its predecessor from the given basic block. More... | |
| Value * | DoPHITranslation (const BasicBlock *CurBB, const BasicBlock *PredBB) |
| void | mutateType (Type *Ty) |
| Mutate the type of this Value to be of the specified type. More... | |
| template<class Compare > | |
| void | sortUseList (Compare Cmp) |
| Sort the use-list. More... | |
| void | reverseUseList () |
| Reverse the use-list. More... | |
| void | print (raw_ostream &O, bool IsForDebug=false) const |
| Implement operator<< on Value. More... | |
| void | print (raw_ostream &O, ModuleSlotTracker &MST, bool IsForDebug=false) const |
| void | printAsOperand (raw_ostream &O, bool PrintType=true, const Module *M=nullptr) const |
| Print the name of this Value out to the specified raw_ostream. More... | |
| void | printAsOperand (raw_ostream &O, bool PrintType, ModuleSlotTracker &MST) const |
Public Member Functions inherited from llvm::ilist_node_with_parent< BasicBlock, Function > | |
| BasicBlock * | getPrevNode () |
| const BasicBlock * | getPrevNode () const |
Get the previous node, or nullptr for the list head. More... | |
| BasicBlock * | getNextNode () |
Get the next node, or nullptr for the list tail. More... | |
| const BasicBlock * | getNextNode () const |
Get the next node, or nullptr for the list tail. More... | |
Public Member Functions inherited from llvm::ilist_node_impl< ilist_detail::compute_node_options< BasicBlock, Options... >::type > | |
| 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. More... | |
Static Public Member Functions | |
| static BasicBlock * | Create (LLVMContext &Context, const Twine &Name="", Function *Parent=nullptr, BasicBlock *InsertBefore=nullptr) |
| Creates a new BasicBlock. More... | |
| static InstListType BasicBlock::* | getSublistAccess (Instruction *) |
| Returns a pointer to a member of the instruction list. More... | |
| static bool | classof (const Value *V) |
| Methods for support type inquiry through isa, cast, and dyn_cast. More... | |
Static Public Member Functions inherited from llvm::Value | |
| static void | dropDroppableUse (Use &U) |
Remove the droppable use U. More... | |
Friends | |
| class | BlockAddress |
| class | SymbolTableListTraits< BasicBlock > |
Additional Inherited Members | |
Static Public Attributes inherited from llvm::Value | |
| static const unsigned | MaxAlignmentExponent = 29 |
| The maximum alignment for instructions. More... | |
| static const unsigned | MaximumAlignment = 1u << MaxAlignmentExponent |
Protected Types inherited from llvm::Value | |
| enum | : unsigned { NumUserOperandsBits = 27 } |
| The number of operands in the subclass. More... | |
Protected Types inherited from llvm::ilist_node_impl< ilist_detail::compute_node_options< BasicBlock, Options... >::type > | |
| using | self_iterator = ilist_iterator< ilist_detail::compute_node_options< BasicBlock, Options... >::type, false, false > |
| using | const_self_iterator = ilist_iterator< ilist_detail::compute_node_options< BasicBlock, Options... >::type, false, true > |
| using | reverse_self_iterator = ilist_iterator< ilist_detail::compute_node_options< BasicBlock, Options... >::type, true, false > |
| using | const_reverse_self_iterator = ilist_iterator< ilist_detail::compute_node_options< BasicBlock, Options... >::type, true, true > |
Protected Member Functions inherited from llvm::Value | |
| Value (Type *Ty, unsigned scid) | |
| ~Value () | |
| Value's destructor should be virtual by design, but that would require that Value and all of its subclasses have a vtable that effectively duplicates the information in the value ID. More... | |
| void | getAllMetadata (SmallVectorImpl< std::pair< unsigned, MDNode * >> &MDs) const |
Appends all metadata attached to this value to MDs, sorting by KindID. More... | |
| bool | hasMetadata () const |
| Return true if this value has any metadata attached to it. More... | |
| bool | eraseMetadata (unsigned KindID) |
| Erase all metadata attachments with the given kind. More... | |
| void | clearMetadata () |
| Erase all metadata attached to this Value. More... | |
| unsigned short | getSubclassDataFromValue () const |
| void | setValueSubclassData (unsigned short D) |
| MDNode * | getMetadata (unsigned KindID) const |
| Get the current metadata attachments for the given kind, if any. More... | |
| MDNode * | getMetadata (StringRef Kind) const |
| void | getMetadata (unsigned KindID, SmallVectorImpl< MDNode * > &MDs) const |
Appends all attachments with the given ID to MDs in insertion order. More... | |
| 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. More... | |
| bool | hasMetadata (StringRef Kind) const |
| void | setMetadata (unsigned KindID, MDNode *Node) |
| Set a particular kind of metadata attachment. More... | |
| void | setMetadata (StringRef Kind, MDNode *Node) |
| void | addMetadata (unsigned KindID, MDNode &MD) |
| Add a metadata attachment. More... | |
| void | addMetadata (StringRef Kind, MDNode &MD) |
Protected Member Functions inherited from llvm::ilist_node_with_parent< BasicBlock, Function > | |
| ilist_node_with_parent ()=default | |
Protected Member Functions inherited from llvm::ilist_node_impl< ilist_detail::compute_node_options< BasicBlock, Options... >::type > | |
| ilist_node_impl ()=default | |
Protected Attributes inherited from llvm::Value | |
| unsigned char | SubclassOptionalData: 7 |
| Hold subclass data that can be dropped. More... | |
| 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 a BasicBlock 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. The BasicBlock 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 line 58 of file BasicBlock.h.
| using llvm::BasicBlock::const_iterator = InstListType::const_iterator |
Definition at line 91 of file BasicBlock.h.
| using llvm::BasicBlock::const_phi_iterator = phi_iterator_impl<const PHINode, BasicBlock::const_iterator> |
Definition at line 349 of file BasicBlock.h.
| using llvm::BasicBlock::const_reverse_iterator = InstListType::const_reverse_iterator |
Definition at line 93 of file BasicBlock.h.
Definition at line 61 of file BasicBlock.h.
| using llvm::BasicBlock::iterator = InstListType::iterator |
Instruction iterators...
Definition at line 90 of file BasicBlock.h.
Definition at line 347 of file BasicBlock.h.
| using llvm::BasicBlock::reverse_iterator = InstListType::reverse_iterator |
Definition at line 92 of file BasicBlock.h.
|
delete |
| BasicBlock::~BasicBlock | ( | ) |
Definition at line 67 of file BasicBlock.cpp.
References assert(), llvm::Constant::destroyConstant(), dropAllReferences(), llvm::ConstantInt::get(), getContext(), llvm::Type::getInt32Ty(), llvm::ConstantExpr::getIntToPtr(), getParent(), llvm::Value::getType(), hasAddressTaken(), llvm::Value::replaceAllUsesWith(), llvm::Value::use_empty(), llvm::Value::user_back(), and validateInstrOrdering().
|
inline |
Definition at line 311 of file BasicBlock.h.
|
inline |
Definition at line 310 of file BasicBlock.h.
Referenced by llvm::OpenMPIRBuilder::createDynamicWorkshareLoop(), findUnwindDestinations(), reconnectPhis(), and llvm::UnrollAndJamLoop().
|
inline |
Instruction iterator methods.
Definition at line 296 of file BasicBlock.h.
Referenced by llvm::Interpreter::callFunction(), canLoopBeDeleted(), CanPropagatePredecessorsForPHIs(), canSplitCallSite(), llvm::CloneAndPruneIntoFromInst(), CloneLoopBlocks(), llvm::FunctionComparator::cmpBasicBlocks(), llvm::computePeelCount(), llvm::OpenMPIRBuilder::createCanonicalLoop(), llvm::OpenMPIRBuilder::createParallel(), llvm::PostDominatorTree::dominates(), llvm::OpenMPIRBuilder::emitCancelationCheckImpl(), ensureValueAvailableInSuccessor(), llvm::Evaluator::EvaluateFunction(), llvm::CodeExtractor::extractCodeRegion(), llvm::OpenMPIRBuilder::finalize(), llvm::findAvailablePtrLoadStore(), findDependencies(), findDuplicateOutputBlock(), findInitTrampolineFromBB(), FindLoopCounter(), findPHIToPartitionLoops(), llvm::InnerLoopVectorizer::fixFirstOrderRecurrence(), FoldCondBranchOnPHI(), FoldTwoEntryPHINode(), llvm::formLCSSAForInstructions(), llvm::CanonicalLoopInfo::getAfterIP(), llvm::CanonicalLoopInfo::getBodyIP(), llvm::MemoryDependenceResults::getDependency(), getInductionVariable(), getStrlenWithNull(), HandleByValArgumentInit(), llvm::InlineFunction(), InsertSafepointPoll(), insertSinCosCall(), insertUniqueBackedgeBlock(), llvm::isSafeToLoadUnconditionally(), llvm::IVUsers::IVUsers(), LLVMGetPreviousInstruction(), makeStatepointExplicitImpl(), llvm::MergeBasicBlockIntoOnlyPred(), mergeEmptyReturnBlocks(), llvm::InstCombinerImpl::mergeStoreIntoSuccessor(), moveBBContents(), NegateValue(), optimizeSQRT(), llvm::peelLoop(), reconnectPhis(), removePredecessor(), replacePhiUsesWith(), rewritePHINodesForExitAndUnswitchedBlocks(), RewriteUsesOfClonedInstructions(), runPass(), scalarizeMaskedCompressStore(), scalarizeMaskedExpandLoad(), scalarizeMaskedGather(), scalarizeMaskedLoad(), scalarizeMaskedScatter(), scalarizeMaskedStore(), SimplifyCondBranchToCondBranch(), llvm::simplifyLoopIVs(), simplifyOneLoop(), llvm::JumpThreadingPass::simplifyPartiallyRedundantLoad(), sizeWithoutDebug(), splitBasicBlockBefore(), splitCallSite(), llvm::SplitKnownCriticalEdge(), llvm::JumpThreadingPass::threadThroughTwoBasicBlocks(), TryToMergeLandingPad(), tryToMoveFreeBeforeNullTest(), llvm::TryToSimplifyUncondBranchFromEmptyBlock(), llvm::UnrollAndJamLoop(), llvm::UnrollLoop(), unswitchNontrivialInvariants(), UpdatePHINodes(), llvm::Interpreter::visitIntrinsicInst(), and llvm::InstCombinerImpl::visitPHINode().
|
inline |
Definition at line 297 of file BasicBlock.h.
| bool BasicBlock::canSplitPredecessors | ( | ) | const |
Definition at line 350 of file BasicBlock.cpp.
References getFirstNonPHI(), and llvm::Instruction::isEHPad().
Referenced by canSplitCallSite().
Methods for support type inquiry through isa, cast, and dyn_cast.
Definition at line 375 of file BasicBlock.h.
References llvm::Value::getValueID().
|
inlinestatic |
Creates a new BasicBlock.
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 line 100 of file BasicBlock.h.
References llvm::ISD::BasicBlock, and Context.
Referenced by addBoundsChecking(), assureFPCallStub(), llvm::CloneBasicBlock(), llvm::OpenMPIRBuilder::createCopyinClauseBlocks(), llvm::MIRParserImpl::createDummyFunction(), llvm::OpenMPIRBuilder::createDynamicWorkshareLoop(), createEmptyFunction(), createFPFnStub(), createFrameHelperMachineFunction(), createGuardBlocks(), llvm::OpenMPIRBuilder::createLoopSkeleton(), llvm::createMemCpyLoopKnownSize(), llvm::createMemCpyLoopUnknownSize(), createMemMoveLoop(), createMemSetLoop(), createResumeEntryBlock(), llvm::createSanitizerCtor(), llvm::OpenMPIRBuilder::createSections(), llvm::Attributor::createShallowWrapper(), createSwitchStatement(), createWrapper(), llvm::ehAwareSplitEdge(), llvm::orc::IRSpeculationLayer::emit(), llvm::OpenMPIRBuilder::emitCancelationCheckImpl(), fillOverallFunction(), llvm::SanitizerStatReport::finish(), FoldCondBranchOnPHI(), getStrlenWithNull(), insertUniqueBackedgeBlock(), LLVMAppendBasicBlockInContext(), LLVMCreateBasicBlockInContext(), LLVMInsertBasicBlockInContext(), llvm::orc::makeStub(), llvm::EscapeEnumerator::Next(), SimplifyCondBranchToCondBranch(), splitBasicBlock(), splitBasicBlockBefore(), llvm::SplitBlockAndInsertIfThenElse(), SplitBlockAndInsertIfThenImpl(), SplitBlockPredecessorsImpl(), llvm::SplitKnownCriticalEdge(), SplitLandingPadPredecessorsImpl(), splitRetconCoroutine(), SwitchToLookupTable(), llvm::JumpThreadingPass::threadEdge(), llvm::JumpThreadingPass::threadThroughTwoBasicBlocks(), and llvm::JumpThreadingPass::unfoldSelectInstr().
| 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 line 259 of file BasicBlock.cpp.
References I.
Referenced by ~BasicBlock().
|
inline |
Definition at line 307 of file BasicBlock.h.
Referenced by llvm::OpenMPIRBuilder::finalize(), and removePredecessor().
|
inline |
Definition at line 298 of file BasicBlock.h.
Referenced by llvm::FunctionComparator::cmpBasicBlocks(), llvm::OpenMPIRBuilder::createParallel(), createSwitchStatement(), detectPopcountIdiom(), detectShiftUntilZeroIdiom(), findDependencies(), getFirstInsertionPt(), llvm::CanonicalLoopInfo::getPreheaderIP(), llvm::insertDebugValuesForPHIs(), InsertSafepointPoll(), instrumentOneFunc(), llvm::RecurrenceDescriptor::isFirstOrderRecurrence(), llvm::isInTailCallPosition(), isSafeAndProfitableToSinkLoad(), LLVMGetNextInstruction(), mergeConditionalStoreToAddress(), moveBBContents(), OptimizeExtractBits(), reconnectPhis(), replaceArgumentUses(), replacePhiUsesWith(), RewriteUsesOfClonedInstructions(), llvm::IRBuilderBase::SetInsertPoint(), llvm::JumpThreadingPass::simplifyPartiallyRedundantLoad(), SinkCast(), sinkCmpExpression(), SinkShiftAndTruncate(), sizeWithoutDebug(), llvm::VPBasicBlock::splitAt(), splitBasicBlock(), llvm::JumpThreadingPass::threadThroughTwoBasicBlocks(), llvm::JumpThreadingPass::unfoldSelectInstr(), and unswitchTrivialBranch().
|
inline |
Definition at line 299 of file BasicBlock.h.
| iplist< BasicBlock >::iterator BasicBlock::eraseFromParent | ( | ) |
Unlink 'this' from the containing function and delete it.
Definition at line 129 of file BasicBlock.cpp.
References llvm::Function::getBasicBlockList(), llvm::ilist_node_impl< ilist_detail::compute_node_options< BasicBlock, Options... >::type >::getIterator(), and getParent().
Referenced by alignOutputBlockWithAggFunc(), llvm::CloneAndPruneIntoFromInst(), createSwitchStatement(), fillOverallFunction(), llvm::InlineFunction(), llvm::MergeBasicBlockIntoOnlyPred(), and GeneratedRTChecks::~GeneratedRTChecks().
|
inline |
Definition at line 309 of file BasicBlock.h.
|
inline |
Definition at line 308 of file BasicBlock.h.
Referenced by calculateStateNumbersForInvokes(), llvm::CloneAndPruneFunctionInto(), llvm::CloneAndPruneIntoFromInst(), cloneInstructionInExitBlock(), llvm::OpenMPIRBuilder::createDynamicWorkshareLoop(), llvm::createPHIsForSplitLoopExit(), createRetBitCast(), createRetPHINode(), createUnreachableSwitchDefault(), despeculateCountZeros(), ensureValueAvailableInSuccessor(), llvm::formLCSSAForInstructions(), llvm::CanonicalLoopInfo::getIndVar(), llvm::MustBeExecutedContextExplorer::getMustBeExecutedNextInstruction(), llvm::InlineFunction(), insertSpills(), insertTrivialPHIs(), mergeCleanupPad(), mergeEmptyReturnBlocks(), llvm::InstCombinerImpl::mergeStoreIntoSuccessor(), llvm::moveInstructionsToTheEnd(), movePHIValuesToInsertedBlock(), removePredecessor(), setCanonicalLoopTripCount(), llvm::JumpThreadingPass::simplifyPartiallyRedundantLoad(), llvm::SplitEdge(), and unswitchTrivialSwitch().
| LLVMContext & BasicBlock::getContext | ( | ) | const |
Get the context in which this basic block lives.
Definition at line 32 of file BasicBlock.cpp.
References llvm::Type::getContext(), and llvm::Value::getType().
Referenced by AddRuntimeUnrollDisableMetaData(), llvm::LoopVersioning::annotateInstWithNoAlias(), llvm::JumpThreadingPass::cloneInstructions(), cloneLoopBlocks(), GeneratedRTChecks::Create(), llvm::OpenMPIRBuilder::createDynamicWorkshareLoop(), llvm::createMemCpyLoopKnownSize(), llvm::createMemCpyLoopUnknownSize(), createStringMetadata(), DisableAllLoopOptsOnLoop(), llvm::AMDGPULibCalls::fold(), insertCall(), insertUniqueBackedgeBlock(), llvm::PPCTTIImpl::isHardwareLoopProfitable(), llvm::MergeBasicBlockIntoOnlyPred(), llvm::parseWidenableBranch(), llvm::LoopVersioning::prepareNoAliasMetadata(), rewritePHIsForCleanupPad(), llvm::SimpleLoopUnswitchPass::run(), llvm::LoopVectorizeHints::setAlreadyVectorized(), llvm::Loop::setLoopAlreadyUnrolled(), llvm::Loop::setLoopMustProgress(), splitBasicBlock(), splitBasicBlockBefore(), llvm::SplitBlockAndInsertIfThenElse(), SplitBlockAndInsertIfThenImpl(), SplitLandingPadPredecessorsImpl(), llvm::splitLoopBound(), llvm::JumpThreadingPass::threadThroughTwoBasicBlocks(), llvm::UnrollLoop(), updatePredecessorProfileMetadata(), and ~BasicBlock().
|
inline |
Definition at line 193 of file BasicBlock.h.
References getFirstInsertionPt().
| 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 line 249 of file BasicBlock.cpp.
References end(), getFirstNonPHI(), and llvm::ilist_node_impl< OptionsT >::getIterator().
Referenced by cloneInstructionInExitBlock(), llvm::InnerLoopVectorizer::completeLoopSkeleton(), llvm::OpenMPIRBuilder::createDynamicWorkshareLoop(), llvm::OpenMPIRBuilder::createParallel(), llvm::OpenMPIRBuilder::createStaticWorkshareLoop(), llvm::InnerLoopVectorizer::createVectorizedLoopSkeleton(), WidenIV::createWideIV(), llvm::DemoteRegToStack(), llvm::VPlan::execute(), llvm::SCEVExpander::findInsertPointAfter(), llvm::InnerLoopVectorizer::fixFirstOrderRecurrence(), llvm::InnerLoopVectorizer::fixReduction(), foldGuardedFunnelShift(), getFirstInsertionPt(), llvm::objcarc::BundledRetainClaimRVs::insertAfterInvokes(), llvm::insertDebugValuesForPHIs(), insertSpills(), instrumentOneFunc(), llvm::invertCondition(), makeStatepointExplicitImpl(), mergeConditionalStoreToAddress(), llvm::InstCombinerImpl::mergeStoreIntoSuccessor(), OptimizeExtractBits(), llvm::SCEVExpander::replaceCongruentIVs(), replaceExtractElements(), rewriteMaterializableInstructions(), llvm::InstCombinerImpl::run(), simplifyRelocatesOffABase(), SinkCast(), sinkCmpExpression(), SinkInstruction(), SinkShiftAndTruncate(), SplitLandingPadPredecessorsImpl(), llvm::TryToSimplifyUncondBranchFromEmptyBlock(), TryToSinkInstruction(), llvm::ObjectSizeOffsetEvaluator::visitPHINode(), WidenIV::widenIVUse(), and llvm::InnerLoopVectorizer::widenPHIInstruction().
|
inline |
Definition at line 162 of file BasicBlock.h.
References getFirstNonPHI().
| const Instruction * BasicBlock::getFirstNonPHI | ( | ) | const |
Returns a pointer to the first instruction in this block that is not a PHINode 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.
Definition at line 212 of file BasicBlock.cpp.
References I.
Referenced by llvm::MachineFunction::addLandingPad(), llvm::calculateClrEHStateNumbers(), calculateStateNumbersForInvokes(), canSplitPredecessors(), cloneInstructionInExitBlock(), CloneLoopBlocks(), llvm::colorEHFunclets(), ConnectEpilog(), ConnectProlog(), llvm::EpilogueVectorizerEpilogueLoop::createEpilogueVectorizedLoopSkeleton(), llvm::createMemCpyLoopKnownSize(), llvm::createPHIsForSplitLoopExit(), detectPopcountIdiom(), detectShiftUntilZeroIdiom(), llvm::ehAwareSplitEdge(), llvm::CodeExtractor::findOrCreateBlockForHoisting(), findUnwindDestinations(), findWasmUnwindDestinations(), llvm::InstCombinerImpl::foldAggregateConstructionIntoAggregateReuse(), getFirstInsertionPt(), getFirstNonPHI(), getLandingPadInst(), getSuccPad(), getUnwindDestTokenHelper(), HandleInlinedEHPad(), hoist(), llvm::InlineFunction(), llvm::insertDebugValuesForPHIs(), insertSpills(), insertUniqueBackedgeBlock(), llvm::isDereferenceableAndAlignedInLoop(), isEHPad(), isLandingPad(), markAliveBlocks(), moveLCSSAPhis(), relocationViaAlloca(), removeEmptyCleanup(), llvm::InstCombinerImpl::run(), SplitLandingPadPredecessorsImpl(), llvm::TryToSimplifyUncondBranchFromEmptyBlock(), and llvm::UnrollRuntimeLoopRemainder().
|
inline |
Definition at line 171 of file BasicBlock.h.
References getFirstNonPHIOrDbg().
| const Instruction * BasicBlock::getFirstNonPHIOrDbg | ( | bool | SkipPseudoOp = false | ) | const |
Returns a pointer to the first instruction in this block that is not a PHINode or a debug intrinsic, or any pseudo operation if SkipPseudoOp is true.
Definition at line 219 of file BasicBlock.cpp.
References I.
Referenced by llvm::ConstantFoldTerminator(), getFirstNonPHIOrDbg(), InitializeUniqueCases(), llvm::SimpleLoopSafetyInfo::isGuaranteedToExecute(), isPredicatedOnPHI(), llvm::moveInstructionsToTheBeginning(), SwitchToLookupTable(), and llvm::InstCombinerImpl::visitAllocaInst().
|
inline |
Definition at line 182 of file BasicBlock.h.
References getFirstNonPHIOrDbgOrLifetime().
| const Instruction * BasicBlock::getFirstNonPHIOrDbgOrLifetime | ( | bool | SkipPseudoOp = false | ) | const |
Returns a pointer to the first instruction in this block that is not a PHINode, a debug intrinsic, or a lifetime intrinsic, or any pseudo operation if SkipPseudoOp is true.
Definition at line 233 of file BasicBlock.cpp.
References I.
Referenced by getFirstNonPHIOrDbgOrLifetime(), and llvm::SplitKnownCriticalEdge().
|
inline |
Definition at line 364 of file BasicBlock.h.
|
inline |
Return the underlying instruction list container.
Currently you need to access the underlying instruction list container directly if you want to modify it.
Definition at line 363 of file BasicBlock.h.
Referenced by llvm::changeToInvokeAndSplitBasicBlock(), llvm::CloneAndPruneIntoFromInst(), llvm::CloneBasicBlock(), cloneInstructionInExitBlock(), llvm::JumpThreadingPass::cloneInstructions(), CloneInstructionsIntoPredecessorBlockAndUpdateSSAUses(), llvm::UnaryOperator::Create(), llvm::BinaryOperator::Create(), llvm::OpenMPIRBuilder::createCanonicalLoop(), createMalloc(), llvm::JumpThreadingPass::duplicateCondBranchOnPHIIntoPred(), llvm::Instruction::eraseFromParent(), FoldCondBranchOnPHI(), llvm::FoldReturnIntoUncondBranch(), llvm::hoistAllInstructionsInto(), llvm::InlineFunction(), llvm::Instruction::insertAfter(), llvm::Instruction::insertBefore(), insertUniqueBackedgeBlock(), llvm::Instruction::Instruction(), llvm::MergeBasicBlockIntoOnlyPred(), moveBBContents(), llvm::Instruction::removeFromParent(), llvm::InstCombinerImpl::run(), SplitLandingPadPredecessorsImpl(), llvm::TryToSimplifyUncondBranchFromEmptyBlock(), llvm::JumpThreadingPass::unfoldSelectInstr(), llvm::UnrollLoop(), and unswitchTrivialBranch().
| Optional< uint64_t > BasicBlock::getIrrLoopHeaderWeight | ( | ) | const |
Definition at line 480 of file BasicBlock.cpp.
References llvm::StringRef::equals(), llvm::Instruction::getMetadata(), llvm::MDString::getString(), and getTerminator().
|
inline |
Definition at line 475 of file BasicBlock.h.
References getLandingPadInst().
| const LandingPadInst * BasicBlock::getLandingPadInst | ( | ) | const |
Return the landingpad instruction associated with the landing pad.
Definition at line 476 of file BasicBlock.cpp.
References getFirstNonPHI().
Referenced by getLandingPadInst(), makeStatepointExplicitImpl(), and SplitLandingPadPredecessorsImpl().
|
inline |
Definition at line 115 of file BasicBlock.h.
References getModule().
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 line 144 of file BasicBlock.cpp.
References getParent(), and llvm::GlobalValue::getParent().
Referenced by CanProveNotTakenFirstIteration(), llvm::IRBuilderBase::CreateAlignedLoad(), llvm::IRBuilderBase::CreateAlignedStore(), llvm::IRBuilderBase::CreateAlloca(), llvm::IRBuilderBase::CreateAtomicCmpXchg(), llvm::IRBuilderBase::CreateAtomicRMW(), llvm::IRBuilderBase::CreateBinaryIntrinsic(), llvm::InnerLoopVectorizer::createInductionResumeValues(), llvm::IRBuilderBase::CreateIntrinsic(), llvm::IRBuilderBase::CreateNoAliasScopeDeclaration(), llvm::IRBuilderBase::CreateUnaryIntrinsic(), llvm::findAvailablePtrLoadStore(), FindLoopCounter(), findPHIToPartitionLoops(), llvm::InnerLoopVectorizer::fixupIVUsers(), llvm::LazyValueInfo::getConstantOnEdge(), llvm::LazyValueInfo::getConstantRangeOnEdge(), getEdgeValueLocal(), llvm::Instruction::getModule(), getModule(), llvm::MemoryDependenceResults::getNonLocalPointerDependency(), llvm::InnerLoopVectorizer::getOrCreateTripCount(), llvm::LazyValueInfo::getPredicateOnEdge(), llvm::getPtrStride(), llvm::RuntimePointerChecking::insert(), print(), llvm::printLoop(), llvm::promoteLoopAccessesToScalars(), ReduceLoopStrength(), llvm::LoopRotatePass::run(), llvm::LoopIdiomRecognizePass::run(), llvm::simplifyLoopAfterUnroll(), simplifyLoopInst(), simplifyOneLoop(), llvm::LazyValueInfo::threadEdge(), llvm::UnrollRuntimeLoopRemainder(), llvm::LoopVersioning::versionLoop(), and llvm::InnerLoopVectorizer::widenPHIInstruction().
|
inline |
Definition at line 108 of file BasicBlock.h.
Return the enclosing method, or null if none.
Definition at line 107 of file BasicBlock.h.
Referenced by addNoRecurseAttrsTopDown(), AddReturnAttributes(), llvm::ChangedIRComparer::analyzeIR(), analyzeLoopUnrollCost(), calculateSEHStateNumbers(), llvm::canSplitLoopBound(), CanWidenIV(), checkOverflow(), CloneLoopBlocks(), cloneLoopBlocks(), llvm::cloneLoopWithPreheader(), llvm::OpenMPIRBuilder::collapseLoops(), llvm::colorEHFunclets(), CompareValueComplexity(), llvm::LoopSafetyInfo::computeBlockColors(), llvm::computeConstantRange(), llvm::computePeelCount(), llvm::computeUnrollCount(), copyMustTailReturn(), llvm::IRBuilderBase::CreateAssumption(), llvm::OpenMPIRBuilder::createCopyinClauseBlocks(), llvm::OpenMPIRBuilder::createDynamicWorkshareLoop(), llvm::IRBuilderBase::CreateElementUnorderedAtomicMemCpy(), llvm::IRBuilderBase::CreateElementUnorderedAtomicMemMove(), llvm::IRBuilderBase::CreateElementUnorderedAtomicMemSet(), llvm::IRBuilderBase::CreateFAddReduce(), createFFSIntrinsic(), llvm::IRBuilderBase::CreateFMulReduce(), llvm::IRBuilderBase::CreateGCGetPointerBase(), llvm::IRBuilderBase::CreateGCGetPointerOffset(), llvm::IRBuilderBase::CreateGCRelocate(), llvm::IRBuilderBase::CreateGCResult(), llvm::IRBuilderBase::CreateGlobalString(), llvm::IRBuilderBase::CreateInvariantStart(), llvm::IRBuilderBase::CreateLaunderInvariantGroup(), llvm::IRBuilderBase::CreateLifetimeEnd(), llvm::IRBuilderBase::CreateLifetimeStart(), llvm::IRBuilderBase::CreateMemCpyInline(), llvm::createMemCpyLoopKnownSize(), llvm::createMemCpyLoopUnknownSize(), llvm::IRBuilderBase::CreateMemMove(), createMemMoveLoop(), llvm::IRBuilderBase::CreateMemSet(), createMemSetLoop(), llvm::IRBuilderBase::CreateMemTransferInst(), llvm::OpenMPIRBuilder::createParallel(), createPopcntIntrinsic(), llvm::IRBuilderBase::CreatePreserveArrayAccessIndex(), llvm::IRBuilderBase::CreatePreserveStructAccessIndex(), llvm::IRBuilderBase::CreatePreserveUnionAccessIndex(), llvm::OpenMPIRBuilder::createStaticWorkshareLoop(), llvm::IRBuilderBase::CreateStripInvariantGroup(), llvm::IRBuilderBase::CreateVectorReverse(), llvm::IRBuilderBase::CreateVectorSplice(), llvm::IRBuilderBase::CreateVScale(), DoFlattenLoopPair(), llvm::InstCombinerImpl::dominatesAllUses(), llvm::orc::IRSpeculationLayer::emit(), llvm::InnerLoopVectorizer::emitMemRuntimeChecks(), llvm::InnerLoopVectorizer::emitSCEVChecks(), eraseFromParent(), llvm::CodeExtractor::extractCodeRegion(), llvm::MustBeExecutedContextExplorer::findBackwardJoinPoint(), findCommonDominator(), llvm::findDevirtualizableCallsForTypeTest(), llvm::MustBeExecutedContextExplorer::findForwardJoinPoint(), FlattenLoopPair(), FoldCondBranchOnPHI(), llvm::formLCSSAForInstructions(), fpModeMatchesGlobalFPAtomicMode(), llvm::gatherUnrollingPreferences(), generateUnsignedDivisionCode(), llvm::CallBase::getCaller(), llvm::IRBuilderBase::getCurrentFunctionReturnType(), getDebugLocString(), getDefaultInlineAdvice(), llvm::TargetLoweringBase::getDefaultSafeStackPointerLocation(), llvm::MemoryDependenceResults::getDependency(), llvm::Trace::getFunction(), llvm::Instruction::getFunction(), llvm::IRSimilarity::IRSimilarityCandidate::getFunction(), llvm::OpenMPIRBuilder::OutlineInfo::getFunction(), llvm::CanonicalLoopInfo::getFunction(), getFunctionTypeFromAsyncSuspend(), llvm::X86TargetLowering::getIRStackGuard(), llvm::TargetLoweringBase::getIRStackGuard(), llvm::VNCoercion::getLoadLoadClobberFullWidthSize(), getModule(), llvm::ARMTTIImpl::getPreferredAddressingMode(), llvm::getPtrStride(), llvm::TargetLoweringBase::getSafeStackPointerLocation(), llvm::GCProjectionInst::getStatepoint(), llvm::AMDGPUTTIImpl::getUnrollingPreferences(), llvm::ARMTTIImpl::getUnrollingPreferences(), getValueSymbolTable(), getVarName(), HandleInlinedEHPad(), HandleInlinedLandingPad(), handlePhiDef(), llvm::hasPartialIVCondition(), llvm::InlineFunction(), insertBoundsCheck(), insertCall(), llvm::insertDebugValuesForPHIs(), InsertSafepointPoll(), insertSpills(), insertUniqueBackedgeBlock(), llvm::LoopVectorizationLegality::isConsecutivePtr(), llvm::CodeExtractor::isEligible(), isEntryBlock(), isExplicitVecOuterLoop(), llvm::isInTailCallPosition(), llvm::ScalarEvolution::isLoopBackedgeGuardedByCond(), isLoopDead(), llvm::RecurrenceDescriptor::isReductionPHI(), llvm::AllocaInst::isStaticAlloca(), llvm::AMDGPULibCalls::isUnsafeMath(), isValidCandidateForColdCC(), LLVMInsertExistingBasicBlockAfterInsertBlock(), llvm::SelectionDAGBuilder::LowerCallTo(), llvm::SITargetLowering::mayBeEmittedAsTailCall(), maybeEndlessLoop(), memoryIsNotModifiedBetween(), llvm::MergeBasicBlockIntoOnlyPred(), moveAfter(), moveBefore(), moveLCSSAPhis(), NegateValue(), llvm::peelLoop(), placeSplitBlockCarefully(), populateWorklist(), print(), llvm::LoopVectorizePass::processLoop(), processLoopInVPlanNativePath(), processUse(), promoteArguments(), llvm::AssumptionCache::registerAssumption(), removeFromParent(), replaceAsyncResumeFunction(), replaceConstantExprOp(), replaceExtractElements(), llvm::SSAUpdaterBulk::RewriteAllUses(), llvm::GCNTTIImpl::rewriteIntrinsicWithAddressSpace(), rewritePHIsForCleanupPad(), RewriteUsesOfClonedInstructions(), llvm::LoopVersioningLICMPass::run(), llvm::LoopAccessInfoPrinterPass::run(), llvm::LoopPredicationPass::run(), llvm::LoopDeletionPass::run(), llvm::IndVarSimplifyPass::run(), llvm::LoopSinkPass::run(), llvm::LoopBoundSplitPass::run(), llvm::LoopIdiomRecognizePass::run(), llvm::LoopFullUnrollPass::run(), llvm::LICMPass::run(), llvm::SimpleLoopUnswitchPass::run(), llvm::LoopCachePrinterPass::run(), llvm::DDGAnalysis::run(), llvm::IVUsersWrapperPass::runOnLoop(), llvm::IRBuilderBase::setConstrainedFPFunctionAttr(), llvm::setProfMetadata(), simplifyAMDGCNMemoryIntrinsicDemanded(), SimplifyCondBranchToCondBranch(), simplifyRelocatesOffABase(), sinkAndCmp0Expression(), sinkLifetimeStartMarkers(), sinkLoopInvariantInstructions(), llvm::LoopPass::skipLoop(), splitBasicBlock(), splitBasicBlockBefore(), llvm::SplitBlockAndInsertIfThenElse(), SplitBlockAndInsertIfThenImpl(), llvm::SplitKnownCriticalEdge(), SplitLandingPadPredecessorsImpl(), llvm::splitLoopBound(), SwitchToLookupTable(), llvm::SyncDependenceAnalysis::SyncDependenceAnalysis(), llvm::JumpThreadingPass::threadThroughTwoBasicBlocks(), llvm::OpenMPIRBuilder::tileLoops(), tryToUnrollAndJamLoop(), tryToUnrollLoop(), llvm::UnrollAndJamLoop(), llvm::UnrollLoop(), llvm::UnrollRuntimeLoopRemainder(), unswitchBestCondition(), unswitchLoop(), UpdateAnalysisInformation(), updateIDTMetaData(), UseTlsOffset(), llvm::InstCombinerImpl::visitAllocaInst(), llvm::InstCombinerImpl::visitLandingPadInst(), worthSinkOrHoistInst(), and ~BasicBlock().
|
inline |
Definition at line 141 of file BasicBlock.h.
References getPostdominatingDeoptimizeCall().
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 line 200 of file BasicBlock.cpp.
References BB, and llvm::SmallPtrSetImpl< PtrType >::insert().
Referenced by canRotateDeoptimizingLatchExit(), and getPostdominatingDeoptimizeCall().
|
inline |
Definition at line 244 of file BasicBlock.h.
References getSinglePredecessor().
| const BasicBlock * BasicBlock::getSinglePredecessor | ( | ) | const |
Return the predecessor of this block if it has a single predecessor block.
Otherwise return a null pointer.
Definition at line 264 of file BasicBlock.cpp.
References E, llvm::pred_begin(), and llvm::pred_end().
Referenced by CanGenerateTest(), CanPropagatePredecessorsForPHIs(), CanProveNotTakenFirstIteration(), canSafelyUnrollMultiExitLoop(), llvm::CloneAndPruneIntoFromInst(), llvm::EpilogueVectorizerEpilogueLoop::createEpilogueVectorizedLoopSkeleton(), GeneratedRTChecks::emitMemRuntimeChecks(), GeneratedRTChecks::emitSCEVChecks(), llvm::VPPredInstPHIRecipe::execute(), llvm::InstCombinerImpl::foldICmpWithDominatingICmp(), foldICmpWithDominatingICmp(), getDomPredecessorCondition(), llvm::GetIfCondition(), getSinglePredecessor(), llvm::objcarc::BundledRetainClaimRVs::insertAfterInvokes(), llvm::isValidAssumeForContext(), llvm::JumpThreadingPass::maybethreadThroughTwoBasicBlocks(), llvm::MergeBasicBlockIntoOnlyPred(), mergeBlocksIntoPredecessors(), mergeCleanupPad(), mergeConditionalStoreToAddress(), optimizeBranch(), llvm::JumpThreadingPass::processGuards(), llvm::JumpThreadingPass::processImpliedCondition(), llvm::InstCombinerImpl::replacedSelectWithOperand(), simplifyOneLoop(), llvm::JumpThreadingPass::simplifyPartiallyRedundantLoad(), simplifySuspendPoint(), splitBasicBlockBefore(), llvm::SplitEdge(), tryToMoveFreeBeforeNullTest(), llvm::TryToSimplifyUncondBranchFromEmptyBlock(), and tryWidenCondBranchToCondBranch().
|
inline |
Definition at line 272 of file BasicBlock.h.
References getSingleSuccessor().
| const BasicBlock * 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 line 294 of file BasicBlock.cpp.
References E, SI, llvm::succ_begin(), and llvm::succ_end().
Referenced by llvm::VPlan::execute(), getSingleSuccessor(), insertSpills(), llvm::isProfitableToTransform(), mergeBlocksIntoPredecessors(), mergeConditionalStores(), and sinkLifetimeStartMarkers().
|
inlinestatic |
Returns a pointer to a member of the instruction list.
Definition at line 367 of file BasicBlock.h.
|
inline |
Definition at line 132 of file BasicBlock.h.
References getTerminatingDeoptimizeCall().
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 line 185 of file BasicBlock.cpp.
References F.
Referenced by getExpectedExitLoopLatchBranch(), getTerminatingDeoptimizeCall(), llvm::InlineFunction(), and tryWidenCondBranchToCondBranch().
|
inline |
Definition at line 150 of file BasicBlock.h.
References getTerminatingMustTailCall().
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 line 154 of file BasicBlock.cpp.
References llvm::User::getOperand(), llvm::ilist_node_with_parent< NodeTy, ParentTy, Options >::getPrevNode(), and llvm::ReturnInst::getReturnValue().
Referenced by getTerminatingMustTailCall(), llvm::InlineFunction(), and llvm::EscapeEnumerator::Next().
|
inline |
Definition at line 123 of file BasicBlock.h.
References getTerminator().
| const Instruction * BasicBlock::getTerminator | ( | ) | const |
Returns the terminator instruction if the block is well formed or null if the block is not well formed.
Definition at line 148 of file BasicBlock.cpp.
Referenced by Prefetch::addInstruction(), llvm::LoopNest::arePerfectlyNested(), llvm::PredicateInfoBuilder::buildPredicateInfo(), CanGenerateTest(), llvm::canPeel(), canRotateDeoptimizingLatchExit(), canSinkInstructions(), llvm::canSplitLoopBound(), canSplitPredecessors(), checkOverflow(), llvm::CloneAndPruneIntoFromInst(), llvm::CloneFunctionInto(), CloneInstructionsIntoPredecessorBlockAndUpdateSSAUses(), CloneLoopBlocks(), cloneLoopBlocks(), llvm::colorEHFunclets(), llvm::FunctionComparator::compare(), llvm::InnerLoopVectorizer::completeLoopSkeleton(), ComputeNumSignBitsImpl(), ComputePostOrders(), ConnectEpilog(), ConnectProlog(), llvm::BranchProbabilityInfo::copyEdgeProbabilities(), copyMustTailReturn(), GeneratedRTChecks::Create(), llvm::OpenMPIRBuilder::createCopyinClauseBlocks(), llvm::OpenMPIRBuilder::createDynamicWorkshareLoop(), llvm::VPRecipeBuilder::createEdgeMask(), llvm::EpilogueVectorizerEpilogueLoop::createEpilogueVectorizedLoopSkeleton(), WidenIV::createExtendInst(), llvm::InnerLoopVectorizer::createInductionResumeValues(), llvm::createMemCpyLoopKnownSize(), llvm::createMemCpyLoopUnknownSize(), createMemMoveLoop(), createMemSetLoop(), llvm::OpenMPIRBuilder::createParallel(), llvm::createPHIsForSplitLoopExit(), llvm::createSanitizerCtorAndInitFunctions(), llvm::OpenMPIRBuilder::createSections(), llvm::OpenMPIRBuilder::createStaticWorkshareLoop(), createSwitchStatement(), createUnreachableSwitchDefault(), llvm::InnerLoopVectorizer::createVectorLoopSkeleton(), despeculateCountZeros(), detectPopcountIdiom(), detectShiftUntilBitTestIdiom(), detectShiftUntilZeroIdiom(), DoFlattenLoopPair(), dominatesMergePoint(), llvm::JumpThreadingPass::duplicateCondBranchOnPHIIntoPred(), llvm::DuplicateInstructionsInSplitBetween(), llvm::ehAwareSplitEdge(), GeneratedRTChecks::emitMemRuntimeChecks(), llvm::InnerLoopVectorizer::emitMinimumIterationCountCheck(), llvm::EpilogueVectorizerMainLoop::emitMinimumIterationCountCheck(), GeneratedRTChecks::emitSCEVChecks(), llvm::InnerLoopVectorizer::emitTransformedIndex(), llvm::Evaluator::EvaluateFunction(), llvm::VPBranchOnMaskRecipe::execute(), llvm::VPWidenCanonicalIVRecipe::execute(), llvm::VPBasicBlock::execute(), llvm::VPlan::execute(), findCommonDominator(), findIBRPredecessor(), findLoopComponents(), FindLoopCounter(), llvm::CodeExtractor::findOrCreateBlockForHoisting(), llvm::InnerLoopVectorizer::fixFirstOrderRecurrence(), llvm::InnerLoopVectorizer::fixLCSSAPHIs(), llvm::InnerLoopVectorizer::fixReduction(), llvm::InnerLoopVectorizer::fixupIVUsers(), FoldCondBranchOnPHI(), foldExit(), foldGuardedFunnelShift(), llvm::InstCombinerImpl::foldICmpWithDominatingICmp(), foldICmpWithDominatingICmp(), llvm::InstCombinerImpl::foldOpIntoPhi(), llvm::InstCombinerImpl::foldPHIArgLoadIntoPHI(), llvm::InstCombinerImpl::foldPHIArgOpIntoPHI(), llvm::InstCombinerImpl::foldPHIArgZextsIntoPHI(), llvm::FoldReturnIntoUncondBranch(), FoldTwoEntryPHINode(), genLoopLimit(), getBranchInsertPoint(), llvm::InnerLoopVectorizer::getBroadcastInstrs(), llvm::Loop::LoopBounds::getCanonicalPredicate(), getDomPredecessorCondition(), getEdgeValueLocal(), getExpectedExitLoopLatchBranch(), llvm::GetIfCondition(), getInsertPointForUses(), getInstrBB(), getIrrLoopHeaderWeight(), llvm::Loop::getLoopGuardBranch(), llvm::InnerLoopVectorizer::getOrCreateTripCount(), llvm::InnerLoopVectorizer::getOrCreateVectorTripCount(), llvm::GCProjectionInst::getStatepoint(), getTerminator(), llvm::hasPartialIVCondition(), hoist(), llvm::hoistRegion(), llvm::InlineFunction(), insertBoundsCheck(), llvm::DIBuilder::insertDeclare(), insertLifetimeMarkersSurroundingCall(), insertSpills(), insertUniqueBackedgeBlock(), IsAcceptableTarget(), llvm::Attributor::isAssumedDead(), llvm::isInTailCallPosition(), isLegalToHoistInto(), llvm::ScalarEvolution::isLoopBackedgeGuardedByCond(), isLoopDead(), isLoopExitTestBasedOn(), isSafePHIToSpeculate(), llvm::isSafeToExpandAt(), llvm::BasicBlockEdge::isSingleEdge(), llvm::isUniformLoop(), isUniformlyReached(), llvm::Loop::makeLoopInvariant(), llvm::JumpThreadingPass::maybeMergeBasicBlockIntoOnlyPred(), llvm::JumpThreadingPass::maybethreadThroughTwoBasicBlocks(), llvm::MergeBasicBlockIntoOnlyPred(), llvm::MergeBlockIntoPredecessor(), mergeConditionalStoreToAddress(), mergeEmptyReturnBlocks(), llvm::InstCombinerImpl::mergeStoreIntoSuccessor(), moveBBContents(), llvm::moveInstructionsToTheEnd(), needsLFTR(), llvm::EscapeEnumerator::Next(), llvm::slpvectorizer::BoUpSLP::optimizeGatherSequence(), optimizeSQRT(), llvm::peelLoop(), llvm::JumpThreadingPass::processBranchOnPHI(), llvm::JumpThreadingPass::processBranchOnXOR(), llvm::JumpThreadingPass::processImpliedCondition(), llvm::JumpThreadingPass::processThreadableEdges(), profitableToRotateLoopExitingLatch(), llvm::promoteLoopAccessesToScalars(), relocationViaAlloca(), removeUndefIntroducingPredecessor(), replaceConstantExprOp(), replaceSuccessorsPhiUsesWith(), replaceWithInvariantCond(), llvm::InstCombinerImpl::run(), scalarizeMaskedCompressStore(), scalarizeMaskedExpandLoad(), scalarizeMaskedGather(), scalarizeMaskedLoad(), scalarizeMaskedScatter(), scalarizeMaskedStore(), separateNestedLoop(), llvm::BranchProbabilityInfo::setEdgeProbability(), simplifyOneLoop(), llvm::JumpThreadingPass::simplifyPartiallyRedundantLoad(), SinkCast(), llvm::InstCombinerImpl::SliceUpIllegalIntegerPHI(), speculatePHINodeLoads(), splitBasicBlock(), splitBasicBlockBefore(), splitBeforeCatchSwitch(), llvm::SplitBlockAndInsertIfThenElse(), SplitBlockAndInsertIfThenImpl(), SplitBlockPredecessorsImpl(), splitCallSite(), llvm::SplitCriticalEdge(), SplitCriticalSideEffectEdges(), llvm::SplitIndirectBrCriticalEdges(), llvm::SplitKnownCriticalEdge(), SplitLandingPadPredecessorsImpl(), llvm::splitLoopBound(), swapBBContents(), ThreadCmpOverPHI(), llvm::JumpThreadingPass::threadEdge(), llvm::JumpThreadingPass::threadThroughTwoBasicBlocks(), TryToMergeLandingPad(), tryToMoveFreeBeforeNullTest(), TryToSinkInstruction(), llvm::JumpThreadingPass::tryToUnfoldSelect(), llvm::JumpThreadingPass::tryToUnfoldSelectInCurrBB(), tryUnmergingGEPsAcrossIndirectBr(), turnGuardIntoBranch(), turnToExplicitForm(), llvm::JumpThreadingPass::unfoldSelectInstr(), llvm::UnrollAndJamLoop(), llvm::UnrollLoop(), llvm::UnrollRuntimeLoopRemainder(), unswitchAllTrivialConditions(), unswitchBestCondition(), unswitchTrivialBranch(), unswitchTrivialSwitch(), updateLatchBranchWeightsForRemainderLoop(), updatePredecessorProfileMetadata(), llvm::LoopVersioning::versionLoop(), llvm::InstCombinerImpl::visitCallInst(), llvm::InstCombinerImpl::visitPHINode(), WidenIV::widenIVUse(), and llvm::InnerLoopVectorizer::widenPHIInstruction().
|
inline |
Definition at line 256 of file BasicBlock.h.
References getUniquePredecessor().
| const BasicBlock * 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 line 272 of file BasicBlock.cpp.
References E, llvm::pred_begin(), and llvm::pred_end().
Referenced by areOuterLoopExitPHIsSupported(), llvm::MustBeExecutedContextExplorer::findBackwardJoinPoint(), findLocationForEntrySafepoint(), llvm::Loop::getLoopGuardBranch(), getUniquePredecessor(), IsAcceptableTarget(), makeStatepointExplicitImpl(), llvm::MergeBlockSuccessorsIntoGivenBlocks(), reuseTableCompare(), llvm::InstCombinerImpl::run(), TryToSinkInstruction(), and llvm::UnrollLoop().
|
inline |
Definition at line 282 of file BasicBlock.h.
References getUniqueSuccessor().
| const BasicBlock * 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 line 302 of file BasicBlock.cpp.
References E, SI, llvm::succ_begin(), and llvm::succ_end().
Referenced by llvm::OpenMPIRBuilder::finalize(), llvm::MustBeExecutedContextExplorer::findForwardJoinPoint(), getUniqueSuccessor(), IsBackEdge(), and llvm::MergeBlockIntoPredecessor().
| ValueSymbolTable * BasicBlock::getValueSymbolTable | ( | ) |
Returns a pointer to the symbol table if one exists.
Definition at line 26 of file BasicBlock.cpp.
References F, and getParent().
|
inline |
Returns true if there are any uses of this basic block other than direct branches, switches, etc.
to it.
Definition at line 448 of file BasicBlock.h.
Referenced by isEligibleLoopForm(), llvm::MergeBasicBlockIntoOnlyPred(), llvm::UnrollLoop(), and ~BasicBlock().
| bool BasicBlock::hasNPredecessors | ( | unsigned | N | ) | const |
Return true if this block has exactly N predecessors.
Definition at line 286 of file BasicBlock.cpp.
References llvm::hasNItems(), N, llvm::pred_begin(), and llvm::pred_end().
Referenced by ensureValueAvailableInSuccessor(), llvm::InstCombinerImpl::mergeStoreIntoSuccessor(), and llvm::MemorySSAUpdater::wireOldPredecessorsToNewImmediatePredecessor().
| bool BasicBlock::hasNPredecessorsOrMore | ( | unsigned | N | ) | const |
Return true if this block has N predecessors or more.
Definition at line 290 of file BasicBlock.cpp.
References llvm::hasNItemsOrMore(), N, llvm::pred_begin(), and llvm::pred_end().
| void BasicBlock::insertInto | ( | Function * | Parent, |
| BasicBlock * | InsertBefore = nullptr |
||
| ) |
Insert unlinked basic block into a function.
Inserts an unlinked basic block into Parent. If InsertBefore is provided, inserts before that basic block, otherwise inserts at the end.
nullptr. Definition at line 57 of file BasicBlock.cpp.
References assert(), llvm::Function::getBasicBlockList(), and llvm::ilist_node_impl< OptionsT >::getIterator().
| iterator_range< filter_iterator< BasicBlock::iterator, std::function< bool(Instruction &)> > > BasicBlock::instructionsWithoutDebug | ( | bool | SkipPseudoOp = false | ) |
Return an iterator range over the instructions in the block, skipping any debug instructions.
Skip and any pseudo operations as well if SkipPseudoOp is true.
Definition at line 110 of file BasicBlock.cpp.
References function, I, and llvm::make_filter_range().
| iterator_range< filter_iterator< BasicBlock::const_iterator, std::function< bool(const Instruction &)> > > BasicBlock::instructionsWithoutDebug | ( | bool | SkipPseudoOp = false | ) | const |
Return a const iterator range over the instructions in the block, skipping any debug instructions.
Skip any pseudo operations as well if SkipPseudoOp is true.
Definition at line 100 of file BasicBlock.cpp.
References function, I, and llvm::make_filter_range().
Referenced by GetCaseResults(), isSafeToSpeculateStore(), simplifyOneLoop(), sizeWithoutDebug(), and tryToMoveFreeBeforeNullTest().
|
inline |
Mark instruction ordering invalid. Done on every instruction insert.
Definition at line 495 of file BasicBlock.h.
References llvm::tgtok::Bits, and validateInstrOrdering().
|
inline |
Return true if this basic block is an exception handling block.
Definition at line 465 of file BasicBlock.h.
References getFirstNonPHI(), and llvm::Instruction::isEHPad().
Referenced by canSplitCallSite(), insertUniqueBackedgeBlock(), llvm::JumpThreadingPass::maybethreadThroughTwoBasicBlocks(), separateNestedLoop(), llvm::JumpThreadingPass::simplifyPartiallyRedundantLoad(), llvm::SplitEdge(), and llvm::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 line 375 of file BasicBlock.cpp.
References assert(), F, and getParent().
Referenced by llvm::SelectionDAGBuilder::isExportableFromCurrentBlock(), llvm::MergeBasicBlockIntoOnlyPred(), and UpdateAnalysisInformation().
|
inline |
Returns true if the Order field of child Instructions is valid.
Definition at line 490 of file BasicBlock.h.
Referenced by llvm::Instruction::comesBefore(), and validateInstrOrdering().
| 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 line 472 of file BasicBlock.cpp.
References getFirstNonPHI().
Referenced by llvm::createPHIsForSplitLoopExit(), and SplitLandingPadPredecessorsImpl().
| bool BasicBlock::isLegalToHoistInto | ( | ) | const |
Return true if it is legal to hoist instructions into this block.
Definition at line 362 of file BasicBlock.cpp.
References assert(), getTerminator(), and llvm::M68kBeads::Term.
| void BasicBlock::moveAfter | ( | BasicBlock * | MovePos | ) |
Unlink this basic block from its current function and insert it right after MovePos in the function MovePos lives in.
Definition at line 138 of file BasicBlock.cpp.
References llvm::Function::getBasicBlockList(), llvm::ilist_node_impl< ilist_detail::compute_node_options< BasicBlock, Options... >::type >::getIterator(), llvm::ilist_node_impl< OptionsT >::getIterator(), and getParent().
Referenced by llvm::MergeBasicBlockIntoOnlyPred(), placeSplitBlockCarefully(), llvm::JumpThreadingPass::threadEdge(), and llvm::JumpThreadingPass::threadThroughTwoBasicBlocks().
| void BasicBlock::moveBefore | ( | BasicBlock * | MovePos | ) |
Unlink this basic block from its current function and insert it into the function that MovePos lives in, right before MovePos.
Definition at line 133 of file BasicBlock.cpp.
References llvm::Function::getBasicBlockList(), llvm::ilist_node_impl< ilist_detail::compute_node_options< BasicBlock, Options... >::type >::getIterator(), llvm::ilist_node_impl< OptionsT >::getIterator(), and getParent().
Referenced by buildClonedLoopBlocks(), GeneratedRTChecks::emitMemRuntimeChecks(), and GeneratedRTChecks::emitSCEVChecks().
|
delete |
| iterator_range<phi_iterator> llvm::BasicBlock::phis | ( | ) |
|
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 line 354 of file BasicBlock.h.
Referenced by addPHINodeEntriesForMappedBlock(), AddPredecessorToBlock(), areInnerLoopExitPHIsSupported(), areOuterLoopExitPHIsSupported(), checkPHIs(), ConnectEpilog(), llvm::createPHIsForSplitLoopExit(), DbgGatherEqualValues(), deleteLoopIfDead(), findLoopComponents(), FindPHIForConditionForwarding(), llvm::InnerLoopVectorizer::fixLCSSAPHIs(), llvm::InnerLoopVectorizer::fixReduction(), fixupPHINodeForNormalDest(), fixupPHINodeForUnwindDest(), ForwardSwitchConditionToPHI(), llvm::Loop::getInductionVariable(), isEpilogProfitable(), isExistingPhi(), isLoopDead(), isPredicatedOnPHI(), isSafeToHoistInvoke(), moveLCSSAPhis(), processHeaderPhiOperands(), profitableToRotateLoopExitingLatch(), PushLoopPHIs(), removeEmptyCleanup(), removePredecessor(), llvm::SCEVExpander::replaceCongruentIVs(), rewritePHINodesForExitAndUnswitchedBlocks(), rewritePHINodesForUnswitchedExitBlock(), scanPHIsAndUpdateValueMap(), SimplifyCondBranchToCondBranch(), splitCallSite(), llvm::splitLoopBound(), tryWidenCondBranchToCondBranch(), llvm::updatePhiNodes(), validateAndCostRequiredSelects(), and llvm::InstCombinerImpl::visitPHINode().
| 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 optional AssemblyAnnotationWriter.
Definition at line 4529 of file AsmWriter.cpp.
References getModule(), getParent(), and llvm::RISCVFenceField::W.
|
inline |
Definition at line 301 of file BasicBlock.h.
Referenced by llvm::moveInstructionsToTheBeginning(), and sinkLoopInvariantInstructions().
|
inline |
Definition at line 302 of file BasicBlock.h.
| void BasicBlock::removeFromParent | ( | ) |
Unlink 'this' from the containing function, but do not delete it.
Definition at line 125 of file BasicBlock.cpp.
References llvm::Function::getBasicBlockList(), llvm::ilist_node_impl< ilist_detail::compute_node_options< BasicBlock, Options... >::type >::getIterator(), and getParent().
Referenced by llvm::DomTreeUpdater::callbackDeleteBB(), and llvm::DomTreeUpdater::deleteBB().
| void BasicBlock::removePredecessor | ( | BasicBlock * | Pred, |
| bool | KeepOneInputPHIs = false |
||
| ) |
Update PHI nodes in this BasicBlock before removal of predecessor Pred.
Note that this function does not actually remove the predecessor.
If KeepOneInputPHIs 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 line 321 of file BasicBlock.cpp.
References assert(), begin(), empty(), front(), llvm::Value::hasNUsesOrMore(), llvm::is_contained(), llvm::make_early_inc_range(), phis(), and llvm::predecessors().
Referenced by llvm::changeToCall(), llvm::ConstantFoldTerminator(), deleteDeadBlocksFromLoop(), HandleInlinedLandingPad(), markAliveBlocks(), llvm::JumpThreadingPass::processBlock(), llvm::JumpThreadingPass::processImpliedCondition(), processSwitch(), redirectTo(), removeNonFeasibleEdges(), RemoveSwitchAfterSelectConversion(), llvm::removeUnwindEdge(), simplifyTerminatorLeadingToRet(), llvm::SplitKnownCriticalEdge(), SwitchToLookupTable(), llvm::JumpThreadingPass::threadThroughTwoBasicBlocks(), TryToMergeLandingPad(), tryWidenCondBranchToCondBranch(), llvm::UnrollLoop(), unswitchNontrivialInvariants(), and unswitchTrivialSwitch().
|
inline |
Definition at line 303 of file BasicBlock.h.
Referenced by llvm::FindAvailableLoadedValue(), findPotentialBlockers(), llvm::slpvectorizer::BoUpSLP::getSpillCost(), inlineRetainOrClaimRVCalls(), llvm::moveInstructionsToTheBeginning(), removeTriviallyEmptyRange(), sinkLoopInvariantInstructions(), and splitCallSite().
|
inline |
Definition at line 304 of file BasicBlock.h.
| void BasicBlock::renumberInstructions | ( | ) |
Renumber instructions and mark the ordering as valid.
Definition at line 499 of file BasicBlock.cpp.
References llvm::tgtok::Bits, and I.
Referenced by llvm::Instruction::comesBefore().
| void BasicBlock::replacePhiUsesWith | ( | BasicBlock * | Old, |
| BasicBlock * | New | ||
| ) |
Update all phi nodes in this basic block to refer to basic block New instead of basic block Old.
Definition at line 446 of file BasicBlock.cpp.
References begin(), end(), llvm::ARM_PROC::IE, and llvm::PHINode::replaceIncomingBlockWith().
Referenced by moveLCSSAPhis(), and splitBasicBlockBefore().
| void BasicBlock::replaceSuccessorsPhiUsesWith | ( | BasicBlock * | New | ) |
Update all phi nodes in this basic block's successors to refer to basic block New instead of to it.
Definition at line 468 of file BasicBlock.cpp.
References replaceSuccessorsPhiUsesWith().
| void BasicBlock::replaceSuccessorsPhiUsesWith | ( | BasicBlock * | Old, |
| BasicBlock * | New | ||
| ) |
Update all phi nodes in this basic block's successors to refer to basic block New instead of basic block Old.
Definition at line 457 of file BasicBlock.cpp.
References getTerminator(), and llvm::successors().
Referenced by llvm::OpenMPIRBuilder::createCanonicalLoop(), and replaceSuccessorsPhiUsesWith().
|
inline |
Definition at line 306 of file BasicBlock.h.
Referenced by alignOutputBlockWithAggFunc(), fillOverallFunction(), findDuplicateOutputBlock(), llvm::moveInstructionsToTheEnd(), tryToMoveFreeBeforeNullTest(), and unswitchTrivialSwitch().
| filter_iterator< BasicBlock::const_iterator, std::function< bool(const Instruction &)> >::difference_type BasicBlock::sizeWithoutDebug | ( | ) | const |
Return the size of the basic block ignoring debug instructions.
Definition at line 120 of file BasicBlock.cpp.
References begin(), end(), and instructionsWithoutDebug().
|
inline |
Definition at line 419 of file BasicBlock.h.
References I, and splitBasicBlock().
| BasicBlock * BasicBlock::splitBasicBlock | ( | iterator | I, |
| const Twine & | BBName = "", |
||
| bool | Before = false |
||
| ) |
Split the basic block into two basic blocks at the specified instruction.
If Before 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 line 381 of file BasicBlock.cpp.
References assert(), Create(), llvm::BranchInst::Create(), end(), getContext(), llvm::ilist_node_with_parent< BasicBlock, Function >::getNextNode(), getParent(), getTerminator(), I, llvm::Instruction::setDebugLoc(), splitBasicBlockBefore(), and this.
Referenced by llvm::OpenMPIRBuilder::createCopyinClauseBlocks(), llvm::createMemCpyLoopKnownSize(), llvm::createMemCpyLoopUnknownSize(), createMemSetLoop(), llvm::OpenMPIRBuilder::createParallel(), llvm::OpenMPIRBuilder::createSections(), despeculateCountZeros(), llvm::VPlan::execute(), llvm::CodeExtractor::findOrCreateBlockForHoisting(), llvm::InlineFunction(), insertBoundsCheck(), insertSpills(), splitBasicBlock(), splitBeforeCatchSwitch(), llvm::SplitBlockAndInsertIfThenElse(), SplitBlockAndInsertIfThenImpl(), llvm::splitBlockBefore(), and SplitBlockImpl().
|
inline |
Definition at line 442 of file BasicBlock.h.
References I, and splitBasicBlockBefore().
| BasicBlock * BasicBlock::splitBasicBlockBefore | ( | iterator | I, |
| const Twine & | 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 iterator I are part of the original basic block. All Instructions BEFORE the iterator I 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 a PHINode 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 line 412 of file BasicBlock.cpp.
References assert(), begin(), Create(), llvm::BranchInst::Create(), getContext(), getParent(), getSinglePredecessor(), getTerminator(), I, llvm::predecessors(), replacePhiUsesWith(), llvm::Instruction::replaceSuccessorWith(), llvm::Instruction::setDebugLoc(), and this.
Referenced by splitBasicBlock(), and splitBasicBlockBefore().
| 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 line 513 of file BasicBlock.cpp.
References assert(), llvm::Instruction::comesBefore(), I, and isInstrOrderValid().
Referenced by invalidateOrders(), and ~BasicBlock().
|
friend |
Definition at line 64 of file BasicBlock.h.
|
friend |
Definition at line 65 of file BasicBlock.h.
1.8.17