Hi,

The Neon multiply/multiply-accumulate/multiply-subtract instructions
can select the top or bottom half of the operand registers. This
selection does not change the cost of the underlying instruction and
this should be reflected by the RTL cost function.

This patch adds RTL tree traversal in the Neon multiply cost function
to match vec_select high-half of its operands. This traversal
prevents the cost of the vec_select from being added into the cost of
the multiply - meaning that these instructions can now be emitted in
the combine pass as they are no longer deemed prohibitively
expensive.

Regression tested and bootstrapped on aarch64-none-linux-gnu - no
issues.

Ok for master?

Thanks,
Jonathan

---

gcc/ChangeLog:

2021-07-19  Jonathan Wright  <jonathan.wri...@arm.com>

        * config/aarch64/aarch64.c (aarch64_vec_select_high_operand_p):
        Define.
        (aarch64_rtx_mult_cost): Traverse RTL tree to prevent cost of
        vec_select high-half from being added into Neon multiply
        cost.
        * rtlanal.c (vec_series_highpart_p): Define.
        * rtlanal.h (vec_series_highpart_p): Declare.

gcc/testsuite/ChangeLog:

        * gcc.target/aarch64/vmul_high_cost.c: New test.

Attachment: rb14704.patch
Description: rb14704.patch

Reply via email to