Currently, getExact fails if it sees two exit counts in different blocks. There is
no solid reason to do so, given that we only calculate exact non-taken count
for exiting blocks that dominate latch. Using this fact, we can simply take min
out of all exits of all blocks to get the exact taken count.
This patch makes the calculation more optimistic with enforcing our assumption
with asserts. It allows us to calculate exact backedge taken count in trivial loops
like
for (int i = 0; i < 100; i++) { if (i > 50) break; . . . }
Actually I start thinking that this may be an over-conservative assert. Imagine the situation:
If we unswitch Loop 2 by invariant condition, we end up with something like
Exits in copies of loop2 no longer dominate the latch of loop1. I didn't comprehend it from the very beginning, but this may be an issue.