On Thu, Oct 08, 2020 at 09:27:54AM +1030, Alan Modra wrote:
> The existing "case AND" in this function is not sufficient for
> optabs.c:avoid_expensive_constant usage, where the AND is passed in
> outer_code.  We'd like to cost AND of rs6000_is_valid_and_mask
> or rs6000_is_valid_2insn_and variety there, so that those masks aren't
> seen as expensive (ie. better to load to a reg then AND).
> 
>       * config/rs6000/rs6000.c (rs6000_rtx_costs): Combine CONST_INT
>       AND handling with IOR/XOR.  Move costing for AND with
>       rs6000_is_valid_and_mask or rs6000_is_valid_2insn_and to
>       CONST_INT.

Sorry this took so long to review :-(

On 64-bit BE this leads to *bigger* code, and closer observation shows
that some common sequences degrade on all configs.  This seems to mostly
be about "andc" (and its dot form).  It wasn't costed properly before,
but after your patch, a single instruction is replaced by three.

Could you look into this?


Segher

Reply via email to