[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 19:01:28 PDT 2016


Errr, this is not two GEPS of a struct type base pointer with the same
type, with a minimum of two operands, etc.

It's
  %6 = getelementptr inbounds i8, i8* %5, i64 %4
   %9 = getelementptr inbounds %struct.A, %struct.A* %x, i32 0, i32 1

This code will do nothing with this.

Want to try again?
:)


On Wed, Jun 1, 2016 at 5:49 PM, Eli Friedman <eli.friedman at gmail.com> wrote:

> eli.friedman added a comment.
>
> Example:
>
>   struct A {
>     unsigned char a[10];
>     unsigned char b;
>   };
>   void f(A* x) {
>     for (unsigned i = 0; i < 11; ++i)
>       x->b += ((unsigned char*)x)[i];
>   }
>
>
> Repository:
>   rL LLVM
>
> http://reviews.llvm.org/D20665
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160601/f383a2fd/attachment.html>


More information about the llvm-commits mailing list