LoopPredication is not profitable when the loop is known to always exit
through some block other than the latch block.
A coarse grained latch check can cause loop predication to predicate the
loop, making the guard invariant out of the loop and always
unconditionally deoptimize. However, the guard may never fail within the
loop because dynamically, it always exits earlier through some other block and never through
the latch block.
We teach LP about this using BranchProfileInfo pass.
This methodology was chosen instead of adding metadata to prevent loop
predication: https://reviews.llvm.org/D44535
I think it is better to add some comment here, what the value of this option actually means.