[cfe-dev] OpenCL support - using metadata
David Neto
dneto.llvm at gmail.com
Thu Mar 3 12:11:33 PST 2011
On Thu, Mar 3, 2011 at 12:25 PM, Anton Lokhmotov
<Anton.Lokhmotov at arm.com> wrote:
> We need to discuss a bit more __local and __constant variables.
>
>> BTW, local variables in our solution are treated much like "static" C
>> variables; they are promoted to the program scope with prefixes (as you
>> might see below).
> We use no metadata for this at all and Clang's conversion for static
> variables. So for:
>
> kernel void foo(...) { local int i; ... }
>
> we generate something like:
>
> @foo.i = internal addrspace(2) global i32 0, align 4
Last December I objected to the technique of transforming a __local
variable into a global-scope static variable. [1] [2]. In a private
email, Krister later explained how it all works out ok, as long as the
back end knows about the convention and puts those variables in a
relocatable data section. So for the record I withdraw my objection.
:-)
However, this is similar to the support for address space conventions
[3]. That is, the target should advertise its support for this
convention.
cheers,
david
[1] http://lists.cs.uiuc.edu/pipermail/cfe-dev/2010-December/012448.html
[2] http://lists.cs.uiuc.edu/pipermail/cfe-dev/2010-December/012467.html
[3] http://lists.cs.uiuc.edu/pipermail/cfe-dev/2011-March/013710.html
More information about the cfe-dev
mailing list