s390: Change SET rtx_cost handling.
authorRobin Dapp <rdapp@linux.ibm.com>
Thu, 3 Feb 2022 11:50:04 +0000 (12:50 +0100)
committerRobin Dapp <rdapp@linux.ibm.com>
Mon, 29 Aug 2022 09:15:10 +0000 (11:15 +0200)
commit1930c5d05ceff2173a32f23e5dbd0738460f521e
treee04d205c3a2d528bdd10888a37cbc4470ac1e6f2
parent34895b6606561a36ffded81efee2904feb9c1bfd
s390: Change SET rtx_cost handling.

The IF_THEN_ELSE detection currently prevents us from properly costing
register-register moves which causes the lower-subreg pass to assume that
a VR-VR move is as expensive as two GPR-GPR moves.

This patch adds handling for SETs containing REGs as well as MEMs and is
inspired by the aarch64 implementation.

gcc/ChangeLog:

* config/s390/s390.cc (s390_address_cost): Declare.
(s390_hard_regno_nregs): Declare.
(s390_rtx_costs): Add handling for REG and MEM in SET.

gcc/testsuite/ChangeLog:

* gcc.target/s390/vector/vec-sum-across-no-lower-subreg-1.c: New test.
gcc/config/s390/s390.cc
gcc/testsuite/gcc.target/s390/vector/vec-sum-across-no-lower-subreg-1.c [new file with mode: 0644]