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: ARM: allow factorization of constants into addressing insns when optimizing for space


> 
> 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.


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