29 SmallVectorImpl<std::pair<const BasicBlock*,const BasicBlock*> > &Result) {
42 std::pair<const BasicBlock*, succ_const_iterator> &Top = VisitStack.
back();
46 bool FoundNew =
false;
54 if (InStack.
count(BB))
55 Result.push_back(std::make_pair(ParentBB, BB));
66 }
while (!VisitStack.
empty());
78 for (
unsigned i = 0; ; ++i) {
79 assert(i != e &&
"Didn't find edge?");
89 bool AllowIdenticalEdges) {
90 assert(SuccNum < TI->getNumSuccessors() &&
"Illegal edge specification!");
97 assert(I != E &&
"No preds, but we have an edge to the block?");
100 if (!AllowIdenticalEdges)
133 return L1 != NULL && L1 == L2;
170 Outer->getExitBlocks(Worklist);
175 }
while (!Worklist.
empty());
185 "This analysis is function-local!");
188 Worklist.
push_back(const_cast<BasicBlock*>(A));
197 "This analysis is function-local!");
227 Worklist.push_back(*
I);
229 if (Worklist.empty()) {
234 Worklist.push_back(const_cast<BasicBlock*>(A->
getParent()));
void push_back(const T &Elt)
bool isReachableFromEntry(const BasicBlock *A) const
LoopT * getParentLoop() const
const Function * getParent() const
Return the enclosing method, or null if none.
unsigned GetSuccessorNumber(BasicBlock *BB, BasicBlock *Succ)
LoopInfoBase< BlockT, LoopT > * LI
T LLVM_ATTRIBUTE_UNUSED_RESULT pop_back_val()
Interval::succ_iterator succ_begin(Interval *I)
bool count(PtrType Ptr) const
count - Return true if the specified pointer is in the set.
bool LLVM_ATTRIBUTE_UNUSED_RESULT empty() const
Loop * getLoopFor(const BasicBlock *BB) const
Interval::succ_iterator succ_end(Interval *I)
unsigned getNumSuccessors() const
static const Loop * getOutermostLoop(const LoopInfo *LI, const BasicBlock *BB)
static bool loopContainsBoth(const LoopInfo *LI, const BasicBlock *BB1, const BasicBlock *BB2)
LLVM Basic Block Representation.
BasicBlock * getSuccessor(unsigned idx) const
Interval::pred_iterator pred_begin(Interval *I)
Interval::pred_iterator pred_end(Interval *I)
bool dominates(const DomTreeNode *A, const DomTreeNode *B) const
static bool isPotentiallyReachableInner(SmallVectorImpl< BasicBlock * > &Worklist, BasicBlock *StopBB, const DominatorTree *DT, const LoopInfo *LI)
void FindFunctionBackedges(const Function &F, SmallVectorImpl< std::pair< const BasicBlock *, const BasicBlock * > > &Result)
const BasicBlock & getEntryBlock() const
TerminatorInst * getTerminator()
Returns the terminator instruction if the block is well formed or null if the block is not well forme...
bool isPotentiallyReachable(const Instruction *From, const Instruction *To, const DominatorTree *DT=0, const LoopInfo *LI=0)
Determine whether instruction 'To' is reachable from 'From', returning true if uncertain.
const BasicBlock * getParent() const
bool isCriticalEdge(const TerminatorInst *TI, unsigned SuccNum, bool AllowIdenticalEdges=false)