[PATCH] D103622: [RISCV] Avoid scalar outgoing arguments overwrite vector frame objects.

Fraser Cormack via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 9 07:01:47 PDT 2021


frasercrmck added a comment.

Thanks for the detailed explanation.

I think the title can be reworded as "overwriting" where it says "overwrite".



================
Comment at: llvm/lib/Target/RISCV/RISCVFrameLowering.cpp:924
 // function contains variable size objects and let eliminateCallFramePseudoInstr
 // preserve stack space for it.
 bool RISCVFrameLowering::hasReservedCallFrame(const MachineFunction &MF) const {
----------------
Update comment here, perhaps?


================
Comment at: llvm/test/CodeGen/RISCV/rvv/rvv-out-arguments.ll:88
-; CHECK-NEXT:    addi a0, a0, -128
+; CHECK-NEXT:    addi a0, a0, -112
 ; CHECK-NEXT:    vs8r.v v8, (a0)
 ; CHECK-NEXT:    addi a0, zero, 1
----------------
Just so I understand, this is presumably the bug here, right? We're storing a vector register to `a0` which is `s0 - (vlenb<<3) - 128` which is (in a roundabout way) `sp`? And we store the arguments to the same spots `0(sp)` and `8(sp)` on lines 116 and 115?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D103622/new/

https://reviews.llvm.org/D103622



More information about the llvm-commits mailing list