[PowerPC] Support the nest parameter attribute
authorHal Finkel <hfinkel@anl.gov>
Sun, 12 Jul 2015 00:37:44 +0000 (00:37 +0000)
committerHal Finkel <hfinkel@anl.gov>
Sun, 12 Jul 2015 00:37:44 +0000 (00:37 +0000)
commitd14325bee9702b309bef4109d454e9437488388d
tree6ad33b764a6aa6bdb0d7a0c0fd383da129b8b682
parent22af148912c8503e305d1cc8741293686d66b864
[PowerPC] Support the nest parameter attribute

This adds support for the 'nest' attribute, which allows the static chain
register to be set for functions calls under non-Darwin PPC/PPC64 targets. r11
is the chain register (which the PPC64 ELF ABI calls the "environment
pointer"). For indirect calls under PPC64 ELFv1, this would normally be loaded
from the function descriptor, but providing an explicit 'nest' parameter will
override that process and use the value provided.

This allows __builtin_call_with_static_chain to work as expected on PowerPC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241984 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/PowerPC/PPCCallingConv.td
lib/Target/PowerPC/PPCISelLowering.cpp
lib/Target/PowerPC/PPCISelLowering.h
test/CodeGen/PowerPC/ppc32-nest.ll [new file with mode: 0644]
test/CodeGen/PowerPC/ppc64-nest.ll [new file with mode: 0644]