This lets us optimize the interesting case of
do { I = PHI(I_Begin, I_Next); I_Next = I +nsw 1 Use(Sext(I_Next)) } while (I_Next < N);
Note: we "already get" the above case, but the way we do so is
incorrect. Making our poison value analysis smarter about this will let
us get rid of the buggy behavior (in a later patch) without regressing
too much performance across the board.
Our langref states:
The code, as written, sounds like it will do the wrong thing if the branch instruction branches to the same basic block regardless of the condition operand. Maybe this is just a bug in the langref? Equally possible is that I misunderstand the behavior that this function is trying to suss out.