Currently we use the trip count from the exiting latch or from the
unique exit block. If the loop is not rotated, the latch won't exit but
the header will.
This patch falls back to using the trip count from the header, if the
header is exiting and the latch is not.
This fixes cases where we failed to unroll with -Oz, like
https://godbolt.org/z/fP6sna8qK
bool foo(int *ptr, int limit) { #pragma clang loop unroll(full) for (unsigned int i = 0; i < 4; i++) { if (ptr[i] > limit) return false; ptr[i]++; } return true; }