[PATCH] D24031: [InstCombine] replace fold of an icmp pattern that should never happen with an assert

Sanjay Patel via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 31 15:22:17 PDT 2016

spatel added a comment.

In https://reviews.llvm.org/D24031#530868, @efriedma wrote:

> The initial worklist visits from the top down, but that isn't a general guarantee that every operand of an instruction will be completely combined before you visit that instruction.  For example, suppose the zext has a second use.  If that use is proven dead and erased between the visit to the "and" and the visit to the "icmp", you can trigger the assertion.  (Or something along those lines; I haven't actually gone through and proved that particular example works the way I described it.)

OK, I'm sufficiently scared that there is a possibility. :)
Do you think it's better to leave the fold in place? Or remove it but not add the assert?


More information about the llvm-commits mailing list