[PATCH] Address Space Casting

Matt Arsenault Matthew.Arsenault at amd.com
Wed Aug 14 12:06:37 PDT 2013


On 08/14/2013 11:07 AM, Eli Friedman wrote:
> On Wed, Aug 14, 2013 at 10:44 AM, Michele Scandale 
> <michele.scandale at gmail.com <mailto:michele.scandale at gmail.com>> wrote:
>
>     Hi arsenm, villmow, theraven,
>
>     Hello to everybody,
>
>     here I a patch to add the 'addrspacecast' instruction to represent
>     casting between pointers of different address spaces in general
>     (pointers of different sizes, value change).
>     I took the specification details from
>     http://lists.cs.uiuc.edu/pipermail/llvmdev/2013-August/064674.html .
>     I haven't implemented the auto upgrade for ptrtoint-inttoptr
>     sequence because it's not clear to me the reasong for this
>     transformation.
>
>
> At a high level, is this actually what we want? Given Matt's work to 
> restrict bitcasts, the problem space changes a bit: this instruction 
> would be used exclusively to represent non-trivial address-space 
> transformations, and I don't see why we can't just can write them out 
> using either arithmetic or platform-specific intrinsics.
>
> -Eli
I think ptrtoint / inttoptr method would be acceptable, at least for 
some targets. It sounded like David had some weird case that might not 
work with this. If the only real problem was turning ptrtoint-inttoptr 
into bitcasts between different sized address spaces, then that should 
be fixed (and probably already is).
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130814/109101a1/attachment.html>


More information about the llvm-commits mailing list