[PATCH] D20495: [BasicAA] An inbounds GEP and an alloca can't alias if the base of the GEP would point "below" the alloca

David Li via llvm-commits llvm-commits at lists.llvm.org
Mon May 23 13:55:44 PDT 2016

davidxl added inline comments.

Comment at: test/Analysis/BasicAA/negoffset.ll:46
@@ +45,3 @@
+; CHECK-LABEL: Function: complex:
+; CHECK-DAG:  MayAlias:     i32* %a2.0, i32* %r2.0
It is also good add a more complex case where we have nested structs/arrays when constant offsets of the accesses can be collapsed (also severs as tests for the new Decompose method)

something like:
struct Inner {
  int inner_f1;
  int inner_f2;

struct Outer {
   int outer_f1;
   int outer_f2;
   struct inner Inner[10];
} Outer_p;

Outer_p[1].Inner[2].f1 vs  some local access at offset 0
Outer_p[i].inner[2].f1 vs some local access at offset 0
Outer_p[i].Inner[j].f2 vs some local access at offst 0 


More information about the llvm-commits mailing list