This pass is completely broken.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18387 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2004-11-30 17:09:06 +00:00
parent 3af4b4fe78
commit 6b205c3ef1

View File

@ -152,20 +152,13 @@ bool PRE::runOnFunction(Function &F) {
bool PRE::ProcessBlock(BasicBlock *BB) {
bool Changed = false;
// DISABLED: This pass invalidates iterators and then uses them.
return false;
// PRE expressions first defined in this block...
Instruction *PrevInst = 0;
for (BasicBlock::iterator I = BB->begin(); I != BB->end(); )
if (ProcessExpression(I)) {
// The current instruction may have been deleted, make sure to back up to
// PrevInst instead.
if (PrevInst)
I = PrevInst;
else
I = BB->begin();
if (ProcessExpression(I++))
Changed = true;
} else {
PrevInst = I++;
}
return Changed;
}