[PATCH] D15859: [InstructionCombining] prepareICWorklistFromFunction halts in infinite loop with instructions of token type
David Majnemer via llvm-commits
llvm-commits at lists.llvm.org
Mon Jan 4 13:54:48 PST 2016
majnemer added inline comments.
================
Comment at: lib/Transforms/InstCombine/InstructionCombining.cpp:3022-3032
@@ -3021,14 +3021,13 @@
Instruction *Inst = &*--EndInst->getIterator();
if (!Inst->use_empty() && !Inst->getType()->isTokenTy())
Inst->replaceAllUsesWith(UndefValue::get(Inst->getType()));
- if (Inst->isEHPad()) {
+ if (Inst->isEHPad() || Inst->getType()->isTokenTy()) {
EndInst = Inst;
continue;
}
if (!isa<DbgInfoIntrinsic>(Inst)) {
++NumDeadInst;
MadeIRChange = true;
}
- if (!Inst->getType()->isTokenTy())
- Inst->eraseFromParent();
+ Inst->eraseFromParent();
}
----------------
Would anything go wrong if we simply had:
if (!Inst->use_empty())
Inst->replaceAllUsesWith(UndefValue::get(Inst->getType()));
if (Inst->isEHPad()) {
EndInst = Inst;
continue;
}
if (!isa<DbgInfoIntrinsic>(Inst)) {
++NumDeadInst;
MadeIRChange = true;
}
Inst->eraseFromParent();
http://reviews.llvm.org/D15859
More information about the llvm-commits
mailing list