remove some trickiness that broke yacr2 and some other programs last night

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22751 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2005-08-10 17:15:20 +00:00
parent df706e3f0c
commit 98599ba6c6

View File

@ -197,9 +197,7 @@ bool LoopSimplify::ProcessLoop(Loop *L) {
DominatorSet &DS = getAnalysis<DominatorSet>();
for (BasicBlock::iterator I = L->getHeader()->begin();
(PN = dyn_cast<PHINode>(I++)); )
if (Value *V = PN->hasConstantValue(true))
if (!isa<Instruction>(V) ||
DS.dominates(cast<Instruction>(V)->getParent(), L->getHeader())) {
if (Value *V = PN->hasConstantValue()) {
PN->replaceAllUsesWith(V);
PN->eraseFromParent();
}