52 #define DEBUG_TYPE "basicblock-utils" 57 bool KeepOneInputPHIs) {
58 for (
auto *BB : BBs) {
63 Succ->removePredecessor(BB, KeepOneInputPHIs);
64 if (Updates && UniqueSuccessors.
insert(Succ).second)
65 Updates->
push_back({DominatorTree::Delete, BB, Succ});
69 while (!BB->empty()) {
78 BB->getInstList().pop_back();
81 assert(BB->getInstList().size() == 1 &&
82 isa<UnreachableInst>(BB->getTerminator()) &&
83 "The successor list of BB isn't empty before " 84 "applying corresponding DTU updates.");
89 bool KeepOneInputPHIs) {
94 bool KeepOneInputPHIs) {
101 assert(Dead.count(Pred) &&
"All predecessors must be dead!");
114 BB->eraseFromParent();
118 bool KeepOneInputPHIs) {
126 std::vector<BasicBlock*> DeadBlocks;
128 if (!Reachable.
count(&*
I)) {
130 DeadBlocks.push_back(BB);
136 return !DeadBlocks.empty();
141 if (!isa<PHINode>(BB->
begin()))
return;
144 if (PN->getIncomingValue(0) != PN)
145 PN->replaceAllUsesWith(PN->getIncomingValue(0));
152 PN->eraseFromParent();
163 bool Changed =
false;
164 for (
unsigned i = 0,
e = PHIs.
size(); i !=
e; ++i)
165 if (
PHINode *PN = dyn_cast_or_null<PHINode>(PHIs[i].
operator Value*()))
174 bool PredecessorWithTwoSuccessors) {
180 if (!PredBB)
return false;
183 if (PredBB == BB)
return false;
196 unsigned FallThruPath;
197 if (PredecessorWithTwoSuccessors) {
198 if (!(PredBB_BI = dyn_cast<BranchInst>(PredBB->
getTerminator())))
204 FallThruPath = PredBB_BI->
getSuccessor(0) == BB ? 0 : 1;
209 for (
Value *IncValue : PN.incoming_values())
218 if (isa<PHINode>(BB->
front())) {
220 if (!isa<PHINode>(PN.getIncomingValue(0)) ||
221 cast<PHINode>(PN.getIncomingValue(0))->
getParent() != BB)
222 IncomingValues.
push_back(PN.getIncomingValue(0));
228 std::vector<DominatorTree::UpdateType> Updates;
230 Updates.reserve(1 + (2 *
succ_size(BB)));
242 Updates.push_back({DominatorTree::Delete, BB, *I});
265 if (PredecessorWithTwoSuccessors) {
306 "The successor list of BB isn't empty before " 307 "applying corresponding DTU updates.");
344 DVI->getExpression(),
345 DVI->getDebugLoc()->getInlinedAt());
360 for (
auto &Instr : ToBeRemoved)
361 Instr->eraseFromParent();
363 return !ToBeRemoved.empty();
388 for (
auto &
I : *BB) {
392 DVI->getDebugLoc()->getInlinedAt());
393 auto VMI = VariableMap.
find(
Key);
396 if (VMI == VariableMap.
end() ||
397 VMI->second.first != DVI->getValue() ||
398 VMI->second.second != DVI->getExpression()) {
399 VariableMap[
Key] = { DVI->getValue(), DVI->getExpression() };
407 for (
auto &Instr : ToBeRemoved)
408 Instr->eraseFromParent();
410 return !ToBeRemoved.empty();
414 bool MadeChanges =
false;
452 "ReplaceInstWithInst: Instruction already inserted into basic block!");
498 "Should have a single succ!");
505 unsigned NumBroken = 0;
509 !isa<CallBrInst>(TI))
521 while (isa<PHINode>(SplitIt) || SplitIt->isEHPad())
523 std::string
Name = BBName.
str();
525 SplitIt, Name.empty() ? Old->
getName() +
".split" :
Name);
531 L->addBasicBlockToLoop(New, *LI);
536 std::vector<DomTreeNode *> Children(OldNode->begin(), OldNode->end());
556 bool PreserveLCSSA,
bool &HasLoopExit) {
576 assert(DT &&
"DT should be available to update LoopInfo!");
581 bool IsLoopEntry = !!L;
582 bool SplitMakesNewLoopHeader =
false;
594 if (!
PL->contains(OldBB))
604 SplitMakesNewLoopHeader =
true;
616 Loop *InnermostPredLoop =
nullptr;
621 while (PredLoop && !PredLoop->contains(OldBB))
625 if (PredLoop && PredLoop->contains(OldBB) &&
626 (!InnermostPredLoop ||
627 InnermostPredLoop->
getLoopDepth() < PredLoop->getLoopDepth()))
628 InnermostPredLoop = PredLoop;
632 if (InnermostPredLoop)
636 if (SplitMakesNewLoopHeader)
653 Value *InVal =
nullptr;
699 if (PredSet.count(IncomingBB)) {
713 bool PreserveLCSSA) {
722 std::string NewName = std::string(Suffix) +
".split-lp";
725 LI, MSSAU, PreserveLCSSA);
744 for (
unsigned i = 0,
e = Preds.
size(); i !=
e; ++i) {
748 assert(!isa<IndirectBrInst>(Preds[i]->getTerminator()) &&
749 "Cannot split an edge from an IndirectBrInst");
750 assert(!isa<CallBrInst>(Preds[i]->getTerminator()) &&
751 "Cannot split an edge from a CallBrInst");
752 Preds[i]->getTerminator()->replaceUsesOfWith(BB, NewBB);
766 bool HasLoopExit =
false;
770 if (!Preds.
empty()) {
780 const char *Suffix1,
const char *Suffix2,
784 bool PreserveLCSSA) {
799 for (
unsigned i = 0,
e = Preds.
size(); i !=
e; ++i) {
803 assert(!isa<IndirectBrInst>(Preds[i]->getTerminator()) &&
804 "Cannot split an edge from an IndirectBrInst");
805 Preds[i]->getTerminator()->replaceUsesOfWith(OrigBB, NewBB1);
808 bool HasLoopExit =
false;
820 if (Pred == NewBB1)
continue;
822 "Cannot split an edge from an IndirectBrInst");
828 if (!NewBB2Preds.
empty()) {
841 NewBB2Pred->getTerminator()->replaceUsesOfWith(OrigBB, NewBB2);
846 PreserveLCSSA, HasLoopExit);
855 NewBB1->getInstList().insert(NewBB1->getFirstInsertionPt(), Clone1);
866 "Split cannot be applied if LPad is token type. Otherwise an " 867 "invalid PHINode of token type would be created.");
870 PN->addIncoming(Clone2, NewBB2);
899 V = BCI->getOperand(0);
900 NewBC = BCI->
clone();
904 if (
PHINode *PN = dyn_cast<PHINode>(V)) {
905 if (PN->getParent() == BB) {
907 NewBC->
setOperand(0, PN->getIncomingValueForBlock(Pred));
909 *i = PN->getIncomingValueForBlock(Pred);
922 return cast<ReturnInst>(NewRet);
936 bool CreateThenBlock = (ThenBlock ==
nullptr);
937 if (CreateThenBlock) {
948 HeadNewTerm->
setMetadata(LLVMContext::MD_prof, BranchWeights);
953 std::vector<DomTreeNode *> Children(OldNode->begin(), OldNode->end());
969 L->addBasicBlockToLoop(ThenBlock, *LI);
970 L->addBasicBlockToLoop(Tail, *LI);
988 (*ThenTerm)->setDebugLoc(SplitBefore->
getDebugLoc());
990 (*ElseTerm)->setDebugLoc(SplitBefore->
getDebugLoc());
993 HeadNewTerm->
setMetadata(LLVMContext::MD_prof, BranchWeights);
1024 if (!Pred1Br || !Pred2Br)
1029 if (Pred2Br->isConditional()) {
1076 if (!BI)
return nullptr;
void DeleteDeadBlocks(ArrayRef< BasicBlock *> BBs, DomTreeUpdater *DTU=nullptr, bool KeepOneInputPHIs=false)
Delete the specified blocks from BB.
Return a value (possibly void), from a function.
SymbolTableList< Instruction >::iterator eraseFromParent()
This method unlinks 'this' from the containing basic block and deletes it.
bool canSplitPredecessors() const
void invalidateCachedPredecessors()
Clears the PredIteratorCache info.
void ReplaceInstWithInst(BasicBlock::InstListType &BIL, BasicBlock::iterator &BI, Instruction *I)
Replace the instruction specified by BI with the instruction specified by I.
Provides a lazy, caching interface for making common memory aliasing information queries, backed by LLVM's alias analysis passes.
void DeleteDeadBlock(BasicBlock *BB, DomTreeUpdater *DTU=nullptr, bool KeepOneInputPHIs=false)
Delete the specified block, which must have no predecessors.
void addIncoming(Value *V, BasicBlock *BB)
Add an incoming value to the end of the PHI list.
void splitBlock(NodeT *NewBB)
splitBlock - BB is split and now it has one successor.
iterator erase(iterator where)
This class represents lattice values for constants.
BasicBlock * getSuccessor(unsigned Idx) const
Return the specified successor. This instruction must be a terminator.
amdgpu Simplify well known AMD library false FunctionCallee Value const Twine & Name
NoneType
A simple null object to allow implicit construction of Optional<T> and similar types without having t...
unsigned getLoopDepth() const
Return the nesting level of this loop.
void removePredecessor(BasicBlock *Pred, bool KeepOneInputPHIs=false)
Notify the BasicBlock that the predecessor Pred is no longer able to reach it.
void push_back(const T &Elt)
void moveToHeader(BlockT *BB)
This method is used to move BB (which must be part of this loop) to be the loop header of the loop (t...
BasicBlock * getSuccessor(unsigned i) const
unsigned SplitAllCriticalEdges(Function &F, const CriticalEdgeSplittingOptions &Options=CriticalEdgeSplittingOptions())
Loop over all of the edges in the CFG, breaking critical edges as they are found. ...
Value * getCondition() const
const Instruction * getTerminator() const LLVM_READONLY
Returns the terminator instruction if the block is well formed or null if the block is not well forme...
BasicBlock * SplitBlock(BasicBlock *Old, Instruction *SplitPt, DominatorTree *DT=nullptr, LoopInfo *LI=nullptr, MemorySSAUpdater *MSSAU=nullptr, const Twine &BBName="")
Split the specified block at the specified instruction - everything before SplitPt stays in Old and e...
LLVMContext & getContext() const
Get the context in which this basic block lives.
bool isReachableFromEntry(const Use &U) const
Provide an overload for a Use.
iterator begin()
Instruction iterator methods.
bool MergeBlockIntoPredecessor(BasicBlock *BB, DomTreeUpdater *DTU=nullptr, LoopInfo *LI=nullptr, MemorySSAUpdater *MSSAU=nullptr, MemoryDependenceResults *MemDep=nullptr, bool PredecessorWithTwoSuccessors=false)
Attempts to merge a block into its predecessor, if possible.
BasicBlock * SplitEdge(BasicBlock *From, BasicBlock *To, DominatorTree *DT=nullptr, LoopInfo *LI=nullptr, MemorySSAUpdater *MSSAU=nullptr)
Split the edge connecting specified block.
Identifies a unique instance of a variable.
Value * removeIncomingValue(unsigned Idx, bool DeletePHIIfEmpty=true)
Remove an incoming value.
MemorySSA * getMemorySSA() const
Get handle on MemorySSA.
Option class for critical edge splitting.
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
static constexpr UpdateKind Delete
LoopT * getLoopFor(const BlockT *BB) const
Return the inner most loop that BB lives in.
A Use represents the edge between a Value definition and its users.
void setName(const Twine &Name)
Change the name of the value.
Interval::succ_iterator succ_begin(Interval *I)
succ_begin/succ_end - define methods so that Intervals may be used just like BasicBlocks can with the...
ReturnInst * FoldReturnIntoUncondBranch(ReturnInst *RI, BasicBlock *BB, BasicBlock *Pred, DomTreeUpdater *DTU=nullptr)
This method duplicates the specified return instruction into a predecessor which ends in an unconditi...
auto reverse(ContainerTy &&C, typename std::enable_if< has_rbegin< ContainerTy >::value >::type *=nullptr) -> decltype(make_range(C.rbegin(), C.rend()))
Instruction * clone() const
Create a copy of 'this' instruction that is identical in all ways except the following: ...
static void UpdatePHINodes(BasicBlock *OrigBB, BasicBlock *NewBB, ArrayRef< BasicBlock *> Preds, BranchInst *BI, bool HasLoopExit)
Update the PHI nodes in OrigBB to include the values coming from NewBB.
Type * getType() const
All values are typed, get the type of this value.
MemoryUseOrDef * getMemoryAccess(const Instruction *I) const
Given a memory Mod/Ref'ing instruction, get the MemorySSA access associated with it.
void addBasicBlockToLoop(BlockT *NewBB, LoopInfoBase< BlockT, LoopT > &LI)
This method is used by other analyses to update loop information.
const BasicBlock * getUniquePredecessor() const
Return the predecessor of this block if it has a unique predecessor block.
bool DeleteDeadPHIs(BasicBlock *BB, const TargetLibraryInfo *TLI=nullptr)
Examine each PHI in the given block and delete it if it is dead.
This class represents a no-op cast from one type to another.
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory)...
BasicBlock * SplitCriticalEdge(Instruction *TI, unsigned SuccNum, const CriticalEdgeSplittingOptions &Options=CriticalEdgeSplittingOptions())
If this edge is a critical edge, insert a new node to split the critical edge.
void replaceAllUsesWith(Value *V)
Change all uses of this to point to a new Value.
DomTreeNodeBase< NodeT > * setNewRoot(NodeT *BB)
Add a new node to the forward dominator tree and make it a new root.
void ReplaceInstWithValue(BasicBlock::InstListType &BIL, BasicBlock::iterator &BI, Value *V)
Replace all uses of an instruction (specified by BI) with a value, then remove and delete the origina...
void takeName(Value *V)
Transfer the name from V to this value.
Concrete subclass of DominatorTreeBase that is used to compute a normal dominator tree...
unsigned getNumSuccessors() const
Return the number of successors that this instruction has.
Interval::succ_iterator succ_end(Interval *I)
void SplitLandingPadPredecessors(BasicBlock *OrigBB, ArrayRef< BasicBlock *> Preds, const char *Suffix, const char *Suffix2, SmallVectorImpl< BasicBlock *> &NewBBs, DominatorTree *DT=nullptr, LoopInfo *LI=nullptr, MemorySSAUpdater *MSSAU=nullptr, bool PreserveLCSSA=false)
This method transforms the landing pad, OrigBB, by introducing two new basic blocks into the function...
iterator find(const_arg_type_t< KeyT > Val)
const BasicBlock & getEntryBlock() const
static bool removeRedundantDbgInstrsUsingBackwardScan(BasicBlock *BB)
Remove redundant instructions within sequences of consecutive dbg.value instructions.
BasicBlock * SplitBlockPredecessors(BasicBlock *BB, ArrayRef< BasicBlock *> Preds, const char *Suffix, DominatorTree *DT=nullptr, LoopInfo *LI=nullptr, MemorySSAUpdater *MSSAU=nullptr, bool PreserveLCSSA=false)
This method introduces at least one new basic block into the function and moves some of the predecess...
The landingpad instruction holds all of the information necessary to generate correct exception handl...
const Instruction * getFirstNonPHI() const
Returns a pointer to the first instruction in this block that is not a PHINode instruction.
const_iterator getFirstInsertionPt() const
Returns an iterator to the first instruction in this block that is suitable for inserting a non-PHI i...
void setDebugLoc(DebugLoc Loc)
Set the debug location information for this instruction.
const BasicBlock * getSinglePredecessor() const
Return the predecessor of this block if it has a single predecessor block.
static constexpr UpdateKind Insert
LLVM Basic Block Representation.
void deleteBB(BasicBlock *DelBB)
Delete DelBB.
This is an important class for using LLVM in a threaded context.
Conditional or Unconditional Branch instruction.
void changeImmediateDominator(DomTreeNodeBase< NodeT > *N, DomTreeNodeBase< NodeT > *NewIDom)
changeImmediateDominator - This method is used to update the dominator tree information when a node's...
size_t size() const
size - Get the array size.
This function has undefined behavior.
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
Value * getIncomingValueForBlock(const BasicBlock *BB) const
This file contains the declarations for the subclasses of Constant, which represent the different fla...
const Instruction & front() const
std::pair< iterator, bool > insert(const ValueT &V)
std::pair< iterator, bool > insert(PtrType Ptr)
Inserts Ptr if and only if there is no element in the container equal to Ptr.
Interval::pred_iterator pred_begin(Interval *I)
pred_begin/pred_end - define methods so that Intervals may be used just like BasicBlocks can with the...
void moveAllAfterSpliceBlocks(BasicBlock *From, BasicBlock *To, Instruction *Start)
From block was spliced into From and To.
iterator_range< df_ext_iterator< T, SetTy > > depth_first_ext(const T &G, SetTy &S)
void splice(iterator where, iplist_impl &L2)
Interval::pred_iterator pred_end(Interval *I)
static BasicBlock * Create(LLVMContext &Context, const Twine &Name="", Function *Parent=nullptr, BasicBlock *InsertBefore=nullptr)
Creates a new BasicBlock.
size_type count(ConstPtrType Ptr) const
count - Return 1 if the specified pointer is in the set, 0 otherwise.
self_iterator getIterator()
void applyUpdatesPermissive(ArrayRef< DominatorTree::UpdateType > Updates)
Submit updates to all available trees.
DomTreeNodeBase< NodeT > * getRootNode()
getRootNode - This returns the entry node for the CFG of the function.
static UndefValue * get(Type *T)
Static factory methods - Return an 'undef' object of the specified type.
DebugLoc getStartLoc() const
Return the debug location of the start of this loop.
bool isExceptionalTerminator() const
Value * getIncomingValue(unsigned i) const
Return incoming value number x.
DomTreeNodeBase< NodeT > * getNode(const NodeT *BB) const
getNode - return the (Post)DominatorTree node for the specified basic block.
auto find(R &&Range, const T &Val) -> decltype(adl_begin(Range))
Provide wrappers to std::find which take ranges instead of having to pass begin/end explicitly...
void setMetadata(unsigned KindID, MDNode *Node)
Set the metadata of the specified kind to the specified node.
void moveToPlace(MemoryUseOrDef *What, BasicBlock *BB, MemorySSA::InsertionPlace Where)
void setSuccessor(unsigned idx, BasicBlock *NewSucc)
bool isLandingPad() const
Return true if this basic block is a landing pad.
bool hasAddressTaken() const
Returns true if there are any uses of this basic block other than direct branches, switches, etc.
const InstListType & getInstList() const
Return the underlying instruction list container.
bool contains(const LoopT *L) const
Return true if the specified loop is contained within in this loop.
Iterator for intrusive lists based on ilist_node.
SmallPtrSet - This class implements a set which is optimized for holding SmallSize or less elements...
BlockVerifier::State From
void applyUpdates(ArrayRef< DominatorTree::UpdateType > Updates)
Submit updates to all available trees.
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small...
Provides information about what library functions are available for the current target.
bool RecursivelyDeleteDeadPHINode(PHINode *PN, const TargetLibraryInfo *TLI=nullptr)
If the specified value is an effectively dead PHI node, due to being a def-use chain of single-use no...
Value * GetIfCondition(BasicBlock *BB, BasicBlock *&IfTrue, BasicBlock *&IfFalse)
Check whether BB is the merge point of a if-region.
bool EliminateUnreachableBlocks(Function &F, DomTreeUpdater *DTU=nullptr, bool KeepOneInputPHIs=false)
Delete all basic blocks from F that are not reachable from its entry node.
void wireOldPredecessorsToNewImmediatePredecessor(BasicBlock *Old, BasicBlock *New, ArrayRef< BasicBlock *> Preds, bool IdenticalEdgesWereMerged=true)
A new empty BasicBlock (New) now branches directly to Old.
static BranchInst * Create(BasicBlock *IfTrue, Instruction *InsertBefore=nullptr)
bool isConditional() const
static PHINode * Create(Type *Ty, unsigned NumReservedValues, const Twine &NameStr="", Instruction *InsertBefore=nullptr)
Constructors - NumReservedValues is a hint for the number of incoming edges that this phi node will h...
pred_range predecessors(BasicBlock *BB)
unsigned getNumIncomingValues() const
Return the number of incoming edges.
void setOperand(unsigned i, Value *Val)
raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
Implements a dense probed hash-table based set with some number of buckets stored inline...
void swap(llvm::BitVector &LHS, llvm::BitVector &RHS)
Implement std::swap in terms of BitVector swap.
void push_back(pointer val)
Class that has the common methods + fields of memory uses/defs.
InstListType::iterator iterator
Instruction iterators...
void FoldSingleEntryPHINodes(BasicBlock *BB, MemoryDependenceResults *MemDep=nullptr)
We know that BB has one predecessor.
bool isLoopHeader(const BlockT *BB) const
void SplitBlockAndInsertIfThenElse(Value *Cond, Instruction *SplitBefore, Instruction **ThenTerm, Instruction **ElseTerm, MDNode *BranchWeights=nullptr)
SplitBlockAndInsertIfThenElse is similar to SplitBlockAndInsertIfThen, but also creates the ElseBlock...
bool RemoveRedundantDbgInstrs(BasicBlock *BB)
Try to remove redundant dbg.value instructions from given basic block.
LoopT * getParentLoop() const
unsigned succ_size(const Instruction *I)
This file provides various utilities for inspecting and working with the control flow graph in LLVM I...
unsigned GetSuccessorNumber(const BasicBlock *BB, const BasicBlock *Succ)
Search for the specified successor of basic block BB and return its position in the terminator instru...
iterator insert(iterator where, pointer New)
const DebugLoc & getDebugLoc() const
Return the debug location for this node as a DebugLoc.
LLVM_NODISCARD bool empty() const
This represents the llvm.dbg.value instruction.
Represents a single loop in the control flow graph.
bool isTokenTy() const
Return true if this is 'token'.
StringRef getName() const
Return a constant reference to the value's name.
BasicBlock * getIncomingBlock(unsigned i) const
Return incoming basic block number i.
const Function * getParent() const
Return the enclosing method, or null if none.
SymbolTableList< BasicBlock >::iterator eraseFromParent()
Unlink 'this' from the containing function and delete it.
DomTreeNodeBase< NodeT > * addNewBlock(NodeT *BB, NodeT *DomBB)
Add a new node to the dominator tree information.
LLVM_NODISCARD std::enable_if<!is_simple_type< Y >::value, typename cast_retty< X, const Y >::ret_type >::type dyn_cast(const Y &Val)
void moveAllAfterMergeBlocks(BasicBlock *From, BasicBlock *To, Instruction *Start)
From block was merged into To.
iterator_range< const_phi_iterator > phis() const
Returns a range that iterates over the phis in the basic block.
BasicBlock * splitBasicBlock(iterator I, const Twine &BBName="")
Split the basic block into two basic blocks at the specified instruction.
Tail - This calling convention attemps to make calls as fast as possible while guaranteeing that tail...
bool isUnconditional() const
std::string str() const
Return the twine contents as a std::string.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
LLVM Value Representation.
void removeInstruction(Instruction *InstToRemove)
Removes an instruction from the dependence analysis, updating the dependence of instructions that pre...
succ_range successors(Instruction *I)
static const Function * getParent(const Value *V)
const LandingPadInst * getLandingPadInst() const
Return the landingpad instruction associated with the landing pad.
const Instruction * getFirstNonPHIOrDbg() const
Returns a pointer to the first instruction in this block that is not a PHINode or a debug intrinsic...
static bool removeRedundantDbgInstrsUsingForwardScan(BasicBlock *BB)
Remove redundant dbg.value instructions using a forward scan.
void DetatchDeadBlocks(ArrayRef< BasicBlock *> BBs, SmallVectorImpl< DominatorTree::UpdateType > *Updates, bool KeepOneInputPHIs=false)
Replace contents of every block in BBs with single unreachable instruction.
void removeBlock(BlockT *BB)
This method completely removes BB from all data structures, including all of the Loop objects it is n...
Instruction * SplitBlockAndInsertIfThen(Value *Cond, Instruction *SplitBefore, bool Unreachable, MDNode *BranchWeights=nullptr, DominatorTree *DT=nullptr, LoopInfo *LI=nullptr, BasicBlock *ThenBlock=nullptr)
Split the containing block at the specified instruction - everything before SplitBefore stays in the ...
static void UpdateAnalysisInformation(BasicBlock *OldBB, BasicBlock *NewBB, ArrayRef< BasicBlock *> Preds, DominatorTree *DT, LoopInfo *LI, MemorySSAUpdater *MSSAU, bool PreserveLCSSA, bool &HasLoopExit)
Update DominatorTree, LoopInfo, and LCCSA analysis information.
bool empty() const
empty - Check if the array is empty.
const BasicBlock * getParent() const
const BasicBlock * getUniqueSuccessor() const
Return the successor of this block if it has a unique successor.