This patch implements minimal support for lowering function calls to callees with arguments and/or return values according to the RISC-V calling convention. Integer, pointer and aggregate types are supported.
Feedback is very much appreciated.
Paths
| Differential D75023
[RISCV][GlobalISel] Add lowerCall for calling convention ClosedPublic Authored by nitinjohnraj 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. Integer, pointer and aggregate types are supported. Feedback is very much appreciated.
Diff Detail
Unit TestsFailed
Event TimelineHerald added subscribers: llvm-commits, evandro, sameer.abuasal and 23 others. · View Herald Transcript lewis-revill added a parent revision: D74977: [RISCV][GlobalISel] Add lowerFormalArguments for calling convention.Feb 23 2020, 11:11 AM Comment Actions 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? lewis-revill added a child revision: D76354: [RISCV][GlobalISel] Legalize types for ALU operations.Apr 7 2020, 11:35 AM Herald added subscribers: VincentWu, luke957, achieveartificialintelligence and 2 others. · View Herald TranscriptJan 14 2022, 7:36 AM
Comment Actions Use ValueAssigners to avoid rewriting generic infrastructure and use determineAndHandleAssignments instead. 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 This revision is now accepted and ready to land.Feb 9 2022, 8:45 AM
nitinjohnraj added inline comments.
nitinjohnraj marked 2 inline comments as done. Comment Actions As stated in the parent revision, we will correctly handle byval, sret and cases where the number of arguments exceed the number of available registers in a future patch. This revision is now accepted and ready to land.May 31 2023, 1:47 AM nitinjohnraj marked an inline comment as done. Comment ActionsSet IsTailCall to false. We will handle tail calls in a future patch. This revision was landed with ongoing or failed builds.Jun 1 2023, 3:59 PM Closed by commit rG9c6bee653ca0: [RISCV][GlobalISel] Add lowerCall for calling convention (authored by nitinjohnraj). · Explain Why This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 511197 llvm/lib/Target/RISCV/GISel/RISCVCallLowering.cpp
llvm/test/CodeGen/RISCV/GlobalISel/irtranslator/calls.ll
|
Should add some tail call cases. You should set IsTailCall to false if you aren’t handling them