[llvm-commits] CVS: llvm/lib/VMCore/Dominators.cpp
Devang Patel
dpatel at apple.com
Thu Jun 7 18:51:00 PDT 2007
Changes in directory llvm/lib/VMCore:
Dominators.cpp updated: 1.108 -> 1.109
---
Log message:
Update LoopSimplify to require and preserve DominatorTree only.
Now LoopSimplify does not require nor preserve ETForest.
---
Diffs of the changes: (+12 -3)
Dominators.cpp | 15 ++++++++++++---
1 files changed, 12 insertions(+), 3 deletions(-)
Index: llvm/lib/VMCore/Dominators.cpp
diff -u llvm/lib/VMCore/Dominators.cpp:1.108 llvm/lib/VMCore/Dominators.cpp:1.109
--- llvm/lib/VMCore/Dominators.cpp:1.108 Thu Jun 7 18:52:40 2007
+++ llvm/lib/VMCore/Dominators.cpp Thu Jun 7 20:50:32 2007
@@ -316,14 +316,23 @@
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) {
More information about the llvm-commits
mailing list