[PATCH] D31924: SROA: Allow eliminating addrspacecasted allocas

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 15 01:18:18 PDT 2017


arsenm added a comment.

In https://reviews.llvm.org/D31924#754467, @loladiro wrote:

> Was there a decision reached here on what the correct semantics are? There are other places in LLVM (I found one in instcombine - there may be others) which do make the assumption that this change is proposing to introduce to the langref. Personally, I don't think this transformation should be allowed. I know there are architectures where different address spaces have different GEP behavior (though I'm not sure if this is the case for any in-tree backend). Nevertheless, if people do feel like this should be allowed (e.g. because such architectures should use something other than addrspacecast to convert between such address spaces), that's fine with me as well, but I think there should a clear statement in the langref on way or the other. As is, different people read the langref differently.


Do you mean non-integral pointers? I don't think this changes the rules I was thinking. You still should have a reversible result. AMDGPU will use some non-integral pointers eventually, although it doesn't need them for this particular case.

I think the way the non-integral pointer is worded now is to allow GC etc. to completely replace the pointer value, in which case eliminating it like this is probably not OK. Would it work to restrict this for only integral pointer address spaces?


https://reviews.llvm.org/D31924





More information about the llvm-commits mailing list