[cfe-dev] [LLVMdev] Language-specific vs target-specific address spaces (was Re: [PATCH] OpenCL support - update on keywords)
Peter Collingbourne
peter at pcc.me.uk
Thu Mar 3 11:04:30 PST 2011
On Thu, Mar 03, 2011 at 01:50:13PM -0500, Ken Dyck wrote:
> On Thu, Mar 3, 2011 at 11:38 AM, Peter Collingbourne <peter at pcc.me.uk> wrote:
> > Also, to avoid regressions in functionality we should retain the
> > ability to qualify a pointer with an LLVM physical address space.
> > This can be achieved by allocating another bit in the Qualifiers
> > class to indicate whether the address space is a logical or physical
> > address space. Physical address spaces would be accessed using the
> > existing __attribute__((address_space)) mechanism, while logical
> > spaces would be accessed using language-specific keywords.
>
> If both an __attribute__-style qualifier and an OpenCL-style one are
> applied to a type definition, won't the Qualifier's address space
> field take on the value of the last of the two to be parsed?
>
> Should we instead reserve _two_ bits for the logical address space
> field, and capture the whole OpenCL qualifier there?
A type with both a logical and physical address space is ambiguous,
because the logical address space dictates the physical address space
used in the code generator. I think they should be mutually exclusive.
Thanks,
--
Peter
More information about the cfe-dev
mailing list