When a SelectInst is in a critical path of a loop, we aggressively turn the SelectInst into a branch
so that we rely more on the branch predictor.
This change simply check if the SelectInst is in a single latch of a loop in isFormingBranchFromSelectProfitable().
Most of the changes in this patch is to update LoopInfo when there is any change in CFG.
With this change, I observed 5% performance gain in spec2000/vpr in kryo without any regression in other benchmarks in spec2000/spec2006.
I am sending this out early to get early feedback about the basic idea of this change as I do the tuning/testing in parallel. This is also more test cases.