[PATCH] D34702: [DependenceAnalysis] Make sure base objects are the same when comparing GEPs

Brendon Cahoon via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 27 11:31:12 PDT 2017


bcahoon created this revision.

The dependence analysis was returning incorrect information when using the GEPs to compute the dependence. The analysis uses the GEP indices to perform the check under certain conditions. It incorrectly does this if the base objects are aliases, but are actually pointing to different locations in an array. Because the SCEVs for the GEPs indices were the same, DA returns a distance of 0.

      

This patch adds another check for the base objects. If the SCEVs for the base pointers are compared, using getMinusSCEV() and the value is not 0, the analysis should fall back on the path that uses the whole SCEV for the dependence check. Not just the GEP indices.

Fixes bug 33567.


https://reviews.llvm.org/D34702

Files:
  lib/Analysis/DependenceAnalysis.cpp
  test/Analysis/DependenceAnalysis/BasePtrBug.ll
  test/Analysis/DependenceAnalysis/BasePtrBug1.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D34702.104221.patch
Type: text/x-patch
Size: 3821 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170627/b6a2e21d/attachment.bin>


More information about the llvm-commits mailing list