For ARM backend, fixed "byval" attribute support.
authorStepan Dyatkovskiy <stpworld@narod.ru>
Sun, 5 May 2013 07:48:36 +0000 (07:48 +0000)
committerStepan Dyatkovskiy <stpworld@narod.ru>
Sun, 5 May 2013 07:48:36 +0000 (07:48 +0000)
commit46abfcf4187432da728cbe452c32143da077e07f
tree1166ab9d35b6cf746dd4198825afe6afa52b8716
parent46e7e6f39e8a4efec0cc45ca346b40683288ff9e
For ARM backend, fixed "byval" attribute support.
Now even the small structures could be passed within byval (small enough
to be stored in GPRs).
In regression tests next function prototypes are checked:

PR15293:
  %artz = type { i32 }
  define void @foo(%artz* byval %s)
  define void @foo2(%artz* byval %s, i32 %p, %artz* byval %s2)
foo: "s" stored in R0
foo2: "s" stored in R0, "s2" stored in R2.

Next AAPCS rules are checked:
5.5 Parameters Passing, C.4 and C.5,
"ParamSize" is parameter size in 32bit words:
-- NSAA != 0, NCRN < R4 and NCRN+ParamSize > R4.
   Parameter should be sent to the stack; NCRN := R4.
-- NSAA != 0, and NCRN < R4, NCRN+ParamSize < R4.
   Parameter stored in GPRs; NCRN += ParamSize.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@181148 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/CodeGen/CallingConvLower.h
lib/CodeGen/CallingConvLower.cpp
lib/Target/ARM/ARMISelLowering.cpp
lib/Target/ARM/ARMISelLowering.h
test/CodeGen/ARM/2013-04-05-Small-ByVal-Structs-PR15293.ll [new file with mode: 0644]
test/CodeGen/ARM/2013-05-02-AAPCS-ByVal-Structs-C4-C5-VFP.ll [new file with mode: 0644]
test/CodeGen/ARM/2013-05-02-AAPCS-ByVal-Structs-C4-C5-VFP2.ll [new file with mode: 0644]