[all-commits] [llvm/llvm-project] cb4fc2: [BasicAA] Make alias GEP positive offset handling ...

Nikita Popov via All-commits all-commits at lists.llvm.org
Tue Nov 17 09:05:58 PST 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: cb4fc25c9189ce779e19b31c976b257364d00ea6
      https://github.com/llvm/llvm-project/commit/cb4fc25c9189ce779e19b31c976b257364d00ea6
  Author: Nikita Popov <nikita.ppv at gmail.com>
  Date:   2020-11-17 (Tue, 17 Nov 2020)

  Changed paths:
    M llvm/lib/Analysis/AliasAnalysisEvaluator.cpp
    M llvm/lib/Analysis/BasicAliasAnalysis.cpp
    M llvm/test/Analysis/BasicAA/zext.ll

  Log Message:
  -----------
  [BasicAA] Make alias GEP positive offset handling symmetric

aliasGEP() currently implements some special handling for the case
where all variable offsets are positive, in which case the constant
offset can be taken as the minimal offset. However, it does not
perform the same handling for the all-negative case. This means that
the alias-analysis result between two GEPs is asymmetric:
If GEP1 - GEP2 is all-positive, then GEP2 - GEP1 is all-negative,
and the first will result in NoAlias, while the second will result
in MayAlias.

Apart from producing sub-optimal results for one order, this also
violates our caching assumption. In particular, if BatchAA is used,
the cached result depends on the order of the GEPs in the first query.
This results in an inconsistency in BatchAA and AA results, which
is how I noticed this issue in the first place.

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




More information about the All-commits mailing list