[PATCH] D33842: [AMDGPU] Fix address space of global variable
Yaxun Liu via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri Jun 2 10:34:02 PDT 2017
yaxunl created this revision.
Herald added subscribers: t-tye, tpr, dstuttard, wdng, kzhuravl.
amdgcn target requires global variable to stay in global or constant address space.
In C or C++ global variables are emitted in the default (generic) address space
which the amdgcn backend cannot handle.
This patch emits global variables in global or constant address space and cast
them to generic address space, in a similar approach as CUDA.
It also fixes pointer size and metadata issue so that standard initializer list is
supported.
This patch was originally part of https://reviews.llvm.org/D33706.
https://reviews.llvm.org/D33842
Files:
lib/Basic/Targets.cpp
lib/CodeGen/CGExpr.cpp
lib/CodeGen/CodeGenModule.cpp
lib/CodeGen/TargetInfo.cpp
test/CodeGen/address-space.c
test/CodeGen/default-address-space.c
test/CodeGenCXX/amdgcn-automatic-variable.cpp
test/CodeGenCXX/cxx0x-initializer-stdinitializerlist.cpp
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D33842.101235.patch
Type: text/x-patch
Size: 28902 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20170602/a411fa66/attachment-0001.bin>
More information about the cfe-commits
mailing list