[llvm] [RISCV] Fold `addi` into load / store even if they are in different BBs. (PR #67024)

Mikhail Gudim via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 22 08:25:02 PDT 2023


mgudim wrote:

> Why can't this be done in `RISCVMergeBaseOffset`?

I haven't seen this pass when I wrote this. I agree, good idea.  

I can't understand why is `RISCVMergeBaseOffset` so late in the pipeline? If we move it right after ISel, we can do the optmizations earlier, which should be generally better, no? Also, some many things are easier to implement while we are still in SSA. What is the latest point at which opportunities for `MergeBaseOffset` are created?

I see two questions here:

(1) Should we combine this with `MergeBaseOffset` (I vote  "yes").
(2) Where in pipeline should this be? (Move `MergeBaseOffset` to `finalizeLowering`?)
@wangpc-pp  @topperc @michaelmaitland @asb What do you think?

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


More information about the llvm-commits mailing list