[PATCH] D91719: [RISCV] Add support for using -msave-restore with tailcalls

Edward Jones via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 19 09:40:52 PDT 2021


edward-jones updated this revision to Diff 338542.
edward-jones added a comment.
Herald added a subscriber: vkmr.

I have updated this so that the generation of the address passed to the restore functions is done in a separate method `RISCVFrameLowering::buildAddr`. This handles both the code models and mirrors `RISCVISelLowering::getAddr` - it would be nice if these functions could share code, or at least be in a common place.

I've also opened a pull request to document the existing `-msave-restore` behaviour in riscv-toolchain-conventions <https://github.com/riscv/riscv-toolchain-conventions/pull/9>, and I have a follow up patch to document the tail call versions of the entry points too.

I've expanded the test to cover the different code models, and pic mode too.


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

https://reviews.llvm.org/D91719

Files:
  llvm/lib/Target/RISCV/RISCVFrameLowering.cpp
  llvm/lib/Target/RISCV/RISCVFrameLowering.h
  llvm/lib/Target/RISCV/RISCVMachineFunctionInfo.h
  llvm/test/CodeGen/RISCV/saverestore.ll
  llvm/test/CodeGen/RISCV/saverestore_tailcall.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D91719.338542.patch
Type: text/x-patch
Size: 17070 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210419/5377273c/attachment.bin>


More information about the llvm-commits mailing list