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

Sam Elliott via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 4 13:12:06 PDT 2019


lenary added inline comments.


================
Comment at: lib/Target/RISCV/RISCVFrameLowering.cpp:401
+  default:
+    llvm_unreachable("Something has gone wrong!");
+  case /*s11*/ RISCV::X27: return "__riscv_save_12";
----------------
Won't we hit this case if (after the hard float ABI lands) someone uses any of fs0-fs11? 

Would it not be better to return `nullptr`, so the code can bail out, rather than asserting?

The same applies in `getRestoreLibCallName`


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