yaxunl added a comment.

In https://reviews.llvm.org/D27627#621533, @yaxunl wrote:

> In https://reviews.llvm.org/D27627#621473, @rjmccall wrote:
>
> > In https://reviews.llvm.org/D27627#619928, @yaxunl wrote:
> >
> > > > Because, notably, if you do that, then an attempt to pass &x as an int* 
> > > > will fail, which means this isn't really C++ anymore... and yet that 
> > > > appears to be exactly what you want.
> > >
> > > How about when generating alloca instruction, I insert addrspacecast to 
> > > the default address space, then everything is in default address space.
> >
> >
> > My question is really about your language design.  You have multiple 
> > address spaces in the implementation, but you're (apparently?) pretending 
> > that they're all part of the same address space in the source language.  
> > How is that expected to work?  Does the default address space embed all 
> > other address spaces?
>
>
> Yes the default address space embeds all other address spaces.


Since the default address space (generic address space 4) can represent all 
other address spaces, we want to use it uniformly. For any pointer which is not 
in the default address space, e.g. alloca, we want to cast it to default 
address space and then use it. Therefore, in the address space agnostic 
languages, we can assume everything is in the default address space. Our 
backend is able to handle load/store in the default address space.


https://reviews.llvm.org/D27627



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to