|
LLVM
3.7.0
|
LLVM Basic Block Representation. More...
#include <BasicBlock.h>
Public Types | |
| typedef iplist< Instruction > | InstListType |
| typedef InstListType::iterator | iterator |
| Instruction iterators... More... | |
| typedef InstListType::const_iterator | const_iterator |
| typedef InstListType::reverse_iterator | reverse_iterator |
| typedef InstListType::const_reverse_iterator | const_reverse_iterator |
Public Types inherited from llvm::Value | |
| enum | ValueTy |
| Concrete subclass of this. More... | |
| typedef use_iterator_impl< Use > | use_iterator |
| typedef use_iterator_impl < const Use > | const_use_iterator |
| typedef user_iterator_impl< User > | user_iterator |
| typedef user_iterator_impl < const User > | const_user_iterator |
Public Member Functions | |
| LLVMContext & | getContext () const |
| Get the context in which this basic block lives. More... | |
| ~BasicBlock () override | |
| 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 it the function does not have a module. More... | |
| Module * | getModule () |
| TerminatorInst * | getTerminator () |
| Returns the terminator instruction if the block is well formed or null if the block is not well formed. More... | |
| const TerminatorInst * | getTerminator () const |
| CallInst * | getTerminatingMustTailCall () |
| Returns the call instruction marked 'musttail' prior to the terminating return instruction of this basic block, if such a call is present. More... | |
| const CallInst * | getTerminatingMustTailCall () const |
| Instruction * | getFirstNonPHI () |
| Returns a pointer to the first instruction in this block that is not a PHINode instruction. More... | |
| const Instruction * | getFirstNonPHI () const |
| Instruction * | getFirstNonPHIOrDbg () |
| Returns a pointer to the first instruction in this block that is not a PHINode or a debug intrinsic. More... | |
| const Instruction * | getFirstNonPHIOrDbg () const |
| Instruction * | getFirstNonPHIOrDbgOrLifetime () |
| Returns a pointer to the first instruction in this block that is not a PHINode, a debug intrinsic, or a lifetime intrinsic. More... | |
| const Instruction * | getFirstNonPHIOrDbgOrLifetime () const |
| iterator | getFirstInsertionPt () |
| Returns an iterator to the first instruction in this block that is suitable for inserting a non-PHI instruction. More... | |
| const_iterator | getFirstInsertionPt () const |
| void | removeFromParent () |
| Unlink 'this' from the containing function, but do not delete it. More... | |
| iplist< 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... | |
| BasicBlock * | getSinglePredecessor () |
| Return the predecessor of this block if it has a single predecessor block. More... | |
| const BasicBlock * | getSinglePredecessor () const |
| BasicBlock * | getUniquePredecessor () |
| Return the predecessor of this block if it has a unique predecessor block. More... | |
| const BasicBlock * | getUniquePredecessor () const |
| BasicBlock * | getSingleSuccessor () |
| Return the successor of this block if it has a single successor. More... | |
| const BasicBlock * | getSingleSuccessor () const |
| BasicBlock * | getUniqueSuccessor () |
| Return the successor of this block if it has a unique successor. More... | |
| const BasicBlock * | getUniqueSuccessor () const |
| 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 () |
| 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 DontDeleteUselessPHIs=false) |
Notify the BasicBlock that the predecessor Pred is no longer able to reach it. More... | |
| BasicBlock * | splitBasicBlock (iterator I, const Twine &BBName="") |
| Split the basic block into two basic blocks at the specified instruction. More... | |
| bool | hasAddressTaken () const |
| Returns true if there are any uses of this basic block other than direct branches, switches, etc. 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 | isLandingPad () const |
| Return true if this basic block is a landing pad. More... | |
| LandingPadInst * | getLandingPadInst () |
| Return the landingpad instruction associated with the landing pad. More... | |
| const LandingPadInst * | getLandingPadInst () const |
Public Member Functions inherited from llvm::Value | |
| virtual | ~Value () |
| 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 | 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... | |
| bool | use_empty () 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 > | uses () |
| iterator_range < const_use_iterator > | uses () const |
| bool | user_empty () 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 > | 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... | |
| 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... | |
| void | intersectOptionalDataWith (const Value *V) |
| Clear any optional flags not set in the given Value. 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... | |
| Value * | stripPointerCasts () |
| Strip off pointer casts, all-zero GEPs, and aliases. More... | |
| const Value * | stripPointerCasts () const |
| Value * | stripPointerCastsNoFollowAliases () |
| Strip off pointer casts and all-zero GEPs. More... | |
| const Value * | stripPointerCastsNoFollowAliases () const |
| Value * | stripInBoundsConstantOffsets () |
| Strip off pointer casts and all-constant inbounds GEPs. More... | |
| const Value * | stripInBoundsConstantOffsets () const |
| Value * | stripAndAccumulateInBoundsConstantOffsets (const DataLayout &DL, APInt &Offset) |
| Accumulate offsets from stripInBoundsConstantOffsets(). More... | |
| const Value * | stripAndAccumulateInBoundsConstantOffsets (const DataLayout &DL, APInt &Offset) const |
| Value * | stripInBoundsOffsets () |
| Strip off pointer casts and inbounds GEPs. More... | |
| const Value * | stripInBoundsOffsets () const |
| Value * | DoPHITranslation (const BasicBlock *CurBB, const BasicBlock *PredBB) |
| Translate PHI node to its predecessor from the given basic block. More... | |
| const Value * | DoPHITranslation (const BasicBlock *CurBB, const BasicBlock *PredBB) const |
| 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) const |
| Implement operator<< on Value. More... | |
| void | print (raw_ostream &O, ModuleSlotTracker &MST) 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< BasicBlock > | |
| BasicBlock * | getPrevNode () |
| Get the previous node, or 0 for the list head. More... | |
| const BasicBlock * | getPrevNode () const |
| Get the previous node, or 0 for the list head. More... | |
| BasicBlock * | getNextNode () |
| Get the next node, or 0 for the list tail. More... | |
| const BasicBlock * | getNextNode () const |
| Get the next node, or 0 for the list tail. 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 iplist< Instruction > 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, Function > |
Additional Inherited Members | |
Static Public Attributes inherited from llvm::Value | |
| static const unsigned | MaxAlignmentExponent = 29 |
| The maximum alignment for instructions. More... | |
| static const unsigned | MaximumAlignment = 1u << MaxAlignmentExponent |
Protected Types inherited from llvm::Value | |
| enum | : unsigned { NumUserOperandsBits = 29 } |
| The number of operands in the subclass. More... | |
Protected Member Functions inherited from llvm::Value | |
| Value (Type *Ty, unsigned scid) | |
| unsigned short | getSubclassDataFromValue () const |
| void | setValueSubclassData (unsigned short D) |
Protected Member Functions inherited from llvm::ilist_node< BasicBlock > | |
| ilist_node () | |
Protected Attributes inherited from llvm::Value | |
| unsigned char | SubclassOptionalData: 7 |
| Hold subclass data that can be dropped. More... | |
| unsigned | NumUserOperands: NumUserOperandsBits |
| bool | IsUsedByMD: 1 |
| bool | HasName: 1 |
| bool | HasHungOffUses: 1 |
LLVM Basic Block Representation.
This represents a single basic block in LLVM. A basic block is simply a container of instructions that execute sequentially. Basic blocks are Values because they are referenced by instructions such as branches and switch tables. The type of a BasicBlock is "Type::LabelTy" because the basic block represents a label to which a branch can jump.
A well formed basic block is formed of a list of non-terminating instructions followed by a single TerminatorInst instruction. TerminatorInst's 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 65 of file BasicBlock.h.
Definition at line 94 of file BasicBlock.h.
Definition at line 96 of file BasicBlock.h.
Definition at line 69 of file BasicBlock.h.
Instruction iterators...
Definition at line 93 of file BasicBlock.h.
Definition at line 95 of file BasicBlock.h.
|
override |
Definition at line 64 of file BasicBlock.cpp.
References llvm::iplist< NodeTy, Traits >::clear(), llvm::Constant::destroyConstant(), dropAllReferences(), llvm::ConstantInt::get(), getContext(), llvm::Type::getInt32Ty(), llvm::ConstantExpr::getIntToPtr(), getParent(), llvm::Value::getType(), hasAddressTaken(), llvm::Value::replaceAllUsesWith(), llvm::Value::use_empty(), and llvm::Value::user_back().
|
inline |
Definition at line 245 of file BasicBlock.h.
References llvm::iplist< NodeTy, Traits >::back().
Referenced by llvm::AliasAnalysis::canBasicBlockModify(), llvm::CloneAndPruneIntoFromInst(), ComputePostOrders(), llvm::DeleteDeadBlock(), and scanInlinedCode().
|
inline |
Definition at line 246 of file BasicBlock.h.
References llvm::iplist< NodeTy, Traits >::back().
|
inline |
Instruction iterator methods.
Definition at line 231 of file BasicBlock.h.
References llvm::iplist< NodeTy, Traits >::begin().
Referenced by llvm::AliasSetTracker::add(), AddPHINodeEntriesForMappedBlock(), llvm::LoopVersioning::addPHINodes(), AddPredecessorToBlock(), AddReachableCodeToWorklist(), llvm::CodeMetrics::analyzeBasicBlock(), BlockIsSimpleEnoughToThreadThrough(), llvm::Interpreter::callFunction(), canIfConvertPHINodes(), CanPropagatePredecessorsForPHIs(), checkCSEInPredecessor(), llvm::CloneAndPruneFunctionInto(), llvm::CloneAndPruneIntoFromInst(), llvm::CloneBasicBlock(), CloneInstructionInExitBlock(), CloneLoopBlocks(), llvm::computeLICMSafetyInfo(), containsSafePHI(), createPHIsForSplitLoopExit(), cse(), cxxDtorIsEmpty(), llvm::DeleteDeadPHIs(), DeleteInstructionInBlock(), llvm::DemotePHIToStack(), llvm::DemoteRegToStack(), llvm::DominatorTree::dominates(), dropAllReferences(), llvm::EliminateDuplicatePHINodes(), llvm::CodeExtractor::extractCodeRegion(), llvm::FindAvailableLoadedValue(), llvm::objcarc::FindDependencies(), FindInitTrampolineFromBB(), llvm::CodeExtractor::findInputsOutputs(), findLocationForEntrySafepoint(), FindPHIForConditionForwarding(), llvm::SSAUpdaterTraits< SSAUpdater >::FindPredecessorBlocks(), findRetainForStoreStrongContraction(), fixPhis(), llvm::FoldBranchToCommonDest(), FoldCondBranchOnPHI(), llvm::FoldSingleEntryPHINodes(), FoldTwoEntryPHINode(), llvm::formLCSSA(), functionHasLines(), generateUnsignedDivisionCode(), llvm::Loop::getCanonicalInductionVariable(), GetCaseResults(), llvm::MemoryDependenceAnalysis::getDependency(), llvm::GetIfCondition(), llvm::MemoryDependenceAnalysis::getNonLocalCallDependency(), llvm::MemoryDependenceAnalysis::getPointerDependencyFrom(), llvm::BasicTTIImplBase< AMDGPUTTIImpl >::getUnrollingPreferences(), llvm::SSAUpdater::GetValueInMiddleOfBlock(), HandleByValArgumentInit(), HandleCallsInBlockInlinedThroughInvoke(), HasNoDuplicateCall(), llvm::hoistRegion(), HoistThenElseCodeToIf(), llvm::InlineFunction(), insertFastDiv(), InsertRootInitializers(), InsertSafepointPoll(), insertSinCosCall(), isBlockValidForExtraction(), llvm::Loop::isLCSSAForm(), llvm::isSafeToLoadUnconditionally(), isTrivialLoopExitBlockHelper(), llvm::Value::isUsedInBasicBlock(), LLVMGetFirstInstruction(), LLVMGetLastInstruction(), LLVMGetPreviousInstruction(), makeStatepointExplicitImpl(), markAliveBlocks(), llvm::MergeBasicBlockIntoOnlyPred(), llvm::MergeBlockIntoPredecessor(), mergeEmptyReturnBlocks(), NegateValue(), normalizeForInvokeSafepoint(), llvm::SparseSolver::Print(), processInstruction(), PushLoopPHIs(), relocationViaAlloca(), removePredecessor(), llvm::RemovePredecessorAndSimplify(), removeUndefIntroducingPredecessor(), replaceSuccessorsPhiUsesWith(), ReplaceWithStatepoint(), RewriteUsesOfClonedInstructions(), scanInlinedCode(), SimplifyBranchOnICmpChain(), SimplifyCondBranchToCondBranch(), llvm::InstCombiner::SimplifyDivRemOfSelect(), llvm::SimplifyInstructionsInBlock(), simplifyOneLoop(), llvm::sinkRegion(), SinkThenElseCodeToEnd(), llvm::SparseSolver::Solve(), SpeculativelyExecuteBB(), splitBasicBlock(), llvm::SplitBlockPredecessors(), llvm::SplitCriticalEdge(), llvm::SplitEdge(), splitVectorValues(), llvm::TryToSimplifyUncondBranchFromEmptyBlock(), TryToSimplifyUncondBranchWithICmpInIt(), TurnSwitchRangeIntoICmp(), llvm::UnrollLoop(), UpdatePHINodes(), llvm::InstVisitor< ObjectSizeOffsetVisitor, SizeOffsetType >::visit(), llvm::InstCombiner::visitPHINode(), and llvm::InstCombiner::visitStoreInst().
|
inline |
Definition at line 232 of file BasicBlock.h.
References llvm::iplist< NodeTy, Traits >::begin().
Methods for support type inquiry through isa, cast, and dyn_cast.
Definition at line 264 of file BasicBlock.h.
References llvm::Value::getValueID().
|
inlinestatic |
Creates a new BasicBlock.
If the Parent parameter is specified, the basic block is automatically inserted at either the end of the function (if InsertBefore is 0), or before the specified basic block.
Definition at line 103 of file BasicBlock.h.
References llvm::ISD::BasicBlock.
Referenced by assureFPCallStub(), llvm::CloneBasicBlock(), convertMemSetToLoop(), convertTransferToLoop(), createFPFnStub(), llvm::createSanitizerCtorAndInitFunctions(), createStubLandingPad(), llvm::CodeExtractor::extractCodeRegion(), FoldCondBranchOnPHI(), generateUnsignedDivisionCode(), INITIALIZE_PASS(), insertFastDiv(), insertUniqueBackedgeBlock(), LLVMAppendBasicBlockInContext(), LLVMInsertBasicBlockInContext(), llvm::orc::makeStub(), PerformHeapAllocSRoA(), llvm::UnifyFunctionExitNodes::runOnFunction(), SimplifyCondBranchToCondBranch(), splitBasicBlock(), llvm::SplitBlockAndInsertIfThen(), llvm::SplitBlockAndInsertIfThenElse(), llvm::SplitBlockPredecessors(), llvm::SplitCriticalEdge(), llvm::SplitLandingPadPredecessors(), and TryToSimplifyUncondBranchWithICmpInIt().
| 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 204 of file BasicBlock.cpp.
References begin(), end(), and I.
Referenced by ~BasicBlock().
|
inline |
Definition at line 242 of file BasicBlock.h.
References llvm::iplist< NodeTy, Traits >::empty().
Referenced by llvm::DeleteDeadBlock().
|
inline |
Definition at line 233 of file BasicBlock.h.
References llvm::iplist< NodeTy, Traits >::end().
Referenced by llvm::AliasSetTracker::add(), AddReachableCodeToWorklist(), allSuccessorsReachEndCatch(), llvm::CodeMetrics::analyzeBasicBlock(), canIfConvertPHINodes(), changeToUnreachable(), checkCSEInPredecessor(), llvm::CloneBasicBlock(), llvm::computeLICMSafetyInfo(), cse(), cxxDtorIsEmpty(), dropAllReferences(), llvm::objcarc::FindDependencies(), llvm::CodeExtractor::findInputsOutputs(), findSafeStoreForStoreStrongContraction(), FoldBlockIntoPredecessor(), llvm::FoldBranchToCommonDest(), llvm::formLCSSA(), functionHasLines(), GetCaseResults(), getFirstInsertionPt(), llvm::MemoryDependenceAnalysis::getNonLocalCallDependency(), llvm::BasicTTIImplBase< AMDGPUTTIImpl >::getUnrollingPreferences(), HandleCallsInBlockInlinedThroughInvoke(), HasNoDuplicateCall(), llvm::hoistRegion(), insertFastDiv(), InsertSafepointPoll(), isBlockValidForExtraction(), isCatchBlock(), llvm::isInTailCallPosition(), llvm::Loop::isLCSSAForm(), llvm::isPotentiallyReachable(), isSafeAndProfitableToSinkLoad(), isTrivialLoopExitBlockHelper(), llvm::Value::isUsedInBasicBlock(), isValidAssumeForContext(), LLVMGetFirstInstruction(), LLVMGetLastInstruction(), LLVMGetNextInstruction(), LLVMPositionBuilder(), makeStatepointExplicitImpl(), markAliveBlocks(), llvm::MergeBlockIntoPredecessor(), passingValueIsAlwaysUndefined(), llvm::SparseSolver::Print(), relocationViaAlloca(), replaceSuccessorsPhiUsesWith(), RewriteUsesOfClonedInstructions(), scanOneBB(), llvm::IRBuilderBase::SetInsertPoint(), llvm::SimplifyInstructionsInBlock(), llvm::sinkRegion(), SinkThenElseCodeToEnd(), llvm::SparseSolver::Solve(), SpeculativelyExecuteBB(), splitBasicBlock(), TryToSinkInstruction(), and llvm::InstVisitor< ObjectSizeOffsetVisitor, SizeOffsetType >::visit().
|
inline |
Definition at line 234 of file BasicBlock.h.
References llvm::iplist< NodeTy, Traits >::end().
| iplist< BasicBlock >::iterator BasicBlock::eraseFromParent | ( | ) |
Unlink 'this' from the containing function and delete it.
Definition at line 97 of file BasicBlock.cpp.
References llvm::iplist< NodeTy, Traits >::erase(), llvm::Function::getBasicBlockList(), and getParent().
Referenced by llvm::CloneAndPruneIntoFromInst(), llvm::DeleteDeadBlock(), FoldBlockIntoPredecessor(), llvm::InlineFunction(), llvm::MergeBasicBlockIntoOnlyPred(), llvm::MergeBlockIntoPredecessor(), mergeEmptyReturnBlocks(), simplifyOneLoop(), and llvm::TryToSimplifyUncondBranchFromEmptyBlock().
|
inline |
Definition at line 243 of file BasicBlock.h.
References llvm::iplist< NodeTy, Traits >::front().
Referenced by llvm::AliasAnalysis::canBasicBlockModify(), llvm::SSAUpdaterTraits< SSAUpdater >::CreateEmptyPHI(), CreatePrologue(), llvm::SSAUpdater::GetValueInMiddleOfBlock(), INITIALIZE_PASS(), isEmptyFunction(), llvm::MergeBlockIntoPredecessor(), mergeEmptyReturnBlocks(), removePredecessor(), llvm::RemovePredecessorAndSimplify(), llvm::UnifyFunctionExitNodes::runOnFunction(), llvm::TryToSimplifyUncondBranchFromEmptyBlock(), and TryToSimplifyUncondBranchWithICmpInIt().
|
inline |
Definition at line 244 of file BasicBlock.h.
References llvm::iplist< NodeTy, Traits >::front().
| 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 llvm::CloneBasicBlock(), llvm::ConstantFoldTerminator(), copyMetadata(), EliminateDeadSwitchCases(), llvm::EmitFWrite(), llvm::EmitMemChr(), llvm::EmitMemCmp(), llvm::EmitMemCpyChk(), llvm::EmitStrLen(), llvm::EmitStrNCmp(), llvm::EmitStrNLen(), llvm::CodeExtractor::extractCodeRegion(), FoldCondBranchOnPHI(), PerformHeapAllocSRoA(), splitBasicBlock(), llvm::SplitBlockAndInsertIfThen(), llvm::SplitBlockAndInsertIfThenElse(), llvm::SplitBlockPredecessors(), llvm::SplitLandingPadPredecessors(), TryToSimplifyUncondBranchWithICmpInIt(), and ~BasicBlock().
| BasicBlock::iterator BasicBlock::getFirstInsertionPt | ( | ) |
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 194 of file BasicBlock.cpp.
References end(), and getFirstNonPHI().
Referenced by CloneInstructionInExitBlock(), llvm::DemoteRegToStack(), getFirstInsertionPt(), llvm::objcarc::BottomUpPtrState::HandlePotentialUse(), makeStatepointExplicitImpl(), OptimizeExtractBits(), rematerializeLiveValues(), llvm::SCEVExpander::replaceCongruentIVs(), ReplaceWithStatepoint(), llvm::InstCombiner::run(), SinkCast(), SinkCmpExpression(), SinkShiftAndTruncate(), llvm::SplitLandingPadPredecessors(), splitVectorValues(), TryToSinkInstruction(), llvm::InstCombiner::visitGetElementPtrInst(), and llvm::ObjectSizeOffsetEvaluator::visitPHINode().
|
inline |
Definition at line 164 of file BasicBlock.h.
References getFirstInsertionPt().
| Instruction * BasicBlock::getFirstNonPHI | ( | ) |
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 165 of file BasicBlock.cpp.
References I.
Referenced by CloneLoopBlocks(), createPHIsForSplitLoopExit(), findBeginCatchSplitPoint(), fixPhis(), getFirstInsertionPt(), getFirstNonPHI(), getJumpThreadDuplicationCost(), getLandingPadInst(), llvm::InvokeInst::getLandingPadInst(), llvm::SSAUpdater::GetValueInMiddleOfBlock(), isLandingPad(), relocationViaAlloca(), llvm::SplitBlockPredecessors(), llvm::SplitLandingPadPredecessors(), and splitVectorValues().
|
inline |
Definition at line 141 of file BasicBlock.h.
References getFirstNonPHI().
| Instruction * BasicBlock::getFirstNonPHIOrDbg | ( | ) |
Returns a pointer to the first instruction in this block that is not a PHINode or a debug intrinsic.
Definition at line 172 of file BasicBlock.cpp.
References I.
Referenced by FindPHIForConditionForwarding(), followSingleUnconditionalBranches(), getFirstNonPHIOrDbg(), InitializeUniqueCases(), isCatchBlock(), SimplifyCondBranchToTwoReturns(), SwitchToLookupTable(), TurnSwitchRangeIntoICmp(), and llvm::InstCombiner::visitAllocaInst().
|
inline |
Definition at line 148 of file BasicBlock.h.
References getFirstNonPHIOrDbg().
| Instruction * BasicBlock::getFirstNonPHIOrDbgOrLifetime | ( | ) |
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 179 of file BasicBlock.cpp.
References I.
Referenced by getFirstNonPHIOrDbgOrLifetime().
|
inline |
Definition at line 155 of file BasicBlock.h.
References 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 252 of file BasicBlock.h.
Referenced by changeToUnreachable(), llvm::CloneAndPruneIntoFromInst(), llvm::CloneBasicBlock(), CloneInstructionInExitBlock(), llvm::BinaryOperator::Create(), createCallHelper(), createInvokeHelper(), createMalloc(), llvm::DeleteDeadBlock(), DeleteInstructionInBlock(), llvm::Instruction::eraseFromParent(), llvm::CodeExtractor::extractCodeRegion(), FoldBlockIntoPredecessor(), llvm::FoldBranchToCommonDest(), FoldCondBranchOnPHI(), llvm::FoldReturnIntoUncondBranch(), FoldTwoEntryPHINode(), HandleCallsInBlockInlinedThroughInvoke(), HoistThenElseCodeToIf(), llvm::InlineFunction(), llvm::Instruction::insertAfter(), llvm::Instruction::insertBefore(), insertFastDiv(), llvm::IRBuilderDefaultInserter< true >::InsertHelper(), llvm::InstCombiner::InsertNewInstBefore(), insertUniqueBackedgeBlock(), llvm::Instruction::Instruction(), LdStHasDebugValue(), llvm::MergeBasicBlockIntoOnlyPred(), llvm::MergeBlockIntoPredecessor(), moveBBContents(), llvm::Instruction::moveBefore(), llvm::Instruction::removeFromParent(), removePredecessor(), llvm::ReplaceInstWithInst(), llvm::InstCombiner::run(), llvm::UnifyFunctionExitNodes::runOnFunction(), SinkThenElseCodeToEnd(), SpeculativelyExecuteBB(), splitBasicBlock(), llvm::SplitLandingPadPredecessors(), llvm::TryToSimplifyUncondBranchFromEmptyBlock(), llvm::UnrollLoop(), and llvm::InstCombiner::visitGetElementPtrInst().
|
inline |
Definition at line 253 of file BasicBlock.h.
| LandingPadInst * BasicBlock::getLandingPadInst | ( | ) |
Return the landingpad instruction associated with the landing pad.
Definition at line 418 of file BasicBlock.cpp.
References llvm::dyn_cast(), and getFirstNonPHI().
Referenced by isCatchAllLandingPad(), makeStatepointExplicitImpl(), and llvm::SplitLandingPadPredecessors().
| const LandingPadInst * BasicBlock::getLandingPadInst | ( | ) | const |
Definition at line 421 of file BasicBlock.cpp.
References llvm::dyn_cast(), and getFirstNonPHI().
Return the module owning the function this basic block belongs to, or nullptr it the function does not have a module.
Note: this is undefined behavior if the block does not have a parent.
Definition at line 116 of file BasicBlock.cpp.
References getParent(), and llvm::GlobalValue::getParent().
Referenced by llvm::LazyValueInfo::eraseBlock(), llvm::FindAvailableLoadedValue(), llvm::LazyValueInfo::getConstant(), llvm::LazyValueInfo::getConstantOnEdge(), llvm::Instruction::getModule(), llvm::MemoryDependenceAnalysis::getPointerDependencyFrom(), llvm::LazyValueInfo::getPredicateOnEdge(), llvm::SSAUpdater::GetValueInMiddleOfBlock(), llvm::SimplifyCFG(), llvm::LazyValueInfo::threadEdge(), llvm::UnrollLoop(), and llvm::UnrollRuntimeLoopProlog().
| Module * BasicBlock::getModule | ( | ) |
Definition at line 120 of file BasicBlock.cpp.
References getParent(), and llvm::GlobalValue::getParent().
Return the enclosing method, or null if none.
Definition at line 111 of file BasicBlock.h.
Referenced by AddAlignmentAssumptions(), llvm::AddLandingPadInfo(), llvm::CodeMetrics::analyzeBasicBlock(), callIntrinsic(), changeToUnreachable(), llvm::CloneBasicBlock(), CloneLoopBlocks(), llvm::CodeMetrics::collectEphemeralValues(), CombineUAddWithOverflow(), computeKnownBitsFromAssume(), llvm::IRBuilderBase::CreateAssumption(), llvm::IRBuilderBase::CreateGCRelocate(), CreateGCRelocates(), llvm::IRBuilderBase::CreateGCResult(), llvm::IRBuilderBase::CreateGCStatepointCall(), llvm::IRBuilderBase::CreateGCStatepointInvoke(), llvm::IRBuilderBase::CreateGlobalString(), llvm::IRBuilderBase::CreateLifetimeEnd(), llvm::IRBuilderBase::CreateLifetimeStart(), llvm::IRBuilderBase::CreateMemCpy(), llvm::IRBuilderBase::CreateMemMove(), llvm::IRBuilderBase::CreateMemSet(), llvm::DemotePHIToStack(), llvm::DemoteRegToStack(), llvm::DominatorTree::dominates(), llvm::InstCombiner::dominatesAllUses(), llvm::EmitBinaryFloatFnCall(), llvm::EmitFPutC(), llvm::EmitFPutS(), llvm::EmitFWrite(), llvm::HexagonTargetLowering::emitLoadLinked(), llvm::AArch64TargetLowering::emitLoadLinked(), llvm::ARMTargetLowering::emitLoadLinked(), llvm::EmitMemChr(), llvm::EmitMemCmp(), llvm::EmitMemCpyChk(), llvm::EmitPutChar(), llvm::EmitPutS(), llvm::HexagonTargetLowering::emitStoreConditional(), llvm::AArch64TargetLowering::emitStoreConditional(), llvm::ARMTargetLowering::emitStoreConditional(), llvm::EmitStrChr(), llvm::EmitStrCpy(), llvm::EmitStrLen(), llvm::EmitStrNCmp(), llvm::EmitStrNCpy(), llvm::EmitStrNLen(), llvm::EmitUnaryFloatFnCall(), eraseFromParent(), llvm::CodeExtractor::extractCodeRegion(), findBasePointer(), FindPotentialTailCall(), FoldCondBranchOnPHI(), generateUnsignedDivisionCode(), llvm::BlockAddress::get(), llvm::MMIAddrLabelMap::getAddrLabelSymbolToEmit(), getCommonReturnValue(), llvm::IRBuilderBase::getCurrentFunctionReturnType(), llvm::MemoryDependenceAnalysis::getDependency(), llvm::Trace::getFunction(), llvm::ValueEnumerator::getGlobalBasicBlockID(), llvm::MemoryDependenceAnalysis::getLoadLoadClobberFullWidthSize(), getModule(), llvm::DOTGraphTraits< DomTreeNode * >::getNodeLabel(), llvm::DOTGraphTraits< RegionNode * >::getNodeLabel(), llvm::MemoryDependenceAnalysis::getNonLocalCallDependency(), llvm::MemoryDependenceAnalysis::getPointerDependencyFrom(), getValueSymbolTable(), HandleByValArgument(), HandleInlinedInvoke(), llvm::InlineFunction(), insertFastDiv(), insertParsePoints(), insertSinCosCall(), insertUseHolderAfter(), isDynamicConstant(), llvm::SelectionDAGBuilder::isExportableFromCurrentBlock(), llvm::isInTailCallPosition(), llvm::isPotentiallyReachable(), llvm::RecurrenceDescriptor::isReductionPHI(), llvm::isSafeToSpeculativelyExecute(), llvm::AllocaInst::isStaticAlloca(), LLVMGetNextBasicBlock(), LLVMGetPreviousBasicBlock(), LLVMInsertBasicBlockInContext(), llvm::BlockAddress::lookup(), llvm::IntrinsicLowering::LowerToByteSwap(), llvm::ARMTargetLowering::makeDMB(), makeStatepointExplicitImpl(), llvm::HexagonTargetLowering::mayBeEmittedAsTailCall(), llvm::MergeBasicBlockIntoOnlyPred(), moveAfter(), moveBefore(), NegateValue(), parentFunctionOfValue(), PerformHeapAllocSRoA(), placeSplitBlockCarefully(), llvm::Value::print(), PrintOps(), ProcessUGT_ADDCST_ADD(), ProcessUMulZExtIdiom(), promoteSingleBlockAlloca(), llvm::AssumptionCache::registerAssumption(), removeFromParent(), ReplaceCallWith(), replaceConstantExprOp(), ReplaceWithStatepoint(), rewriteSingleStoreAlloca(), scanOneBB(), SimplifyCondBranchToCondBranch(), llvm::BasicBlockPass::skipOptnoneFunction(), splitBasicBlock(), llvm::SplitBlockAndInsertIfThen(), llvm::SplitBlockAndInsertIfThenElse(), llvm::SplitBlockPredecessors(), llvm::SplitCriticalEdge(), llvm::SplitLandingPadPredecessors(), splitVectorValues(), SwitchToLookupTable(), llvm::TryToSimplifyUncondBranchFromEmptyBlock(), TryToSimplifyUncondBranchWithICmpInIt(), TryToSinkInstruction(), llvm::UnrollLoop(), llvm::UnrollRuntimeLoopProlog(), UpdateCallGraphAfterInlining(), useFuncSeen(), ValueDominatesPHI(), llvm::vectorizeBasicBlock(), llvm::InstCombiner::visitAllocaInst(), llvm::InstCombiner::visitCallInst(), llvm::InstCombiner::visitFPTrunc(), llvm::InstCombiner::visitLandingPadInst(), and ~BasicBlock().
|
inline |
Definition at line 112 of file BasicBlock.h.
| BasicBlock * BasicBlock::getSinglePredecessor | ( | ) |
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 211 of file BasicBlock.cpp.
References llvm::pred_begin(), and llvm::pred_end().
Referenced by CanPropagatePredecessorsForPHIs(), llvm::CloneAndPruneIntoFromInst(), llvm::DeleteDeadBlock(), llvm::DominatorTree::dominates(), FindPHIForConditionForwarding(), FoldBlockIntoPredecessor(), llvm::FoldBranchToCommonDest(), llvm::GetIfCondition(), getSinglePredecessor(), llvm::ScalarEvolution::isLoopBackedgeGuardedByCond(), isOnlyReachableViaThisEdge(), llvm::MergeBasicBlockIntoOnlyPred(), simplifyOneLoop(), llvm::SplitEdge(), tryToMoveFreeBeforeNullTest(), and TryToSimplifyUncondBranchWithICmpInIt().
|
inline |
Definition at line 195 of file BasicBlock.h.
References getSinglePredecessor().
| BasicBlock * BasicBlock::getSingleSuccessor | ( | ) |
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 238 of file BasicBlock.cpp.
References llvm::SI, llvm::succ_begin(), and llvm::succ_end().
Referenced by getSingleSuccessor().
|
inline |
Definition at line 215 of file BasicBlock.h.
References getSingleSuccessor().
|
inlinestatic |
Returns a pointer to a member of the instruction list.
Definition at line 256 of file BasicBlock.h.
| CallInst * BasicBlock::getTerminatingMustTailCall | ( | ) |
Returns the call instruction marked 'musttail' prior to the terminating return instruction of this basic block, if such a call is present.
Otherwise, returns null.
Definition at line 134 of file BasicBlock.cpp.
References llvm::iplist< NodeTy, Traits >::back(), llvm::dyn_cast(), llvm::iplist< NodeTy, Traits >::empty(), llvm::iplist< NodeTy, Traits >::front(), llvm::User::getOperand(), llvm::ilist_node< NodeTy >::getPrevNode(), and llvm::ReturnInst::getReturnValue().
Referenced by getTerminatingMustTailCall(), and llvm::InlineFunction().
Definition at line 130 of file BasicBlock.h.
References getTerminatingMustTailCall().
| TerminatorInst * BasicBlock::getTerminator | ( | ) |
Returns the terminator instruction if the block is well formed or null if the block is not well formed.
Definition at line 124 of file BasicBlock.cpp.
References llvm::iplist< NodeTy, Traits >::back(), llvm::dyn_cast(), and llvm::iplist< NodeTy, Traits >::empty().
Referenced by AddReachableCodeToWorklist(), llvm::CodeMetrics::analyzeBasicBlock(), BlockIsSimpleEnoughToThreadThrough(), checkBasicSSA(), llvm::CloneAndPruneIntoFromInst(), llvm::CloneFunctionInto(), CloneLoopBlocks(), computeKnownBitsFromDominatingCondition(), ConnectProlog(), llvm::ConstantFoldTerminator(), convertMemSetToLoop(), convertTransferToLoop(), createPHIsForSplitLoopExit(), llvm::DeleteDeadBlock(), DeleteInstructionInBlock(), llvm::DemotePHIToStack(), DominatesMergePoint(), findBasePointer(), FindMostPopularDest(), FindPHIForConditionForwarding(), findReachableBlocks(), FindUnconditionalPreds(), FoldBlockIntoPredecessor(), llvm::FoldBranchToCommonDest(), FoldCondBranchOnPHI(), llvm::FoldReturnIntoUncondBranch(), FoldTwoEntryPHINode(), followSingleUnconditionalBranches(), generateUnsignedDivisionCode(), GetBestDestForJumpOnUndef(), llvm::DOTGraphTraits< const Function * >::getEdgeSourceLabel(), getEdgeValueLocal(), llvm::GetIfCondition(), getInsertPointForUses(), getLoopLatchExitBlock(), llvm::RegionTraits< Function >::getNumSuccessors(), llvm::Loop::getStartLoc(), llvm::GCRelocateOperands::getStatepoint(), llvm::GetSuccessorNumber(), hoist(), llvm::InlineFunction(), llvm::DIBuilder::insertDeclare(), llvm::InsertPreheaderForLoop(), insertUniqueBackedgeBlock(), isChainSelectCmpBranch(), llvm::SparseSolver::isEdgeFeasible(), llvm::isInTailCallPosition(), llvm::ScalarEvolution::isLoopBackedgeGuardedByCond(), isSafePHIToSpeculate(), isSelectorDispatch(), llvm::BasicBlockEdge::isSingleEdge(), llvm::Loop::makeLoopInvariant(), markAliveBlocks(), matchOutlinedFinallyCall(), llvm::MergeBasicBlockIntoOnlyPred(), llvm::MergeBlockIntoPredecessor(), mergeEmptyReturnBlocks(), moveBBContents(), PerformHeapAllocSRoA(), llvm::promoteLoopAccessesToScalars(), relocationViaAlloca(), removeUndefIntroducingPredecessor(), replaceConstantExprOp(), llvm::InstCombiner::replacedSelectWithOperand(), replaceSuccessorsPhiUsesWith(), rewriteLoopExitBlock(), llvm::UnifyFunctionExitNodes::runOnFunction(), ScalarizeMaskedLoad(), ScalarizeMaskedStore(), SimplifyBranchOnICmpChain(), SimplifyCondBranchToCondBranch(), SimplifyCondBranchToTwoReturns(), simplifyOneLoop(), SinkThenElseCodeToEnd(), llvm::InstCombiner::SliceUpIllegalIntegerPHI(), speculatePHINodeLoads(), SpeculativelyExecuteBB(), splitBasicBlock(), llvm::SplitBlockAndInsertIfThen(), llvm::SplitBlockAndInsertIfThenElse(), llvm::SplitCriticalEdge(), SplitCriticalSideEffectEdges(), llvm::SplitEdge(), llvm::SplitLandingPadPredecessors(), llvm::succ_begin(), llvm::succ_end(), tryToMakeAllocaBePromotable(), TryToMergeLandingPad(), tryToMoveFreeBeforeNullTest(), llvm::TryToSimplifyUncondBranchFromEmptyBlock(), TryToSimplifyUncondBranchWithICmpInIt(), llvm::UnrollLoop(), llvm::UnrollRuntimeLoopProlog(), llvm::LoopVersioning::versionLoop(), and llvm::InstCombiner::visitCallInst().
| const TerminatorInst * BasicBlock::getTerminator | ( | ) | const |
Definition at line 129 of file BasicBlock.cpp.
References llvm::iplist< NodeTy, Traits >::back(), llvm::dyn_cast(), and llvm::iplist< NodeTy, Traits >::empty().
| BasicBlock * BasicBlock::getUniquePredecessor | ( | ) |
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 224 of file BasicBlock.cpp.
References llvm::pred_begin(), and llvm::pred_end().
Referenced by findLocationForEntrySafepoint(), getUniquePredecessor(), isDynamicConstant(), makeStatepointExplicitImpl(), llvm::MergeBlockIntoPredecessor(), normalizeForInvokeSafepoint(), llvm::InstCombiner::replacedSelectWithOperand(), and reuseTableCompare().
|
inline |
Definition at line 206 of file BasicBlock.h.
References getUniquePredecessor().
| BasicBlock * BasicBlock::getUniqueSuccessor | ( | ) |
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 246 of file BasicBlock.cpp.
References llvm::SI, llvm::succ_begin(), and llvm::succ_end().
Referenced by getUniqueSuccessor(), and TryToMergeLandingPad().
|
inline |
Definition at line 224 of file BasicBlock.h.
References getUniqueSuccessor().
| ValueSymbolTable * BasicBlock::getValueSymbolTable | ( | ) |
Returns a pointer to the symbol table if one exists.
Definition at line 26 of file BasicBlock.cpp.
References F(), and getParent().
|
inline |
Returns true if there are any uses of this basic block other than direct branches, switches, etc.
to it.
Definition at line 306 of file BasicBlock.h.
References llvm::Value::getSubclassDataFromValue().
Referenced by llvm::CloneFunctionInto(), llvm::MMIAddrLabelMap::getAddrLabelSymbolToEmit(), hasAddressTakenAndUsed(), llvm::BlockAddress::lookup(), llvm::MergeBasicBlockIntoOnlyPred(), llvm::MergeBlockIntoPredecessor(), llvm::UnrollLoop(), and ~BasicBlock().
| 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 54 of file BasicBlock.cpp.
References llvm::Function::getBasicBlockList(), llvm::iplist< NodeTy, Traits >::insert(), and llvm::iplist< NodeTy, Traits >::push_back().
| 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 413 of file BasicBlock.cpp.
References getFirstNonPHI().
Referenced by allPredsCameFromLandingPad(), createPHIsForSplitLoopExit(), isBlockValidForExtraction(), llvm::SplitBlockPredecessors(), llvm::SplitCriticalEdge(), and llvm::SplitLandingPadPredecessors().
| 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 110 of file BasicBlock.cpp.
References llvm::Function::getBasicBlockList(), getParent(), I, and llvm::iplist< NodeTy, Traits >::splice().
Referenced by llvm::MergeBasicBlockIntoOnlyPred(), and placeSplitBlockCarefully().
| 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 103 of file BasicBlock.cpp.
References llvm::Function::getBasicBlockList(), getParent(), and llvm::iplist< NodeTy, Traits >::splice().
Referenced by insertFastDiv().
|
inline |
Definition at line 236 of file BasicBlock.h.
References llvm::iplist< NodeTy, Traits >::rbegin().
Referenced by findLiveSetAtInst(), FindPotentialTailCall(), and isSafeToSpeculateStore().
|
inline |
Definition at line 237 of file BasicBlock.h.
References llvm::iplist< NodeTy, Traits >::rbegin().
| void BasicBlock::removeFromParent | ( | ) |
Unlink 'this' from the containing function, but do not delete it.
Definition at line 93 of file BasicBlock.cpp.
References llvm::Function::getBasicBlockList(), getParent(), and llvm::iplist< NodeTy, Traits >::remove().
| void BasicBlock::removePredecessor | ( | BasicBlock * | Pred, |
| bool | DontDeleteUselessPHIs = false |
||
| ) |
Notify the BasicBlock that the predecessor Pred is no longer able to reach it.
This method is used to notify a BasicBlock that the specified Predecessor of the block is no longer able to reach it.
This is actually not used to update the Predecessor list, but is actually used to update the PHI nodes that reside in the block. Note that this should be called while the predecessor still refers to this block.
Definition at line 266 of file BasicBlock.cpp.
References begin(), llvm::dyn_cast(), llvm::iplist< NodeTy, Traits >::empty(), llvm::Instruction::eraseFromParent(), front(), llvm::UndefValue::get(), llvm::PHINode::getIncomingBlock(), getInstList(), llvm::PHINode::getNumIncomingValues(), llvm::PHINode::hasConstantValue(), llvm::Value::hasNUsesOrMore(), Other, llvm::iplist< NodeTy, Traits >::pop_front(), llvm::pred_begin(), llvm::pred_end(), llvm::PHINode::removeIncomingValue(), and llvm::Value::replaceAllUsesWith().
Referenced by changeToCall(), changeToUnreachable(), llvm::ConstantFoldTerminator(), llvm::DeleteDeadBlock(), EliminateDeadSwitchCases(), FoldCondBranchOnPHI(), llvm::FoldReturnIntoUncondBranch(), HandleInlinedInvoke(), llvm::RemovePredecessorAndSimplify(), RemoveSwitchAfterSelectConversion(), removeUndefIntroducingPredecessor(), SimplifyCondBranchToTwoReturns(), simplifyOneLoop(), SimplifyTerminatorOnSelect(), llvm::SplitCriticalEdge(), and SwitchToLookupTable().
|
inline |
Definition at line 238 of file BasicBlock.h.
References llvm::iplist< NodeTy, Traits >::rend().
Referenced by allPredCameFromBeginCatch(), FindPotentialTailCall(), and isSafeToSpeculateStore().
|
inline |
Definition at line 239 of file BasicBlock.h.
References llvm::iplist< NodeTy, Traits >::rend().
| 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 390 of file BasicBlock.cpp.
References begin(), llvm::dyn_cast(), end(), llvm::PHINode::getBasicBlockIndex(), llvm::TerminatorInst::getNumSuccessors(), llvm::TerminatorInst::getSuccessor(), getTerminator(), llvm::ARM_PROC::IE, and llvm::PHINode::setIncomingBlock().
|
inline |
Definition at line 241 of file BasicBlock.h.
References llvm::iplist< NodeTy, Traits >::size().
Referenced by llvm::FastISel::fastEmitBranch(), isEmptyFunction(), and tryToMoveFreeBeforeNullTest().
| 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 348 of file BasicBlock.cpp.
References begin(), Create(), llvm::BranchInst::Create(), llvm::dyn_cast(), end(), llvm::iplist< NodeTy, Traits >::end(), llvm::PHINode::getBasicBlockIndex(), getContext(), getInstList(), getParent(), getTerminator(), I, llvm::Instruction::setDebugLoc(), llvm::PHINode::setIncomingBlock(), llvm::iplist< NodeTy, Traits >::splice(), llvm::succ_begin(), and llvm::succ_end().
Referenced by convertMemSetToLoop(), convertTransferToLoop(), generateUnsignedDivisionCode(), HandleCallsInBlockInlinedThroughInvoke(), llvm::InlineFunction(), PerformHeapAllocSRoA(), ScalarizeMaskedLoad(), ScalarizeMaskedStore(), SimplifyBranchOnICmpChain(), llvm::SplitBlock(), llvm::SplitBlockAndInsertIfThen(), and llvm::SplitBlockAndInsertIfThenElse().
|
friend |
Definition at line 67 of file BasicBlock.h.
|
friend |
Definition at line 75 of file BasicBlock.h.
1.8.6