forked from OSchip/llvm-project
[SCEV] Make SCEV verification available from command line with new PM
New pass manager doesn't use verifyAnalysis, so currently there is no way to call SCEV verification from command line when new PM is used. This patch adds a pass that allows you to do that. Reviewers: reames, fhahn, sanjoy.google, nikic Reviewed By: fhahn Subscribers: hiraditya, javed.absar, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D70423
This commit is contained in:
parent
19fd8925a4
commit
259ca0418e
|
@ -1922,6 +1922,13 @@ public:
|
|||
ScalarEvolution run(Function &F, FunctionAnalysisManager &AM);
|
||||
};
|
||||
|
||||
/// Verifier pass for the \c ScalarEvolutionAnalysis results.
|
||||
class ScalarEvolutionVerifierPass
|
||||
: public PassInfoMixin<ScalarEvolutionVerifierPass> {
|
||||
public:
|
||||
PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM);
|
||||
};
|
||||
|
||||
/// Printer pass for the \c ScalarEvolutionAnalysis results.
|
||||
class ScalarEvolutionPrinterPass
|
||||
: public PassInfoMixin<ScalarEvolutionPrinterPass> {
|
||||
|
|
|
@ -12040,6 +12040,12 @@ ScalarEvolution ScalarEvolutionAnalysis::run(Function &F,
|
|||
AM.getResult<LoopAnalysis>(F));
|
||||
}
|
||||
|
||||
PreservedAnalyses
|
||||
ScalarEvolutionVerifierPass::run(Function &F, FunctionAnalysisManager &AM) {
|
||||
AM.getResult<ScalarEvolutionAnalysis>(F).verify();
|
||||
return PreservedAnalyses::all();
|
||||
}
|
||||
|
||||
PreservedAnalyses
|
||||
ScalarEvolutionPrinterPass::run(Function &F, FunctionAnalysisManager &AM) {
|
||||
AM.getResult<ScalarEvolutionAnalysis>(F).print(OS);
|
||||
|
|
|
@ -240,6 +240,7 @@ FUNCTION_PASS("verify<loops>", LoopVerifierPass())
|
|||
FUNCTION_PASS("verify<memoryssa>", MemorySSAVerifierPass())
|
||||
FUNCTION_PASS("verify<regions>", RegionInfoVerifierPass())
|
||||
FUNCTION_PASS("verify<safepoint-ir>", SafepointIRVerifierPass())
|
||||
FUNCTION_PASS("verify<scalar-evolution>", ScalarEvolutionVerifierPass())
|
||||
FUNCTION_PASS("view-cfg", CFGViewerPass())
|
||||
FUNCTION_PASS("view-cfg-only", CFGOnlyViewerPass())
|
||||
FUNCTION_PASS("transform-warning", WarnMissedTransformationsPass())
|
||||
|
|
Loading…
Reference in New Issue