Page MenuHomePhabricator

[RISCV][GlobalISel] Add lowerCall for calling convention
AcceptedPublic

Authored by lewis-revill on Feb 23 2020, 11:11 AM.

Details

Summary

This patch implements minimal support for lowering function calls to callees with arguments and/or return values according to the RISC-V calling convention. Simple non-aggregate types are supported.

Feedback is very much appreciated.

Diff Detail

Event Timeline

lewis-revill created this revision.Feb 23 2020, 11:11 AM

Rebase, update test structure. Correct missing defs by adding CallReturnHandler.

Joe added a subscriber: Joe.Mar 17 2020, 5:02 AM

If you're supporting a pointer value return type, should there be a test for this?

Other than that, this looks fine to me - although should wait until somebody more experienced looks at it.

Side note: Would it be worth, in the future, to outline the process of finding In/OutputArgs and ArgInfos to something like a computeOutgoingArgs/computeIncomingArgs that fills a list of ISD::In/OutputArg and ArgInfos? Or would this just obfuscate things?

Add test for pointer return type

Bug fix - add target flags to call instruction.

lenary resigned from this revision.Jan 14 2021, 10:10 AM
rkruppe removed a subscriber: rkruppe.Jan 14 2021, 10:20 AM
lewis-revill edited the summary of this revision. (Show Details)

Rebased, and updated where appropriate to continue to build correctly.

arsenm added inline comments.Jan 17 2022, 4:41 PM
llvm/lib/Target/RISCV/RISCVCallLowering.cpp
337

Same comment on the other half of the call lowering patches

Use ValueAssigners to avoid rewriting generic infrastructure and use determineAndHandleAssignments instead.

lewis-revill marked an inline comment as done.Jan 26 2022, 4:23 AM
lewis-revill retitled this revision from [WIP][RISCV][GlobalISel] Add lowerCall for calling convention to [RISCV][GlobalISel] Add lowerCall for calling convention.Feb 9 2022, 3:13 AM
lewis-revill edited the summary of this revision. (Show Details)
arsenm accepted this revision.Feb 9 2022, 8:45 AM
arsenm added inline comments.
llvm/lib/Target/RISCV/RISCVCallLowering.cpp
263

Not sure why you're bothering to filter these out. splitToValueTypes should handle near everything (I'm aware of some assertions on weird non-byte element sized vectors)

This revision is now accepted and ready to land.Feb 9 2022, 8:45 AM