[llvm-commits] CVS: llvm/lib/Transforms/Scalar/IndVarSimplify.cpp
Chris Lattner
lattner at cs.uiuc.edu
Wed Dec 10 14:44:01 PST 2003
Changes in directory llvm/lib/Transforms/Scalar:
IndVarSimplify.cpp updated: 1.43 -> 1.44
---
Log message:
Fix bug: IndVarsSimplify/2003-12-10-RemoveInstrCrash.llx
---
Diffs of the changes: (+5 -0)
Index: llvm/lib/Transforms/Scalar/IndVarSimplify.cpp
diff -u llvm/lib/Transforms/Scalar/IndVarSimplify.cpp:1.43 llvm/lib/Transforms/Scalar/IndVarSimplify.cpp:1.44
--- llvm/lib/Transforms/Scalar/IndVarSimplify.cpp:1.43 Wed Dec 10 12:06:47 2003
+++ llvm/lib/Transforms/Scalar/IndVarSimplify.cpp Wed Dec 10 14:43:04 2003
@@ -140,6 +140,8 @@
DEBUG(IV->print(std::cerr));
+ while (isa<PHINode>(AfterPHIIt)) ++AfterPHIIt;
+
// Don't do math with pointers...
const Type *IVTy = IV->Phi->getType();
if (isa<PointerType>(IVTy)) IVTy = Type::ULongTy;
@@ -204,6 +206,9 @@
PHIOps.insert(PHIOps.end(), MaybeDead->op_begin(),
MaybeDead->op_end());
MaybeDead->getParent()->getInstList().erase(MaybeDead);
+
+ // Erasing the instruction could invalidate the AfterPHI iterator!
+ AfterPHIIt = Header->begin();
}
}
More information about the llvm-commits
mailing list