[PATCH] D21613: [DSE] Avoid iterator invalidation bugs by deferring deletion.

Eli Friedman via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 24 11:10:25 PDT 2016


eli.friedman added a comment.

" can you please explain why the phi nodes must stick around (at least in the short term)? I don't follow.."

Err, the PHI nodes don't need to stick around; you just need to make sure you don't delete the instruction the iterator is pointing at, and the operand of a phi node could be that instruction.  There are other ways around the issue, I guess... you could even pass a pointer to the iterator to deleteDeadInstruction and make it update the iterator, I guess, instead of postponing deleting it.


http://reviews.llvm.org/D21613





More information about the llvm-commits mailing list