On 8/13/26 11:59 PM, Jin Ma wrote:
Recognize SRLI/SRLIW followed by a matching-width ADD-type operation
when the normalized shift amount is two and the required
producer-consumer dependency holds. Reuse the common shift classifier
and report wordness from the existing add classifier.
Leave the fusion disabled by default and XFAIL its positive dump
checks until a CPU enables it.
gcc/ChangeLog:
* config/riscv/riscv-fusion.cc (riscv_insn_is_add_type_p): Optionally
report whether the instruction is a word form.
(riscv_fuse_srli_add): New function.
(riscv_fusion_table): Add RISCV_FUSE_SRLI_ADD.
* config/riscv/riscv-protos.h (enum riscv_fusion_pairs): Add
RISCV_FUSE_SRLI_ADD.
gcc/testsuite/ChangeLog:
* gcc.target/riscv/fusion-srli-add.c: New test.
* gcc.target/riscv/fusion-word-positive-rtl-srli-add.c: Likewise.
OK once prerequisites are approved.
jeff