[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 07:42:59 PDT 2023
mgudim wrote:
> Tests?
I wanted to commit a test first:
https://github.com/llvm/llvm-project/pull/67022
This way the diff for this PR can show what's changed (https://llvm.org/docs/TestingGuide.html#precommit-workflow-for-tests)
> Isn't `CodeGenPrepare::optimizeMemoryInst` supposed to move GEPs to their uses?
Yes, I've looked at that at first too. The problem is that the `gep` lowers into more than one instruction, but only one of them (`addi`) can be sinked into the loop to be absorbed into offset of `ld`.
> Does this increase register pressure?
I hope not. Without this transformation, the `addi` inside the loop would use a register until the `ld`. Let me collect the number of spills before / after this pathch and I'll post that soon.
https://github.com/llvm/llvm-project/pull/67024
More information about the llvm-commits
mailing list