HomePhabricator

Require chained analyses in BasicAA and AAResults to be transitive

Authored by bjope on Fri, Jan 1, 3:05 PM.

Description

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

Details

Committed
bjopeMon, Jan 11, 2:50 AM
Reviewer
nikic
Differential Revision
D94138: Require chained analyses in BasicAA and AAResults to be transitive
Parents
rGc5be0e0cc0e2: [X86] Fix tile register spill issue.
Branches
Unknown
Tags
Unknown