Update LoopSimplify to require and preserve DominatorTree only.

Now LoopSimplify does not require nor preserve ETForest.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37512 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Devang Patel
2007-06-08 01:50:32 +00:00
parent 1a90a5aebe
commit dba2413b2e
3 changed files with 42 additions and 35 deletions

View File

@@ -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) {