This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: ARM: allow factorization of constants into addressing insns when optimizing for space
- From: Richard Earnshaw <rearnsha at arm dot com>
- To: Nicolas Pitre <nico at cam dot org>
- Cc: gcc-patches at gcc dot gnu dot org, Richard Earnshaw <rearnsha at arm dot com>
- Date: Mon, 20 Oct 2003 16:47:20 +0100
- Subject: Re: ARM: allow factorization of constants into addressing insns when optimizing for space
- Organization: ARM Ltd.
- Reply-to: Richard dot Earnshaw at arm dot com
>
> If optimizing for space, we currently let the compiler synthesize constants
> only if they need one insn, otherwise a load from memory is performed.
>
> This patch allows the compiler to synthesize constants with up to 2 insns,
> which uses the same space as a load from memory (the ldr insn and the pool
> entry) so worse case is the same. HOwever, this gives the opportunity to
> take even less space when different offsets can be factorized and combined
> into multiple pre-indexed loads or stores.
>
> Testing shows varying degree of text size reduction depending on code
> patern. No increase of code space has been noted.
>
> This patch also restructure related code a bit with some more comments to
> make things clearer but with no other operational changes.
>
>
> <date> Nicolas Pitre <nico@cam.org>
>
> * config/arm/arm.c (arm_override_options): Set arm_constant_limit
> to 2 instead of 1 when optimize_size is true. Gather code based on
> optimize_size together. Add comment about XScale load latency.
>
I'd prefer the code to be structured as
if (optimize_size)
/* Space-based value settings. */
else
/* Time-based value settings. */
But other than that, OK.
R.