[PATCH] D20665: Claim NoAlias if two GEPs index different fields of the same struct

Daniel Berlin via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 1 20:52:35 PDT 2016


On Wed, Jun 1, 2016 at 8:35 PM, Ahmed Bougacha <ahmed.bougacha at gmail.com>
wrote:

> Clang already has this: -fstrict-aliasing, which enables struct-path
> aware TBAA, via !tbaa metadata.
>

There are plenty of cases it does not generate good tbaa or struct path
tbaa. :)


>
> That TBAA isn't sufficient is intentional though: you're probably
> hitting the return PartialAlias at the end of BasicAAResult::aliasGEP
> (PR9971).
>

This is a different case, and easily resolvable with info that says it is
part of a union or not.

At least, GCC does not pretend to okay non-explicit union accesses.
See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65892
and https://gcc.gnu.org/bugzilla/show_bug.cgi?id=14319



>
> -Ahmed
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160601/42c55779/attachment.html>


More information about the llvm-commits mailing list