LoopSimplify preserves AA.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52053 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Devang Patel 2008-06-06 17:50:58 +00:00
parent 8fb6a94b69
commit 4c37c07ee3

View File

@ -73,6 +73,7 @@ namespace {
AU.addPreserved<LoopInfo>();
AU.addPreserved<DominatorTree>();
AU.addPreserved<DominanceFrontier>();
AU.addPreserved<AliasAnalysis>();
AU.addPreservedID(BreakCriticalEdgesID); // No critical edges added.
}
@ -252,9 +253,10 @@ ReprocessLoop:
for (BasicBlock::iterator I = L->getHeader()->begin();
(PN = dyn_cast<PHINode>(I++)); )
if (Value *V = PN->hasConstantValue()) {
PN->replaceAllUsesWith(V);
PN->eraseFromParent();
}
if (AA) AA->deleteValue(PN);
PN->replaceAllUsesWith(V);
PN->eraseFromParent();
}
return Changed;
}