Page MenuHomePhabricator

[RISCV][GlobalISel] Add lowerFormalArguments for calling convention
Needs ReviewPublic

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



This patch adds an IncomingValueHandler and IncomingValueAssigner, and implements minimal support for lowering formal arguments according to the RISC-V calling convention. Simple non-aggregate integer and pointer types are supported.

Diff Detail

Unit TestsFailed

120 msLLVM.Transforms/LoopStrengthReduce::Unknown Unit Message ("")
Script: -- : 'RUN: at line 1'; /mnt/disks/ssd0/agent/workspace/amd64_debian_testing_clang8/build/bin/llc -debug-only=loop-reduce < /mnt/disks/ssd0/agent/workspace/amd64_debian_testing_clang8/llvm/test/Transforms/LoopStrengthReduce/phi-unknownscev.ll 2>&1 | /mnt/disks/ssd0/agent/workspace/amd64_debian_testing_clang8/build/bin/FileCheck /mnt/disks/ssd0/agent/workspace/amd64_debian_testing_clang8/llvm/test/Transforms/LoopStrengthReduce/phi-unknownscev.ll

Event Timeline

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

Rebase, update test structure.

Joe added inline comments.Mar 20 2020, 7:52 AM

Perhaps add a test for this?


Floats don't work here. HandleAssignments tries to truncate it. Best to leave it unsupported for now.

lewis-revill edited the summary of this revision. (Show Details)

Address comments relating to supported types.

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:42 PM

Same as other patches, don't copy your own splitToValueTypes

lewis-revill edited the summary of this revision. (Show Details)

Introduce an IncomingValueAssigner to allow us to call determineAndHandleAssignments.

lewis-revill marked 3 inline comments as done.Jan 26 2022, 4:02 AM
lewis-revill retitled this revision from [WIP][RISCV][GlobalISel] Add lowerFormalArguments for calling convention to [RISCV][GlobalISel] Add lowerFormalArguments for calling convention.Feb 9 2022, 3:12 AM
arsenm added inline comments.Feb 9 2022, 8:46 AM

Probably should have some byval, sret, and cases where the argument list runs out of registers. Same for return values / hidden sret