]> granicus.if.org Git - llvm/commit
[DependenceAnalysis] Make sure base objects are the same when comparing GEPs
authorBrendon Cahoon <bcahoon@codeaurora.org>
Wed, 5 Jul 2017 21:35:47 +0000 (21:35 +0000)
committerBrendon Cahoon <bcahoon@codeaurora.org>
Wed, 5 Jul 2017 21:35:47 +0000 (21:35 +0000)
commitf2a183956613457eb5a363dfdf515bfc8b92e911
treeea7fa3e90dad3e505e0e20772ad60f4a46f51209
parent0aff1ea91d8b2731d16e593854bfc408a5a7c126
[DependenceAnalysis] Make sure base objects are the same when comparing GEPs

The dependence analysis was returning incorrect information when using the GEPs
to compute dependences. The analysis uses the GEP indices under certain
conditions, but was doing it incorrectly when the base objects of the GEP are
aliases, but pointing to different locations in the same array.

This patch adds another check for the base objects. If the base pointer SCEVs
are not equal, then the dependence analysis should fall back on the path
that uses the whole SCEV for the dependence check. This fixes PR33567.

Differential Revision: https://reviews.llvm.org/D34702

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307203 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Analysis/DependenceAnalysis.cpp
test/Analysis/DependenceAnalysis/BasePtrBug.ll [new file with mode: 0644]