[PATCH] D62686: [WIP][RISCV] Add support for save/restore of CSRs via libcalls

Lewis Revill via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 30 09:14:27 PDT 2019


lewis-revill added a comment.

I might need to go through the variable/function names to replace 'CSR' with CalleeSavedRegister or something that doesn't cause confusion with RISC-V 'CSR' meaning 'Control & Status Register'...



================
Comment at: lib/Target/RISCV/RISCVMachineFunctionInfo.h:70
+
+  const std::vector<CalleeSavedInfo> &getFixedCSRs() {
+    if (!FixedCSRs)
----------------
I have put these two functions here just to try to deduplicate this common operation of distinguishing between fixed and non-fixed callee saved registers. I'd appreciate advice on a neater approach.


================
Comment at: lib/Target/RISCV/RISCVRegisterInfo.cpp:84
 
+static cl::opt<bool> EnableSaveRestore("enable-save-restore", cl::init(false),
+    cl::desc("Enable save/restore of callee-saved registers via libcalls"));
----------------
This should probably appear somewhere else, there ideally needs to be a Clang flag for this.


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