[llvm-dev] Alias Analysis with inbound GEPs
Daniel Berlin via llvm-dev
llvm-dev at lists.llvm.org
Mon Jul 25 16:58:27 PDT 2016
> > It is actually undefined behavior. This is explicitly called out in
> Annex J.2: "An array subscript is out of range, even if an object is
> apparently accessible with the given subscript (as in the lvalue expression
> a given the declaration int a) ". If you break it apart into
> separate steps, the interesting bit is that the implicit array-to-pointer
> conversion is not equivalent to a cast; "int* b = (int*)a;" is not
> equivalent to "int* b = *a;", even though the expressions have the same
> type and value.
> > There currently isn't any way to model the aliasing behavior of the
> address-of operator or array-to-pointer decay in LLVM IR. See also
> http://lists.llvm.org/pipermail/llvm-dev/2016-July/102472.html .
> It seems like we might we able to use TBAA metadata with struct field
> information to get this then.
Kinda, but the validity of this info does not (and should not) depend on
TBAA being enabled or not.
> > -Eli
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the llvm-dev