This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: RFA: autoincrement patches for gcc 4 - updated patch
- From: Paul Brook <paul at codesourcery dot com>
- To: gcc-patches at gcc dot gnu dot org
- Cc: Ian Lance Taylor <iant at google dot com>, Joern RENNECKE <joern dot rennecke at st dot com>, Richard Henderson <rth at redhat dot com>, Bernd Schmidt <bernd dot schmidt at analog dot com>
- Date: Sat, 15 Jul 2006 16:02:31 +0100
- Subject: Re: RFA: autoincrement patches for gcc 4 - updated patch
- References: <421F4698.1050809@st.com> <44996F60.8000108@st.com> <m3r70nmz0x.fsf@localhost.localdomain>
> 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