Autoincrement pass
Jeffrey A Law
law@hurl.cygnus.com
Wed Mar 31 23:46:00 GMT 1999
> One problem I've observed is: pointer arithmetic (of which autoinc and
> autodec are subsets) seems to limit the scheduler's freedom to move
> instructions.
>
> I see this type of code generated gcc for the SH4 fairly often:
>
> mov.l @r0+,r1
> mov.l @r0,r2
> add r3,r2
>
> Since the memory load latency is two, it would be nice to schedule this to:
>
> mov.l @(4,r0),r2
> mov.l @r0+,r1
> add r3,r2
>
> but it seems the scheduler is unable to move the 2nd load before the 1st
> load due to the r0 post-increment dependency.
>
> I think (with the current scheduler implementation) the usage
> autoinc/autodec reduces code size, at the cost of performance on some
> architectures due to this problem.
There's no way to do that with our current scheduler framework.
When you make autoinc modes, you add dependencies between two insns that
did not previously have a dependency, which inhibits ILP that can be found
by the compiler and/or an out of execution hardware reorder buffer.
jeff
More information about the Gcc
mailing list