[PATCH] D45510: [RFC][AliasAnalysis][BasicAA] Return MayAlias for the pointer plus variable offset to structure object member

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 12 12:47:10 PDT 2018


efriedma added inline comments.


================
Comment at: lib/Analysis/BasicAliasAnalysis.cpp:1164
+  // We can't get GEP offset to identify pointer alias if the GEP has variable
+  // indeces.
+  else
----------------
shiva0217 wrote:
> efriedma wrote:
> > *indices.
> > 
> > You should probably fix the big block comment as well; "we can't count on the constant offsets that come from non-struct sources" isn't an accurate description of the LangRef rules for GEPs.
> Hi @efriedma. Thanks for your comments. I update the comment block. Is it ok?
Could you reorganize the code so it looks more like `if (!DecompGEP.VarIndices.empty()) return false; int64_t GEPBaseOffset = DecompGEP.StructOffset + DecompGEP.OtherOffset;`?


Repository:
  rL LLVM

https://reviews.llvm.org/D45510





More information about the llvm-commits mailing list