> Is this whole huge complicated peephole really worth it? I'd expect
> the pattern to match quite a few times, but all the additional checks
> probably make it not trigger very often. Honza, do you have numbers
> about the effects of this patch??
The pattern match about every access to array where both base and index
are load from memory for the address computation on pentium and i686, so
I can imagine there are testcases where this accounts for important
portion of code. It matches 315 times on tramp3d, 35 times on Gerald's
testcase and 20 times in combine.c. Every match is roughly 4 bytes of
So I think it sort of worth it just because the costs of extra peep2 are
low despite it's spagettiness...