This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: RFA: autoincrement patches for gcc 4 - updated patch


> When I look at this patch, it seems to me that it turns
> pseudo-assembly code like this:
>
>     r1 = r0 + 8
>     r2 = (r1)
>     r3 = r0 + 12
>     r4 = (r3)
>...
> However, it seems to me that we can view this as two separate
> optimizations.  The first one is to change the first code above into
> this:
>
>     r1 = r0 + 8
>     r2 = (r1)
>     r1 = r1 + 4
>     r4 = (r1)
>
> On machines without register offset addressing and with relatively few
> registers, this is a useful optimization because it decreases register
> pressure.

This can also useful on machines with limited immediate ranges (eg. most RISC 
machines). Typically it occurs with large structures, ie. when "+ 12" 
requires multiple instructions.

We've seen evidence that this transformation would help Thumb code on CSiBE.

Paul


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]