[llvm] [llvm][RISCV] Implement Zilsd load/store pair optimization (PR #158640)

Brandon Wu via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 21 08:56:04 PDT 2025


4vtomat wrote:

> I did a bit of a closer look at the code this time around.
> 
> I think there's still some issue where we treat symbolic offsets similarly to immediate offsets. This might appear with more testing where both an in-parameter and a global were loaded/stored to/from in the same basic block, especially if those loads/stores were interleaved.
> 
> Hopefully I have also proposed some simplifications too :)

do you mean something like this?
```
%2:gpr = LW %1, target-flags(riscv-lo) @global_var :: (load (s32))
%3:gpr = LW %0, 0 :: (load (s32))
%4:gpr = LW %1, target-flags(riscv-lo) @global_var + 4 :: (load (s32))
%5:gpr = LW %0, 4 :: (load (s32))
```
I think it works correctly lol

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


More information about the llvm-commits mailing list