]> granicus.if.org Git - llvm/commit
Track validity of pass results
authorSerge Pavlov <sepavloff@gmail.com>
Fri, 13 Jan 2017 06:09:54 +0000 (06:09 +0000)
committerSerge Pavlov <sepavloff@gmail.com>
Fri, 13 Jan 2017 06:09:54 +0000 (06:09 +0000)
commite77eb6a23d69bfb175a0bfef5a081269ca8d120c
treeb4ab8a5db2780cc5e79c64b684f1bb684601421c
parenta2090aaaf9bc9288f91ebafad756879883625153
Track validity of pass results

Running tests with expensive checks enabled exhibits some problems with
verification of pass results.

First, the pass verification may require results of analysis that are not
available. For instance, verification of loop info requires results of dominator
tree analysis. A pass may be marked as conserving loop info but does not need to
be dependent on DominatorTreePass. When a pass manager tries to verify that loop
info is valid, it needs dominator tree, but corresponding analysis may be
already destroyed as no user of it remained.

Another case is a pass that is skipped. For instance, entities with linkage
available_externally do not need code generation and such passes are skipped for
them. In this case result verification must also be skipped.

To solve these problems this change introduces a special flag to the Pass
structure to mark passes that have valid results. If this flag is reset,
verifications dependent on the pass result are skipped.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291882 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/Pass.h
include/llvm/PassAnalysisSupport.h
lib/Analysis/CallGraphSCCPass.cpp
lib/Analysis/LoopInfo.cpp
lib/Analysis/LoopPass.cpp
lib/CodeGen/MachineDominators.cpp
lib/CodeGen/MachineFunctionPass.cpp
lib/IR/LegacyPassManager.cpp
lib/IR/Pass.cpp
test/CodeGen/Generic/externally_available.ll
test/CodeGen/Mips/mul.ll