[PATCH] D33842: [AMDGPU] Fix address space of global variable

2017-07-05 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl marked 12 inline comments as done. yaxunl added inline comments. Comment at: include/clang/Basic/TargetInfo.h:969 + /// LangAS::Default. + virtual unsigned getGlobalAddressSpace() const { return LangAS::Default; } + rjmccall wrote: > I'm not sure this

[PATCH] D33842: [AMDGPU] Fix address space of global variable

2017-06-22 Thread John McCall via Phabricator via cfe-commits
rjmccall added inline comments. Comment at: include/clang/Basic/TargetInfo.h:969 + /// LangAS::Default. + virtual unsigned getGlobalAddressSpace() const { return LangAS::Default; } + I'm not sure this really needs to exist. Comment at:

[PATCH] D33842: [AMDGPU] Fix address space of global variable

2017-06-22 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 103613. yaxunl marked 2 inline comments as done. yaxunl added a comment. Revised by John's comments. https://reviews.llvm.org/D33842 Files: include/clang/Basic/TargetInfo.h lib/Basic/Targets.cpp lib/CodeGen/CGBlocks.cpp lib/CodeGen/CGDecl.cpp

[PATCH] D33842: [AMDGPU] Fix address space of global variable

2017-06-20 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl marked 3 inline comments as done. yaxunl added inline comments. Comment at: include/clang/Basic/TargetInfo.h:959 + /// \brief Return the target address space which is read only and can be + /// casted to the generic address space. + virtual llvm::Optional

[PATCH] D33842: [AMDGPU] Fix address space of global variable

2017-06-20 Thread John McCall via Phabricator via cfe-commits
rjmccall added inline comments. Comment at: include/clang/Basic/TargetInfo.h:959 + /// \brief Return the target address space which is read only and can be + /// casted to the generic address space. + virtual llvm::Optional getTargetConstantAddressSpace() const {

[PATCH] D33842: [AMDGPU] Fix address space of global variable

2017-06-12 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 102204. yaxunl marked an inline comment as done. yaxunl added a comment. Add TargetInfo::getTargetConstantAddressSpace. https://reviews.llvm.org/D33842 Files: include/clang/Basic/TargetInfo.h lib/Basic/Targets.cpp lib/CodeGen/CGExpr.cpp

[PATCH] D33842: [AMDGPU] Fix address space of global variable

2017-06-02 Thread John McCall via Phabricator via cfe-commits
rjmccall added inline comments. Comment at: lib/CodeGen/CGExpr.cpp:360 + CGF.getContext().getTargetAddressSpace(LangAS::opencl_constant); +} auto *GV = new llvm::GlobalVariable( This is not an appropriate place to stick

[PATCH] D33842: [AMDGPU] Fix address space of global variable

2017-06-02 Thread Yaxun Liu via Phabricator via cfe-commits
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