Inspired from these two docs
https://arxiv.org/pdf/1607.02318.pdf
https://riscv.org/wp-content/uploads/2016/07/Tue1130celio-fusion-finalV2.pdf
this patch contains known pairs that can be fused from above two docs.
Differential D73643
[RISCV] Macro Fusion for RISC-V kamleshbhalui on Jan 29 2020, 9:54 AM. Authored by
Details Inspired from these two docs this patch contains known pairs that can be fused from above two docs.
Diff Detail Event TimelineComment Actions Wow, this is really cool! I'm amazed it took so little (target-specific) code. It would be good to understand the trade-offs of doing this rescheduling when the core doesn't necessarily support fusion. With the current instructions, I don't see many scheduling problems coming from blindly fusing all the time, but maybe this should be a subtarget feature that can be switched on and off in case it creates scheduling issues.
Comment Actions As @lenary said, this must be enabled only for those sub targets that actually fuse these instrs. Also, when using the macro fusion pass, you should also enable the post RA pass. Otherwise, it's less effective. Comment Actions Please, prefix the title with [RISCV].
Comment Actions Indexed load and store fusion should not be exclusive to LD and SD. It applies to any (F)Lx/(F)Sx. The literature just talks about LD/ST (note that this is not SD) in the sense of an arbitrary load/store instruction. Similarly for the various other fusion pairs involving memory accesses.
Comment Actions Is Chipyard already supporting these micro-op-fusion? and how can i use this code to make a riscv file (test.riscv) from a c file? Comment Actions Hi, I'd like to know if you are still interested in this work? There is a microarchitecture called XiangShan that actually supports instruction fusion. We are working on support of this processor in LLVM, including macro fusion, and we hope to make our patches upstream. The fusion pairs are listed here (translations needed) and I suppose it's a good opportunity to introduce instruction fusion in the RISCV ecosystem of LLVM. |
Different implementations may implement just some of the possible pairs. So this feature should perhaps be broken down into each category.