Try harder to preserve operand ties in maybe_legitimize_operands
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.
2018-05-25 Richard Sandiford <richard.sandiford@linaro.org>
gcc/
* optabs.c (can_reuse_operands_p): New function.
(maybe_legitimize_operands): Try to reuse the results for
earlier operands.
From-SVN: r260706