[AA] Correctly maintain the sign of PartiaAlias offset
authorMomchil Velikov <momchil.velikov@arm.com>
Fri, 17 Dec 2021 15:07:19 +0000 (15:07 +0000)
committerMomchil Velikov <momchil.velikov@arm.com>
Fri, 17 Dec 2021 15:45:26 +0000 (15:45 +0000)
commit6192c312cf8da6d4f787b65917597431828f7b04
treef558942cd8485e3cd28c491cc618fdcb893f4372
parent512ab9968d5f7a655f797e542b8bc9c48674c0d7
[AA] Correctly maintain the sign of PartiaAlias offset

Preserve the invariant that offset reported in the case of a
`PartialAlias` between `Loc1` and `Loc2`, is such that
`Loc1 + Offset = Loc2`, where `Loc1` and `Loc2` are the first and
the second argument, respectively, in alias queries.

Differential Revision: https://reviews.llvm.org/D115927
llvm/lib/Analysis/BasicAliasAnalysis.cpp
llvm/unittests/Analysis/AliasAnalysisTest.cpp