[all-commits] [llvm/llvm-project] d3fcbe: [SPARC] Make calls to function with big return val...

Koakuma via All-commits all-commits at lists.llvm.org
Mon Oct 17 17:02:09 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: d3fcbee10d893b9e01e563c3840414ba89283484
      https://github.com/llvm/llvm-project/commit/d3fcbee10d893b9e01e563c3840414ba89283484
  Author: Koakuma <koachan at protonmail.com>
  Date:   2022-10-18 (Tue, 18 Oct 2022)

  Changed paths:
    M llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
    M llvm/lib/Target/Sparc/SparcCallingConv.td
    M llvm/lib/Target/Sparc/SparcISelLowering.cpp
    M llvm/lib/Target/Sparc/SparcISelLowering.h
    M llvm/test/CodeGen/SPARC/64abi.ll
    A llvm/test/CodeGen/SPARC/bigreturn.ll

  Log Message:
  -----------
  [SPARC] Make calls to function with big return values work

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.

Reviewed By: MaskRay

Differential Revision: https://reviews.llvm.org/D132465




More information about the All-commits mailing list