[all-commits] [llvm/llvm-project] 675be6: Require chained analyses in BasicAA and AAResults ...

Björn Pettersson via All-commits all-commits at lists.llvm.org
Mon Jan 11 02:51:51 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 675be651062476cd0cd4b491b35c275bb03d7b2c
      https://github.com/llvm/llvm-project/commit/675be651062476cd0cd4b491b35c275bb03d7b2c
  Author: Bjorn Pettersson <bjorn.a.pettersson at ericsson.com>
  Date:   2021-01-11 (Mon, 11 Jan 2021)

  Changed paths:
    M llvm/lib/Analysis/AliasAnalysis.cpp
    M llvm/lib/Analysis/BasicAliasAnalysis.cpp
    M llvm/lib/Target/Hexagon/HexagonLoopIdiomRecognition.cpp
    M llvm/lib/Transforms/Scalar/GVNHoist.cpp

  Log Message:
  -----------
  Require chained analyses in BasicAA and AAResults to be transitive

This patch fixes a bug that could result in miscompiles (at least
in an OOT target). The problem could be seen by adding checks that
the DominatorTree used in BasicAliasAnalysis and ValueTracking was
valid (e.g. by adding DT->verify() call before every DT dereference
and then running all tests in test/CodeGen).

Problem was that the LegacyPassManager calculated "last user"
incorrectly for passes such as the DominatorTree when not telling
the pass manager that there was a transitive dependency between
the different analyses. And then it could happen that an incorrect
dominator tree was used when doing alias analysis (which was a pretty
serious bug as the alias analysis result could be invalid).

Fixes: https://bugs.llvm.org/show_bug.cgi?id=48709

Reviewed By: nikic

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




More information about the All-commits mailing list