https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90402
--- Comment #4 from Richard Biener <rguenth at gcc dot gnu.org> --- All are similar, the VN in if-conversion removes a PHI - this is something we cannot really deal with when doing peeling. In all cases this is a missed optimization on the non-if-converted body of course. In one case we're considering PHI <UNDEF, constant> as constant, in the other we're CSEing two equivalent PHIs. Both do not require doing anything optimistic or iterating. We can't easily trick VN to consider the PHIs varying, I suppose we could just VN the loop body which would require to have a starting BB (skip PHIs, allowing multiple entries into it) and multiple exits, the latch and the exit block. But this would also complicate it quite a bit since we'd need to track edges not in the region. Still that's going to be what I'll do.