[PATCH] D31404: [OpenCL] Allow alloca return non-zero private pointer

Yaxun Liu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Apr 10 11:42:57 PDT 2017


yaxunl marked 2 inline comments as done.
yaxunl added inline comments.


================
Comment at: include/clang/Basic/AddressSpaces.h:32
+  // QualType represents private address space in OpenCL source code.
+  Default = 0,
+
----------------
Anastasia wrote:
> yaxunl wrote:
> > Anastasia wrote:
> > > The alloca AS is not taken from the target AS map but from the DataLayout. This keep me wonder whether the explicit Default item is actually needed here....
> > For OpenCL, the default addr space is mapped to alloca addr space. For other languages, it is mapped by the address space mapping table.
> Ok. BTW, why is it done differently for other languages than OpenCL now? Is it something we missed in the programming model before? Or is it something specific to AMD target support?
This is because amdgcn target now supports a new address space mapping where alloca address space is different from generic address space. For OpenCL, address space 0 should be mapped to alloca address space; for other languages, address space 0 should be mapped to a target specific generic address space. The previous approach for mapping address spaces cannot handle the requirements since it always maps address space 0 to target address space 0. Therefore it needs to be extended for more general cases.


https://reviews.llvm.org/D31404





More information about the cfe-commits mailing list