[Attributor][FIX] Properly promote arguments pointers to arrays
authorJohannes Doerfert <johannes@jdoerfert.de>
Thu, 29 Oct 2020 05:13:27 +0000 (00:13 -0500)
committerJohannes Doerfert <johannes@jdoerfert.de>
Thu, 29 Oct 2020 05:45:32 +0000 (00:45 -0500)
commitd39f574dcc99d639f224fb0adebbf3de6ffeedbc
treee4b2810cccc05d5294d5f5a54828b36c073bfb5f
parent73547b08de59d1be0e65d8dbc989e9c186295fcd
[Attributor][FIX] Properly promote arguments pointers to arrays

When we promote pointer arguments we did compute a wrong offset and use
a wrong type for the array case.

Bug reported and reduced by Whitney Tsang <whitneyt@ca.ibm.com>.
llvm/lib/Transforms/IPO/AttributorAttributes.cpp
llvm/test/Transforms/Attributor/ArgumentPromotion/array.ll [new file with mode: 0644]