|
LLVM
12.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 () const |
| Returns a pointer to the first instruction in this block that is not a PHINode or a debug intrinsic. More... | |
| Instruction * | getFirstNonPHIOrDbg () |
| const Instruction * | getFirstNonPHIOrDbgOrLifetime () const |
| Returns a pointer to the first instruction in this block that is not a PHINode, a debug intrinsic, or a lifetime intrinsic. More... | |
| Instruction * | getFirstNonPHIOrDbgOrLifetime () |
| 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 () 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 () |
| 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="") |
| Split the basic block into two basic blocks at the specified instruction. More... | |
| BasicBlock * | splitBasicBlock (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... | |
| 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... | |
| 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 user of this value. More... | |
| bool | hasNUses (unsigned N) const |
| Return true if this Value has exactly N users. More... | |
| bool | hasNUsesOrMore (unsigned N) const |
| Return true if this value has N users or more. More... | |
| Use * | getSingleUndroppableUse () |
| Return true if there is exactly one user of this value that cannot be dropped. More... | |
| bool | hasNUndroppableUses (unsigned N) const |
| Return true if there this value. More... | |
| bool | hasNUndroppableUsesOrMore (unsigned N) const |
| Return true if this value has N users 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... | |
| 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 | 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 * | stripPointerCastsAndInvariantGroups () const |
| Strip off pointer casts, all-zero GEPs and invariant group info. More... | |
| Value * | stripPointerCastsAndInvariantGroups () |
| 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 *) {}) |
| uint64_t | getPointerDereferenceableBytes (const DataLayout &DL, bool &CanBeNull) 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... | |
Friends | |
| class | BlockAddress |
| class | SymbolTableListTraits< BasicBlock > |
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 340 of file BasicBlock.h.
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 338 of file BasicBlock.h.
Definition at line 92 of file BasicBlock.h.
|
delete |
| BasicBlock::~BasicBlock | ( | ) |
Definition at line 67 of file BasicBlock.cpp.
References assert(), llvm::iplist_impl< IntrusiveListT, TraitsT >::clear(), llvm::Constant::destroyConstant(), dropAllReferences(), llvm::ConstantInt::get(), getContext(), llvm::Type::getInt32Ty(), llvm::ConstantExpr::getIntToPtr(), getParent(), llvm::Value::getType(), hasAddressTaken(), llvm::Value::replaceAllUsesWith(), llvm::SymbolTableListTraits< ValueSubClass >::setSymTabObject(), llvm::Value::use_empty(), llvm::Value::user_back(), and validateInstrOrdering().
|
inline |
Definition at line 303 of file BasicBlock.h.
Referenced by llvm::DomTreeUpdater::callbackDeleteBB(), llvm::AAResults::canBasicBlockModify(), CheckForCanReleaseCFGHazard(), llvm::CloneAndPruneIntoFromInst(), createCallInst(), createCast(), FindPredecessorAutoreleaseWithSafePath(), findUnwindDestinations(), getValueFromMetadata(), INITIALIZE_PASS(), isInertARCValue(), promoteSingleBlockAlloca(), reconnectPhis(), shouldKeepInEntry(), llvm::SimplifyInstructionsInBlock(), llvm::SparseSolver< LatticeKey, LatticeVal, KeyInfo >::Solve(), llvm::UnrollAndJamLoop(), and llvm::UnrollLoop().
|
inline |
Definition at line 304 of file BasicBlock.h.
|
inline |
Instruction iterator methods.
Definition at line 289 of file BasicBlock.h.
Referenced by llvm::MemorySSAUpdater::applyInsertUpdates(), llvm::calculateWasmEHInfo(), llvm::Interpreter::callFunction(), canLoopBeDeleted(), canonicalizeSaturatedAdd(), CanPropagatePredecessorsForPHIs(), canRotateDeoptimizingLatchExit(), canSplitCallSite(), CheckForCanReleaseCFGHazard(), llvm::CloneAndPruneIntoFromInst(), CloneLoopBlocks(), llvm::FunctionComparator::cmpBasicBlocks(), llvm::computePeelCount(), ComputePostOrders(), createCallInst(), createCast(), llvm::createCodeGenPreparePass(), llvm::createObjCARCOptPass(), llvm::OpenMPIRBuilder::CreateParallel(), llvm::createScalarizerPass(), llvm::createShadowStackGCLoweringPass(), createUnreachableSwitchDefault(), cse(), DeleteBasicBlock(), despeculateCountZeros(), llvm::PostDominatorTree::dominates(), llvm::GVNExpression::Expression::dump(), llvm::JumpThreadingPass::DuplicateCondBranchOnPHIIntoPred(), llvm::DuplicateInstructionsInSplitBetween(), eliminateDeadStores(), llvm::EliminateDuplicatePHINodes(), llvm::OpenMPIRBuilder::emitCancelationCheckImpl(), ensureValueAvailableInSuccessor(), eraseLifetimeMarkersOnInputs(), llvm::Evaluator::EvaluateFunction(), llvm::FastISel::fastEmitZExtFromI1(), llvm::FindAvailablePtrLoadStore(), llvm::objcarc::FindDependencies(), findIBRPredecessor(), findInitTrampolineFromBB(), llvm::CodeExtractor::findInputsOutputs(), FindLoopCounter(), llvm::CodeExtractor::findOrCreateBlockForHoisting(), findPHIToPartitionLoops(), llvm::SSAUpdaterTraits< SSAUpdater >::FindPredecessorBlocks(), findRetainForStoreStrongContraction(), firstNonDbg(), llvm::InnerLoopVectorizer::fixFirstOrderRecurrence(), fixPhis(), llvm::FoldBranchToCommonDest(), FoldCondBranchOnPHI(), llvm::FoldSingleEntryPHINodes(), FoldTwoEntryPHINode(), genLoopLimit(), llvm::Loop::getCanonicalInductionVariable(), llvm::MemoryDependenceResults::getDependency(), llvm::GetIfCondition(), getInductionVariable(), GetLocation(), getMemSetPatternValue(), getOrCreateDebugLoc(), getSign32(), llvm::MemoryDependenceResults::getSimplePointerDependencyFrom(), getSubprogram(), llvm::PPCTTIImpl::getUserCost(), llvm::SSAUpdater::GetValueInMiddleOfBlock(), HandleByValArgumentInit(), HandleCallsInBlockInlinedThroughInvoke(), hasProfileData(), hasUsesOutsideLoop(), llvm::hoistAllInstructionsInto(), INITIALIZE_PASS(), llvm::InlineFunction(), InsertRootInitializers(), InsertSafepointPoll(), insertSinCosCall(), instrumentMaskedLoadOrStore(), is_empty(), llvm::DenseMapInfo< ICVValue >::isEqual(), llvm::isGuaranteedToTransferExecutionToSuccessor(), IsIncrementNUW(), IsNonLocalValue(), isObjectDereferencedInBlock(), isOnlyReachableViaThisEdge(), isSafeToHoistInvoke(), llvm::isSafeToLoadUnconditionally(), isSafeToSpeculateStore(), isTrivialLoopExitBlock(), llvm::Value::isUsedInBasicBlock(), isZero(), llvm::IVUsers::IVUsers(), LLVMGetFirstInstruction(), LLVMGetLastInstruction(), LLVMGetPreviousInstruction(), llvm::log2(), makeStatepointExplicitImpl(), llvm::SparseSolver< LatticeKey, LatticeVal, KeyInfo >::MarkBlockExecutable(), MarkBlocksLiveIn(), memoryIsNotModifiedBetween(), llvm::MergeBasicBlockIntoOnlyPred(), mergeCleanupPad(), mergeEmptyReturnBlocks(), moveLCSSAPhis(), NegateValue(), normalizeForInvokeSafepoint(), operator new(), operator<<(), llvm::slpvectorizer::BoUpSLP::optimizeGatherSequence(), optimizeSQRT(), llvm::peelLoop(), performMaskedAtomicOp(), phis(), prepareICWorklistFromFunction(), ProcessBlock(), processInternalGlobal(), promoteMemoryToRegister(), promoteSingleBlockAlloca(), PushLoopPHIs(), reconnectPhis(), removeEmptyCleanup(), removePredecessor(), llvm::RemovePredecessorAndSimplify(), removeUndefIntroducingPredecessor(), replacePhiUsesWith(), replaceUsesOfWith(), RetagMask(), rewritePHINodesForExitAndUnswitchedBlocks(), RewriteUsesOfClonedInstructions(), scalarizeMaskedCompressStore(), shouldKeepInEntry(), SimplifyCondBranchToCondBranch(), llvm::InstCombiner::simplifyDivRemOfSelectWithZeroOp(), llvm::SimplifyInstructionsInBlock(), llvm::simplifyLoopIVs(), simplifyOneLoop(), llvm::JumpThreadingPass::SimplifyPartiallyRedundantLoad(), llvm::sinkRegion(), sizeWithoutDebug(), llvm::SplitBlock(), llvm::SplitBlockPredecessors(), splitCallSite(), llvm::SplitCriticalEdge(), StackMallocSizeClass(), llvm::JumpThreadingPass::ThreadEdge(), llvm::JumpThreadingPass::ThreadGuard(), llvm::JumpThreadingPass::ThreadThroughTwoBasicBlocks(), truncateIVUse(), tryToElideArgumentCopy(), tryToMoveFreeBeforeNullTest(), llvm::TryToSimplifyUncondBranchFromEmptyBlock(), llvm::JumpThreadingPass::TryToUnfoldSelectInCurrBB(), tryToVectorizeHorReductionOrInstOperands(), tryUnmergingGEPsAcrossIndirectBr(), llvm::JumpThreadingPass::UnfoldSelectInstr(), llvm::UnrollAndJamLoop(), llvm::UnrollLoop(), unswitchNontrivialInvariants(), updateForIncomingValueLocation(), UpdatePHINodes(), updatePhiNodes(), llvm::LoopVersioning::versionLoop(), llvm::InstVisitor< ObjectSizeOffsetVisitor, SizeOffsetType >::visit(), llvm::Interpreter::visitIndirectBrInst(), llvm::Interpreter::visitIntrinsicInst(), llvm::InstCombiner::visitPHINode(), and llvm::InstCombiner::visitStoreInst().
|
inline |
Definition at line 290 of file BasicBlock.h.
| bool BasicBlock::canSplitPredecessors | ( | ) | const |
Definition at line 356 of file BasicBlock.cpp.
References getFirstNonPHI(), and llvm::Instruction::isEHPad().
Referenced by canSplitCallSite(), canSplitPredecessors(), classof(), and llvm::SplitBlockPredecessors().
Methods for support type inquiry through isa, cast, and dyn_cast.
Definition at line 366 of file BasicBlock.h.
References canSplitPredecessors(), dropAllReferences(), llvm::Value::getValueID(), I, removePredecessor(), and splitBasicBlock().
|
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 Name.
Referenced by addBoundsChecking(), AddCalls(), assureFPCallStub(), canCreateThunkFor(), llvm::CloneBasicBlock(), llvm::CloneFunction(), llvm::OpenMPIRBuilder::CreateCopyinClauseBlocks(), llvm::OpenMPIRBuilder::CreateCritical(), llvm::MIRParserImpl::createDummyFunction(), llvm::createDwarfEHPass(), createEmptyFunction(), createFPFnStub(), createGuardBlocks(), llvm::createMemCpyLoopKnownSize(), llvm::createMemCpyLoopUnknownSize(), createMemMoveLoop(), createMemSetLoop(), CreatePrologue(), createResumeEntryBlock(), llvm::createSanitizerCtor(), createShallowWrapper(), createWrapper(), ehAwareSplitEdge(), llvm::orc::IRSpeculationLayer::emit(), llvm::OpenMPIRBuilder::emitCancelationCheckImpl(), llvm::CodeExtractor::findInputsOutputs(), llvm::SanitizerStatReport::finish(), firstNonDbg(), FitWeights(), FoldCondBranchOnPHI(), FunctionNumber(), getEmscriptenFunction(), getStrlenWithNull(), getTrueOrFalseValue(), INITIALIZE_PASS(), insertLifetimeMarkersSurroundingCall(), insertUniqueBackedgeBlock(), instrumentMaskedLoadOrStore(), LLVMAppendBasicBlockInContext(), LLVMCreateBasicBlockInContext(), LLVMInsertBasicBlockInContext(), llvm::orc::makeStub(), mayLoopAccessLocation(), needsRuntimeRegistrationOfSectionRange(), llvm::EscapeEnumerator::Next(), optimizeSQRT(), PerformHeapAllocSRoA(), performMaskedAtomicOp(), replaceUsesOfWith(), llvm::UnifyFunctionExitNodes::runOnFunction(), scaleWeights(), selectJumpTableArmEncoding(), shouldKeepInEntry(), SimplifyCondBranchToCondBranch(), llvm::sinkRegion(), splitBasicBlock(), llvm::SplitBlockAndInsertIfThen(), llvm::SplitBlockAndInsertIfThenElse(), llvm::SplitBlockPredecessors(), llvm::SplitCriticalEdge(), llvm::SplitLandingPadPredecessors(), splitRetconCoroutine(), SwitchToLookupTable(), llvm::JumpThreadingPass::ThreadEdge(), llvm::JumpThreadingPass::ThreadThroughTwoBasicBlocks(), llvm::JumpThreadingPass::UnfoldSelectInstr(), and unifyReturnBlockSet().
| 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 251 of file BasicBlock.cpp.
References llvm::User::dropAllReferences(), and I.
Referenced by classof(), llvm::Function::dropAllReferences(), and ~BasicBlock().
|
inline |
Definition at line 300 of file BasicBlock.h.
Referenced by llvm::DomTreeUpdater::callbackDeleteBB(), is_empty(), and phis().
|
inline |
Definition at line 291 of file BasicBlock.h.
Referenced by canRotateDeoptimizingLatchExit(), llvm::MemorySSAUpdater::changeToUnreachable(), llvm::changeToUnreachable(), CheckForCanReleaseCFGHazard(), llvm::CloneFunction(), llvm::FunctionComparator::cmpBasicBlocks(), llvm::ConvertDebugDeclareToDebugValue(), createCast(), llvm::OpenMPIRBuilder::CreateParallel(), cse(), DeleteBasicBlock(), detectPopcountIdiom(), detectShiftUntilZeroIdiom(), llvm::JumpThreadingPass::DuplicateCondBranchOnPHIIntoPred(), eliminateDeadStores(), llvm::OpenMPIRBuilder::emitCancelationCheckImpl(), llvm::objcarc::FindDependencies(), llvm::CodeExtractor::findOrCreateBlockForHoisting(), findSafeStoreForStoreStrongContraction(), first_use_of_in_block(), getFirstInsertionPt(), getInsertPt(), getMemSetPatternValue(), getSign32(), getTrueOrFalseValue(), llvm::PPCTTIImpl::getUserCost(), HandleCallsInBlockInlinedThroughInvoke(), llvm::objcarc::BottomUpPtrState::HandlePotentialUse(), hasProfileData(), llvm::hoistAllInstructionsInto(), INITIALIZE_PASS(), llvm::insertDebugValuesForPHIs(), InsertSafepointPoll(), llvm::isGuaranteedToTransferExecutionToSuccessor(), llvm::isInTailCallPosition(), isOnlyReachableViaThisEdge(), llvm::isPotentiallyReachable(), isSafeAndProfitableToSinkLoad(), isSafeToSpeculateStore(), llvm::Value::isUsedInBasicBlock(), isZero(), LLVMGetFirstInstruction(), LLVMGetLastInstruction(), LLVMGetNextInstruction(), LLVMPositionBuilder(), MarkBlocksLiveIn(), memoryIsNotModifiedBetween(), mergeConditionalStoreToAddress(), llvm::Instruction::moveBefore(), llvm::InjectorIRStrategy::mutate(), NegateValue(), llvm::RandomIRBuilder::newSource(), operator new(), OptimizeExtractBits(), llvm::slpvectorizer::BoUpSLP::optimizeGatherSequence(), passingValueIsAlwaysUndefined(), performMaskedAtomicOp(), prepareICWorklistFromFunction(), llvm::PrepareToSplitEntryBlock(), ProcessBlock(), promoteMemoryToRegister(), propagateMetadata(), reconnectPhis(), replacePhiUsesWith(), RetagMask(), RewriteUsesOfClonedInstructions(), scalarizeMaskedCompressStore(), llvm::IRBuilderBase::SetInsertPoint(), shouldInstrumentBlock(), llvm::SimplifyInstructionsInBlock(), llvm::JumpThreadingPass::SimplifyPartiallyRedundantLoad(), SinkCast(), sinkCmpExpression(), llvm::sinkRegion(), SinkShiftAndTruncate(), sizeWithoutDebug(), splitBasicBlock(), llvm::JumpThreadingPass::ThreadEdge(), llvm::JumpThreadingPass::ThreadThroughTwoBasicBlocks(), TryToSinkInstruction(), tryToVectorizeHorReductionOrInstOperands(), tryUnmergingGEPsAcrossIndirectBr(), unswitchTrivialBranch(), and llvm::InstVisitor< ObjectSizeOffsetVisitor, SizeOffsetType >::visit().
|
inline |
Definition at line 292 of file BasicBlock.h.
| iplist< BasicBlock >::iterator BasicBlock::eraseFromParent | ( | ) |
Unlink 'this' from the containing function and delete it.
Definition at line 127 of file BasicBlock.cpp.
References llvm::iplist_impl< IntrusiveListT, TraitsT >::erase(), llvm::Function::getBasicBlockList(), llvm::ilist_node_impl< ilist_detail::compute_node_options< BasicBlock, Options... >::type >::getIterator(), and getParent().
Referenced by llvm::CloneAndPruneIntoFromInst(), createCast(), llvm::createCodeGenPreparePass(), llvm::OpenMPIRBuilder::CreateCritical(), DeleteBasicBlock(), deleteDeadBlocksFromLoop(), despeculateCountZeros(), llvm::OpenMPIRBuilder::finalize(), getFirstInsertionPt(), llvm::InlineFunction(), isCleanupBlockEmpty(), llvm::MergeBasicBlockIntoOnlyPred(), mergeCleanupPad(), mergeEmptyReturnBlocks(), removeEmptyCleanup(), llvm::TryToSimplifyUncondBranchFromEmptyBlock(), and unifyReturnBlockSet().
|
inline |
Definition at line 301 of file BasicBlock.h.
Referenced by calculateStateNumbersForInvokes(), llvm::AAResults::canBasicBlockModify(), llvm::Attributor::checkForAllReadWriteInstructions(), llvm::CloneAndPruneFunctionInto(), llvm::CloneAndPruneIntoFromInst(), cloneInstructionInExitBlock(), llvm::createAArch64StackTaggingPass(), llvm::SSAUpdaterTraits< SSAUpdater >::CreateEmptyPHI(), createFFSIntrinsic(), createPHIsForSplitLoopExit(), CreatePrologue(), createRetPHINode(), createUnreachableSwitchDefault(), llvm::DemotePHIToStack(), llvm::DemoteRegToStack(), despeculateCountZeros(), detectShiftUntilZeroIdiom(), llvm::GVNExpression::Expression::dump(), eliminateDeadStores(), ensureValueAvailableInSuccessor(), llvm::CodeExtractor::findInputsOutputs(), findLocationForEntrySafepoint(), firstNonDbg(), getConstrainedOpcode(), llvm::MustBeExecutedContextExplorer::getMustBeExecutedNextInstruction(), llvm::SCEVExpander::getOrInsertCanonicalInductionVariable(), GetRMWLibcall(), getSuccState(), getTrueOrFalseValue(), llvm::SSAUpdater::GetValueInMiddleOfBlock(), INITIALIZE_PASS(), llvm::InlineFunction(), insertLifetimeMarkersSurroundingCall(), insertSpills(), insertTrivialPHIs(), instrumentMaskedLoadOrStore(), IsIncrementNUW(), isLoadConditional(), isOnlyReachableViaThisEdge(), isProfitableForVectorization(), isSafeToExecuteUnconditionally(), isSafeToPromoteArgument(), isSuspendBlock(), isTrivialLoopExitBlock(), isZero(), MarkBlocksLiveIn(), llvm::MergeBlockIntoPredecessor(), mergeCleanupPad(), mergeEmptyReturnBlocks(), llvm::moveInstructionsToTheEnd(), llvm::JumpThreadingPass::ProcessBranchOnXOR(), promoteSingleBlockAlloca(), llvm::removeAllNonTerminatorAndEHPadInstructions(), removePredecessor(), llvm::RemovePredecessorAndSimplify(), rewritePHIs(), llvm::UnifyFunctionExitNodes::runOnFunction(), SimplifyCondBranchToCondBranch(), llvm::JumpThreadingPass::SimplifyPartiallyRedundantLoad(), llvm::SplitEdge(), StackMallocSizeClass(), truncateIVUse(), llvm::TryToSimplifyUncondBranchFromEmptyBlock(), unswitchTrivialSwitch(), llvm::SelectionDAGBuilder::UpdateSplitBlock(), llvm::LoopVersioning::versionLoop(), and llvm::InstCombiner::visitStoreInst().
|
inline |
Definition at line 302 of file BasicBlock.h.
| 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 Prefetch::addInstruction(), AddRuntimeUnrollDisableMetaData(), allPredecessorsComeFromSameSource(), llvm::LoopVersioning::annotateInstWithNoAlias(), llvm::SwitchInstProfUpdateWrapper::buildProfBranchWeightsMD(), calcArraySize(), llvm::DomTreeUpdater::callbackDeleteBB(), llvm::CloneBasicBlock(), llvm::CloneFunction(), llvm::ConstantFoldTerminator(), llvm::CallBrInst::Create(), llvm::createMemCpyLoopKnownSize(), llvm::createMemCpyLoopUnknownSize(), createStringMetadata(), DisableAllLoopOptsOnLoop(), ehAwareSplitEdge(), llvm::emitBCmp(), llvm::emitCalloc(), llvm::OpenMPIRBuilder::emitCancelationCheckImpl(), llvm::emitFWrite(), llvm::emitMalloc(), llvm::emitMemChr(), llvm::emitMemCmp(), llvm::emitMemCpyChk(), llvm::emitStrLen(), llvm::emitStrNCmp(), equalityPropUnSafe(), eraseDeadBBsAndChildren(), llvm::CodeExtractor::findInputsOutputs(), FitWeights(), llvm::AMDGPULibCalls::fold(), FoldCondBranchOnPHI(), getMinAnalyzeableBackedgeTakenCount(), hasAllGatScatUsers(), INITIALIZE_PASS(), insertCall(), insertUniqueBackedgeBlock(), llvm::PPCTTIImpl::isHardwareLoopProfitable(), isOnlyReachableViaThisEdge(), isTrivialLoopExitBlock(), llvm::MergeBasicBlockIntoOnlyPred(), llvm::MemorySSA::moveTo(), optimizeMemCmpConstantSize(), optimizeSQRT(), llvm::parseWidenableBranch(), patchAndReplaceAllUsesWith(), PerformHeapAllocSRoA(), llvm::LoopVersioning::prepareNoAliasMetadata(), llvm::JumpThreadingPass::ProcessBranchOnXOR(), llvm::IRCEPass::run(), llvm::runIPSCCP(), scaleWeights(), llvm::LoopVectorizeHints::setAlreadyVectorized(), setBranchWeights(), llvm::Loop::setLoopAlreadyUnrolled(), SimplifyCondBranchToCondBranch(), llvm::sinkRegion(), splitBasicBlock(), llvm::SplitBlockAndInsertIfThen(), llvm::SplitBlockAndInsertIfThenElse(), llvm::SplitBlockPredecessors(), llvm::SplitLandingPadPredecessors(), llvm::JumpThreadingPass::ThreadEdge(), llvm::JumpThreadingPass::ThreadThroughTwoBasicBlocks(), llvm::TryToSimplifyUncondBranchFromEmptyBlock(), llvm::JumpThreadingPass::UnfoldSelectInstr(), llvm::UnreachableInst::UnreachableInst(), updatePredecessorProfileMetadata(), and ~BasicBlock().
| 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 241 of file BasicBlock.cpp.
References end(), getFirstNonPHI(), and llvm::ilist_node_impl< OptionsT >::getIterator().
Referenced by cheapToScalarize(), cloneInstructionInExitBlock(), llvm::ConvertDebugDeclareToDebugValue(), ConvertToSInt(), llvm::OpenMPIRBuilder::CreateCritical(), llvm::OpenMPIRBuilder::CreateParallel(), llvm::DemoteRegToStack(), llvm::GVNExpression::Expression::dump(), eraseDeadBBsAndChildren(), llvm::SCEVExpander::expandCodeFor(), findInsertPointAfter(), llvm::InnerLoopVectorizer::fixFirstOrderRecurrence(), llvm::InnerLoopVectorizer::fixReduction(), foldGuardedRotateToFunnelShift(), genLoopLimit(), getFirstInsertionPt(), getFirstNonPHIOrDbgOrLifetime(), getInsertPt(), getOrCreateDebugLoc(), GetPointerOperand(), getRetComponentType(), getScalarIntrinsicDeclaration(), llvm::objcarc::BottomUpPtrState::HandlePotentialUse(), hasUsesOutsideLoop(), llvm::insertDebugValuesForPHIs(), insertSpills(), instrumentMaskedLoadOrStore(), llvm::invertCondition(), llvm::DenseMapInfo< ICVValue >::isEqual(), IsInterestingCmp(), isPromotedResultSafe(), makeStatepointExplicitImpl(), MarkBlocksLiveIn(), mergeConditionalStoreToAddress(), llvm::InjectorIRStrategy::mutate(), llvm::InstDeleterIRStrategy::mutate(), llvm::RandomIRBuilder::newSink(), llvm::RandomIRBuilder::newSource(), OptimizeExtractBits(), false::LibCallsShrinkWrap::perform(), llvm::SCEVExpander::replaceCongruentIVs(), replaceExtractElements(), rewriteMaterializableInstructions(), llvm::InstCombiner::run(), llvm::salvageKnowledge(), shouldInstrumentBlock(), simplifyRelocatesOffABase(), SinkCast(), sinkCmpExpression(), SinkShiftAndTruncate(), llvm::SplitLandingPadPredecessors(), llvm::JumpThreadingPass::ThreadGuard(), truncateIVUse(), TryToSinkInstruction(), tryUnmergingGEPsAcrossIndirectBr(), llvm::sroa::AllocaSliceRewriter::visit(), llvm::InstCombiner::visitGetElementPtrInst(), llvm::ObjectSizeOffsetEvaluator::visitPHINode(), llvm::InstCombiner::visitStoreInst(), and llvm::InnerLoopVectorizer::widenPHIInstruction().
|
inline |
Definition at line 188 of file BasicBlock.h.
References eraseFromParent(), getFirstInsertionPt(), getSinglePredecessor(), insertInto(), instructionsWithoutDebug(), moveAfter(), moveBefore(), removeFromParent(), and sizeWithoutDebug().
| 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 214 of file BasicBlock.cpp.
References I.
Referenced by llvm::MachineFunction::addLandingPad(), llvm::calculateClrEHStateNumbers(), calculateStateNumbersForInvokes(), llvm::calculateWasmEHInfo(), CanGenerateTest(), canSplitPredecessors(), canSplitPredecessors(), CloneLoopBlocks(), llvm::colorEHFunclets(), ConnectEpilog(), ConnectProlog(), createCallInst(), llvm::createMemCpyLoopKnownSize(), llvm::OpenMPIRBuilder::CreateParallel(), createPHIsForSplitLoopExit(), detectPopcountIdiom(), detectShiftUntilZeroIdiom(), ehAwareSplitEdge(), eraseDeadBBsAndChildren(), llvm::CodeExtractor::findInputsOutputs(), llvm::CodeExtractor::findOrCreateBlockForHoisting(), findUnwindDestinations(), findWasmUnwindDestinations(), fixPhis(), getEmscriptenFunction(), getFirstInsertionPt(), getFirstNonPHI(), getIdentityValueForAtomicOp(), getJumpThreadDuplicationCost(), getLandingPadInst(), getNumElements(), getOrCreateDebugLoc(), getParentPad(), GetPointerOperand(), getSuccPad(), getSuccState(), getTerminatingMustTailCall(), getUnwindDestTokenHelper(), llvm::SSAUpdater::GetValueInMiddleOfBlock(), HandleInlinedEHPad(), hoist(), llvm::InlineFunction(), llvm::insertDebugValuesForPHIs(), insertSpills(), isAtomic(), isCleanupBlockEmpty(), llvm::isDereferenceableAndAlignedInLoop(), isEHPad(), isLandingPad(), isProfitableForVectorization(), isWrapperOnlyCall(), mapWasmLandingPadIndex(), markAliveBlocks(), moveLCSSAPhis(), relocationViaAlloca(), removeEmptyCleanup(), replaceAllUsesOfWithIn(), rewritePHIs(), llvm::IRTranslator::runOnMachineFunction(), SimplifyCondBranchToCondBranch(), llvm::SplitLandingPadPredecessors(), TypeSizeToSizeIndex(), llvm::UnrollRuntimeLoopRemainder(), and llvm::sroa::AllocaSliceRewriter::visit().
|
inline |
Definition at line 162 of file BasicBlock.h.
References getFirstNonPHI(), and getFirstNonPHIOrDbg().
| const Instruction * BasicBlock::getFirstNonPHIOrDbg | ( | ) | const |
Returns a pointer to the first instruction in this block that is not a PHINode or a debug intrinsic.
Definition at line 221 of file BasicBlock.cpp.
References I.
Referenced by llvm::createCodeGenPreparePass(), createUnreachableSwitchDefault(), doCallSiteSplitting(), eliminateDeadSwitchCases(), eliminateSwiftErrorArgument(), FindPHIForConditionForwarding(), firstNonDbg(), FoldTwoEntryPHINode(), llvm::IRTranslator::getAnalysisUsage(), getFirstNonPHI(), getFirstNonPHIOrDbg(), InitializeUniqueCases(), llvm::SimpleLoopSafetyInfo::isGuaranteedToExecute(), isIgnorableInst(), isPredicatedOnPHI(), mergeCleanupPad(), llvm::moveInstructionsToTheBeginning(), replaceSwiftErrorOps(), llvm::SplitBlockPredecessors(), SwitchToLookupTable(), tryToElideArgumentCopy(), TryToMergeLandingPad(), and llvm::InstCombiner::visitAllocaInst().
|
inline |
Definition at line 170 of file BasicBlock.h.
References getFirstNonPHIOrDbg(), and getFirstNonPHIOrDbgOrLifetime().
| const Instruction * BasicBlock::getFirstNonPHIOrDbgOrLifetime | ( | ) | const |
Returns a pointer to the first instruction in this block that is not a PHINode, a debug intrinsic, or a lifetime intrinsic.
Definition at line 228 of file BasicBlock.cpp.
References I, and llvm::Instruction::isLifetimeStartOrEnd().
Referenced by getFirstNonPHIOrDbg(), getFirstNonPHIOrDbgOrLifetime(), GetSortedValueDataFromCallTargets(), shouldInstrumentBlock(), simplifyTerminatorLeadingToRet(), and llvm::SplitCriticalEdge().
|
inline |
Definition at line 178 of file BasicBlock.h.
References getFirstInsertionPt(), and getFirstNonPHIOrDbgOrLifetime().
|
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 354 of file BasicBlock.h.
Referenced by assertBranchOrSelectConditionHoisted(), calcArraySize(), llvm::DomTreeUpdater::callbackDeleteBB(), llvm::changeToInvokeAndSplitBasicBlock(), llvm::changeToUnreachable(), llvm::CloneAndPruneIntoFromInst(), llvm::CloneBasicBlock(), llvm::CloneFunction(), cloneInstructionInExitBlock(), llvm::JumpThreadingPass::CloneInstructions(), llvm::UnaryOperator::Create(), llvm::BinaryOperator::Create(), createMalloc(), llvm::JumpThreadingPass::DuplicateCondBranchOnPHIIntoPred(), llvm::Instruction::eraseFromParent(), firstNonDbg(), llvm::FoldBranchToCommonDest(), FoldCondBranchOnPHI(), llvm::FoldReturnIntoUncondBranch(), FunctionNumber(), getOrCreateDebugLoc(), llvm::hoistAllInstructionsInto(), llvm::InlineFunction(), llvm::Instruction::insertAfter(), llvm::Instruction::insertBefore(), llvm::IRBuilderDefaultInserter::InsertHelper(), insertLifetimeMarkersSurroundingCall(), llvm::InstCombiner::InsertNewInstBefore(), insertUniqueBackedgeBlock(), llvm::Instruction::Instruction(), isSafeToHoistInvoke(), isSafeToSpeculateStore(), llvm::MergeBasicBlockIntoOnlyPred(), moveBBContents(), llvm::Instruction::moveBefore(), false::LibCallsShrinkWrap::perform(), llvm::Instruction::removeFromParent(), llvm::ReplaceInstWithInst(), llvm::InstCombiner::run(), llvm::UnifyFunctionExitNodes::runOnFunction(), splitBasicBlock(), llvm::SplitLandingPadPredecessors(), llvm::TryToSimplifyUncondBranchFromEmptyBlock(), llvm::UnrollLoop(), unswitchTrivialBranch(), updateForIncomingValueLocation(), and llvm::InstCombiner::visitGetElementPtrInst().
|
inline |
Definition at line 355 of file BasicBlock.h.
| Optional< uint64_t > BasicBlock::getIrrLoopHeaderWeight | ( | ) | const |
Definition at line 457 of file BasicBlock.cpp.
References llvm::StringRef::equals(), llvm::Instruction::getMetadata(), llvm::MDString::getString(), and getTerminator().
Referenced by getLandingPadInst().
| const LandingPadInst * BasicBlock::getLandingPadInst | ( | ) | const |
Return the landingpad instruction associated with the landing pad.
Definition at line 453 of file BasicBlock.cpp.
References llvm::dyn_cast(), and getFirstNonPHI().
Referenced by getLandingPadInst(), getParentPad(), isEHPad(), isTrivialLoopExitBlock(), MarkBlocksLiveIn(), and llvm::SplitLandingPadPredecessors().
|
inline |
Definition at line 439 of file BasicBlock.h.
References getIrrLoopHeaderWeight(), getLandingPadInst(), and isLegalToHoistInto().
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 146 of file BasicBlock.cpp.
References getParent(), and llvm::GlobalValue::getParent().
Referenced by Prefetch::addInstruction(), llvm::addRuntimeChecks(), buildNonAtomicBinOp(), callAppendArgs(), callAppendStringN(), callPrintfBegin(), CanProveNotTakenFirstIteration(), llvm::CloneFunction(), computeAllocaDefaultAlign(), computeLoadStoreDefaultAlign(), llvm::IRBuilderBase::CreateAlignedLoad(), llvm::IRBuilderBase::CreateAlignedStore(), llvm::IRBuilderBase::CreateAlloca(), CreateAssert(), llvm::IRBuilderBase::CreateAtomicCmpXchg(), llvm::IRBuilderBase::CreateAtomicRMW(), llvm::IRBuilderBase::CreateBinaryIntrinsic(), llvm::IRBuilderBase::CreateIntrinsic(), llvm::IRBuilderBase::CreateUnaryIntrinsic(), llvm::InnerLoopVectorizer::createVectorizedLoopSkeleton(), llvm::JumpThreadingPass::DuplicateCondBranchOnPHIIntoPred(), eliminateDeadStores(), emitBinaryFloatFnCallHelper(), llvm::emitCalloc(), llvm::emitFPutC(), llvm::emitFPutS(), llvm::emitFWrite(), emitLibCall(), llvm::emitMalloc(), llvm::emitMemCpyChk(), llvm::emitPutChar(), llvm::emitPutS(), llvm::InnerLoopVectorizer::emitSCEVChecks(), emitUnaryFloatFnCallHelper(), llvm::LazyValueInfo::eraseBlock(), llvm::FindAvailablePtrLoadStore(), FindLoopCounter(), findPHIToPartitionLoops(), llvm::InnerLoopVectorizer::fixupIVUsers(), llvm::LazyValueInfo::getConstant(), llvm::LazyValueInfo::getConstantOnEdge(), llvm::LazyValueInfo::getConstantRange(), llvm::LazyValueInfo::getConstantRangeOnEdge(), getEdgeValueLocal(), getEmscriptenFunction(), getMinAnalyzeableBackedgeTakenCount(), llvm::Instruction::getModule(), getModule(), getNumElements(), llvm::InnerLoopVectorizer::getOrCreateTripCount(), getParent(), GetPointerOperand(), llvm::LazyValueInfo::getPredicateOnEdge(), llvm::getPtrStride(), llvm::MemoryDependenceResults::getSimplePointerDependencyFrom(), llvm::SSAUpdater::GetValueInMiddleOfBlock(), isIgnorableInst(), isLoadConditional(), isObjectDereferencedInBlock(), llvm::LoopAccessInfo::isUniform(), mayLoopAccessLocation(), llvm::MemoryDepChecker::Dependence::print(), llvm::printLoop(), llvm::JumpThreadingPass::ProcessBlock(), llvm::JumpThreadingPass::ProcessImpliedCondition(), llvm::promoteLoopAccessesToScalars(), ReduceLoopStrength(), replaceUsesOfWith(), llvm::LoopRotatePass::run(), llvm::IndVarSimplifyPass::run(), llvm::LoopIdiomRecognizePass::run(), llvm::simplifyCFG(), llvm::SimplifyInstructionsInBlock(), llvm::simplifyLoopAfterUnroll(), simplifyLoopInst(), simplifyOneLoop(), llvm::LazyValueInfo::threadEdge(), llvm::JumpThreadingPass::ThreadGuard(), tryToVectorizeHorReductionOrInstOperands(), llvm::UnrollRuntimeLoopRemainder(), llvm::LoopVersioning::versionLoop(), llvm::InnerLoopVectorizer::widenIntOrFpInduction(), and llvm::InnerLoopVectorizer::widenPHIInstruction().
|
inline |
Definition at line 115 of file BasicBlock.h.
References getModule(), getTerminator(), and LLVM_READONLY.
Return the enclosing method, or null if none.
Definition at line 107 of file BasicBlock.h.
Referenced by Prefetch::addInstruction(), addNoRecurseAttrsTopDown(), AddReturnAttributes(), llvm::DDGBuilder::areNodesMergeable(), calculateCXXStateNumbers(), calculateSEHStateNumbers(), callIntrinsic(), canFoldIVIncExpr(), CanGenerateTest(), castToIncrementInst(), CC_MipsO32_FP64(), llvm::changeToUnreachable(), llvm::Attributor::checkForAllReadWriteInstructions(), llvm::CloneFunction(), CloneLoopBlocks(), cloneLoopBlocks(), llvm::cloneLoopWithPreheader(), llvm::CodeMetrics::collectEphemeralValues(), combineADDToMAT_PCREL_ADDR(), CompareValueComplexity(), computeAllocaDefaultAlign(), llvm::LoopSafetyInfo::computeBlockColors(), llvm::computeConstantRange(), computeKnownBitsFromAssume(), computeLoadStoreDefaultAlign(), llvm::computePeelCount(), llvm::computeUnrollCount(), llvm::ConstantFoldTerminator(), copyMustTailReturn(), llvm::SanitizerStatReport::create(), llvm::createArgumentPromotionPass(), llvm::IRBuilderBase::CreateAssumption(), llvm::OpenMPIRBuilder::CreateCopyinClauseBlocks(), llvm::OpenMPIRBuilder::CreateCritical(), llvm::IRBuilderBase::CreateElementUnorderedAtomicMemCpy(), llvm::IRBuilderBase::CreateElementUnorderedAtomicMemMove(), llvm::IRBuilderBase::CreateElementUnorderedAtomicMemSet(), llvm::IRBuilderBase::CreateFAddReduce(), createFFSIntrinsic(), llvm::IRBuilderBase::CreateFMulReduce(), llvm::IRBuilderBase::CreateGCRelocate(), llvm::IRBuilderBase::CreateGCResult(), CreateGCStatepointCallCommon(), CreateGCStatepointInvokeCommon(), llvm::IRBuilderBase::CreateGlobalString(), llvm::IRBuilderBase::CreateInvariantStart(), llvm::IRBuilderBase::CreateLaunderInvariantGroup(), llvm::IRBuilderBase::CreateLifetimeEnd(), llvm::IRBuilderBase::CreateLifetimeStart(), llvm::createLoopDeletionPass(), llvm::IRBuilderBase::CreateMaskedStore(), llvm::IRBuilderBase::CreateMemCpy(), llvm::IRBuilderBase::CreateMemCpyInline(), llvm::createMemCpyLoopKnownSize(), llvm::createMemCpyLoopUnknownSize(), llvm::IRBuilderBase::CreateMemMove(), createMemMoveLoop(), llvm::IRBuilderBase::CreateMemSet(), createMemSetLoop(), llvm::OpenMPIRBuilder::CreateParallel(), createPopcntIntrinsic(), llvm::IRBuilderBase::CreatePreserveArrayAccessIndex(), llvm::IRBuilderBase::CreatePreserveStructAccessIndex(), llvm::IRBuilderBase::CreatePreserveUnionAccessIndex(), llvm::createScalarizerPass(), llvm::IRBuilderBase::CreateStripInvariantGroup(), llvm::createSVEIntrinsicOptsPass(), DeleteBasicBlock(), deleteDeadInstruction(), llvm::DemotePHIToStack(), llvm::DemoteRegToStack(), despeculateCountZeros(), DisableAllLoopOptsOnLoop(), llvm::InstCombiner::dominatesAllUses(), ehAwareSplitEdge(), eliminateDeadStores(), llvm::orc::IRSpeculationLayer::emit(), llvm::AArch64TargetLowering::emitAtomicCmpXchgNoStoreLLBalance(), llvm::ARMTargetLowering::emitAtomicCmpXchgNoStoreLLBalance(), llvm::OpenMPIRBuilder::emitCancelationCheckImpl(), llvm::HexagonTargetLowering::emitLoadLinked(), llvm::AArch64TargetLowering::emitLoadLinked(), llvm::ARMTargetLowering::emitLoadLinked(), llvm::InnerLoopVectorizer::emitMemRuntimeChecks(), llvm::InnerLoopVectorizer::emitSCEVChecks(), llvm::HexagonTargetLowering::emitStoreConditional(), llvm::AArch64TargetLowering::emitStoreConditional(), llvm::ARMTargetLowering::emitStoreConditional(), llvm::PPCTargetLowering::emitTrailingFence(), enableCallSafepoints(), equalityPropUnSafe(), eraseDeadBBsAndChildren(), eraseFromParent(), llvm::CodeExtractor::extractCodeRegion(), llvm::CodeExtractor::findAllocas(), llvm::MustBeExecutedContextExplorer::findBackwardJoinPoint(), llvm::findDevirtualizableCallsForTypeTest(), llvm::MustBeExecutedContextExplorer::findForwardJoinPoint(), llvm::CodeExtractor::findInputsOutputs(), llvm::SwitchCG::SwitchLowering::findJumpTables(), findLIVLoopCondition(), findUnwindDestinations(), firstNonDbg(), FitWeights(), llvm::AMDGPULibCalls::fold(), FoldCondBranchOnPHI(), llvm::formLCSSAForInstructions(), llvm::gatherUnrollingPreferences(), generateUnsignedDivisionCode(), llvm::BlockAddress::get(), llvm::CallBase::getCaller(), getComparePred(), llvm::IRBuilderBase::getCurrentFunctionReturnType(), getDebugLocString(), getDefaultInlineAdvice(), llvm::TargetLoweringBase::getDefaultSafeStackPointerLocation(), llvm::MemoryDependenceResults::getDependency(), getEmscriptenFunction(), llvm::BasicTTIImplBase< AMDGPUTTIImpl >::getEstimatedNumberOfCaseClusters(), llvm::Trace::getFunction(), llvm::Instruction::getFunction(), llvm::ValueEnumerator::getGlobalBasicBlockID(), getInnermostLoopFor(), llvm::TargetLoweringBase::getIRStackGuard(), llvm::VNCoercion::getLoadLoadClobberFullWidthSize(), GetLocation(), getMaxWidenStepsOpts(), llvm::ARMTTIImpl::getMemcpyCost(), getModule(), getOrCreateDebugLoc(), getOrInsertValueProfilingCall(), getParameterABIAttributes(), getParentPad(), getPointerOperands(), llvm::getPtrStride(), getReductionIntrinsic(), llvm::TargetLoweringBase::getSafeStackPointerLocation(), llvm::MemoryDependenceResults::getSimplePointerDependencyFrom(), getSubprogram(), llvm::HexagonTargetLowering::getTgtMemIntrinsic(), getTrueOrFalseValue(), llvm::AMDGPUTTIImpl::getUnrollingPreferences(), llvm::ARMTTIImpl::getUnrollingPreferences(), getValueSymbolTable(), getVarName(), HandleInlinedEHPad(), HandleInlinedLandingPad(), handlePhiDef(), hasProfileData(), INITIALIZE_PASS(), llvm::InlineFunction(), llvm::DivergenceAnalysis::inRegion(), insertCall(), llvm::insertDebugValuesForPHIs(), insertLifetimeMarkersSurroundingCall(), InsertSafepointPoll(), insertSinCosCall(), insertSpills(), instrumentMaskedLoadOrStore(), llvm::isAllocaPromotable(), isCallPromotable(), llvm::CaptureTracker::isDereferenceableOrNull(), llvm::CodeExtractor::isEligible(), llvm::DenseMapInfo< ICVValue >::isEqual(), isExplicitVecOuterLoop(), llvm::SelectionDAGBuilder::isExportableFromCurrentBlock(), isIgnorableInst(), llvm::isInTailCallPosition(), isLoadConditional(), llvm::ScalarEvolution::isLoopBackedgeGuardedByCond(), llvm::ScalarEvolution::isLoopEntryGuardedByCond(), IsMasked(), IsNonLocalValue(), isNotUsedOrFreeInLoop(), isNoWrap(), isObjectDereferencedInBlock(), isOnlyReachableViaThisEdge(), isPointerValueDeadOnEntryToFunction(), llvm::isPotentiallyReachable(), isPromotedInstructionLegal(), llvm::RecurrenceDescriptor::isReductionPHI(), isReportingError(), llvm::AllocaInst::isStaticAlloca(), llvm::TargetLoweringBase::isSuitableForJumpTable(), llvm::isTLIScalarize(), isTrivialLoopExitBlock(), llvm::AMDGPULibCalls::isUnsafeMath(), isValidCandidateForColdCC(), isZero(), LLVMGetNextBasicBlock(), LLVMGetPreviousBasicBlock(), LLVMInsertBasicBlockInContext(), LLVMInsertExistingBasicBlockAfterInsertBlock(), llvm::BlockAddress::lookup(), llvm::SelectionDAGBuilder::LowerCallTo(), LowerRotate(), llvm::ARMTargetLowering::makeDMB(), llvm::AMDGPUSubtarget::makeLIDRangeMetadata(), llvm::SITargetLowering::mayBeEmittedAsTailCall(), maybeEndlessLoop(), maybePrintComdat(), mayLoopAccessLocation(), memoryIsNotModifiedBetween(), llvm::MergeBasicBlockIntoOnlyPred(), mergeCleanupPad(), moveAfter(), moveBefore(), moveLCSSAPhis(), needsRuntimeRegistrationOfSectionRange(), NegateValue(), optimizeSQRT(), llvm::peelLoop(), PerformHeapAllocSRoA(), performMaskedAtomicOp(), placeSplitBlockCarefully(), populateWorklist(), llvm::PrepareToSplitEntryBlock(), llvm::LegacyDivergenceAnalysis::print(), llvm::MemoryDepChecker::Dependence::print(), llvm::Value::print(), printIRBlockReference(), llvm::LazyValueInfo::printLVI(), llvm::JumpThreadingPass::ProcessBlock(), llvm::LoopVectorizePass::processLoop(), processLoopInVPlanNativePath(), promoteArguments(), promoteSingleBlockAlloca(), ReduceLoopStrength(), llvm::AssumptionCache::registerAssumption(), removeFromParent(), removeUndefIntroducingPredecessor(), replaceAllUsesOfWithIn(), replaceConstantExprOp(), replaceExtractElements(), replaceUsesOfWith(), reportLoadElim(), RetagMask(), llvm::SSAUpdaterBulk::RewriteAllUses(), llvm::GCNTTIImpl::rewriteIntrinsicWithAddressSpace(), RewriteUsesOfClonedInstructions(), llvm::IRCEPass::run(), llvm::LoopAccessInfoPrinterPass::run(), llvm::LoopPredicationPass::run(), llvm::LoopRotatePass::run(), llvm::IndVarSimplifyPass::run(), llvm::LoopDeletionPass::run(), llvm::LoopIdiomRecognizePass::run(), llvm::HWAddressSanitizerPass::run(), llvm::LoopFullUnrollPass::run(), llvm::LICMPass::run(), llvm::SimpleLoopUnswitchPass::run(), llvm::LoopCachePrinterPass::run(), llvm::DDGAnalysis::run(), llvm::IVUsersWrapperPass::runOnLoop(), scaleWeights(), llvm::IRBuilderBase::setConstrainedFPFunctionAttr(), llvm::setProfMetadata(), llvm::AArch64TTIImpl::shouldConsiderAddressTypePromotion(), shouldConvert(), llvm::ARMTTIImpl::shouldFavorBackedgeIndex(), ShrinkDemandedConstant(), SimplifyCondBranchToCondBranch(), simplifyLoopInst(), simplifyRelocatesOffABase(), sinkLifetimeStartMarkers(), sinkLoopInvariantInstructions(), llvm::sinkRegion(), llvm::LoopPass::skipLoop(), splitBasicBlock(), llvm::SplitBlockAndInsertIfThen(), llvm::SplitBlockAndInsertIfThenElse(), llvm::fuzzerop::splitBlockDescriptor(), llvm::SplitBlockPredecessors(), llvm::SplitCriticalEdge(), llvm::SplitLandingPadPredecessors(), SwitchToLookupTable(), llvm::JumpThreadingPass::ThreadEdge(), llvm::JumpThreadingPass::ThreadThroughTwoBasicBlocks(), TryToMergeLandingPad(), llvm::TryToSimplifyUncondBranchFromEmptyBlock(), llvm::JumpThreadingPass::TryToUnfoldSelectInCurrBB(), tryToUnrollAndJamLoop(), tryToUnrollLoop(), TypeSizeToSizeIndex(), llvm::JumpThreadingPass::UnfoldSelectInstr(), llvm::UnrollAndJamLoop(), llvm::UnrollLoop(), llvm::UnrollRuntimeLoopRemainder(), unswitchBestCondition(), UpdateAnalysisInformation(), updateOperand(), useFuncSeen(), UseTlsOffset(), llvm::InstCombiner::visitAllocaInst(), llvm::InstCombiner::visitCallInst(), llvm::InstCombiner::visitLandingPadInst(), llvm::InnerLoopVectorizer::widenCallInstruction(), ~BasicBlock(), and ExpandedValuesCleaner::~ExpandedValuesCleaner().
|
inline |
Definition at line 108 of file BasicBlock.h.
References getModule().
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 202 of file BasicBlock.cpp.
References getTerminatingDeoptimizeCall(), getUniqueSuccessor(), and llvm::SmallPtrSetImpl< PtrType >::insert().
Referenced by canRotateDeoptimizingLatchExit(), getMinAnalyzeableBackedgeTakenCount(), getPostdominatingDeoptimizeCall(), and getTerminatingDeoptimizeCall().
|
inline |
Definition at line 141 of file BasicBlock.h.
References getPostdominatingDeoptimizeCall(), and getTerminatingMustTailCall().
| const BasicBlock * BasicBlock::getSinglePredecessor | ( | ) | const |
Return the predecessor of this block if it has a single predecessor block.
If this basic block has a single predecessor block, return the block, otherwise return a null pointer.
Otherwise return a null pointer.
Definition at line 258 of file BasicBlock.cpp.
References E, llvm::pred_begin(), and llvm::pred_end().
Referenced by allPredecessorsComeFromSameSource(), assertBranchOrSelectConditionHoisted(), CanGenerateTest(), CanPropagatePredecessorsForPHIs(), CanProveNotTakenFirstIteration(), canRotateDeoptimizingLatchExit(), canSafelyUnrollMultiExitLoop(), llvm::CloneAndPruneIntoFromInst(), llvm::collectCmpOps(), createCallInst(), llvm::createCodeGenPreparePass(), detectShiftUntilZeroIdiom(), llvm::DominatorTree::dominates(), llvm::VPlan::dump(), llvm::JumpThreadingPass::EvaluateOnPredecessorEdge(), llvm::VPPredInstPHIRecipe::execute(), FindPHIForConditionForwarding(), FindWidenableTerminatorAboveLoop(), llvm::FoldBranchToCommonDest(), foldICmpWithDominatingICmp(), getDomPredecessorCondition(), getFirstInsertionPt(), llvm::GetIfCondition(), getSinglePredecessor(), handlePhiDef(), llvm::ScalarEvolution::isLoopBackedgeGuardedByCond(), IsMasked(), isOnlyReachableViaThisEdge(), llvm::isValidAssumeForContext(), llvm::JumpThreadingPass::MaybeMergeBasicBlockIntoOnlyPred(), llvm::JumpThreadingPass::MaybeThreadThroughTwoBasicBlocks(), llvm::MergeBasicBlockIntoOnlyPred(), mergeBlocksIntoPredecessors(), mergeCleanupPad(), mergeConditionalStores(), mergeConditionalStoreToAddress(), false::LibCallsShrinkWrap::perform(), llvm::JumpThreadingPass::ProcessGuards(), llvm::JumpThreadingPass::ProcessImpliedCondition(), processUGT_ADDCST_ADD(), recordConditions(), ReduceSwitchRange(), removeUndefIntroducingPredecessor(), replaceAllUsesOfWithIn(), llvm::InstCombiner::replacedSelectWithOperand(), replaceUsesOfWith(), reportMayClobberedLoad(), llvm::SpeculativeExecutionPass::runImpl(), shouldInstrumentBlock(), SimplifyCondBranchToCondBranch(), simplifyOneLoop(), llvm::JumpThreadingPass::SimplifyPartiallyRedundantLoad(), simplifySuspendPoint(), llvm::SplitEdge(), tryToMoveFreeBeforeNullTest(), and tryWidenCondBranchToCondBranch().
|
inline |
Definition at line 237 of file BasicBlock.h.
References getSinglePredecessor(), and getUniquePredecessor().
| 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 293 of file BasicBlock.cpp.
References E, SI, llvm::succ_begin(), and llvm::succ_end().
Referenced by checkLoopsStructure(), llvm::createCodeGenPreparePass(), llvm::VPlan::dump(), ensureValueAvailableInSuccessor(), FindWidenableTerminatorAboveLoop(), getSingleSuccessor(), getUniquePredecessor(), insertSpills(), mergeBlocksIntoPredecessors(), llvm::MergeBlockSuccessorsIntoGivenBlocks(), mergeConditionalStores(), false::LibCallsShrinkWrap::perform(), llvm::SpeculativeExecutionPass::runImpl(), sinkLifetimeStartMarkers(), and llvm::sinkRegion().
|
inline |
Definition at line 265 of file BasicBlock.h.
References getSingleSuccessor(), and getUniqueSuccessor().
|
inlinestatic |
Returns a pointer to a member of the instruction list.
Definition at line 358 of file BasicBlock.h.
References getValueSymbolTable().
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 187 of file BasicBlock.cpp.
References llvm::dyn_cast(), and F().
Referenced by llvm::canPeel(), findUnwindDestinations(), getExpectedExitLoopLatchBranch(), getPostdominatingDeoptimizeCall(), getTerminatingDeoptimizeCall(), getTerminator(), llvm::InlineFunction(), and tryWidenCondBranchToCondBranch().
|
inline |
Definition at line 132 of file BasicBlock.h.
References getPostdominatingDeoptimizeCall(), and getTerminatingDeoptimizeCall().
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 156 of file BasicBlock.cpp.
References llvm::dyn_cast(), llvm::User::getOperand(), llvm::ilist_node_with_parent< NodeTy, ParentTy, Options >::getPrevNode(), and llvm::ReturnInst::getReturnValue().
Referenced by getPostdominatingDeoptimizeCall(), getTerminatingMustTailCall(), and llvm::InlineFunction().
|
inline |
Definition at line 150 of file BasicBlock.h.
References getFirstNonPHI(), and getTerminatingMustTailCall().
| 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 150 of file BasicBlock.cpp.
Referenced by Prefetch::addInstruction(), allPredecessorsComeFromSameSource(), llvm::LoopNest::arePerfectlyNested(), assertBranchOrSelectConditionHoisted(), llvm::LoopVectorizationLegality::blockNeedsPredication(), BrPHIToSelect(), llvm::PredicateInfoBuilder::buildPredicateInfo(), canFoldIVIncExpr(), CanGenerateTest(), canonicalizeSaturatedAdd(), llvm::canPeel(), canRenameComdat(), canRotateDeoptimizingLatchExit(), canSinkInstructions(), canSplitPredecessors(), llvm::changeToUnreachable(), checkBasicSSA(), llvm::Attributor::checkForAllReadWriteInstructions(), checkLoopsStructure(), llvm::CloneAndPruneIntoFromInst(), llvm::CloneFunction(), llvm::CloneFunctionInto(), CloneLoopBlocks(), cloneLoopBlocks(), llvm::LoopVectorizationPlanner::collectTriviallyDeadInstructions(), llvm::colorEHFunclets(), llvm::FunctionComparator::compare(), computeKnownBitsFromOperator(), ComputePostOrders(), llvm::ComputeSpeculationCost(), computeUnlikelySuccessors(), ConnectEpilog(), ConnectProlog(), llvm::ConstantFoldTerminator(), ConvertToSInt(), copyMustTailReturn(), createCallInst(), createCast(), llvm::createCodeGenPreparePass(), llvm::OpenMPIRBuilder::CreateCopyinClauseBlocks(), llvm::OpenMPIRBuilder::CreateCritical(), llvm::VPRecipeBuilder::createEdgeMask(), createFFSIntrinsic(), CreateGCRelocates(), llvm::createLICMPass(), llvm::createLowerSwitchPass(), llvm::createMemCpyLoopKnownSize(), llvm::createMemCpyLoopUnknownSize(), createMemMoveLoop(), createMemSetLoop(), llvm::OpenMPIRBuilder::CreateParallel(), createPHIsForSplitLoopExit(), CreatePrologue(), llvm::createR600ISelDag(), createResumeEntryBlock(), llvm::createSanitizerCtorAndInitFunctions(), createUnreachableSwitchDefault(), llvm::InnerLoopVectorizer::createVectorizedLoopSkeleton(), llvm::DemotePHIToStack(), despeculateCountZeros(), detectPopcountIdiom(), detectShiftUntilZeroIdiom(), doCallSiteSplitting(), DominatesMergePoint(), llvm::JumpThreadingPass::DuplicateCondBranchOnPHIIntoPred(), llvm::DuplicateInstructionsInSplitBetween(), ehAwareSplitEdge(), eliminateDeadStores(), llvm::OpenMPIRBuilder::emitCancelationCheckImpl(), llvm::InnerLoopVectorizer::emitMemRuntimeChecks(), llvm::InnerLoopVectorizer::emitMinimumIterationCountCheck(), llvm::InnerLoopVectorizer::emitSCEVChecks(), llvm::InnerLoopVectorizer::emitTransformedIndex(), enableCallSafepoints(), EvaluateConstantChrecAtConstant(), llvm::Evaluator::EvaluateFunction(), llvm::VPBranchOnMaskRecipe::execute(), llvm::VPWidenCanonicalIVRecipe::execute(), llvm::VPBasicBlock::execute(), llvm::VPlan::execute(), llvm::FastISel::fastEmitZExtFromI1(), findBasePointer(), llvm::orc::SpeculateQuery::findCalles(), findIBRPredecessor(), findInnerReductionPhi(), llvm::CodeExtractor::findInputsOutputs(), findInsertPointAfter(), FindLoopCounter(), llvm::CodeExtractor::findOrCreateBlockForHoisting(), FindPHIForConditionForwarding(), findUnconditionalPreds(), FindWidenableTerminatorAboveLoop(), firstNonDbg(), FitWeights(), llvm::InnerLoopVectorizer::fixFirstOrderRecurrence(), llvm::InnerLoopVectorizer::fixLCSSAPHIs(), llvm::InnerLoopVectorizer::fixReduction(), llvm::InnerLoopVectorizer::fixupIVUsers(), llvm::FoldBranchToCommonDest(), FoldCondBranchOnPHI(), foldGuardedRotateToFunnelShift(), foldICmpWithDominatingICmp(), foldOperationIntoPhiValue(), llvm::FoldReturnIntoUncondBranch(), FoldTwoEntryPHINode(), llvm::ScalarEvolution::forgetLoopDispositions(), genLoopLimit(), GetBestDestForJumpOnUndef(), getBranchHint(), getBranchInsertPoint(), llvm::InnerLoopVectorizer::getBroadcastInstrs(), llvm::Loop::LoopBounds::getCanonicalPredicate(), getDomPredecessorCondition(), llvm::DOTGraphTraits< DOTFuncInfo * >::getEdgeAttributes(), llvm::DOTGraphTraits< DOTFuncInfo * >::getEdgeSourceLabel(), getEdgeValueLocal(), getEHPadFromPredecessor(), getEmscriptenFunction(), getExpectedExitLoopLatchBranch(), getFirstNonAllocaInTheEntryBlock(), llvm::GetIfCondition(), getInductionVariable(), getInnermostLoopFor(), getInsertPointForUses(), getIrrLoopHeaderWeight(), getJumpThreadDuplicationCost(), llvm::Loop::getLoopGuardBranch(), getMaxBackedgeTakenCount(), getModule(), getNumBytes(), getNumElements(), llvm::RegionTraits< Function >::getNumSuccessors(), getOnlyLiveSuccessor(), getOrCreateDebugLoc(), llvm::InnerLoopVectorizer::getOrCreateTripCount(), llvm::InnerLoopVectorizer::getOrCreateVectorTripCount(), getOutliningBenefit(), getOutliningPenalty(), GetPointerOperand(), getStrlenWithNull(), getSubprogram(), llvm::GetSuccessorNumber(), getSuccState(), getTerminator(), getTrueOrFalseValue(), handleFree(), handlePhiDef(), hasOnlyUniformBranches(), hasProfileData(), hasZeroSignBit(), hoist(), llvm::hoistAllInstructionsInto(), llvm::SCEVExpander::hoistIVInc(), llvm::hoistRegion(), INITIALIZE_PASS(), llvm::InlineFunction(), insertBoundsCheck(), llvm::DIBuilder::insertDeclare(), insertLifetimeMarkersSurroundingCall(), llvm::InsertPreheaderForLoop(), insertSpills(), insertUniqueBackedgeBlock(), inversePermutation(), is_empty(), IsAcceptableTarget(), llvm::Attributor::isAssumedDead(), isChainSelectCmpBranch(), llvm::CaptureTracker::isDereferenceableOrNull(), llvm::SparseSolver< LatticeKey, LatticeVal, KeyInfo >::isEdgeFeasible(), llvm::RecurrenceDescriptor::isFirstOrderRecurrence(), llvm::PPCTTIImpl::isHardwareLoopProfitable(), isIgnorableInst(), IsIncrementNUW(), isInertARCValue(), llvm::isInTailCallPosition(), IsInterestingCmp(), isLegalToHoistInto(), llvm::ScalarEvolution::isLoopBackedgeGuardedByCond(), isLoopDead(), isLoopExitTestBasedOn(), isNotUsedOrFreeInLoop(), isOnlyReachableViaThisEdge(), isProfitableForVectorization(), isPromotedInstructionLegal(), isSafeAndProfitableToSinkLoad(), isSafePHIToSpeculate(), llvm::isSafeToExpandAt(), llvm::isSafeToMoveBefore(), isSafeToSpeculateStore(), llvm::BasicBlockEdge::isSingleEdge(), isTrivialLoopExitBlock(), isUnconditionalBranch(), llvm::isUniformLoop(), isUniformlyReached(), llvm::Loop::makeLoopInvariant(), MarkBlocksLiveIn(), llvm::JumpThreadingPass::MaybeMergeBasicBlockIntoOnlyPred(), llvm::JumpThreadingPass::MaybeThreadThroughTwoBasicBlocks(), mayLoopAccessLocation(), llvm::LoopVectorizationCostModel::memoryInstructionCanBeWidened(), llvm::MergeBasicBlockIntoOnlyPred(), llvm::MergeBlockIntoPredecessor(), mergeCleanupPad(), mergeConditionalStoreToAddress(), mergeEmptyReturnBlocks(), moveBBContents(), llvm::moveInstructionsToTheEnd(), moveLCSSAPhis(), llvm::MemorySSAUpdater::moveToPlace(), needsLFTR(), llvm::EscapeEnumerator::Next(), normalizePredicate(), llvm::slpvectorizer::BoUpSLP::optimizeGatherSequence(), optimizeSQRT(), patchAndReplaceAllUsesWith(), llvm::peelLoop(), PerformHeapAllocSRoA(), llvm::PHITransAddr::PHITranslateWithInsertion(), prepareForSplit(), prepareICWorklistFromFunction(), llvm::LoopVectorizationLegality::prepareToFoldTailByMasking(), llvm::JumpThreadingPass::ProcessBlock(), ProcessBlock(), llvm::JumpThreadingPass::ProcessBranchOnPHI(), llvm::JumpThreadingPass::ProcessImpliedCondition(), llvm::JumpThreadingPass::ProcessThreadableEdges(), processUGT_ADDCST_ADD(), profitableToRotateLoopExitingLatch(), llvm::promoteLoopAccessesToScalars(), llvm::GVNHoist::rank(), recordCondition(), redirectToHub(), relocationViaAlloca(), llvm::removeAllNonTerminatorAndEHPadInstructions(), llvm::MemorySSAUpdater::removeBlocks(), removeEmptyCleanup(), removeUndefIntroducingPredecessor(), llvm::removeUnwindEdge(), replaceAllUsesOfWithIn(), replaceConstantExprOp(), llvm::InstCombiner::replacedSelectWithOperand(), replaceSuccessorsPhiUsesWith(), reportMayClobberedLoad(), llvm::IRCEPass::run(), llvm::ModuleSanitizerCoveragePass::run(), llvm::InstCombiner::run(), llvm::SpeculativeExecutionPass::runImpl(), llvm::runIPSCCP(), llvm::MachinePipeliner::runOnMachineFunction(), scalarizeMaskedCompressStore(), scalarizeMaskedExpandLoad(), scalarizeMaskedGather(), scalarizeMaskedLoad(), scalarizeMaskedScatter(), scalarizeMaskedStore(), scaleWeights(), setBranchWeights(), llvm::BranchProbabilityInfo::setEdgeProbability(), shouldConvert(), llvm::StackProtector::shouldEmitSDCheck(), SimplifyCondBranchToCondBranch(), simplifyOneLoop(), llvm::JumpThreadingPass::SimplifyPartiallyRedundantLoad(), SinkCast(), llvm::sinkRegion(), llvm::InstCombiner::SliceUpIllegalIntegerPHI(), speculatePHINodeLoads(), splitBasicBlock(), splitBeforeCatchSwitch(), llvm::SplitBlockAndInsertIfThen(), llvm::SplitBlockAndInsertIfThenElse(), llvm::fuzzerop::splitBlockDescriptor(), splitCallSite(), llvm::SplitCriticalEdge(), SplitCriticalSideEffectEdges(), llvm::SplitEdge(), llvm::SplitIndirectBrCriticalEdges(), llvm::SplitLandingPadPredecessors(), llvm::succ_begin(), llvm::succ_end(), swapBBContents(), ThreadCmpOverPHI(), llvm::JumpThreadingPass::ThreadEdge(), llvm::JumpThreadingPass::ThreadThroughTwoBasicBlocks(), truncateIVUse(), llvm::JumpThreadingPass::TryThreadEdge(), tryToElideArgumentCopy(), TryToMergeLandingPad(), tryToMoveFreeBeforeNullTest(), llvm::TryToSimplifyUncondBranchFromEmptyBlock(), TryToSinkInstruction(), llvm::JumpThreadingPass::TryToUnfoldSelect(), tryUnmergingGEPsAcrossIndirectBr(), turnGuardIntoBranch(), turnToExplicitForm(), llvm::JumpThreadingPass::UnfoldSelectInstr(), unifyReturnBlockSet(), llvm::UnrollAndJamLoop(), llvm::UnrollLoop(), llvm::UnrollRuntimeLoopRemainder(), unswitchAllTrivialConditions(), unswitchNontrivialInvariants(), unswitchTrivialBranch(), unswitchTrivialSwitch(), llvm::MemorySSAUpdater::updateForClonedBlockIntoPred(), updateLatchBranchWeightsForRemainderLoop(), UpdatePDTWorklist(), updatePredecessorProfileMetadata(), llvm::MachineFunction::verify(), llvm::LoopVersioning::versionLoop(), llvm::InstCombiner::visitCallInst(), visitIVCast(), llvm::InstCombiner::visitPHINode(), llvm::InstCombiner::visitStoreInst(), llvm::InnerLoopVectorizer::widenIntOrFpInduction(), and ExpandedValuesCleaner::~ExpandedValuesCleaner().
|
inline |
Definition at line 123 of file BasicBlock.h.
References getTerminatingDeoptimizeCall(), and getTerminator().
| const BasicBlock * BasicBlock::getUniquePredecessor | ( | ) | const |
Return the predecessor of this block if it has a unique predecessor block.
If this basic block has a unique predecessor block, return the block, otherwise return a null pointer.
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).
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 271 of file BasicBlock.cpp.
References E, llvm::pred_begin(), and llvm::pred_end().
Referenced by areOuterLoopExitPHIsSupported(), llvm::Attributor::checkForAllReadWriteInstructions(), llvm::createCodeGenPreparePass(), llvm::OpenMPIRBuilder::CreateCritical(), llvm::MustBeExecutedContextExplorer::findBackwardJoinPoint(), findLocationForEntrySafepoint(), llvm::Loop::getLoopGuardBranch(), getSinglePredecessor(), getUniquePredecessor(), IsAcceptableTarget(), isZero(), makeStatepointExplicitImpl(), llvm::MergeBlockIntoPredecessor(), llvm::MergeBlockSuccessorsIntoGivenBlocks(), llvm::MemorySSAUpdater::moveAllAfterMergeBlocks(), moveLCSSAPhis(), normalizeForInvokeSafepoint(), reuseTableCompare(), llvm::InstCombiner::run(), TryToSinkInstruction(), and llvm::UnrollLoop().
|
inline |
Definition at line 249 of file BasicBlock.h.
References getSingleSuccessor(), getUniquePredecessor(), hasNPredecessors(), hasNPredecessorsOrMore(), and N.
| 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 301 of file BasicBlock.cpp.
References E, SI, llvm::succ_begin(), and llvm::succ_end().
Referenced by llvm::OpenMPIRBuilder::CreateCritical(), llvm::OpenMPIRBuilder::finalize(), llvm::MustBeExecutedContextExplorer::findForwardJoinPoint(), llvm::Loop::getLoopGuardBranch(), getPostdominatingDeoptimizeCall(), getSingleSuccessor(), getUniqueSuccessor(), IsBackEdge(), llvm::MergeBlockIntoPredecessor(), moveLCSSAPhis(), and TryToMergeLandingPad().
|
inline |
Definition at line 275 of file BasicBlock.h.
References getUniqueSuccessor(), and print().
| 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().
Referenced by getSublistAccess().
|
inline |
Returns true if there are any uses of this basic block other than direct branches, switches, etc.
to it.
Definition at line 412 of file BasicBlock.h.
References replacePhiUsesWith(), and replaceSuccessorsPhiUsesWith().
Referenced by llvm::CloneFunction(), llvm::CloneFunctionInto(), llvm::createCodeGenPreparePass(), despeculateCountZeros(), llvm::AsmPrinter::emitBasicBlockStart(), firstNonDbg(), llvm::MMIAddrLabelMap::getAddrLabelSymbolToEmit(), hasAddressTakenAndUsed(), isBlockValidForExtraction(), isEligibleLoopForm(), llvm::BlockAddress::lookup(), llvm::MergeBasicBlockIntoOnlyPred(), llvm::MergeBlockIntoPredecessor(), llvm::GVNHoist::rank(), ReduceSwitchRange(), llvm::IRTranslator::runOnMachineFunction(), llvm::UnrollLoop(), and ~BasicBlock().
Return true if this block has exactly N predecessors.
Definition at line 285 of file BasicBlock.cpp.
References llvm::hasNItems(), llvm::pred_begin(), and llvm::pred_end().
Referenced by CheckForCanReleaseCFGHazard(), llvm::OpenMPIRBuilder::CreateCritical(), ensureValueAvailableInSuccessor(), getUniquePredecessor(), llvm::JumpThreadingPass::ProcessThreadableEdges(), llvm::InstCombiner::visitStoreInst(), and llvm::MemorySSAUpdater::wireOldPredecessorsToNewImmediatePredecessor().
Return true if this block has N predecessors or more.
Definition at line 289 of file BasicBlock.cpp.
References llvm::hasNItemsOrMore(), llvm::pred_begin(), and llvm::pred_end().
Referenced by getUniquePredecessor(), and TryToMergeLandingPad().
| 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(), llvm::ilist_node_impl< OptionsT >::getIterator(), llvm::iplist_impl< IntrusiveListT, TraitsT >::insert(), and llvm::iplist_impl< IntrusiveListT, TraitsT >::push_back().
Referenced by getFirstInsertionPt(), and llvm::invalidateParentIListOrdering().
| iterator_range< filter_iterator< BasicBlock::const_iterator, std::function< bool(const Instruction &)> > > BasicBlock::instructionsWithoutDebug | ( | ) | const |
Return a const iterator range over the instructions in the block, skipping any debug instructions.
Definition at line 100 of file BasicBlock.cpp.
References I, and llvm::make_filter_range().
Referenced by allPredecessorsComeFromSameSource(), areOuterLoopExitPHIsSupported(), BlockIsSimpleEnoughToThreadThrough(), llvm::CodeExtractorAnalysisCache::CodeExtractorAnalysisCache(), detectShiftUntilZeroIdiom(), llvm::orc::SpeculateQuery::findCalles(), findInnerReductionPhi(), llvm::FoldBranchToCommonDest(), GetCaseResults(), getFirstInsertionPt(), getOutliningBenefit(), hasProfileData(), isSafeToSpeculateStore(), mergeConditionalStoreToAddress(), llvm::LegacyDivergenceAnalysis::print(), ReduceSwitchRange(), simplifyOneLoop(), sizeWithoutDebug(), and tryToMoveFreeBeforeNullTest().
| iterator_range< filter_iterator< BasicBlock::iterator, std::function< bool(Instruction &)> > > BasicBlock::instructionsWithoutDebug | ( | ) |
Return an iterator range over the instructions in the block, skipping any debug instructions.
Definition at line 109 of file BasicBlock.cpp.
References I, and llvm::make_filter_range().
|
inline |
Mark instruction ordering invalid. Done on every instruction insert.
Definition at line 455 of file BasicBlock.h.
References llvm::tgtok::Bits, renumberInstructions(), and validateInstrOrdering().
Referenced by llvm::invalidateParentIListOrdering().
|
inline |
Return true if this basic block is an exception handling block.
Definition at line 429 of file BasicBlock.h.
References getFirstNonPHI(), getLandingPadInst(), llvm::Instruction::isEHPad(), and isLandingPad().
Referenced by calculateCXXStateNumbers(), calculateSEHStateNumbers(), llvm::calculateWasmEHInfo(), canSplitCallSite(), eraseDeadBBsAndChildren(), getParameterABIAttributes(), getPredState(), llvm::JumpThreadingPass::MaybeThreadThroughTwoBasicBlocks(), llvm::JumpThreadingPass::ProcessBranchOnXOR(), llvm::GVNHoist::rank(), separateNestedLoop(), llvm::JumpThreadingPass::SimplifyPartiallyRedundantLoad(), llvm::fuzzerop::splitBlockDescriptor(), and llvm::SplitCriticalEdge().
|
inline |
Returns true if the Order field of child Instructions is valid.
Definition at line 450 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.
I.e., it's the destination of the 'unwind' edge of an invoke instruction.
Definition at line 448 of file BasicBlock.cpp.
References getFirstNonPHI().
Referenced by createPHIsForSplitLoopExit(), isEHPad(), llvm::SplitBlockPredecessors(), llvm::SplitLandingPadPredecessors(), and llvm::JumpThreadingPass::ThreadEdge().
| bool BasicBlock::isLegalToHoistInto | ( | ) | const |
Return true if it is legal to hoist instructions into this block.
Definition at line 368 of file BasicBlock.cpp.
References assert(), and getTerminator().
Referenced by getLandingPadInst(), and llvm::sroa::AllocaSliceRewriter::visit().
| 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.
Unlink this basic block from its current function and insert it into the function that MovePos lives in, right after MovePos.
Definition at line 140 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(), getParent(), and llvm::iplist_impl< IntrusiveListT, TraitsT >::splice().
Referenced by CreatePrologue(), getFirstInsertionPt(), 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.
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(), getParent(), and llvm::iplist_impl< IntrusiveListT, TraitsT >::splice().
Referenced by buildClonedLoopBlocks(), canRotateDeoptimizingLatchExit(), getFirstInsertionPt(), and llvm::sinkRegion().
|
delete |
|
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 345 of file BasicBlock.h.
Referenced by AddPHINodeEntriesForMappedBlock(), AddPredecessorToBlock(), areInnerLoopExitPHIsSupported(), areOuterLoopExitPHIsSupported(), assertBranchOrSelectConditionHoisted(), llvm::canIfConvertPHINodes(), ConnectEpilog(), ConvertToSInt(), llvm::createCodeGenPreparePass(), createPHIsForSplitLoopExit(), llvm::DeleteDeadPHIs(), deleteLoopIfDead(), llvm::GVNExpression::Expression::dump(), llvm::FastISel::fastEmitZExtFromI1(), findInnerReductionPhi(), FindPHIForConditionForwarding(), llvm::InnerLoopVectorizer::fixCrossIterationPHIs(), llvm::InnerLoopVectorizer::fixLCSSAPHIs(), llvm::InnerLoopVectorizer::fixReduction(), fixupPHINodeForNormalDest(), fixupPHINodeForUnwindDest(), ForwardSwitchConditionToPHI(), llvm::Loop::getInductionVariable(), getMaxBackedgeTakenCount(), getMaxWidenStepsOpts(), getOtherIncomingValue(), GetPointerOperand(), llvm::SSAUpdater::GetValueInMiddleOfBlock(), isEpilogProfitable(), isExistingPhi(), IsIncrementNUW(), isKnownTypeIdMember(), isLoopDead(), isPredicatedOnPHI(), isProfitableChain(), isSafeToSpeculateStore(), llvm::LoopVectorizationLegality::isUniform(), llvm::MergeBlockIntoPredecessor(), moveLCSSAPhis(), processHeaderPhiOperands(), profitableToRotateLoopExitingLatch(), PushLoopPHIs(), removeUndefIntroducingPredecessor(), replaceAllUsesOfWithIn(), llvm::SCEVExpander::replaceCongruentIVs(), rewritePHINodesForExitAndUnswitchedBlocks(), rewritePHINodesForUnswitchedExitBlock(), scaleWeights(), scanPHIsAndUpdateValueMap(), SimplifyCondBranchToCondBranch(), llvm::fuzzerop::splitBlockDescriptor(), splitCallSite(), tryToElideArgumentCopy(), tryWidenCondBranchToCondBranch(), llvm::UnrollAndJamLoop(), and usesLiveOut().
| iterator_range< BasicBlock::phi_iterator > BasicBlock::phis | ( | ) |
Definition at line 315 of file BasicBlock.cpp.
References begin(), llvm::dyn_cast(), empty(), and P.
| 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 4366 of file AsmWriter.cpp.
References llvm::RISCVFenceField::W.
Referenced by getUniqueSuccessor().
|
inline |
Definition at line 294 of file BasicBlock.h.
Referenced by canRotateDeoptimizingLatchExit(), checkForMustTailInVarArgFn(), findLiveSetAtInst(), llvm::slpvectorizer::BoUpSLP::getSpillCost(), isIgnorableInst(), llvm::moveInstructionsToTheBeginning(), patchAndReplaceAllUsesWith(), and sinkLoopInvariantInstructions().
|
inline |
Definition at line 295 of file BasicBlock.h.
| void BasicBlock::removeFromParent | ( | ) |
Unlink 'this' from the containing function, but do not delete it.
Definition at line 123 of file BasicBlock.cpp.
References llvm::Function::getBasicBlockList(), llvm::ilist_node_impl< ilist_detail::compute_node_options< BasicBlock, Options... >::type >::getIterator(), getParent(), and llvm::iplist_impl< IntrusiveListT, TraitsT >::remove().
Referenced by llvm::DomTreeUpdater::callbackDeleteBB(), llvm::DomTreeUpdater::deleteBB(), and getFirstInsertionPt().
| 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 326 of file BasicBlock.cpp.
References assert(), begin(), llvm::Instruction::eraseFromParent(), llvm::find(), front(), llvm::PHINode::hasConstantValue(), llvm::Value::hasNUsesOrMore(), llvm::pred_begin(), llvm::pred_end(), llvm::PHINode::removeIncomingValue(), and llvm::Value::replaceAllUsesWith().
Referenced by canRotateDeoptimizingLatchExit(), llvm::changeToCall(), classof(), llvm::ConstantFoldTerminator(), llvm::JumpThreadingPass::DuplicateCondBranchOnPHIIntoPred(), FitWeights(), FoldCondBranchOnPHI(), llvm::FoldReturnIntoUncondBranch(), FoldTwoEntryPHINode(), HandleInlinedLandingPad(), markAliveBlocks(), mergeCleanupPad(), llvm::JumpThreadingPass::ProcessBlock(), llvm::JumpThreadingPass::ProcessImpliedCondition(), processSwitch(), ReduceSwitchRange(), llvm::RemovePredecessorAndSimplify(), RemoveSwitchAfterSelectConversion(), removeUndefIntroducingPredecessor(), llvm::removeUnwindEdge(), replaceConditionalBranchesOnConstant(), setBranchWeights(), SimplifyCondBranchToCondBranch(), simplifyTerminatorLeadingToRet(), llvm::SplitCriticalEdge(), SwitchToLookupTable(), llvm::JumpThreadingPass::ThreadEdge(), llvm::JumpThreadingPass::ThreadThroughTwoBasicBlocks(), tryWidenCondBranchToCondBranch(), and unswitchTrivialSwitch().
|
inline |
Definition at line 296 of file BasicBlock.h.
Referenced by canRotateDeoptimizingLatchExit(), checkForMustTailInVarArgFn(), llvm::slpvectorizer::BoUpSLP::getSpillCost(), isIgnorableInst(), isObjectDereferencedInBlock(), llvm::moveInstructionsToTheBeginning(), patchAndReplaceAllUsesWith(), removeTriviallyEmptyRange(), sinkLoopInvariantInstructions(), and splitCallSite().
|
inline |
Definition at line 297 of file BasicBlock.h.
| void BasicBlock::renumberInstructions | ( | ) |
Renumber instructions and mark the ordering as valid.
Definition at line 476 of file BasicBlock.cpp.
References llvm::tgtok::Bits, and I.
Referenced by llvm::Instruction::comesBefore(), and invalidateOrders().
| 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 419 of file BasicBlock.cpp.
References begin(), llvm::dyn_cast(), end(), llvm::ARM_PROC::IE, and llvm::PHINode::replaceIncomingBlockWith().
Referenced by hasAddressTaken(), moveLCSSAPhis(), replaceSuccessorsPhiUsesWith(), and scaleWeights().
| 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 430 of file BasicBlock.cpp.
References llvm::for_each(), getTerminator(), replacePhiUsesWith(), and llvm::successors().
Referenced by hasAddressTaken(), and replaceSuccessorsPhiUsesWith().
| 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 442 of file BasicBlock.cpp.
References replaceSuccessorsPhiUsesWith().
|
inline |
Definition at line 299 of file BasicBlock.h.
Referenced by canCreateThunkFor(), detectShiftUntilZeroIdiom(), FitWeights(), getOrCreateDebugLoc(), llvm::moveInstructionsToTheEnd(), llvm::SpeculativeExecutionPass::runImpl(), 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 118 of file BasicBlock.cpp.
References begin(), end(), and instructionsWithoutDebug().
Referenced by getFirstInsertionPt().
| BasicBlock * BasicBlock::splitBasicBlock | ( | iterator | I, |
| const Twine & | BBName = "" |
||
| ) |
Split the basic block into two basic blocks at the specified instruction.
This splits a basic block into two at the specified instruction.
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 BasicBlock 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.
Note that all instructions BEFORE the specified iterator stay as part of the original basic block, an unconditional branch is added to the new BB, and the rest of the instructions in the BB are moved to the new BB, including the old terminator. This invalidates the 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).
Definition at line 392 of file BasicBlock.cpp.
References assert(), Create(), llvm::BranchInst::Create(), end(), getContext(), getInstList(), llvm::ilist_node_with_parent< BasicBlock, Function >::getNextNode(), getParent(), getTerminator(), I, and llvm::Instruction::setDebugLoc().
Referenced by llvm::changeToInvokeAndSplitBasicBlock(), classof(), llvm::OpenMPIRBuilder::CreateCopyinClauseBlocks(), llvm::OpenMPIRBuilder::CreateCritical(), llvm::createMemCpyLoopKnownSize(), llvm::createMemCpyLoopUnknownSize(), createMemSetLoop(), llvm::OpenMPIRBuilder::CreateParallel(), CreatePrologue(), createResumeEntryBlock(), despeculateCountZeros(), llvm::CodeExtractor::findOrCreateBlockForHoisting(), getStrlenWithNull(), getTrueOrFalseValue(), INITIALIZE_PASS(), llvm::InlineFunction(), insertBoundsCheck(), insertSpills(), PerformHeapAllocSRoA(), performMaskedAtomicOp(), scalarizeMaskedCompressStore(), scalarizeMaskedExpandLoad(), scalarizeMaskedGather(), scalarizeMaskedLoad(), scalarizeMaskedScatter(), scalarizeMaskedStore(), shouldKeepInEntry(), SimplifyCondBranchToCondBranch(), splitBasicBlock(), splitBeforeCatchSwitch(), llvm::SplitBlock(), llvm::SplitBlockAndInsertIfThen(), llvm::SplitBlockAndInsertIfThenElse(), llvm::fuzzerop::splitBlockDescriptor(), and unifyReturnBlockSet().
|
inline |
Definition at line 406 of file BasicBlock.h.
References llvm::ilist_node_impl< OptionsT >::getIterator(), and splitBasicBlock().
| 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 490 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.13