diff options
author | Serge Pavlov <sepavloff@gmail.com> | 2017-01-13 06:09:54 +0000 |
---|---|---|
committer | Serge Pavlov <sepavloff@gmail.com> | 2017-01-13 06:09:54 +0000 |
commit | d409411ef195329a24cea00589e9853ab6a5ace8 (patch) | |
tree | 31459227034048c2e1e5274200e73d075317eb6e /llvm/lib/CodeGen/MachineFunctionPass.cpp | |
parent | d30e6f7421f4b319f1203d660bbc89f09d8944f7 (diff) | |
download | bcm5719-llvm-d409411ef195329a24cea00589e9853ab6a5ace8.tar.gz bcm5719-llvm-d409411ef195329a24cea00589e9853ab6a5ace8.zip |
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
llvm-svn: 291882
Diffstat (limited to 'llvm/lib/CodeGen/MachineFunctionPass.cpp')
-rw-r--r-- | llvm/lib/CodeGen/MachineFunctionPass.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/MachineFunctionPass.cpp b/llvm/lib/CodeGen/MachineFunctionPass.cpp index 2265676ff8b..a7ece36a1e5 100644 --- a/llvm/lib/CodeGen/MachineFunctionPass.cpp +++ b/llvm/lib/CodeGen/MachineFunctionPass.cpp @@ -38,8 +38,10 @@ Pass *MachineFunctionPass::createPrinterPass(raw_ostream &O, bool MachineFunctionPass::runOnFunction(Function &F) { // Do not codegen any 'available_externally' functions at all, they have // definitions outside the translation unit. - if (F.hasAvailableExternallyLinkage()) + if (F.hasAvailableExternallyLinkage()) { + setExecuted(false); return false; + } MachineModuleInfo &MMI = getAnalysis<MachineModuleInfo>(); MachineFunction &MF = MMI.getMachineFunction(F); |