[BasicAA] Make better use of zext and sign information
authorHal Finkel <hfinkel@anl.gov>
Tue, 30 Sep 2014 22:43:40 +0000 (22:43 +0000)
committerHal Finkel <hfinkel@anl.gov>
Tue, 30 Sep 2014 22:43:40 +0000 (22:43 +0000)
commita0715579f0023db159d56a4b1dd8c7549c713498
tree7631e35c387a142cc3e16be383ed901510386c57
parent2c453a0c03b6bb88953258cd0eae66d69856a25a
[BasicAA] Make better use of zext and sign information

Two related things:

 1. Fixes a bug when calculating the offset in GetLinearExpression. The code
    previously used zext to extend the offset, so negative offsets were converted
    to large positive ones.

 2. Enhance aliasGEP to deduce that, if the difference between two GEP
    allocations is positive and all the variables that govern the offset are also
    positive (i.e. the offset is strictly after the higher base pointer), then
    locations that fit in the gap between the two base pointers are NoAlias.

Patch by Nick White!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@218714 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Analysis/BasicAliasAnalysis.cpp
test/Analysis/BasicAA/phi-aa.ll
test/Analysis/BasicAA/zext.ll [new file with mode: 0644]