Fix some simple bugs. StrongPHIElimination now does not crash on 164.gzip.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45773 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Owen Anderson 2008-01-09 06:19:05 +00:00
parent 92b7c1d94e
commit cb7d949a19

View File

@ -178,7 +178,6 @@ public:
else if (preorder[ABlock] > preorder[BBlock])
return false;
assert(0 && "Error sorting by dominance!");
return false;
}
};
@ -208,8 +207,9 @@ StrongPHIElimination::computeDomForest(std::set<unsigned>& regs) {
for (std::vector<unsigned>::iterator I = worklist.begin(), E = worklist.end();
I != E; ++I) {
unsigned pre = preorder[LV.getVarInfo(*I).DefInst->getParent()];
MachineBasicBlock* parentBlock =
LV.getVarInfo(CurrentParent->getReg()).DefInst->getParent();
MachineBasicBlock* parentBlock = CurrentParent->getReg() ?
LV.getVarInfo(CurrentParent->getReg()).DefInst->getParent() :
0;
while (pre > maxpreorder[parentBlock]) {
stack.pop_back();