[llvm] [RISCV] add more generic macrofusions (PR #151140)

Daniel Henrique Barboza via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 1 04:55:44 PDT 2025


danielhb wrote:

> I wonder if we can merge some fusions into one? For example, `add+lw` and `add.uw+lw`, I don't see why we should make them standalone fusions.

@wangpc-pp I don't mind merging similar fusions. I split them because I didn't want to assume that other processors would always fuse add.uw+lw if they fuse add+lw. 

>From the current fusion list I'm adding:

- bfext (slli+srli)
- auipc+load
- auipc+addiw
- lui+load
- add+lw
- add+load 
- add.uw+load
- addi+load
- shXadd+load, where X=1,2,3
- shXadduw+load, where X=1,2,3

I believe we can:

- remove auipc+addiw per Craig comment above;
- merge add+load  and  add.uw+load;
- merge shXadd+load and shXadduw+load;
- remove add+lw. Just checked and veyron-v1 can make it do with add+load.

We'll end up with:

- bfext (slli+srli)
- auipc+load
- lui+load
- (add/add.uw)+load 
- addi+load
- (shXadd/shXadd.uw)+load, where X=1,2,3




https://github.com/llvm/llvm-project/pull/151140


More information about the llvm-commits mailing list