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

Anastasia Stulova via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed May 31 11:06:47 PDT 2017


Anastasia added inline comments.


================
Comment at: lib/CodeGen/CGDecl.cpp:1107
   assert(T.getAddressSpace() == LangAS::Default);
   if (getASTAllocaAddressSpace() != LangAS::Default) {
     auto *Addr = getTargetHooks().performAddrSpaceCast(
----------------
Is this code still needed here, considering that CreateTempAlloca is doing this already?


================
Comment at: lib/CodeGen/CGDecl.cpp:1109
 
-  // Alloca always returns a pointer in alloca address space, which may
-  // be different from the type defined by the language. For example,
----------------
Why removing the comment?


================
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.
----------------
I am still confused, what is the case the alloca AS is different from the language AS?


https://reviews.llvm.org/D33706





More information about the cfe-commits mailing list