After setting LSR instructions number priority number 1 for X86, I've received several regression (on of them from Wei Mi) on the tests like this:
for (int i = 0; i < n; i++) y[i] += c * x[i]; // y[i], c, x[i] are float
The reason was in too many complicated address calculations which conflict with other instructions.
The suggested heuristic limit number of complicated addresses, leaving all gains and avoiding the regression.
Could you add a comment explaining the >> 3?
It does not make sense to count folded addresses as additional instructions on its own and the >> 3 makes it even more cryptic why we do that :).