]> git.ipfire.org Git - thirdparty/gcc.git/commit
RISC-V: Avoid more unsplit insns in const expander [PR118832].
authorRobin Dapp <rdapp.gcc@gmail.com>
Thu, 13 Feb 2025 23:33:24 +0000 (16:33 -0700)
committerJeff Law <jlaw@ventanamicro.com>
Thu, 13 Feb 2025 23:33:24 +0000 (16:33 -0700)
commit28b2ad5341f875ee7e034b0c6f9e4eb725e19a8f
tree01d091e57f1ee6a6228f26eba29e2e8c5c7554ba
parent6ac313525a1faecb9f39a0ba3240f7a9ead91dcc
RISC-V: Avoid more unsplit insns in const expander [PR118832].

Hi,

in PR118832 we have another instance of the problem already noticed in
PR117878.  We sometimes use e.g. expand_simple_binop for vector
operations like shift or and.  While this is usually OK, it causes
problems when doing it late, e.g. during LRA.

In particular, we might rematerialize a const_vector during LRA, which
then leaves an insn laying around that cannot be split any more if it
requires a pseudo.  Therefore we should only use the split variants
in expand_const_vector.

This patch fixed the issue in the PR and also pre-emptively rewrites two
other spots that might be prone to the same issue.

Regtested on rv64gcv_zvl512b.  As the two other cases don't have a test
(so might not even trigger) I unconditionally enabled them for my testsuite
run.

Regards
 Robin

PR target/118832

gcc/ChangeLog:

* config/riscv/riscv-v.cc (expand_const_vector):  Expand as
vlmax insn during lra.

gcc/testsuite/ChangeLog:

* gcc.target/riscv/rvv/autovec/pr118832.c: New test.
gcc/config/riscv/riscv-v.cc
gcc/testsuite/gcc.target/riscv/rvv/autovec/pr118832.c [new file with mode: 0644]