[PATCH] D68979: [RISCV] Handle variable sized objects with the stack need to be realigned

Sam Elliott via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 17 07:30:33 PDT 2019


lenary added a comment.

This is looking good. Just a few small comments at the moment, and I'm going to kick off a testing run on our internal build system.



================
Comment at: llvm/lib/Target/RISCV/RISCVFrameLowering.cpp:362
+    if (hasBP(MF))
+      FrameReg = RISCV::X9;
+    else
----------------
Please may you use `getBPReg` here instead of hard-coded RISCV::X9?

At some point, we should use `getFPReg` for everywhere we hard-code RISCV::X2, but that's irrelevant to this change.


================
Comment at: llvm/lib/Target/RISCV/RISCVFrameLowering.cpp:388
+  if (hasBP(MF))
+    SavedRegs.set(RISCV::X9);
 
----------------
Again, use `getBPReg` here to avoid hard-coding RISCV::X9.


================
Comment at: llvm/lib/Target/RISCV/RISCVRegisterInfo.cpp:86
+  if (TFI->hasBP(MF))
+    markSuperRegs(Reserved, RISCV::X9); // bp
   assert(checkAllSuperRegsMarked(Reserved));
----------------
Again, use getBPReg here (if you can, this one is harder)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D68979





More information about the llvm-commits mailing list