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
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:
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
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
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 {
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
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
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