]> granicus.if.org Git - clang/commit
AMDGPU: Handle structs directly in AMDGPUABIInfo
authorMatt Arsenault <Matthew.Arsenault@amd.com>
Mon, 22 Aug 2016 19:25:59 +0000 (19:25 +0000)
committerMatt Arsenault <Matthew.Arsenault@amd.com>
Mon, 22 Aug 2016 19:25:59 +0000 (19:25 +0000)
commit5cb9343f53d83c9a8a33aac5b2ce01672ff02cf3
tree82e425fb96a175873219b32f16f89ff0920fdfd2
parent6a3fcde80d60660b486c6948d3a8b382ba1c23b0
AMDGPU: Handle structs directly in AMDGPUABIInfo

Structs are currently handled as pointer + byval, which makes AMDGPU
LLVM backend generate incorrect code when structs are used. This patch
changes struct argument to be handled directly and without flattening,
which Clover (Mesa 3D Gallium OpenCL state tracker) will be able to
handle. Flattening would expand the struct to individual elements and
pass each as a separate argument, which Clover can not
handle. Furthermore, such expansion does not fit the OpenCL
programming model which requires to explicitely specify each argument
index, size and memory location.

Patch by Vedran Miletić

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@279463 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/TargetInfo.cpp
test/CodeGenOpenCL/amdgpu-abi-struct-coerce.cl [new file with mode: 0644]