[PATCH] D98802: [RISCV][WIP] Fix offset computation for RVV
Roger Ferrer Ibanez via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Mar 18 09:21:03 PDT 2021
rogfer01 added a comment.
In D98802#2634791 <https://reviews.llvm.org/D98802#2634791>, @StephenFan wrote:
> Hi @rogfer01 ! It is reasonable to me. But I think the instruction of `BuildMI(MBB, MBBI, DL, TII->get(RISCV::ADDI), SPReg)` can be eliminated. Firstly, the value of calleeSavedStackSize can be regarded as a aligned value(For example, aligned to MFI.getStackAlign()). Then we can calculate the padding size by the aligned calleeSavedStackSize minus the original calleeSavedStackSize. When emits prologue, we can minus the value of `MFI.getStackSize() - original calleeSavedStackSize + aligned calleeSavedStackSize`. When get the offset of the rvv object, we can `MFI.getStackSize() - original calleesavedStackSize`, because we just want to calculate the non-calleesaved field size.
That sounds like a great idea, I will try your suggestion. Thanks a lot @StephenFan !
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D98802/new/
https://reviews.llvm.org/D98802
More information about the llvm-commits
mailing list