[llvm-dev] relation between address spaces and physical memory locations
James Molloy via llvm-dev
llvm-dev at lists.llvm.org
Wed Mar 23 02:43:38 PDT 2016
Hi,
Address spaces in LLVM are an abstract concept and LLVM attaches no
internal meaning to address spaces, apart from:
- Location 0 in address space 0 is 'nullptr' and a pointer to this cannot
be dereferenced in a well formed program.
- pointers in different address spaces cannot alias.
Different backends attach different meanings. So for example an OpenCL
backend might interpret address space 1 as local memory, 2 as private
memory etc (in fact for OpenCL, these mappings are defined in the Clang
frontend, if I recall correctly)
Cheers,
James
On Wed, 23 Mar 2016 at 09:31, Mohammad Norouzi via llvm-dev <
llvm-dev at lists.llvm.org> wrote:
> Hi,
>
> Do address spaces in llvm corespond to different memory locations? For
> example, Shared and Global refer to RAM while Local refers to registers?
>
> I guess that this may be true in GPU programming. So, I would like to know
> about CPUs.
>
> Thanks.
>
> Best,
> Mohammad
>
>
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160323/aef17f2f/attachment.html>
More information about the llvm-dev
mailing list