[PATCH] Fix Bug in SROA transformation [PR18615]

Rafael EspĂ­ndola rafael.espindola at gmail.com
Thu Feb 20 14:57:47 PST 2014


On 20 February 2014 05:46, Karthik Bhat <kv.bhat at samsung.com> wrote:
>   Hi Rafael,Chandler,
>   I was revisiting the patch and looking into SROA in more detail. I think the check was in incorrect position.
>   If we have a out-of-bounds access in memtransfer we should never add the instruction into MemTransferSliceMap and also remove any instruction on the other side of the transfer if already added to MemTransferSliceMap.
>   The problem in the current code seems to be that in visitMemTransferInst while checking for out of bounds we are just checking the upper bound and not the case were offset is negative.
>   Added code to check the same. Please let me know your inputs on the same as i'm a bit new to optimization code.

The test can be reduced a bit more. I noticed that just "-early-cse
-sroa" would crash, and feeding the output of -early-cse run to just
-sroa crashes it too. I then just simplified it by hand a bit more
(attached).

Cheers,
Rafael
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test.ll
Type: application/octet-stream
Size: 627 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140220/fe0eee83/attachment.obj>


More information about the llvm-commits mailing list