]> git.ipfire.org Git - thirdparty/gcc.git/commit
[PR target/119587] RISC-V: xtheadmemidx: Split slli.uw pattern
authorBohan Lei <garthlei@linux.alibaba.com>
Sat, 11 Oct 2025 16:11:34 +0000 (10:11 -0600)
committerJeff Law <jlaw@ventanamicro.com>
Sat, 11 Oct 2025 16:24:25 +0000 (10:24 -0600)
commitc9586a3e9060cfcbda62604f515d9974c00adaea
tree39e730382e63316c12a487aa0ab122ce639975a4
parente347e2b81ac7daa7382c611a62d54ec0b761bee8
[PR target/119587] RISC-V: xtheadmemidx: Split slli.uw pattern

The combine pass can generate an index like (and:DI (mult:DI (reg:DI)
(const_int scale)) (const_int mask)) when XTheadMemIdx is available.
LRA may pull it out, and thus a splitter is needed when Zba is not
available.

A similar splitter were introduced when XTheadMemIdx support was added,
but removed in commit 31c3c5d.  The new splitter in this new patch is
based on the removed one.

PR target/119587
gcc/ChangeLog:

* config/riscv/thead.md (*th_memidx_operand): New splitter.

gcc/testsuite/ChangeLog:

* gcc.target/riscv/xtheadmemidx-bug.c: New test.
gcc/config/riscv/thead.md
gcc/testsuite/gcc.target/riscv/xtheadmemidx-bug.c [new file with mode: 0644]