[LLVMdev] Address space extension
Matt Arsenault
arsenm2 at gmail.com
Mon Aug 12 10:23:15 PDT 2013
On Aug 9, 2013, at 2:23 , David Chisnall <David.Chisnall at cl.cam.ac.uk> wrote:
> On 8 Aug 2013, at 18:34, Matt Arsenault <arsenm2 at gmail.com> wrote:
>
>> I have the auto upgrade for turning bitcasts into inttoptr/ptrtoint implemented, but it isn't necessary with the current rule that same sized pointer bitcasts are allowed. This would be always necessary if all cross address space bitcasts were disallowed.
>
> The ptrtoint inttoptr dance isn't adequate for this (trust me - it's what we're doing currently in our back end and it's really, really horrible and only mostly works). We currently have a lot of hacks in our branch to stop mid-level optimisers turning these back into bitcasts, or doing annoying (semantics-breaking) sign / zero extends. If you're fixing this, please fix it properly by introducing an address space cast instruction that is exposed as a SelectionDAG node.
Turning those back into bitcasts shouldn't happen as of 2 or 3 weeks ago. There are a few more places that create casts that might still need fixing that I haven't gotten to yet.
More information about the llvm-dev
mailing list