I have experimented with collecting a set of instructions that LSR is likely to eliminate in the scalar version of the loop. This is e.g. an add of a PHI and a constant.
At this point, the patch is showing a general improvement of at least %5 in scalar estimates. The collectLikelyLSRed() can likely be improved.
At this point, I wonder what the response to this is? Is this a good or bad idea?
How much would we want a general improvement vs avoiding worst case degradation of estimates?