This is geared at being a debugging aid. When analysing IR, it's common to have large complicated loops with multiple exits and profiling data which indicates which exit is actually taken. When looking to see if there's a problem in SCEV's exit count logic, it really helps to be able to quickly see which exits are probably dead in practice. These are frequently - though not always - good places to examine further.
For the moment, the implementation of the estimated exit count stuff is SCEV specific. There's a version of something analogous in getEstimatedTripCount but a) trip count != exit count, and b) this needs to handle multiple exit loops, and c) I want to be able switch consumes over one by one to minimize breakage. My plan is to land this, move the impl into a common analysis header, then visit each one by one.
Why are the branch weights here 20/1 and not 19/1 (and relatedly, why do we need to subtract -1 in the exit count calculation)?