First stage of call lowering for Mips fast-isel
authorReed Kotler <rkotler@mips.com>
Thu, 13 Nov 2014 23:37:45 +0000 (23:37 +0000)
committerReed Kotler <rkotler@mips.com>
Thu, 13 Nov 2014 23:37:45 +0000 (23:37 +0000)
commit198bb227545b8a0cbe76244d78a5ad6fc6befdb3
treec8fcbc360687dee63726f80a6dc681d830a25ade
parent016f651f8d47815498a93d38db48ff9cdc7fc306
First stage of call lowering for Mips fast-isel

Summary:
This has most of what is needed for mips fast-isel call lowering for O32.
What is missing I will add on the next patch because this patch is already too large.
It should not be doing anything wrong but it will punt on some cases that it is basically
capable of doing.

The mechanism is there for parameters to be passed on the stack but I have not enabled it because it serves as a way for now to prevent some of the strange cases of O32 register passing that I have not fully checked yet and have some issues.

The Mips O32 abi rules are very complicated as far how data is passed in floating and integer registers.

However there is a way to think about this all very simply and this implementation reflects that.

Basically, the ABI rules are written as if everything is passed on the stack and aligned as such.
Once that is conceptually done, it is nearly trivial to reassign those locations to registers and
then all the complexity disappears.

So I have told tablegen that all the data is passed on the stack and during the lowering I fix
this by assigning to registers as per the ABI doc.

This has been my approach and you can line up what I did with the ABI document and see 1 to 1 what
is going on.

Test Plan: callabi.ll

Reviewers: dsanders

Reviewed By: dsanders

Subscribers: jholewinski, echristo, ahatanak, llvm-commits, rfuhler

Differential Revision: http://reviews.llvm.org/D5714

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221948 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/Mips/MipsCallingConv.td
lib/Target/Mips/MipsFastISel.cpp
lib/Target/Mips/MipsISelLowering.cpp
test/CodeGen/Mips/Fast-ISel/callabi.ll [new file with mode: 0644]