Re: [PATCH v5 06/18] RISC-V: Add ADD_ANDI macro-fusion recognition
Jeffrey Law <[email protected]>
| Newsgroups | gmane.comp.gcc.patches |
|---|---|
| Message-ID | <[email protected]> |
On 8/13/2026 11:57 PM, Jin Ma wrote: > Recognize ADD/ADDI-type instructions followed by ANDI when the result > register forms the required dependency. Parameterize the ANDI > classifier so the new recognizer and existing B_ALUI logic share RTL > parsing. > > Leave the fusion disabled by default. > > gcc/ChangeLog: > > * config/riscv/riscv-fusion.cc (riscv_insn_is_add_addi_p): New > function. > (riscv_insn_is_andi_type_p): Likewise. > (riscv_fuse_b_alui): Reuse the ANDI matcher. > (riscv_fuse_add_andi): New function. > (riscv_fusion_table): Add RISCV_FUSE_ADD_ANDI. > * config/riscv/riscv-protos.h (enum riscv_fusion_pairs): Add > RISCV_FUSE_ADD_ANDI. > > gcc/testsuite/ChangeLog: > > * gcc.target/riscv/fusion-add-addi-andi.c: New test. > * gcc.target/riscv/fusion-mv-li-andi-rtl.c: Likewise. > * gcc.target/riscv/fusion-special-positive-rtl-add-andi.c: Likewise. > > Signed-off-by: Jin Ma <[email protected]> OK once prerequisites are approved. jeff