[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[1][7] given the declaration int a[4][5]) ".  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.



> -Hal
>
> >
> > -Eli
>
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160725/dd304690/attachment.html>


More information about the llvm-dev mailing list