[PATCH] D32608: SROA: Use correct address space when splitting loads (PR26154)

Hans Wennborg via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 1 15:28:11 PDT 2017


hans added a comment.

In https://reviews.llvm.org/D32608#741986, @chandlerc wrote:

> This test case should be cleaned up and merged into `SROA/address-spaces.ll`.


Done.

While doing that I ran into problems because the data layout in that file specifies 16 bits for pointers in address space 1, which means the GEPs into that address space need to use i16 for the offset. I've tried to fix that for the GEPs involed here.

> Also, if I delete the 'getPointerAddressSpace()` call on line 3701, no test fails, so we clearly need better tests for the address space manipulation code in this file,

:-/

> or the call on line 3701 is actually dead and it should be *replaced* with the load-based address space in this patch.

No, using the address space from the load for the store will not pass the verifier in this test.

I'm not very familiar with SROA, but this patch makes sense to me: if we cannot find an already split load, we create a new one, and we do it in the same way as we would originally have done up around line 3575, i.e. using the load instruction's address space.


https://reviews.llvm.org/D32608





More information about the llvm-commits mailing list