[M68k] Override `CanLowerReturn` to fix assertion with large return
authorIan Douglas Scott <ian@iandouglasscott.com>
Sat, 22 Apr 2023 19:01:28 +0000 (12:01 -0700)
committerMin-Yih Hsu <minyihh@uci.edu>
Sat, 22 Apr 2023 19:23:04 +0000 (12:23 -0700)
commit745221268125e86b1543a7aa643414e9cc8cb2d2
tree0ba0f56c465f786e762495361e50a50867c58172
parentc3bf6d20ac306b829dc99939b3a8f9487f7f1c9a
[M68k] Override `CanLowerReturn` to fix assertion with large return

If it couldn't fit the return value in two registers, this caused an
error during codegen. It seems this method is implemented in other
backends but not here, and allows it to pass return values in memory
when it isn't able to do so in registers.

Seems to fix compilation of Rust code with certain return types:
https://github.com/rust-lang/rust/issues/89498

Differential Revision: https://reviews.llvm.org/D148856
llvm/lib/Target/M68k/M68kISelLowering.cpp
llvm/lib/Target/M68k/M68kISelLowering.h
llvm/test/CodeGen/M68k/multiple-return.ll [new file with mode: 0644]