This is an archive of the discontinued LLVM Phabricator instance.

[M68k] Override `CanLowerReturn` to fix assertion with large return
ClosedPublic

Authored by ids1024 on Apr 20 2023, 4:05 PM.

Details

Summary

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

Diff Detail

Event Timeline

ids1024 created this revision.Apr 20 2023, 4:05 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 20 2023, 4:05 PM
ids1024 requested review of this revision.Apr 20 2023, 4:05 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 20 2023, 4:06 PM
ids1024 updated this revision to Diff 515558.Apr 20 2023, 7:03 PM

git-clang-format

myhsu accepted this revision.Apr 21 2023, 2:35 PM

LGTM
I also found that several crashes when building llvm-test-suite are caused by this issue, so thanks a lot!

This revision is now accepted and ready to land.Apr 21 2023, 2:35 PM

Yes, thanks a lot for implementing this! This addresses an important issue we're seeing with the Rust compiler.

glaubitz accepted this revision.Apr 22 2023, 1:50 AM

@ids1024 Can you land this change yourself? Otherwise, it would be good if @myhsu could land it for you.