LLVM  6.0.0svn
Classes | Public Types | Public Member Functions | Static Public Member Functions | Friends | List of all members
llvm::BasicBlock Class Referencefinal

LLVM Basic Block Representation. More...

#include "llvm/IR/BasicBlock.h"

Inheritance diagram for llvm::BasicBlock:
Inheritance graph
[legend]
Collaboration diagram for llvm::BasicBlock:
Collaboration graph
[legend]

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
 
BasicBlockoperator= (const BasicBlock &)=delete
 
 ~BasicBlock ()
 
LLVMContextgetContext () const
 Get the context in which this basic block lives. More...
 
const FunctiongetParent () const
 Return the enclosing method, or null if none. More...
 
FunctiongetParent ()
 
const ModulegetModule () const
 Return the module owning the function this basic block belongs to, or nullptr it the function does not have a module. More...
 
ModulegetModule ()
 
const TerminatorInstgetTerminator () const LLVM_READONLY
 Returns the terminator instruction if the block is well formed or null if the block is not well formed. More...
 
TerminatorInstgetTerminator ()
 
const CallInstgetTerminatingDeoptimizeCall () const
 Returns the call instruction calling .experimental.deoptimize prior to the terminating return instruction of this basic block, if such a call is present. More...
 
CallInstgetTerminatingDeoptimizeCall ()
 
const CallInstgetTerminatingMustTailCall () const
 Returns the call instruction marked 'musttail' prior to the terminating return instruction of this basic block, if such a call is present. More...
 
CallInstgetTerminatingMustTailCall ()
 
const InstructiongetFirstNonPHI () const
 Returns a pointer to the first instruction in this block that is not a PHINode instruction. More...
 
InstructiongetFirstNonPHI ()
 
const InstructiongetFirstNonPHIOrDbg () const
 Returns a pointer to the first instruction in this block that is not a PHINode or a debug intrinsic. More...
 
InstructiongetFirstNonPHIOrDbg ()
 
const InstructiongetFirstNonPHIOrDbgOrLifetime () const
 Returns a pointer to the first instruction in this block that is not a PHINode, a debug intrinsic, or a lifetime intrinsic. More...
 
InstructiongetFirstNonPHIOrDbgOrLifetime ()
 
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 ()
 
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 BasicBlockgetSinglePredecessor () const
 Return the predecessor of this block if it has a single predecessor block. More...
 
BasicBlockgetSinglePredecessor ()
 
const BasicBlockgetUniquePredecessor () const
 Return the predecessor of this block if it has a unique predecessor block. More...
 
BasicBlockgetUniquePredecessor ()
 
const BasicBlockgetSingleSuccessor () const
 Return the successor of this block if it has a single successor. More...
 
BasicBlockgetSingleSuccessor ()
 
const BasicBlockgetUniqueSuccessor () const
 Return the successor of this block if it has a unique successor. More...
 
BasicBlockgetUniqueSuccessor ()
 
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 Instructionfront () const
 
Instructionfront ()
 
const Instructionback () const
 
Instructionback ()
 
iterator_range< const_phi_iteratorphis () const
 Returns a range that iterates over the phis in the basic block. More...
 
iterator_range< phi_iteratorphis ()
 
const InstListTypegetInstList () const
 Return the underlying instruction list container. More...
 
InstListTypegetInstList ()
 
ValueSymbolTablegetValueSymbolTable ()
 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...
 
bool canSplitPredecessors () const
 
BasicBlocksplitBasicBlock (iterator I, const Twine &BBName="")
 Split the basic block into two basic blocks at the specified instruction. More...
 
BasicBlocksplitBasicBlock (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 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 LandingPadInstgetLandingPadInst () const
 Return the landingpad instruction associated with the landing pad. More...
 
LandingPadInstgetLandingPadInst ()
 
bool isLegalToHoistInto () const
 Return true if it is legal to hoist instructions into this block. More...
 
Optional< uint64_t > getIrrLoopHeaderWeight () const
 
- Public Member Functions inherited from llvm::Value
 Value (const Value &)=delete
 
Valueoperator= (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...
 
TypegetType () const
 All values are typed, get the type of this value. More...
 
LLVMContextgetContext () const
 All values hold a context through their type. More...
 
bool hasName () const
 
ValueNamegetValueName () 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 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 replaceUsesExceptBlockAddr (Value *New)
 replaceUsesExceptBlockAddr - 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
 
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_iteratormaterialized_uses ()
 
iterator_range< const_use_iteratormaterialized_uses () const
 
iterator_range< use_iteratoruses ()
 
iterator_range< const_use_iteratoruses () 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
 
Useruser_back ()
 
const Useruser_back () const
 
iterator_range< user_iteratormaterialized_users ()
 
iterator_range< const_user_iteratormaterialized_users () const
 
iterator_range< user_iteratorusers ()
 
iterator_range< const_user_iteratorusers () 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...
 
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 ValuestripPointerCasts () const
 Strip off pointer casts, all-zero GEPs, and aliases. More...
 
ValuestripPointerCasts ()
 
const ValuestripPointerCastsAndBarriers () const
 Strip off pointer casts, all-zero GEPs, aliases and barriers. More...
 
ValuestripPointerCastsAndBarriers ()
 
const ValuestripPointerCastsNoFollowAliases () const
 Strip off pointer casts and all-zero GEPs. More...
 
ValuestripPointerCastsNoFollowAliases ()
 
const ValuestripInBoundsConstantOffsets () const
 Strip off pointer casts and all-constant inbounds GEPs. More...
 
ValuestripInBoundsConstantOffsets ()
 
const ValuestripAndAccumulateInBoundsConstantOffsets (const DataLayout &DL, APInt &Offset) const
 Accumulate offsets from stripInBoundsConstantOffsets(). More...
 
ValuestripAndAccumulateInBoundsConstantOffsets (const DataLayout &DL, APInt &Offset)
 
const ValuestripInBoundsOffsets () const
 Strip off pointer casts and inbounds GEPs. More...
 
ValuestripInBoundsOffsets ()
 
unsigned getPointerDereferenceableBytes (const DataLayout &DL, bool &CanBeNull) const
 Returns the number of bytes known to be dereferenceable for the pointer value. More...
 
unsigned getPointerAlignment (const DataLayout &DL) const
 Returns an alignment of the pointer value. More...
 
const ValueDoPHITranslation (const BasicBlock *CurBB, const BasicBlock *PredBB) const
 Translate PHI node to its predecessor from the given basic block. More...
 
ValueDoPHITranslation (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 >
BasicBlockgetPrevNode ()
 
const BasicBlockgetPrevNode () const
 Get the previous node, or nullptr for the list head. More...
 
BasicBlockgetNextNode ()
 Get the next node, or nullptr for the list tail. More...
 
const BasicBlockgetNextNode () 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 BasicBlockCreate (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 >
 

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 = 28 }
 The number of operands in the subclass. More...
 
- Protected Types inherited from llvm::ilist_node_impl< ilist_detail::compute_node_options< BasicBlock, Options... >::type >
using self_iterator = ilist_iterator< ilist_detail::compute_node_options< BasicBlock, Options... >::type, false, false >
 
using const_self_iterator = ilist_iterator< ilist_detail::compute_node_options< BasicBlock, Options... >::type, false, true >
 
using reverse_self_iterator = ilist_iterator< ilist_detail::compute_node_options< BasicBlock, Options... >::type, true, false >
 
using const_reverse_self_iterator = ilist_iterator< ilist_detail::compute_node_options< BasicBlock, Options... >::type, true, true >
 
- Protected Member Functions inherited from llvm::Value
 Value (Type *Ty, unsigned scid)
 
 ~Value ()
 Value's destructor should be virtual by design, but that would require that Value and all of its subclasses have a vtable that effectively duplicates the information in the value ID. More...
 
unsigned short getSubclassDataFromValue () const
 
void setValueSubclassData (unsigned short D)
 
- Protected Member Functions inherited from llvm::ilist_node_with_parent< BasicBlock, Function >
 ilist_node_with_parent ()=default
 
- Protected Member Functions inherited from llvm::ilist_node_impl< ilist_detail::compute_node_options< BasicBlock, Options... >::type >
 ilist_node_impl ()=default
 
- Protected Attributes inherited from llvm::Value
unsigned char SubclassOptionalData: 7
 Hold subclass data that can be dropped. More...
 
unsigned NumUserOperands: NumUserOperandsBits
 
unsigned IsUsedByMD: 1
 
unsigned HasName: 1
 
unsigned HasHungOffUses: 1
 
unsigned HasDescriptor: 1
 

Detailed Description

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 59 of file BasicBlock.h.

Member Typedef Documentation

◆ const_iterator

Definition at line 92 of file BasicBlock.h.

◆ const_phi_iterator

Definition at line 303 of file BasicBlock.h.

◆ const_reverse_iterator

Definition at line 94 of file BasicBlock.h.

◆ InstListType

Definition at line 62 of file BasicBlock.h.

◆ iterator

Instruction iterators...

Definition at line 91 of file BasicBlock.h.

◆ phi_iterator

Definition at line 301 of file BasicBlock.h.

◆ reverse_iterator

Definition at line 93 of file BasicBlock.h.

Constructor & Destructor Documentation

◆ BasicBlock()

llvm::BasicBlock::BasicBlock ( const BasicBlock )
delete

◆ ~BasicBlock()

BasicBlock::~BasicBlock ( )

Member Function Documentation

◆ back() [1/2]

const Instruction& llvm::BasicBlock::back ( ) const
inline

◆ back() [2/2]

Instruction& llvm::BasicBlock::back ( )
inline

Definition at line 267 of file BasicBlock.h.

◆ begin() [1/2]

iterator llvm::BasicBlock::begin ( )
inline

Instruction iterator methods.

Definition at line 252 of file BasicBlock.h.

Referenced by AddPHINodeEntriesForMappedBlock(), AddPredecessorToBlock(), AddReachableCodeToWorklist(), allPredecessorsComeFromSameSource(), asmClobbersCTR(), BlockIsSimpleEnoughToThreadThrough(), llvm::calculateClrEHStateNumbers(), llvm::Interpreter::callFunction(), CanPropagatePredecessorsForPHIs(), CheckForCanReleaseCFGHazard(), llvm::CloneAndPruneIntoFromInst(), llvm::CloneBasicBlock(), CloneLoop(), cloneLoopBlocks(), CloneLoopBlocks(), llvm::FunctionComparator::cmpBasicBlocks(), llvm::computeLoopSafetyInfo(), llvm::computePeelCount(), ComputePostOrders(), containsSafePHI(), ConvertToSInt(), createCast(), llvm::createCodeGenPreparePass(), llvm::createObjCARCOptPass(), createPHIsForSplitLoopExit(), llvm::createSeparateConstOffsetFromGEPPass(), llvm::createShadowStackGCLoweringPass(), cse(), cxxDtorIsEmpty(), DeleteBasicBlock(), llvm::DeleteDeadPHIs(), deleteLoopIfDead(), despeculateCountZeros(), doCallSiteSplitting(), llvm::DominatorTree::dominates(), llvm::GVNExpression::Expression::dump(), llvm::JumpThreadingPass::DuplicateCondBranchOnPHIIntoPred(), llvm::DuplicateInstructionsInSplitBetween(), eliminateDeadStores(), llvm::EliminateDuplicatePHINodes(), eliminateRecursiveTailCall(), eliminateUnreachableBlock(), ensureValueAvailableInSuccessor(), llvm::Evaluator::EvaluateFunction(), llvm::CodeExtractor::extractCodeRegion(), llvm::FastISel::fastEmitZExtFromI1(), llvm::FindAvailablePtrLoadStore(), findBestInsertionSet(), llvm::objcarc::FindDependencies(), findIBRPredecessor(), findInitTrampolineFromBB(), llvm::CodeExtractor::findInputsOutputs(), FindLoopCounter(), FindPHIForConditionForwarding(), findPHIToPartitionLoops(), llvm::SSAUpdaterTraits< SSAUpdater >::FindPredecessorBlocks(), findRetainForStoreStrongContraction(), findTRECandidate(), llvm::InnerLoopVectorizer::fixFirstOrderRecurrence(), fixPhis(), llvm::InnerLoopVectorizer::fixReduction(), llvm::FoldBranchToCommonDest(), FoldCondBranchOnPHI(), llvm::FoldSingleEntryPHINodes(), FoldTwoEntryPHINode(), generateUnsignedDivisionCode(), genLoopLimit(), llvm::Loop::getCanonicalInductionVariable(), GetCaseResults(), llvm::MemoryDependenceResults::getDependency(), llvm::GetIfCondition(), getIncrmentFactorSCEV(), getInductionVariable(), GetLocation(), getLoopLatchExitBlock(), getMemSetPatternValue(), llvm::DOTGraphTraits< PGOUseFunc * >::getNodeLabel(), llvm::MemoryDependenceResults::getNonLocalCallDependency(), llvm::MemoryDependenceResults::getSimplePointerDependencyFrom(), getSuccPad(), llvm::DenseMapInfo< CallValue >::getTombstoneKey(), getTypePartition(), llvm::BasicTTIImplBase< AMDGPUTTIImpl >::getUnrollingPreferences(), llvm::SSAUpdater::GetValueInMiddleOfBlock(), HandleByValArgumentInit(), HandleCallsInBlockInlinedThroughInvoke(), handleEndBlock(), hasProfileData(), llvm::hoistRegion(), HoistThenElseCodeToIf(), INITIALIZE_PASS(), INITIALIZE_PASS_WITH_OPTIONS(), llvm::InlineFunction(), insertDebugValues(), InsertRootInitializers(), InsertSafepointPoll(), insertSinCosCall(), instrumentMaskedLoadOrStore(), is_empty(), isExistingPhi(), IsIncrementNUW(), isLoopDead(), IsNonLocalValue(), isOnlyReachableViaThisEdge(), isPotentiallyNaryReassociable(), isProfitableChain(), isProfitableForVectorization(), llvm::isSafeToLoadUnconditionally(), llvm::Value::isUsedInBasicBlock(), isZero(), llvm::IVUsers::IVUsers(), LLVMGetFirstInstruction(), LLVMGetLastInstruction(), LLVMGetPreviousInstruction(), llvm::log2(), makeBitReverse(), makeStatepointExplicitImpl(), llvm::SparseSolver< LatticeKey, LatticeVal, KeyInfo >::MarkBlockExecutable(), MarkBlocksLiveIn(), memoryIsNotModifiedBetween(), llvm::MergeBasicBlockIntoOnlyPred(), llvm::MergeBlockIntoPredecessor(), mergeCleanupPad(), mergeEmptyReturnBlocks(), moveBBContents(), NegateValue(), normalizeForInvokeSafepoint(), operator new(), operator<<(), optimizeSQRT(), llvm::OrderedBasicBlock::OrderedBasicBlock(), llvm::peelLoop(), performMaskedAtomicOp(), ProcessBlock(), processInternalGlobal(), promoteMemoryToRegister(), promoteSingleBlockAlloca(), PushLoopPHIs(), ReduceSwitchRange(), relocateInstructionBefore(), removeEmptyCleanup(), removePredecessor(), llvm::RemovePredecessorAndSimplify(), removeUndefIntroducingPredecessor(), replaceAllUsesOfWithIn(), ReplaceUsesOfWith(), rewritePHINodesForExitAndUnswitchedBlocks(), RewriteUsesOfClonedInstructions(), runOnBasicBlock(), scalarizeMaskedScatter(), scanInlinedCode(), scanPHIsAndUpdateValueMap(), shouldKeepInEntry(), shouldSpeculateInstrs(), SimplifyBranchOnICmpChain(), SimplifyCondBranchToCondBranch(), llvm::InstCombiner::simplifyDivRemOfSelectWithZeroOp(), llvm::SimplifyInstructionsInBlock(), SimplifyLoopInst(), llvm::simplifyLoopIVs(), simplifyOneLoop(), llvm::JumpThreadingPass::SimplifyPartiallyRedundantLoad(), llvm::sinkRegion(), SpeculativelyExecuteBB(), llvm::SplitBlockPredecessors(), llvm::SplitCriticalEdge(), splitPredecessorsOfLoopExit(), StackMallocSizeClass(), llvm::JumpThreadingPass::ThreadEdge(), llvm::JumpThreadingPass::ThreadGuard(), truncateIVUse(), tryToElideArgumentCopy(), llvm::TryToSimplifyUncondBranchFromEmptyBlock(), tryToSimplifyUncondBranchWithICmpInIt(), llvm::JumpThreadingPass::TryToUnfoldSelectInCurrBB(), tryToVectorizeHorReductionOrInstOperands(), TurnSwitchRangeIntoICmp(), llvm::UnrollLoop(), UpdatePHINodes(), updatePhiNodes(), llvm::LoopVersioning::versionLoop(), llvm::InstVisitor< ObjectSizeOffsetVisitor, SizeOffsetType >::visit(), llvm::Interpreter::visitIndirectBrInst(), llvm::InstCombiner::visitPHINode(), and llvm::InstCombiner::visitStoreInst().

◆ begin() [2/2]

const_iterator llvm::BasicBlock::begin ( ) const
inline

Definition at line 253 of file BasicBlock.h.

◆ canSplitPredecessors()

bool BasicBlock::canSplitPredecessors ( ) const

◆ classof()

static bool llvm::BasicBlock::classof ( const Value V)
inlinestatic

Methods for support type inquiry through isa, cast, and dyn_cast.

Definition at line 329 of file BasicBlock.h.

References canSplitPredecessors(), dropAllReferences(), llvm::Value::getValueID(), I, removePredecessor(), and splitBasicBlock().

◆ Create()

static BasicBlock* llvm::BasicBlock::Create ( LLVMContext Context,
const Twine Name = "",
Function Parent = nullptr,
BasicBlock InsertBefore = nullptr 
)
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 101 of file BasicBlock.h.

References llvm::ISD::BasicBlock.

Referenced by addBoundsChecking(), assureFPCallStub(), llvm::CloneBasicBlock(), llvm::CloneFunction(), createCast(), createDevirtTriggerFunc(), createDummyFunction(), llvm::createDwarfEHPass(), llvm::createEfficiencySanitizerPass(), createEmptyFunction(), createFPFnStub(), llvm::createMemCpyLoop(), llvm::createMemCpyLoopKnownSize(), llvm::createMemCpyLoopUnknownSize(), createMemMoveLoop(), createMemSetLoop(), CreatePrologue(), createResumeEntryBlock(), llvm::createSanitizerCtorAndInitFunctions(), CreateWrapper(), llvm::VPBlockBase::deleteCFG(), ehAwareSplitEdge(), eliminateRecursiveTailCall(), llvm::CodeExtractor::extractCodeRegion(), llvm::CodeExtractor::findInputsOutputs(), llvm::SanitizerStatReport::finish(), FitWeights(), fixPhis(), FoldCondBranchOnPHI(), FunctionNumber(), generateUnsignedDivisionCode(), getSignature(), getTrueOrFalseValue(), INITIALIZE_PASS(), insertUniqueBackedgeBlock(), instrumentMaskedLoadOrStore(), LLVMAppendBasicBlockInContext(), LLVMInsertBasicBlockInContext(), llvm::orc::makeStub(), mayLoopAccessLocation(), needsRuntimeRegistrationOfSectionRange(), llvm::EscapeEnumerator::Next(), optimizeSQRT(), PerformHeapAllocSRoA(), performMaskedAtomicOp(), readWideAPInt(), ReplaceUsesOfWith(), llvm::UnifyFunctionExitNodes::runOnFunction(), scaleWeights(), selectJumpTableArmEncoding(), shouldKeepInEntry(), SimplifyCondBranchToCondBranch(), splitBasicBlock(), llvm::SplitBlockAndInsertIfThen(), llvm::SplitBlockAndInsertIfThenElse(), llvm::SplitBlockPredecessors(), llvm::SplitCriticalEdge(), llvm::SplitLandingPadPredecessors(), SumCanReachMin(), SwitchToLookupTable(), llvm::JumpThreadingPass::ThreadEdge(), tryToSimplifyUncondBranchWithICmpInIt(), llvm::JumpThreadingPass::TryToUnfoldSelect(), unifyReturnBlockSet(), and unswitchTrivialSwitch().

◆ dropAllReferences()

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 210 of file BasicBlock.cpp.

References llvm::User::dropAllReferences(), and I.

Referenced by classof(), deleteDeadBlocksFromLoop(), llvm::Function::dropAllReferences(), eliminateUnreachableBlock(), and ~BasicBlock().

◆ empty()

bool llvm::BasicBlock::empty ( ) const
inline

◆ end() [1/2]

iterator llvm::BasicBlock::end ( )
inline

Definition at line 254 of file BasicBlock.h.

Referenced by AddReachableCodeToWorklist(), asmClobbersCTR(), llvm::calculateClrEHStateNumbers(), llvm::changeToUnreachable(), CheckForCanReleaseCFGHazard(), llvm::CloneBasicBlock(), llvm::CloneFunction(), llvm::FunctionComparator::cmpBasicBlocks(), llvm::computeLoopSafetyInfo(), llvm::ConvertDebugDeclareToDebugValue(), createCast(), llvm::createSeparateConstOffsetFromGEPPass(), cse(), cxxDtorIsEmpty(), DeleteBasicBlock(), detectCTLZIdiom(), detectPopcountIdiom(), doCallSiteSplitting(), llvm::JumpThreadingPass::DuplicateCondBranchOnPHIIntoPred(), eliminateDeadStores(), eliminateRecursiveTailCall(), llvm::objcarc::FindDependencies(), findSafeStoreForStoreStrongContraction(), first_use_of_in_block(), llvm::InnerLoopVectorizer::fixReduction(), foldBlockIntoPredecessor(), llvm::FoldBranchToCommonDest(), GetCaseResults(), getFirstInsertionPt(), getInductionVariable(), getMemSetPatternValue(), llvm::DOTGraphTraits< PGOUseFunc * >::getNodeLabel(), llvm::MemoryDependenceResults::getNonLocalCallDependency(), llvm::MemoryDependenceResults::getNonLocalPointerDependency(), llvm::DenseMapInfo< CallValue >::getTombstoneKey(), getTrueOrFalseValue(), getTypePartition(), llvm::BasicTTIImplBase< AMDGPUTTIImpl >::getUnrollingPreferences(), HandleCallsInBlockInlinedThroughInvoke(), handleEndBlock(), llvm::objcarc::BottomUpPtrState::HandlePotentialUse(), hasProfileData(), llvm::hoistRegion(), INITIALIZE_PASS(), insertDebugValues(), InsertSafepointPoll(), instrumentOneFunc(), llvm::isInTailCallPosition(), isOnlyReachableViaThisEdge(), isPotentiallyNaryReassociable(), llvm::isPotentiallyReachable(), isSafeAndProfitableToSinkLoad(), llvm::Value::isUsedInBasicBlock(), llvm::isValidAssumeForContext(), isZero(), LLVMGetFirstInstruction(), LLVMGetLastInstruction(), LLVMGetNextInstruction(), LLVMPositionBuilder(), makeBitReverse(), MarkBlocksLiveIn(), memoryIsNotModifiedBetween(), llvm::MergeBlockIntoPredecessor(), mergeConditionalStoreToAddress(), llvm::Instruction::moveBefore(), llvm::InjectorIRStrategy::mutate(), operator new(), OptimizeExtractBits(), llvm::OrderedBasicBlock::OrderedBasicBlock(), passingValueIsAlwaysUndefined(), performMaskedAtomicOp(), preheader(), llvm::PrepareToSplitEntryBlock(), ProcessBlock(), llvm::programUndefinedIfFullPoison(), promoteMemoryToRegister(), propagateMetadata(), relocateInstructionBefore(), removeTriviallyEmptyRange(), replaceAllUsesOfWithIn(), ReplaceUsesOfWith(), RewriteUsesOfClonedInstructions(), runOnBasicBlock(), scalarizeMaskedScatter(), scanOneBB(), llvm::IRBuilderBase::SetInsertPoint(), shouldInstrumentBlock(), llvm::SimplifyInstructionsInBlock(), SimplifyLoopInst(), llvm::JumpThreadingPass::SimplifyPartiallyRedundantLoad(), SinkCast(), SinkCmpExpression(), llvm::sinkRegion(), SinkShiftAndTruncate(), SpeculativelyExecuteBB(), splitBasicBlock(), TryToSinkInstruction(), llvm::JumpThreadingPass::TryToUnfoldSelect(), tryToVectorizeHorReductionOrInstOperands(), TypeSizeToSizeIndex(), unswitchTrivialBranch(), and llvm::InstVisitor< ObjectSizeOffsetVisitor, SizeOffsetType >::visit().

◆ end() [2/2]

const_iterator llvm::BasicBlock::end ( ) const
inline

Definition at line 255 of file BasicBlock.h.

◆ eraseFromParent()

iplist< BasicBlock >::iterator BasicBlock::eraseFromParent ( )

◆ front() [1/2]

const Instruction& llvm::BasicBlock::front ( ) const
inline

Definition at line 264 of file BasicBlock.h.

Referenced by llvm::calculateClrEHStateNumbers(), calculateStateNumbersForInvokes(), llvm::AAResults::canBasicBlockModify(), llvm::CloneAndPruneFunctionInto(), llvm::CloneAndPruneIntoFromInst(), CloneInstructionInExitBlock(), CloneLoop(), createCTLZIntrinsic(), llvm::SSAUpdaterTraits< SSAUpdater >::CreateEmptyPHI(), createPHIsForSplitLoopExit(), CreatePrologue(), llvm::DemotePHIToStack(), llvm::DemoteRegToStack(), despeculateCountZeros(), detectCTLZIdiom(), llvm::GVNExpression::Expression::dump(), eliminateDeadStores(), eliminateDeadSwitchCases(), eliminateRecursiveTailCall(), ensureValueAvailableInSuccessor(), llvm::CodeExtractor::findInputsOutputs(), findLocationForEntrySafepoint(), findTRECandidate(), llvm::IRTranslator::getAnalysisUsage(), llvm::SCEVExpander::getOrInsertCanonicalInductionVariable(), GetRMWLibcall(), getSuccPad(), getSuccState(), getTrueOrFalseValue(), llvm::SSAUpdater::GetValueInMiddleOfBlock(), INITIALIZE_PASS(), llvm::InlineFunction(), insertSpills(), instrumentMaskedLoadOrStore(), isEmptyFunction(), IsIncrementNUW(), isLoadConditional(), isOnlyReachableViaThisEdge(), isProfitableForVectorization(), isSafeToExecuteUnconditionally(), isSafeToPromoteArgument(), isZero(), MarkBlocksLiveIn(), llvm::MergeBlockIntoPredecessor(), mergeCleanupPad(), mergeEmptyReturnBlocks(), operator<<(), phis(), llvm::JumpThreadingPass::ProcessBranchOnXOR(), promoteSingleBlockAlloca(), llvm::removeAllNonTerminatorAndEHPadInstructions(), removePredecessor(), llvm::RemovePredecessorAndSimplify(), rewritePHIs(), llvm::UnifyFunctionExitNodes::runOnFunction(), llvm::JumpThreadingPass::SimplifyPartiallyRedundantLoad(), llvm::SplitEdge(), StackMallocSizeClass(), truncateIVUse(), llvm::TryToSimplifyUncondBranchFromEmptyBlock(), tryToSimplifyUncondBranchWithICmpInIt(), unswitchTrivialSwitch(), llvm::LoopVersioning::versionLoop(), and llvm::InstCombiner::visitStoreInst().

◆ front() [2/2]

Instruction& llvm::BasicBlock::front ( )
inline

Definition at line 265 of file BasicBlock.h.

◆ getContext()

LLVMContext & BasicBlock::getContext ( ) const

Get the context in which this basic block lives.

Definition at line 33 of file BasicBlock.cpp.

References assert(), llvm::ISD::BasicBlock, C, llvm::Type::getContext(), llvm::Type::getLabelTy(), llvm::Value::getType(), insertInto(), llvm::Value::setName(), and llvm::Value::Value().

Referenced by AddRuntimeUnrollDisableMetaData(), llvm::addStringMetadataToLoop(), allPredecessorsComeFromSameSource(), llvm::LoopVersioning::annotateInstWithNoAlias(), llvm::CloneBasicBlock(), llvm::CloneFunction(), CloneLoop(), llvm::ConstantFoldTerminator(), llvm::createMemCpyLoopKnownSize(), llvm::createMemCpyLoopUnknownSize(), createStringMetadata(), llvm::VPBlockBase::deleteCFG(), DisableAllLoopOptsOnLoop(), ehAwareSplitEdge(), emitCalloc(), llvm::emitFWrite(), llvm::emitMemChr(), llvm::emitMemCmp(), llvm::emitMemCpyChk(), llvm::emitStrLen(), llvm::emitStrNCmp(), EqualityPropUnSafe(), llvm::CodeExtractor::extractCodeRegion(), llvm::CodeExtractor::findInputsOutputs(), FitWeights(), llvm::AMDGPULibCalls::fold(), FoldCondBranchOnPHI(), foldMallocMemset(), llvm::InvokeInst::getLandingPadInst(), llvm::DenseMapInfo< CallValue >::getTombstoneKey(), insertCall(), insertUniqueBackedgeBlock(), IntersectUnsignedRange(), isOnlyReachableViaThisEdge(), llvm::MemorySSA::moveTo(), optimizeSQRT(), patchAndReplaceAllUsesWith(), PerformHeapAllocSRoA(), llvm::LoopVersioning::prepareNoAliasMetadata(), llvm::JumpThreadingPass::ProcessBranchOnXOR(), scaleWeights(), setBranchWeights(), llvm::Loop::setLoopAlreadyUnrolled(), splitBasicBlock(), llvm::SplitBlockAndInsertIfThen(), llvm::SplitBlockAndInsertIfThenElse(), llvm::SplitBlockPredecessors(), llvm::SplitLandingPadPredecessors(), llvm::JumpThreadingPass::ThreadEdge(), llvm::TryToSimplifyUncondBranchFromEmptyBlock(), tryToSimplifyUncondBranchWithICmpInIt(), llvm::UnreachableInst::UnreachableInst(), updatePredecessorProfileMetadata(), and ~BasicBlock().

◆ getFirstInsertionPt() [1/2]

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 200 of file BasicBlock.cpp.

References end(), getFirstNonPHI(), and llvm::ilist_node_impl< OptionsT >::getIterator().

Referenced by llvm::calculateClrEHStateNumbers(), cheapToScalarize(), CloneInstructionInExitBlock(), llvm::ConvertDebugDeclareToDebugValue(), ConvertToSInt(), createDirectCallInst(), llvm::InnerLoopVectorizer::createInductionVariable(), llvm::InnerLoopVectorizer::createVectorIntOrFpInductionPHI(), llvm::InnerLoopVectorizer::createVectorizedLoopSkeleton(), llvm::DemoteRegToStack(), llvm::GVNExpression::Expression::dump(), llvm::VPlan::execute(), llvm::SCEVExpander::expandCodeFor(), findIBRPredecessor(), findInsertPointAfter(), llvm::InnerLoopVectorizer::fixFirstOrderRecurrence(), llvm::InnerLoopVectorizer::fixReduction(), genLoopLimit(), getFirstInsertionPt(), getFirstNonPHIOrDbgOrLifetime(), getIncrmentFactorSCEV(), GetPointerOperand(), getRetComponentType(), getScalarIntrinsicDeclaration(), getSignature(), llvm::objcarc::BottomUpPtrState::HandlePotentialUse(), insertSpills(), instrumentMaskedLoadOrStore(), instrumentOneFunc(), makeBitReverse(), makeStatepointExplicitImpl(), MarkBlocksLiveIn(), mergeConditionalStoreToAddress(), llvm::InjectorIRStrategy::mutate(), llvm::InstDeleterIRStrategy::mutate(), llvm::RandomIRBuilder::newSink(), llvm::RandomIRBuilder::newSource(), OptimizeExtractBits(), false::LibCallsShrinkWrap::perform(), llvm::promoteIndirectCall(), rematerializeLiveValues(), replaceAllUsesOfWithIn(), llvm::SCEVExpander::replaceCongruentIVs(), replaceExtractElements(), rewriteMaterializableInstructions(), llvm::InstCombiner::run(), setInsertionPoint(), shouldInstrumentBlock(), simplifyRelocatesOffABase(), SinkCast(), SinkCmpExpression(), SinkShiftAndTruncate(), splitCallSite(), llvm::SplitLandingPadPredecessors(), llvm::JumpThreadingPass::ThreadGuard(), truncateIVUse(), TryToSinkInstruction(), TypeSizeToSizeIndex(), llvm::sroa::AllocaSliceRewriter::visit(), llvm::InstCombiner::visitGetElementPtrInst(), llvm::ObjectSizeOffsetEvaluator::visitPHINode(), llvm::InstCombiner::visitStoreInst(), and llvm::InnerLoopVectorizer::widenPHIInstruction().

◆ getFirstInsertionPt() [2/2]

iterator llvm::BasicBlock::getFirstInsertionPt ( )
inline

◆ getFirstNonPHI() [1/2]

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 171 of file BasicBlock.cpp.

References I.

Referenced by llvm::calculateClrEHStateNumbers(), calculateStateNumbersForInvokes(), canSplitCallSite(), canSplitPredecessors(), CloneLoopBlocks(), llvm::colorEHFunclets(), ConnectProlog(), llvm::createMemCpyLoopKnownSize(), createPHIsForSplitLoopExit(), detectCTLZIdiom(), detectPopcountIdiom(), DFS(), ehAwareSplitEdge(), findIBRPredecessor(), llvm::CodeExtractor::findInputsOutputs(), llvm::CodeExtractor::findOrCreateBlockForHoisting(), findUnwindDestinations(), fixPhis(), getFirstInsertionPt(), getFirstNonPHI(), getJumpThreadDuplicationCost(), getLandingPadInst(), getParentPad(), GetPointerOperand(), getSignature(), getSuccPad(), getSuccState(), getTerminatingMustTailCall(), getUnwindDestTokenHelper(), llvm::SSAUpdater::GetValueInMiddleOfBlock(), HandleInlinedEHPad(), hasExceptionPointerOrCodeUser(), llvm::InlineFunction(), isAtomic(), isEHPad(), isLandingPad(), isPredicatedOnPHI(), isProfitableForVectorization(), isWrapperOnlyCall(), markAliveBlocks(), llvm::programUndefinedIfFullPoison(), relocationViaAlloca(), removeEmptyCleanup(), rewritePHIs(), shouldReorderOperands(), SimplifyBranchOnICmpChain(), splitCallSite(), llvm::SplitLandingPadPredecessors(), TypeSizeToSizeIndex(), and llvm::UnrollRuntimeLoopRemainder().

◆ getFirstNonPHI() [2/2]

Instruction* llvm::BasicBlock::getFirstNonPHI ( )
inline

Definition at line 154 of file BasicBlock.h.

References getFirstNonPHI(), and getFirstNonPHIOrDbg().

◆ getFirstNonPHIOrDbg() [1/2]

const Instruction * BasicBlock::getFirstNonPHIOrDbg ( ) const

◆ getFirstNonPHIOrDbg() [2/2]

Instruction* llvm::BasicBlock::getFirstNonPHIOrDbg ( )
inline

Definition at line 162 of file BasicBlock.h.

References getFirstNonPHIOrDbg(), and getFirstNonPHIOrDbgOrLifetime().

◆ getFirstNonPHIOrDbgOrLifetime() [1/2]

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 185 of file BasicBlock.cpp.

References I.

Referenced by getFirstNonPHIOrDbg(), getFirstNonPHIOrDbgOrLifetime(), insertDebugValues(), simplifyTerminatorLeadingToRet(), and SortCallTargets().

◆ getFirstNonPHIOrDbgOrLifetime() [2/2]

Instruction* llvm::BasicBlock::getFirstNonPHIOrDbgOrLifetime ( )
inline

Definition at line 170 of file BasicBlock.h.

References getFirstInsertionPt(), and getFirstNonPHIOrDbgOrLifetime().

◆ getInstList() [1/2]

const InstListType& llvm::BasicBlock::getInstList ( ) const
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 317 of file BasicBlock.h.

Referenced by llvm::calculateClrEHStateNumbers(), callsiteIsHot(), llvm::changeToInvokeAndSplitBasicBlock(), llvm::changeToUnreachable(), llvm::CloneAndPruneIntoFromInst(), llvm::CloneBasicBlock(), llvm::CloneFunction(), CloneInstructionInExitBlock(), llvm::BinaryOperator::Create(), createCallHelper(), createDirectCallInst(), createInvokeHelper(), createMalloc(), llvm::DeleteDeadBlock(), llvm::JumpThreadingPass::DuplicateCondBranchOnPHIIntoPred(), eliminateRecursiveTailCall(), eliminateUnreachableBlock(), llvm::Instruction::eraseFromParent(), llvm::CodeExtractor::extractCodeRegion(), llvm::CodeExtractor::findInputsOutputs(), fixPhis(), foldBlockIntoPredecessor(), llvm::FoldBranchToCommonDest(), FoldCondBranchOnPHI(), llvm::FoldReturnIntoUncondBranch(), FoldTwoEntryPHINode(), FunctionNumber(), llvm::IRBuilderBase::getCurrentFunctionReturnType(), HoistThenElseCodeToIf(), llvm::InlineFunction(), llvm::Instruction::insertAfter(), llvm::Instruction::insertBefore(), insertCallRetPHI(), llvm::IRBuilderDefaultInserter::InsertHelper(), llvm::InstCombiner::InsertNewInstBefore(), insertUniqueBackedgeBlock(), llvm::Instruction::Instruction(), LdStHasDebugValue(), llvm::MergeBasicBlockIntoOnlyPred(), llvm::MergeBlockIntoPredecessor(), moveBBContents(), llvm::Instruction::moveBefore(), false::LibCallsShrinkWrap::perform(), preheader(), llvm::promoteIndirectCall(), promoteSingleBlockAlloca(), readWideAPInt(), llvm::Instruction::removeFromParent(), removePredecessor(), llvm::ReplaceInstWithInst(), ReplaceUsesOfWith(), llvm::InstCombiner::run(), llvm::UnifyFunctionExitNodes::runOnFunction(), shouldSpeculateInstrs(), SimplifyFunction(), SpeculativelyExecuteBB(), splitBasicBlock(), llvm::SplitLandingPadPredecessors(), llvm::JumpThreadingPass::ThreadEdge(), llvm::TryToSimplifyUncondBranchFromEmptyBlock(), llvm::JumpThreadingPass::TryToUnfoldSelect(), unifyReturnBlockSet(), llvm::UnrollLoop(), unswitchTrivialBranch(), and llvm::InstCombiner::visitGetElementPtrInst().

◆ getInstList() [2/2]

InstListType& llvm::BasicBlock::getInstList ( )
inline

Definition at line 318 of file BasicBlock.h.

◆ getIrrLoopHeaderWeight()

Optional< uint64_t > BasicBlock::getIrrLoopHeaderWeight ( ) const

◆ getLandingPadInst() [1/2]

const LandingPadInst * BasicBlock::getLandingPadInst ( ) const

Return the landingpad instruction associated with the landing pad.

Definition at line 447 of file BasicBlock.cpp.

References llvm::dyn_cast(), and getFirstNonPHI().

Referenced by CloneLoop(), getLandingPadInst(), getParentPad(), isEHPad(), makeStatepointExplicitImpl(), MarkBlocksLiveIn(), and llvm::SplitLandingPadPredecessors().

◆ getLandingPadInst() [2/2]

LandingPadInst* llvm::BasicBlock::getLandingPadInst ( )
inline

◆ getModule() [1/2]

const Module * BasicBlock::getModule ( ) const

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::LoopAccessInfo::addRuntimeChecks(), llvm::CloneFunction(), llvm::InnerLoopVectorizer::createVectorizedLoopSkeleton(), llvm::JumpThreadingPass::DuplicateCondBranchOnPHIIntoPred(), eliminateDeadStores(), llvm::emitBinaryFloatFnCall(), emitCalloc(), llvm::emitFPutC(), llvm::emitFPutS(), llvm::emitFWrite(), llvm::emitMemChr(), llvm::emitMemCmp(), llvm::emitMemCpyChk(), llvm::emitPutChar(), llvm::emitPutS(), llvm::InnerLoopVectorizer::emitSCEVChecks(), llvm::emitStrChr(), llvm::emitStrCpy(), llvm::emitStrLen(), llvm::emitStrNCmp(), llvm::emitStrNCpy(), llvm::emitUnaryFloatFnCall(), llvm::LazyValueInfo::eraseBlock(), llvm::FindAvailablePtrLoadStore(), FindLoopCounter(), findPHIToPartitionLoops(), llvm::InnerLoopVectorizer::fixupIVUsers(), llvm::LazyValueInfo::getConstant(), llvm::LazyValueInfo::getConstantOnEdge(), llvm::LazyValueInfo::getConstantRange(), llvm::LazyValueInfo::getConstantRangeOnEdge(), getEdgeValueLocal(), llvm::Instruction::getModule(), getModule(), llvm::InnerLoopVectorizer::getOrCreateTripCount(), getParent(), GetPointerOperand(), llvm::LazyValueInfo::getPredicateOnEdge(), llvm::getPtrStride(), getSignature(), llvm::MemoryDependenceResults::getSimplePointerDependencyFrom(), llvm::SSAUpdater::GetValueInMiddleOfBlock(), handleEndBlock(), isIgnorableInst(), isLoadConditional(), isObjectDereferencedInBlock(), mayLoopAccessLocation(), llvm::MemoryDepChecker::Dependence::print(), llvm::JumpThreadingPass::ProcessBlock(), llvm::JumpThreadingPass::ProcessImpliedCondition(), llvm::promoteLoopAccessesToScalars(), ReduceLoopStrength(), ReplaceUsesOfWith(), llvm::LoopRotatePass::run(), llvm::LoopPredicationPass::run(), llvm::IndVarSimplifyPass::run(), llvm::LoopIdiomRecognizePass::run(), llvm::simplifyCFG(), llvm::SimplifyInstructionsInBlock(), SimplifyLoopInst(), simplifyOneLoop(), SumCanReachMin(), llvm::LazyValueInfo::threadEdge(), llvm::JumpThreadingPass::ThreadGuard(), tryToVectorizeHorReductionOrInstOperands(), llvm::UnrollLoop(), llvm::UnrollRuntimeLoopRemainder(), llvm::LoopVersioning::versionLoop(), llvm::InnerLoopVectorizer::widenIntOrFpInduction(), and llvm::InnerLoopVectorizer::widenPHIInstruction().

◆ getModule() [2/2]

Module* llvm::BasicBlock::getModule ( )
inline

Definition at line 116 of file BasicBlock.h.

References getModule(), getTerminator(), and LLVM_READONLY.

◆ getParent() [1/2]

const Function* llvm::BasicBlock::getParent ( ) const
inline

Return the enclosing method, or null if none.

Definition at line 108 of file BasicBlock.h.

Referenced by llvm::addLandingPadInfo(), addNoRecurseAttrsTopDown(), asmClobbersCTR(), calculateSEHStateNumbers(), callIntrinsic(), callsiteIsHot(), canFoldIVIncExpr(), castToIncrementInst(), CC_MipsO32_FP64(), llvm::changeToUnreachable(), llvm::CloneBasicBlock(), llvm::CloneFunction(), CloneLoop(), cloneLoopBlocks(), CloneLoopBlocks(), llvm::cloneLoopWithPreheader(), llvm::CodeMetrics::collectEphemeralValues(), CompareValueComplexity(), computeKnownBitsFromAssume(), llvm::computeLoopSafetyInfo(), llvm::computePeelCount(), computeUnrollCount(), llvm::SanitizerStatReport::create(), llvm::createArgumentPromotionPass(), llvm::IRBuilderBase::CreateAssumption(), llvm::IRBuilderBase::CreateBinaryIntrinsic(), llvm::createCodeGenPreparePass(), createCTLZIntrinsic(), llvm::IRBuilderBase::CreateElementUnorderedAtomicMemCpy(), llvm::IRBuilderBase::CreateFAddReduce(), llvm::IRBuilderBase::CreateFMulReduce(), llvm::IRBuilderBase::CreateGCRelocate(), llvm::IRBuilderBase::CreateGCResult(), CreateGCStatepointCallCommon(), CreateGCStatepointInvokeCommon(), llvm::IRBuilderBase::CreateGlobalString(), llvm::IRBuilderBase::CreateInvariantStart(), llvm::IRBuilderBase::CreateLifetimeEnd(), llvm::IRBuilderBase::CreateLifetimeStart(), llvm::IRBuilderBase::CreateMaskedStore(), createMaskInstrs(), llvm::IRBuilderBase::CreateMemCpy(), llvm::createMemCpyLoop(), llvm::createMemCpyLoopKnownSize(), llvm::createMemCpyLoopUnknownSize(), llvm::IRBuilderBase::CreateMemMove(), createMemMoveLoop(), llvm::IRBuilderBase::CreateMemSet(), createMemSetLoop(), createPopcntIntrinsic(), llvm::createSeparateConstOffsetFromGEPPass(), DeleteBasicBlock(), llvm::VPBlockBase::deleteCFG(), deleteDeadInstruction(), llvm::DemotePHIToStack(), llvm::DemoteRegToStack(), despeculateCountZeros(), DFS(), DisableAllLoopOptsOnLoop(), llvm::InstCombiner::dominatesAllUses(), ehAwareSplitEdge(), eliminateRecursiveTailCall(), llvm::AArch64TargetLowering::emitAtomicCmpXchgNoStoreLLBalance(), llvm::ARMTargetLowering::emitAtomicCmpXchgNoStoreLLBalance(), llvm::HexagonTargetLowering::emitLoadLinked(), llvm::AArch64TargetLowering::emitLoadLinked(), llvm::ARMTargetLowering::emitLoadLinked(), llvm::HexagonTargetLowering::emitStoreConditional(), llvm::AArch64TargetLowering::emitStoreConditional(), llvm::ARMTargetLowering::emitStoreConditional(), llvm::PPCTargetLowering::emitTrailingFence(), enableCallSafepoints(), EqualityPropUnSafe(), eraseFromParent(), llvm::AlignmentFromAssumptionsPass::extractAlignmentInfo(), llvm::CodeExtractor::extractCodeRegion(), llvm::findDevirtualizableCallsForTypeTest(), findIBRPredecessor(), llvm::CodeExtractor::findInputsOutputs(), FindLIVLoopCondition(), findTRECandidate(), findUnwindDestinations(), FitWeights(), fixPhis(), llvm::AMDGPULibCalls::fold(), FoldCondBranchOnPHI(), GatherDominatingDefs(), gatherUnrollingPreferences(), generateUnsignedDivisionCode(), llvm::BlockAddress::get(), llvm::MMIAddrLabelMap::getAddrLabelSymbolToEmit(), getCommonReturnValue(), getCompareCC(), getComparePred(), llvm::IRBuilderBase::getCurrentFunctionReturnType(), getDebugLocString(), llvm::TargetLoweringBase::getDefaultSafeStackPointerLocation(), llvm::MemoryDependenceResults::getDependency(), getDescription(), llvm::BasicTTIImplBase< AMDGPUTTIImpl >::getEstimatedNumberOfCaseClusters(), llvm::Trace::getFunction(), llvm::Instruction::getFunction(), llvm::ValueEnumerator::getGlobalBasicBlockID(), llvm::TargetLoweringBase::getIRStackGuard(), llvm::MemoryDependenceResults::getLoadLoadClobberFullWidthSize(), GetLocation(), getModule(), llvm::DOTGraphTraits< BoUpSLP * >::getNodeAttributes(), llvm::DOTGraphTraits< DomTreeNode * >::getNodeLabel(), llvm::DOTGraphTraits< RegionNode * >::getNodeLabel(), llvm::MemoryDependenceResults::getNonLocalCallDependency(), getParameterABIAttributes(), llvm::CallSiteBase<>::getParent(), getParentPad(), GetPointerOperand(), getPointerOperands(), getReductionIntrinsic(), llvm::SCEVExpander::getRelatedExistingExpansion(), llvm::TargetLoweringBase::getSafeStackPointerLocation(), getSignature(), llvm::MemoryDependenceResults::getSimplePointerDependencyFrom(), getSubprogram(), getSuccPad(), getTrueOrFalseValue(), llvm::ARMTTIImpl::getUnrollingPreferences(), getValueSymbolTable(), getVarName(), getX86SSEConditionCode(), handleEndBlock(), HandleInlinedEHPad(), HandleInlinedLandingPad(), handlePhiDef(), hasOutsideLoopUser(), hasProfileData(), hasUnaryFloatFn(), INITIALIZE_PASS(), INITIALIZE_PASS_WITH_OPTIONS(), llvm::InlineFunction(), insertCall(), insertCallRetCast(), insertDebugValues(), InsertSafepointPoll(), insertSinCosCall(), instrumentMaskedLoadOrStore(), IntersectUnsignedRange(), llvm::isAllocaPromotable(), isAlwaysFoldable(), isCallPromotable(), isDynamicConstant(), llvm::SelectionDAGBuilder::isExportableFromCurrentBlock(), isIgnorableInst(), llvm::isInTailCallPosition(), isLoadConditional(), IsNonLocalValue(), isNotUsedInLoop(), isObjectDereferencedInBlock(), isOnlyReachableViaThisEdge(), isPointerValueDeadOnEntryToFunction(), llvm::isPotentiallyReachable(), llvm::RecurrenceDescriptor::isReductionPHI(), isReportingError(), llvm::AllocaInst::isStaticAlloca(), llvm::TargetLoweringBase::isSuitableForJumpTable(), llvm::AMDGPULibCalls::isUnsafeMath(), isZero(), LLVMGetNextBasicBlock(), LLVMGetPreviousBasicBlock(), LLVMInsertBasicBlockInContext(), llvm::BlockAddress::lookup(), llvm::CallLowering::lowerCall(), llvm::SelectionDAGBuilder::LowerCallTo(), LowerInterruptReturn(), llvm::ARMTargetLowering::makeDMB(), llvm::AMDGPUSubtarget::makeLIDRangeMetadata(), llvm::HexagonTargetLowering::mayBeEmittedAsTailCall(), llvm::SITargetLowering::mayBeEmittedAsTailCall(), maybePrintComdat(), mayLoopAccessLocation(), memoryIsNotModifiedBetween(), llvm::MergeBasicBlockIntoOnlyPred(), mergeCleanupPad(), moveAfter(), moveBefore(), needsRuntimeRegistrationOfSectionRange(), NegateValue(), operator<<(), optimizeSQRT(), llvm::peelLoop(), PerformHeapAllocSRoA(), performMaskedAtomicOp(), placeSplitBlockCarefully(), populateWorklist(), llvm::PrepareToSplitEntryBlock(), llvm::DivergenceAnalysis::print(), llvm::MemoryDepChecker::Dependence::print(), llvm::Value::print(), llvm::MIPrinter::printIRBlockReference(), llvm::LazyValueInfo::printLVI(), llvm::JumpThreadingPass::ProcessBlock(), llvm::LoopVectorizePass::processLoop(), promoteSingleBlockAlloca(), ReduceLoopStrength(), llvm::AssumptionCache::registerAssumption(), removeFromParent(), RemoveInstInputs(), removeUndefIntroducingPredecessor(), replaceAllUsesOfWithIn(), replaceConstantExprOp(), replaceExtractElements(), ReplaceUsesOfWith(), reportLoadElim(), RewriteUsesOfClonedInstructions(), llvm::LoopAccessInfoPrinterPass::run(), llvm::LoopRotatePass::run(), llvm::LoopDataPrefetchPass::run(), llvm::IndVarSimplifyPass::run(), llvm::SimpleLoopUnswitchPass::run(), llvm::JumpThreadingPass::runImpl(), llvm::IVUsersWrapperPass::runOnLoop(), scaleWeights(), scanOneBB(), llvm::setProfMetadata(), llvm::AArch64TTIImpl::shouldConsiderAddressTypePromotion(), shouldConvert(), llvm::CaptureTracker::shouldExplore(), shouldGuaranteeTCO(), ShrinkDemandedConstant(), SimplifyCondBranchToCondBranch(), SimplifyLoopInst(), simplifyRelocatesOffABase(), sinkLoopInvariantInstructions(), llvm::BasicBlockPass::skipBasicBlock(), llvm::LoopPass::skipLoop(), splitBasicBlock(), llvm::SplitBlockAndInsertIfThen(), llvm::SplitBlockAndInsertIfThenElse(), llvm::fuzzerop::splitBlockDescriptor(), llvm::SplitBlockPredecessors(), llvm::SplitCriticalEdge(), llvm::SplitLandingPadPredecessors(), stripModuloOnShift(), SwitchToLookupTable(), llvm::JumpThreadingPass::ThreadEdge(), tryCreateCallSitesOnOrPredicatedArgument(), tryToElideArgumentCopy(), TryToMergeLandingPad(), llvm::TryToSimplifyUncondBranchFromEmptyBlock(), tryToSimplifyUncondBranchWithICmpInIt(), TryToSinkInstruction(), tryToUnrollLoop(), llvm::UnrollLoop(), llvm::UnrollRuntimeLoopRemainder(), unswitchLoop(), updateOperand(), useFuncSeen(), UseTlsOffset(), ValueDominatesPHI(), llvm::InstCombiner::visitAllocaInst(), llvm::InstCombiner::visitLandingPadInst(), llvm::InnerLoopVectorizer::widenInstruction(), and ~BasicBlock().

◆ getParent() [2/2]

Function* llvm::BasicBlock::getParent ( )
inline

Definition at line 109 of file BasicBlock.h.

References getModule().

◆ getSinglePredecessor() [1/2]

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 217 of file BasicBlock.cpp.

References E, llvm::pred_begin(), and llvm::pred_end().

Referenced by allPredecessorsComeFromSameSource(), llvm::LoopVectorizationPlanner::buildVPlans(), CanPropagatePredecessorsForPHIs(), canSafelyUnrollMultiExitLoop(), llvm::CloneAndPruneIntoFromInst(), llvm::collectCmpOps(), llvm::createCodeGenPreparePass(), llvm::DeleteDeadBlock(), detectCTLZIdiom(), llvm::DominatorTree::dominates(), llvm::VPlan::execute(), findIBRPredecessor(), FindPHIForConditionForwarding(), findRetainForStoreStrongContraction(), fixPhis(), foldBlockIntoPredecessor(), llvm::FoldBranchToCommonDest(), foldSelectICmpAndOr(), getFirstInsertionPt(), llvm::GetIfCondition(), getSinglePredecessor(), llvm::DenseMapInfo< CallValue >::getTombstoneKey(), handlePhiDef(), insertDebugValues(), llvm::ScalarEvolution::isLoopBackedgeGuardedByCond(), isOnlyReachableViaThisEdge(), isOrHeader(), llvm::isValidAssumeForContext(), llvm::MergeBasicBlockIntoOnlyPred(), mergeCleanupPad(), mergeConditionalStores(), mergeConditionalStoreToAddress(), false::LibCallsShrinkWrap::perform(), llvm::JumpThreadingPass::ProcessBlock(), llvm::JumpThreadingPass::ProcessGuards(), llvm::JumpThreadingPass::ProcessImpliedCondition(), processUGT_ADDCST_ADD(), ReduceSwitchRange(), removeUndefIntroducingPredecessor(), replaceAllUsesOfWithIn(), llvm::InstCombiner::replacedSelectWithOperand(), ReplaceUsesOfWith(), reportMayClobberedLoad(), llvm::SpeculativeExecutionPass::runImpl(), shouldInstrumentBlock(), shouldSpeculateInstrs(), simplifyLoopCFG(), simplifyOneLoop(), llvm::JumpThreadingPass::SimplifyPartiallyRedundantLoad(), SolveQuadraticEquation(), llvm::SplitEdge(), tryToMoveFreeBeforeNullTest(), tryToSimplifyUncondBranchWithICmpInIt(), and TypeSizeToSizeIndex().

◆ getSinglePredecessor() [2/2]

BasicBlock* llvm::BasicBlock::getSinglePredecessor ( )
inline

Definition at line 212 of file BasicBlock.h.

References getSinglePredecessor(), and getUniquePredecessor().

◆ getSingleSuccessor() [1/2]

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 244 of file BasicBlock.cpp.

References E, SI, llvm::succ_begin(), and llvm::succ_end().

Referenced by ensureValueAvailableInSuccessor(), llvm::VPlan::execute(), findIBRPredecessor(), getSingleSuccessor(), getUniquePredecessor(), insertCallRetPHI(), mergeConditionalStores(), false::LibCallsShrinkWrap::perform(), llvm::programUndefinedIfFullPoison(), llvm::SpeculativeExecutionPass::runImpl(), and simplifyLoopCFG().

◆ getSingleSuccessor() [2/2]

BasicBlock* llvm::BasicBlock::getSingleSuccessor ( )
inline

Definition at line 234 of file BasicBlock.h.

References getSingleSuccessor(), and getUniqueSuccessor().

◆ getSublistAccess()

static InstListType BasicBlock::* llvm::BasicBlock::getSublistAccess ( Instruction )
inlinestatic

Returns a pointer to a member of the instruction list.

Definition at line 321 of file BasicBlock.h.

References getValueSymbolTable().

◆ getTerminatingDeoptimizeCall() [1/2]

const CallInst * BasicBlock::getTerminatingDeoptimizeCall ( ) const

Returns the call instruction calling .experimental.deoptimize 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(), and F().

Referenced by findUnwindDestinations(), getTerminatingDeoptimizeCall(), getTerminator(), and llvm::InlineFunction().

◆ getTerminatingDeoptimizeCall() [2/2]

CallInst* llvm::BasicBlock::getTerminatingDeoptimizeCall ( )
inline

Definition at line 133 of file BasicBlock.h.

References getTerminatingDeoptimizeCall(), and getTerminatingMustTailCall().

◆ getTerminatingMustTailCall() [1/2]

const CallInst * BasicBlock::getTerminatingMustTailCall ( ) const

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 125 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 getTerminatingDeoptimizeCall(), getTerminatingMustTailCall(), and llvm::InlineFunction().

◆ getTerminatingMustTailCall() [2/2]

CallInst* llvm::BasicBlock::getTerminatingMustTailCall ( )
inline

Definition at line 142 of file BasicBlock.h.

References getFirstNonPHI(), and getTerminatingMustTailCall().

◆ getTerminator() [1/2]

const TerminatorInst * 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 120 of file BasicBlock.cpp.

References llvm::dyn_cast().

Referenced by AddReachableCodeToWorklist(), llvm::addStringMetadataToLoop(), allPredecessorsComeFromSameSource(), asmClobbersCTR(), BlockIsSimpleEnoughToThreadThrough(), BrPHIToSelect(), llvm::LoopVectorizationPlanner::buildVPlans(), llvm::calculateClrEHStateNumbers(), canExpandBackedgeTakenCount(), canFoldIVIncExpr(), canRenameComdat(), canSinkInstructions(), canSplitPredecessors(), checkBasicSSA(), llvm::CloneAndPruneIntoFromInst(), llvm::CloneFunction(), llvm::CloneFunctionInto(), CloneLoop(), cloneLoopBlocks(), CloneLoopBlocks(), llvm::collectCmpOps(), llvm::LoopVectorizationPlanner::collectTriviallyDeadInstructions(), llvm::colorEHFunclets(), llvm::FunctionComparator::compare(), llvm::ComputeSpeculationCost(), ConnectProlog(), llvm::ConstantFoldTerminator(), ConvertToSInt(), createCast(), llvm::createCodeGenPreparePass(), createCTLZIntrinsic(), CreateGCRelocates(), llvm::InnerLoopVectorizer::createInductionVariable(), llvm::createLICMPass(), llvm::createMemCpyLoop(), llvm::createMemCpyLoopKnownSize(), llvm::createMemCpyLoopUnknownSize(), createMemMoveLoop(), createMemSetLoop(), createPHIsForSplitLoopExit(), CreatePrologue(), llvm::InnerLoopVectorizer::createVectorIntOrFpInductionPHI(), llvm::InnerLoopVectorizer::createVectorizedLoopSkeleton(), llvm::VPBlockBase::deleteCFG(), llvm::DeleteDeadBlock(), llvm::DemotePHIToStack(), despeculateCountZeros(), detectCTLZIdiom(), detectPopcountIdiom(), DFS(), DominatesMergePoint(), llvm::JumpThreadingPass::DuplicateCondBranchOnPHIIntoPred(), llvm::DuplicateInstructionsInSplitBetween(), ehAwareSplitEdge(), eliminateDeadStores(), eliminateDeadSwitchCases(), eliminateTailRecursion(), llvm::InnerLoopVectorizer::emitMemRuntimeChecks(), llvm::InnerLoopVectorizer::emitMinimumIterationCountCheck(), llvm::InnerLoopVectorizer::emitSCEVChecks(), enableCallSafepoints(), EvaluateConstantChrecAtConstant(), llvm::Evaluator::EvaluateFunction(), llvm::VPlan::execute(), llvm::FastISel::fastEmitZExtFromI1(), findBasePointer(), findIBRPredecessor(), llvm::CodeExtractor::findInputsOutputs(), findInsertPointAfter(), FindLIVLoopCondition(), FindLoopCounter(), FindMostPopularDest(), llvm::CodeExtractor::findOrCreateBlockForHoisting(), FindPHIForConditionForwarding(), findRetainForStoreStrongContraction(), findUnconditionalPreds(), FitWeights(), llvm::InnerLoopVectorizer::fixFirstOrderRecurrence(), llvm::InnerLoopVectorizer::fixReduction(), llvm::InnerLoopVectorizer::fixupIVUsers(), foldBlockIntoPredecessor(), llvm::FoldBranchToCommonDest(), FoldCondBranchOnPHI(), foldOperationIntoPhiValue(), foldReturnAndProcessPred(), llvm::FoldReturnIntoUncondBranch(), FoldTwoEntryPHINode(), llvm::ScalarEvolution::forgetValue(), generateUnsignedDivisionCode(), genLoopLimit(), GetBestDestForJumpOnUndef(), getBranchHint(), llvm::InnerLoopVectorizer::getBroadcastInstrs(), getConstantValue(), llvm::DOTGraphTraits< const Function * >::getEdgeAttributes(), llvm::DOTGraphTraits< const Function * >::getEdgeSourceLabel(), getEdgeValueLocal(), getEHPadFromPredecessor(), llvm::GetIfCondition(), getInductionVariable(), getInsertPointForUses(), getIrrLoopHeaderWeight(), getJumpThreadDuplicationCost(), llvm::getLoopEstimatedTripCount(), getLoopLatchExitBlock(), getLoopTest(), getModule(), getNumBytes(), llvm::RegionTraits< Function >::getNumSuccessors(), llvm::InnerLoopVectorizer::getOrCreateTripCount(), llvm::InnerLoopVectorizer::getOrCreateVectorTripCount(), getParentPad(), GetPointerOperand(), getSignature(), llvm::GetSuccessorNumber(), getSuccPad(), getSuccState(), getTerminator(), getTrueOrFalseValue(), handleFinalSuspend(), handleFree(), handlePhiDef(), hasOnlyUniformBranches(), hasOutsideLoopUser(), hasProfileData(), hasZeroSignBit(), llvm::SCEVExpander::hoistIVInc(), llvm::hoistRegion(), INITIALIZE_PASS(), llvm::InlineFunction(), insertCallRetCast(), insertDebugValues(), llvm::DIBuilder::insertDeclare(), llvm::InsertPreheaderForLoop(), insertSpills(), insertUniqueBackedgeBlock(), instrumentMemAccess(), IntersectUnsignedRange(), is_empty(), IsAcceptableTarget(), isAlwaysFoldable(), isChainSelectCmpBranch(), llvm::SparseSolver< LatticeKey, LatticeVal, KeyInfo >::isEdgeFeasible(), isIgnorableInst(), IsIncrementNUW(), llvm::isInTailCallPosition(), isLegalToHoistInto(), llvm::ScalarEvolution::isLoopBackedgeGuardedByCond(), isLoopDead(), isLoopInvariant(), isNotUsedInLoop(), isOnlyReachableViaThisEdge(), isOrHeader(), isSafeAndProfitableToSinkLoad(), isSafePHIToSpeculate(), isSCCHeader(), llvm::BasicBlockEdge::isSingleEdge(), isUnconditionalBranch(), isUniformlyReached(), makeBitReverse(), llvm::Loop::makeLoopInvariant(), MarkBlocksLiveIn(), matchPair(), mayLoopAccessLocation(), llvm::MergeBasicBlockIntoOnlyPred(), llvm::MergeBlockIntoPredecessor(), mergeCleanupPad(), mergeConditionalStoreToAddress(), mergeEmptyReturnBlocks(), moveBBContents(), llvm::EscapeEnumerator::Next(), llvm::slpvectorizer::BoUpSLP::optimizeGatherSequence(), optimizeSQRT(), patchAndReplaceAllUsesWith(), llvm::peelLoop(), PerformHeapAllocSRoA(), llvm::PHITransAddr::PHITranslateWithInsertion(), preheader(), prepareForSplit(), llvm::JumpThreadingPass::ProcessBlock(), ProcessBlock(), llvm::JumpThreadingPass::ProcessBranchOnPHI(), llvm::JumpThreadingPass::ProcessImpliedCondition(), llvm::JumpThreadingPass::ProcessThreadableEdges(), processUGT_ADDCST_ADD(), llvm::promoteLoopAccessesToScalars(), llvm::GVNHoist::rank(), relocationViaAlloca(), llvm::removeAllNonTerminatorAndEHPadInstructions(), removeEmptyCleanup(), removeUndefIntroducingPredecessor(), llvm::removeUnwindEdge(), replaceAllUsesOfWithIn(), replaceConstantExprOp(), llvm::InstCombiner::replacedSelectWithOperand(), replaceFallthroughCoroEnd(), replaceSuccessorsPhiUsesWith(), ReplaceUsesOfWith(), reportMayClobberedLoad(), llvm::LoopPredicationPass::run(), llvm::SpeculativeExecutionPass::runImpl(), llvm::JumpThreadingPass::runImpl(), scalarizeMaskedGather(), scalarizeMaskedLoad(), scalarizeMaskedScatter(), scalarizeMaskedStore(), scaleWeights(), setBranchWeights(), shouldConvert(), llvm::StackProtector::shouldEmitSDCheck(), llvm::CaptureTracker::shouldExplore(), shouldInstrumentBlock(), shouldReorderOperands(), shouldSpeculateInstrs(), SimplifyBranchOnICmpChain(), SimplifyCondBranchToCondBranch(), SimplifyCondBranchToTwoReturns(), simplifyOneLoop(), llvm::JumpThreadingPass::SimplifyPartiallyRedundantLoad(), SinkCast(), llvm::InstCombiner::SliceUpIllegalIntegerPHI(), speculatePHINodeLoads(), SpeculativelyExecuteBB(), SplitAddRecs(), splitBasicBlock(), splitBeforeCatchSwitch(), llvm::SplitBlockAndInsertIfThen(), llvm::SplitBlockAndInsertIfThenElse(), llvm::fuzzerop::splitBlockDescriptor(), llvm::SplitCriticalEdge(), SplitCriticalSideEffectEdges(), llvm::SplitEdge(), llvm::SplitLandingPadPredecessors(), llvm::succ_begin(), llvm::succ_end(), SumCanReachMin(), llvm::JumpThreadingPass::ThreadEdge(), truncateIVUse(), tryCreateCallSitesOnOrPredicatedArgument(), tryToElideArgumentCopy(), TryToMergeLandingPad(), tryToMoveFreeBeforeNullTest(), llvm::TryToSimplifyUncondBranchFromEmptyBlock(), tryToSimplifyUncondBranchWithICmpInIt(), TryToSinkInstruction(), llvm::JumpThreadingPass::TryToUnfoldSelect(), tryUnmergingGEPsAcrossIndirectBr(), llvm::UnrollLoop(), llvm::UnrollRuntimeLoopRemainder(), unswitchAllTrivialConditions(), unswitchTrivialBranch(), unswitchTrivialSwitch(), updatePredecessorProfileMetadata(), llvm::LoopVersioning::versionLoop(), llvm::InstCombiner::visitCallInst(), llvm::InstCombiner::visitPHINode(), llvm::InstCombiner::visitStoreInst(), and llvm::InnerLoopVectorizer::widenIntOrFpInduction().

◆ getTerminator() [2/2]

TerminatorInst* llvm::BasicBlock::getTerminator ( )
inline

Definition at line 124 of file BasicBlock.h.

References getTerminatingDeoptimizeCall(), and getTerminator().

◆ getUniquePredecessor() [1/2]

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 230 of file BasicBlock.cpp.

References E, llvm::pred_begin(), and llvm::pred_end().

Referenced by findIBRPredecessor(), findLocationForEntrySafepoint(), llvm::ScalarEvolution::forgetValue(), getLoopLatchExitBlock(), getSinglePredecessor(), getUniquePredecessor(), IsAcceptableTarget(), isDynamicConstant(), isZero(), makeStatepointExplicitImpl(), llvm::MergeBlockIntoPredecessor(), moveBBContents(), normalizeForInvokeSafepoint(), reuseTableCompare(), and unswitchTrivialBranch().

◆ getUniquePredecessor() [2/2]

BasicBlock* llvm::BasicBlock::getUniquePredecessor ( )
inline

Definition at line 224 of file BasicBlock.h.

References getSingleSuccessor(), and getUniquePredecessor().

◆ getUniqueSuccessor() [1/2]

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 252 of file BasicBlock.cpp.

References E, SI, llvm::succ_begin(), and llvm::succ_end().

Referenced by getSingleSuccessor(), getUniqueSuccessor(), moveBBContents(), and TryToMergeLandingPad().

◆ getUniqueSuccessor() [2/2]

BasicBlock* llvm::BasicBlock::getUniqueSuccessor ( )
inline

Definition at line 244 of file BasicBlock.h.

References getUniqueSuccessor().

◆ getValueSymbolTable()

ValueSymbolTable * BasicBlock::getValueSymbolTable ( )

Returns a pointer to the symbol table if one exists.

Definition at line 27 of file BasicBlock.cpp.

References F(), and getParent().

Referenced by getSublistAccess().

◆ hasAddressTaken()

bool llvm::BasicBlock::hasAddressTaken ( ) const
inline

◆ insertInto()

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.

Precondition
getParent() is nullptr.

Definition at line 54 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 getContext(), and getFirstInsertionPt().

◆ isEHPad()

bool llvm::BasicBlock::isEHPad ( ) const
inline

◆ isLandingPad()

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 442 of file BasicBlock.cpp.

References getFirstNonPHI().

Referenced by createPHIsForSplitLoopExit(), hasExceptionPointerOrCodeUser(), INITIALIZE_PASS(), isEHPad(), llvm::SplitBlockPredecessors(), and llvm::SplitLandingPadPredecessors().

◆ isLegalToHoistInto()

bool BasicBlock::isLegalToHoistInto ( ) const

Return true if it is legal to hoist instructions into this block.

Definition at line 358 of file BasicBlock.cpp.

References assert(), and getTerminator().

Referenced by getLandingPadInst().

◆ moveAfter()

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(), 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(), and llvm::JumpThreadingPass::ThreadEdge().

◆ moveBefore()

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(), 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(), llvm::createCodeGenPreparePass(), llvm::InnerLoopVectorizer::createVectorIntOrFpInductionPHI(), findIBRPredecessor(), getFirstInsertionPt(), and insertDebugValues().

◆ operator=()

BasicBlock& llvm::BasicBlock::operator= ( const BasicBlock )
delete

◆ phis() [1/2]

iterator_range<const_phi_iterator> llvm::BasicBlock::phis ( ) const
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 308 of file BasicBlock.h.

Referenced by GetPointerOperand(), isKnownTypeIdMember(), operator<<(), splitBasicBlock(), and llvm::fuzzerop::splitBlockDescriptor().

◆ phis() [2/2]

iterator_range< BasicBlock::phi_iterator > BasicBlock::phis ( )

Definition at line 266 of file BasicBlock.cpp.

References llvm::dyn_cast(), and front().

◆ rbegin() [1/2]

reverse_iterator llvm::BasicBlock::rbegin ( )
inline

◆ rbegin() [2/2]

const_reverse_iterator llvm::BasicBlock::rbegin ( ) const
inline

Definition at line 258 of file BasicBlock.h.

◆ removeFromParent()

void BasicBlock::removeFromParent ( )

◆ removePredecessor()

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 276 of file BasicBlock.cpp.

References assert(), begin(), llvm::dyn_cast(), llvm::Instruction::eraseFromParent(), llvm::find(), front(), llvm::UndefValue::get(), llvm::PHINode::getIncomingBlock(), getInstList(), llvm::PHINode::getNumIncomingValues(), llvm::PHINode::hasConstantValue(), llvm::Value::hasNUsesOrMore(), Other, llvm::iplist_impl< IntrusiveListT, TraitsT >::pop_front(), llvm::pred_begin(), llvm::pred_end(), llvm::PHINode::removeIncomingValue(), and llvm::Value::replaceAllUsesWith().

Referenced by changeToCall(), classof(), llvm::ConstantFoldTerminator(), FitWeights(), FoldCondBranchOnPHI(), llvm::FoldReturnIntoUncondBranch(), HandleInlinedLandingPad(), mergeCleanupPad(), llvm::JumpThreadingPass::ProcessBlock(), ReduceSwitchRange(), llvm::RemovePredecessorAndSimplify(), RemoveSwitchAfterSelectConversion(), removeUndefIntroducingPredecessor(), llvm::removeUnwindEdge(), setBranchWeights(), SimplifyBranchOnICmpChain(), SimplifyCondBranchToTwoReturns(), simplifyOneLoop(), SimplifyTerminatorOnSelect(), llvm::SplitCriticalEdge(), and SwitchToLookupTable().

◆ rend() [1/2]

reverse_iterator llvm::BasicBlock::rend ( )
inline

◆ rend() [2/2]

const_reverse_iterator llvm::BasicBlock::rend ( ) const
inline

Definition at line 260 of file BasicBlock.h.

◆ 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 420 of file BasicBlock.cpp.

References llvm::dyn_cast(), llvm::PHINode::getBasicBlockIndex(), getTerminator(), llvm::ARM_PROC::IE, llvm::PHINode::setIncomingBlock(), and llvm::TerminatorInst::successors().

Referenced by hasAddressTaken(), and shouldSpeculateInstrs().

◆ size()

size_t llvm::BasicBlock::size ( ) const
inline

◆ splitBasicBlock() [1/2]

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 382 of file BasicBlock.cpp.

References assert(), Create(), llvm::BranchInst::Create(), E, end(), getContext(), getInstList(), llvm::ilist_node_with_parent< BasicBlock, Function >::getNextNode(), getParent(), getTerminator(), I, phis(), llvm::Instruction::setDebugLoc(), llvm::succ_begin(), llvm::succ_end(), and llvm::Successor.

Referenced by llvm::changeToInvokeAndSplitBasicBlock(), classof(), llvm::createMemCpyLoop(), llvm::createMemCpyLoopKnownSize(), llvm::createMemCpyLoopUnknownSize(), createMemSetLoop(), CreatePrologue(), createResumeEntryBlock(), llvm::InnerLoopVectorizer::createVectorizedLoopSkeleton(), despeculateCountZeros(), llvm::InnerLoopVectorizer::emitMemRuntimeChecks(), llvm::InnerLoopVectorizer::emitMinimumIterationCountCheck(), llvm::InnerLoopVectorizer::emitSCEVChecks(), llvm::VPlan::execute(), llvm::CodeExtractor::findOrCreateBlockForHoisting(), getTrueOrFalseValue(), handleFinalSuspend(), INITIALIZE_PASS(), llvm::InlineFunction(), insertSpills(), instrumentMemAccess(), isKnownTypeIdMember(), isProfitableForVectorization(), PerformHeapAllocSRoA(), performMaskedAtomicOp(), replaceFallthroughCoroEnd(), scalarizeMaskedGather(), scalarizeMaskedLoad(), scalarizeMaskedScatter(), scalarizeMaskedStore(), shouldKeepInEntry(), SimplifyBranchOnICmpChain(), SimplifyFunction(), splitBasicBlock(), splitBeforeCatchSwitch(), llvm::SplitBlock(), llvm::SplitBlockAndInsertIfThen(), llvm::SplitBlockAndInsertIfThenElse(), and llvm::fuzzerop::splitBlockDescriptor().

◆ splitBasicBlock() [2/2]

BasicBlock* llvm::BasicBlock::splitBasicBlock ( Instruction I,
const Twine BBName = "" 
)
inline

Friends And Related Function Documentation

◆ BlockAddress

friend class BlockAddress
friend

Definition at line 65 of file BasicBlock.h.

◆ SymbolTableListTraits< BasicBlock >

friend class SymbolTableListTraits< BasicBlock >
friend

Definition at line 66 of file BasicBlock.h.


The documentation for this class was generated from the following files: