[LLVMdev] possible addrspacecast problem

David Chisnall David.Chisnall at cl.cam.ac.uk
Wed Mar 18 05:31:09 PDT 2015

On 18 Mar 2015, at 09:44, David Chisnall <david.chisnall at cl.cam.ac.uk> wrote:
> So it looks as if InstCombine is deciding that it can hoist the GEP above the addrspacecast.  Unfortunately, narrowing it down to InstCombine doesn't actually narrow it down very much - I'll keep looking...

It looks like, when the AddrSpaceCast stuff went in, all of the Bitcast code paths in InstCombine were simply extended to also do address space casts.  I believe that this is the wrong approach: at the very least, target should be allowed to decide whether address space casts are symmetric, and ideally we'd simply define that they're not required to be unless we have strong evidence that we're killing some useful optimisations.  We'll change this and add some tests in our version, but I'm happy to prepare a test for upstreaming if others agree with this assessment.


More information about the llvm-dev mailing list