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

Lewis Revill via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 4 07:33:40 PDT 2019


lewis-revill planned changes to this revision.
lewis-revill added inline comments.
Herald added a subscriber: MaskRay.


================
Comment at: lib/Target/RISCV/RISCVRegisterInfo.cpp:105
+  const auto *RVFI = MF.getInfo<RISCVMachineFunctionInfo>();
+  if (!RVFI->useSaveRestoreLibCalls())
+    return false;
----------------
I have a feeling it may be beneficial here to instead cast away const to get a modifiable `RVFI`, so that we can call `getUseSaveRestoreLibCalls` instead and never end up with the situation where we call `useSaveRestoreLibCalls` here but get a different result when we call `getUseSaveRestoreLibCalls` at a later stage.

This way we'd know that every time we check for whether lib calls can be used we get the same result, since we're always calling the lazy getter.


Repository:
  rL LLVM

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

https://reviews.llvm.org/D62686





More information about the llvm-commits mailing list