[PATCH] D33706: [AMDGPU] Fix address space for global and temporary variables in C++

Yaxun Liu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed May 31 11:25:49 PDT 2017


yaxunl marked an inline comment as done.
yaxunl added inline comments.


================
Comment at: lib/CodeGen/CGDecl.cpp:1107
   assert(T.getAddressSpace() == LangAS::Default);
   if (getASTAllocaAddressSpace() != LangAS::Default) {
     auto *Addr = getTargetHooks().performAddrSpaceCast(
----------------
Anastasia wrote:
> Is this code still needed here, considering that CreateTempAlloca is doing this already?
I have planed but forgot to remove this. This is also the reason I removed the comments. I will remove it in the update.


================
Comment at: lib/CodeGen/CodeGenFunction.h:1930
+  /// temporary variable in default address space. If \p DoCast is true,
+  /// alloca will be casted to the address space expected by the language,
+  /// otherwise it stays in the alloca address space.
----------------
Anastasia wrote:
> I am still confused, what is the case the alloca AS is different from the language AS?
In C or C++ language where all variables without explicit address space attribute are assumed to be in the default address space.


https://reviews.llvm.org/D33706





More information about the cfe-commits mailing list