[PATCH] D12802: [BasicAA] Non-equal indices in a GEP of a SequentialType don't overlap

James Molloy via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 11 06:02:01 PDT 2015


jmolloy created this revision.
jmolloy added reviewers: majnemer, hfinkel, chandlerc.
jmolloy added a subscriber: llvm-commits.
jmolloy set the repository for this revision to rL LLVM.

If the final indices of two GEPs can be proven to not be equal, and the GEP is of a SequentialType (not a StructType), then the two GEPs do not alias.

We have to be careful not to return a false negative when dealing with indices into array types that are larger than the number of elements in the array - in this case there can be a partial alias between the GEPs (it breaks our "must" or "no" assumption). With this patch we're quite conservative about this case and only proceed if all intermediate indices are identical between the two GEPs.

Repository:
  rL LLVM

http://reviews.llvm.org/D12802

Files:
  lib/Analysis/BasicAliasAnalysis.cpp
  test/Analysis/BasicAA/sequential-gep.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D12802.34547.patch
Type: text/x-patch
Size: 4720 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150911/e468cb26/attachment-0001.bin>


More information about the llvm-commits mailing list