Fix some simple bugs. StrongPHIElimination now does not crash on 164.gzip.
authorOwen Anderson <resistor@mac.com>
Wed, 9 Jan 2008 06:19:05 +0000 (06:19 +0000)
committerOwen Anderson <resistor@mac.com>
Wed, 9 Jan 2008 06:19:05 +0000 (06:19 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45773 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/StrongPHIElimination.cpp

index 3b201f7b8188a09fd4448ec97161c5d93be70167..eff02f1fbf9c21d1fbd46ba5e1e614989ea3d86e 100644 (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();