This patch enables generation of relocations for pointers extracted from vectors when vector of pointers have scalar base pointer.
I'm uncomfortable with this patch. The placement in this helper function leaves open the possibility that other callers of findBDVorBase encounter an incorrectly typed result. I'm also concerned that we might end up with a scalar-base, vector-derived pair ending up in the stack map, and I don't think the downstream code knows how to deal with that.
A principled fix would be to integrate getelementptr into the base rewriting logic analogously to extractelement.
In the meantime, I've posted an alternate workaround in https://reviews.llvm.org/D57138. What do you think of that?
I think what you actually want here is:
i.e. bitcast either scalars, or between vector types.