[PATCH] D62686: [RISCV] Add support for save/restore of callee-saved registers via libcalls

Lewis Revill via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Dec 16 09:02:04 PST 2019


lewis-revill marked an inline comment as done.
lewis-revill added inline comments.


================
Comment at: llvm/lib/Target/RISCV/RISCVFrameLowering.cpp:289
   unsigned CFIIndex = MF.addFrameInst(
       MCCFIInstruction::createDefCfaOffset(nullptr, -StackSize));
   BuildMI(MBB, MBBI, DL, TII->get(TargetOpcode::CFI_INSTRUCTION))
----------------
shiva0217 wrote:
> Should the -StackSize be -RealStackSize?
Looks like it, good catch.


================
Comment at: llvm/lib/Target/RISCV/RISCVFrameLowering.cpp:668
+        .setMIFlag(MachineInstr::FrameSetup);
+
+    // Add registers spilled in libcall as liveins.
----------------
shiva0217 wrote:
> GCC will generate stack adjustment and GPR callee saved CFIs for the save libcalls. Should we do the same?
I'm not familiar with the use of the CFI offset stuff, though just to be sure, you're saying that in addition to the manually-added `.cfi_offset`s in the libcalls themselves we would want to add them in our frame too?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D62686





More information about the cfe-commits mailing list