summaryrefslogtreecommitdiffstats
path: root/llvm/lib/VMCore/Dominators.cpp
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2007-06-08 01:50:32 +0000
committerDevang Patel <dpatel@apple.com>2007-06-08 01:50:32 +0000
commitbecc466451f3aded756009b93e2f3a965ad70e4d (patch)
tree4a92a713889c320b286eccab57c4a84407c561e4 /llvm/lib/VMCore/Dominators.cpp
parent86798e5e1146a09079ff6632d07baa0c41001c86 (diff)
downloadbcm5719-llvm-becc466451f3aded756009b93e2f3a965ad70e4d.tar.gz
bcm5719-llvm-becc466451f3aded756009b93e2f3a965ad70e4d.zip
Update LoopSimplify to require and preserve DominatorTree only.
Now LoopSimplify does not require nor preserve ETForest. llvm-svn: 37512
Diffstat (limited to 'llvm/lib/VMCore/Dominators.cpp')
-rw-r--r--llvm/lib/VMCore/Dominators.cpp15
1 files changed, 12 insertions, 3 deletions
diff --git a/llvm/lib/VMCore/Dominators.cpp b/llvm/lib/VMCore/Dominators.cpp
index fc5d6a63ca9..32c435b2c60 100644
--- a/llvm/lib/VMCore/Dominators.cpp
+++ b/llvm/lib/VMCore/Dominators.cpp
@@ -316,14 +316,23 @@ void DominatorTreeBase::updateDFSNumbers()
for (df_iterator<BasicBlock*> I = df_begin(Roots[i]),
E = df_end(Roots[i]); I != E; ++I) {
BasicBlock *BB = *I;
- ETNode *ETN = getNode(BB)->getETNode();
- if (ETN && !ETN->hasFather())
- ETN->assignDFSNumber(dfsnum);
+ DomTreeNode *BBNode = getNode(BB);
+ if (BBNode) {
+ ETNode *ETN = BBNode->getETNode();
+ if (ETN && !ETN->hasFather())
+ ETN->assignDFSNumber(dfsnum);
+ }
}
SlowQueries = 0;
DFSInfoValid = true;
}
+/// isReachableFromEntry - Return true if A is dominated by the entry
+/// block of the function containing it.
+const bool DominatorTreeBase::isReachableFromEntry(BasicBlock* A) {
+ return dominates(&A->getParent()->getEntryBlock(), A);
+}
+
// dominates - Return true if A dominates B. THis performs the
// special checks necessary if A and B are in the same basic block.
bool DominatorTreeBase::dominates(Instruction *A, Instruction *B) {
OpenPOWER on IntegriCloud