[llvm-dev] RFC: Resolving TBAA issues

Daniel Berlin via llvm-dev llvm-dev at lists.llvm.org
Sat Aug 19 12:13:09 PDT 2017


On Sat, Aug 19, 2017 at 11:27 AM, Ivan A. Kosarev via llvm-dev <
llvm-dev at lists.llvm.org> wrote:

> Daniel,
>
>  ....
>


> the type of (*x) is not compatible with the type of (*b) or, recursively,
> type of b->i. Similarly, the type of (*b) is not compatible with (*x) or,
> recursively, x->i.
>
>
I'm not sure i'd agree with this.


> > But, let's assume that is true for a second.
> > GIven
> > struct A *a
> > struct X *x
> >
> > a->i
> > x->i
> >
> > Can these accesses alias?
> ...
>


> No alias. struct X is not compatible with struct A.
> ...
>


> No alias. Same reason.
>
>
I think these are interesting interpretations.  I'm not sure i'd personally
agree with them (and there are definitely compilers out there that do not).
It gets more weird with unions.

But i'm also not going to say they are unreasonable, because i think the
rules are sufficiently subject to reasonable interpretation already.  There
are things clearly allowed (IE everyone agrees) by the standard that no
compiler allows, and things not allowed by the standard that all compilers
allow.

(See the cerberus reports, which go through this in great detail for C).


That said, these interpretations allow significantly more optimization than
we allow today, so if users are accepting of them, awesome.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20170819/da62362e/attachment.html>


More information about the llvm-dev mailing list