This patch fixes a bug in prepareICWorklistFromFunction, where the loop becomes infinite with instructions of token type. The patch checks if the instruction is token type, and if so it updates EndInst with the current instruction.
Details
Details
Diff Detail
Diff Detail
- Repository
- rL LLVM
Event Timeline
lib/Transforms/InstCombine/InstructionCombining.cpp | ||
---|---|---|
3022–3032 ↗ | (On Diff #43899) | 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(); |
lib/Transforms/InstCombine/InstructionCombining.cpp | ||
---|---|---|
3022–3032 ↗ | (On Diff #43899) | It will actually hit a verifier assertion failure if gc.relocate instruction takes an undef gc.statepoint token. But the verifier could be fixed in a later patch if we'd like to have the code you suggested. I dont know if there's similar issues for uses of cleanuppad or catchpad. |