[cfe-dev] OpenCL Address Spaces and Runtimes

John McCall rjmccall at apple.com
Tue Apr 12 22:28:26 PDT 2011


On Apr 12, 2011, at 10:13 PM, Speziale Ettore wrote:
> I wrote this mail to ask about how OpenCL specific address spaces should
> be mapped to the llvm intermediate bitcode.
> 
> Currently, in clang it is possible to attach to variables OpenCL
> specific address spaces. While parsing, a language specific address
> space is attached to the variable base type:
> 
> global int *a;
> 
> inside clang becomes
> 
> __attribute__((address_space(16776960))) int *a;
> 
> When the AST is translated to llvm representation, the language specific
> address space is translated to the corresponding address space in the
> target machine. We loss any information about language specific address
> spaces.

I asked about whether OpenCL backends would possibly need this
information and was informed that they wouldn't.  If that's not true, then
we should move to a different representation, like a normal decl
attribute instead of a type attribute.

John.



More information about the cfe-dev mailing list