AMDGPU: Use direct struct returns and arguments
authorMatt Arsenault <Matthew.Arsenault@amd.com>
Wed, 9 Aug 2017 21:44:58 +0000 (21:44 +0000)
committerMatt Arsenault <Matthew.Arsenault@amd.com>
Wed, 9 Aug 2017 21:44:58 +0000 (21:44 +0000)
commit3fe7395fbce65a0b0fa54cb3bed8f5a332c3166c
tree85f865b330c02616e91f210af9bf804690a3684f
parentae704a54729d0a6e2c72b7fd7e364c33a7989f57
AMDGPU: Use direct struct returns and arguments

This is an improvement over always using byval for
structs.

This will use registers until ~16 are used, and then
switch back to byval. This needs more work, since I'm
not sure it ever really makes sense to use byval. If
the register limit is exceeded, the arguments still
end up passed on the stack, but with a different ABI.
It also may make sense to base this on number of
registers used for non-struct arguments, rather than
just arguments that appear first in the argument list.

llvm-svn: 310527
clang/lib/CodeGen/TargetInfo.cpp
clang/test/CodeGenOpenCL/addr-space-struct-arg.cl
clang/test/CodeGenOpenCL/amdgpu-abi-struct-coerce.cl
clang/test/CodeGenOpenCL/amdgpu-nullptr.cl