[PATCH] D132465: [SPARC] Make calls to function with big return values work

Koakuma via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 23 05:41:39 PDT 2022


koakuma created this revision.
koakuma added reviewers: venkatra, dcederman, ro, brad.
Herald added subscribers: jrtc27, fedor.sergeev, hiraditya, jyknight.
Herald added a project: All.
koakuma requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Implement CanLowerReturn and associated CallingConv changes for SPARC/SPARC64.

In particular, for SPARC64 there's new `RetCC_Sparc64_*` functions that handles the return case of the calling convention.
It uses the same analysis as `CC_Sparc64_*` family of funtions, but fails if the return value doesn't fit into the return registers.

This makes calls to functions with big return values converted to an sret function as expected, instead of crashing LLVM.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D132465

Files:
  llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
  llvm/lib/Target/Sparc/SparcCallingConv.td
  llvm/lib/Target/Sparc/SparcISelLowering.cpp
  llvm/lib/Target/Sparc/SparcISelLowering.h
  llvm/test/CodeGen/SPARC/bigreturn.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D132465.454802.patch
Type: text/x-patch
Size: 8634 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220823/9f24cd02/attachment.bin>


More information about the llvm-commits mailing list