diff options
| author | Chandler Carruth <chandlerc@gmail.com> | 2015-01-22 21:53:09 +0000 |
|---|---|---|
| committer | Chandler Carruth <chandlerc@gmail.com> | 2015-01-22 21:53:09 +0000 |
| commit | df8b223deae9e2a4a127d379a9ce2701b68c8414 (patch) | |
| tree | 6635f253a020787f7e090bbf90e149f904cbc717 /llvm/tools | |
| parent | cb36becbeb84826dcfff19243051d97c71d57211 (diff) | |
| download | bcm5719-llvm-df8b223deae9e2a4a127d379a9ce2701b68c8414.tar.gz bcm5719-llvm-df8b223deae9e2a4a127d379a9ce2701b68c8414.zip | |
[PM] Actually add the new pass manager support for the assumption cache.
I had already factored this analysis specifically to enable doing this,
but hadn't actually committed the necessary wiring to get at this from
the new pass manager. This also nicely shows how the separate cache
object can be directly managed by the new pass manager.
This analysis didn't have any direct tests and so I've added a printer
pass and a boring test case. I chose to print the i1 value which is
being assumed rather than the call to llvm.assume as that seems much
more useful for testing... but suggestions on an even better printing
strategy welcome. My main goal was to make sure things actually work. =]
llvm-svn: 226868
Diffstat (limited to 'llvm/tools')
| -rw-r--r-- | llvm/tools/opt/PassRegistry.def | 2 | ||||
| -rw-r--r-- | llvm/tools/opt/Passes.cpp | 1 |
2 files changed, 3 insertions, 0 deletions
diff --git a/llvm/tools/opt/PassRegistry.def b/llvm/tools/opt/PassRegistry.def index 66ee5e56272..b3296aa5ec0 100644 --- a/llvm/tools/opt/PassRegistry.def +++ b/llvm/tools/opt/PassRegistry.def @@ -50,6 +50,7 @@ CGSCC_PASS("no-op-cgscc", NoOpCGSCCPass()) #ifndef FUNCTION_ANALYSIS #define FUNCTION_ANALYSIS(NAME, CREATE_PASS) #endif +FUNCTION_ANALYSIS("assumptions", AssumptionAnalysis()) FUNCTION_ANALYSIS("domtree", DominatorTreeAnalysis()) FUNCTION_ANALYSIS("loops", LoopAnalysis()) FUNCTION_ANALYSIS("no-op-function", NoOpFunctionAnalysis()) @@ -61,6 +62,7 @@ FUNCTION_ANALYSIS("no-op-function", NoOpFunctionAnalysis()) FUNCTION_PASS("invalidate<all>", InvalidateAllAnalysesPass()) FUNCTION_PASS("no-op-function", NoOpFunctionPass()) FUNCTION_PASS("print", PrintFunctionPass(dbgs())) +FUNCTION_PASS("print<assumptions>", AssumptionPrinterPass(dbgs())) FUNCTION_PASS("print<domtree>", DominatorTreePrinterPass(dbgs())) FUNCTION_PASS("print<loops>", LoopPrinterPass(dbgs())) FUNCTION_PASS("verify", VerifierPass()) diff --git a/llvm/tools/opt/Passes.cpp b/llvm/tools/opt/Passes.cpp index ee515430554..5488059905e 100644 --- a/llvm/tools/opt/Passes.cpp +++ b/llvm/tools/opt/Passes.cpp @@ -15,6 +15,7 @@ //===----------------------------------------------------------------------===// #include "Passes.h" +#include "llvm/Analysis/AssumptionCache.h" #include "llvm/Analysis/CGSCCPassManager.h" #include "llvm/Analysis/LazyCallGraph.h" #include "llvm/Analysis/LoopInfo.h" |

