[ARM][PR65768] Keep constants in register when expanding

Richard Earnshaw Richard.Earnshaw@foss.arm.com
Thu May 14 09:26:00 GMT 2015


On 27/04/15 00:07, Kugan wrote:
>
>> While I support your goals, I think your approach needs some refinement.
>>
>> In particular, we DO NOT want another function that starts looking at
>> constant values and tries to decide, on a case by case basis, what to do
>> with that value.  We need to keep the logic for that, as much as
>> possible, in one small set of functions so that the compiler cannot end
>> up with conflicting decisions coming from different bits of code.
>>
>> So const_ok_for_split has to go.  Instead you should be using
>> const_ok_for op (an existing routine) and a simple macro that
>> encapsulates "optimize >= 2 && can_create_pseudo_p ()" as the gate for
>> when to use a separate scratch register.
>>
>
> Thanks for the review. Please find the patch attached that does this.
> Regression tested on qemu for arm-none-linux-gnueab with no new
> regressions. Bootstrapped successfully on chromebook. Is this OK for trunk?
>
> Thanks,
> Kugan
>
>
> gcc/ChangeLog:
>
> 2015-04-26  Kugan Vivekanandarajah  <kuganv@linaro.org>
> 	    Zhenqiang Chen  <zhenqiang.chen@linaro.org>
>
> 	PR target/65768
> 	* config/arm/arm.h (CONST_OK_FOR_SPLIT): New macro.
> 	* config/arm/arm.md (subsi3, andsi3, iorsi3, xorsi3, movsi): Keep some
> 	 large constants in register instead of splitting them.
>

I think your macro should be renamed to "DONT_EARLY_SPLIT_CONSTANT" (and 
the logic for it inverted, so that you don't need '!' in front of every 
instance).

OK with that change.

R.

> gcc/testsuite/ChangeLog:
>
> 2015-04-26  Kugan Vivekanandarajah  <kuganv@linaro.org>
> 	    Zhenqiang Chen  <zhenqiang.chen@linaro.org>
>
> 	PR target/65768
> 	* gcc.target/arm/maskdata.c: New test.
>



More information about the Gcc-patches mailing list