On 05/23/2018 12:47 AM, Richard Sandiford wrote:
> maybe_legitimize_operands normally goes through each operand in turn
> and legitimises it in isolation.  For example, if two operands to
> an instruction initially have constant value C, and the instruction
> requires both operands to be registers, the function ends up forcing
> C into a register twice and passing two different registers to the
> instruction.
> 
> I think we should try a bit harder to preserve the rtx_equal_p
> property, if it's easy to do.  Some targets can optimise that
> case better than they would the general case of all operands
> being different.  This is particularly true for SVE after the
> upcoming changes to the IFN_COND_* routines.
> 
> This is hard to test on its own, but is covered by the upcoming
> IFN_COND_* patches.
> 
> Tested on aarch64-linux-gnu (with and without SLP, and with and without
> the follow-on patch that needs it), aarch64_be-elf and x86_64-linux-gnu.
> OK to install?
> 
> Richard
> 
> 
> 2018-05-23  Richard Sandiford  <richard.sandif...@linaro.org>
> 
> gcc/
>       * optabs.c (can_reuse_operands_p): New function.
>       (maybe_legitimize_operands): Try to reuse the results for
>       earlier operands.
OK.
jeff

Reply via email to