More AddUsersIfInteresting related fix.

llvm-svn: 152909
This commit is contained in:
Hongbin Zheng 2012-03-16 08:31:24 +00:00
parent 741f8d666f
commit 73e53f510a
1 changed files with 5 additions and 2 deletions

View File

@ -1967,8 +1967,11 @@ bool IndVarSimplify::runOnLoop(Loop *L, LPPassManager &LPM) {
// loop exit test instruction. // loop exit test instruction.
if (IU && NewICmp) { if (IU && NewICmp) {
ICmpInst *NewICmpInst = dyn_cast<ICmpInst>(NewICmp); ICmpInst *NewICmpInst = dyn_cast<ICmpInst>(NewICmp);
if (NewICmpInst) if (NewICmpInst) {
IU->AddUsersIfInteresting(cast<Instruction>(NewICmpInst->getOperand(0))); SmallPtrSet<Loop*,16> SimpleLoopNests;
IU->AddUsersIfInteresting(cast<Instruction>(NewICmpInst->getOperand(0)),
SimpleLoopNests);
}
} }
// Clean up dead instructions. // Clean up dead instructions.
Changed |= DeleteDeadPHIs(L->getHeader()); Changed |= DeleteDeadPHIs(L->getHeader());