From 8e46796ab92bde4b86c2822496234eb0e08b8328 Mon Sep 17 00:00:00 2001 From: Sean Silva Date: Tue, 9 Aug 2016 00:28:52 +0000 Subject: [PATCH] Consistently use LoopAnalysisManager One exception here is LoopInfo which must forward-declare it (because the typedef is in LoopPassManager.h which depends on LoopInfo). Also, some includes for LoopPassManager.h were needed since that file provides the typedef. Besides a general consistently benefit, the extra layer of indirection allows the mechanical part of https://reviews.llvm.org/D23256 that requires touching every transformation and analysis to be factored out cleanly. Thanks to David for the suggestion. llvm-svn: 278079 --- include/llvm/Analysis/IVUsers.h | 5 +++-- include/llvm/Analysis/LoopAccessAnalysis.h | 5 +++-- include/llvm/Transforms/Scalar/IndVarSimplify.h | 3 ++- include/llvm/Transforms/Scalar/LICM.h | 3 ++- include/llvm/Transforms/Scalar/LoopDeletion.h | 3 ++- include/llvm/Transforms/Scalar/LoopIdiomRecognize.h | 3 ++- include/llvm/Transforms/Scalar/LoopInstSimplify.h | 3 ++- include/llvm/Transforms/Scalar/LoopRotation.h | 3 ++- include/llvm/Transforms/Scalar/LoopSimplifyCFG.h | 3 ++- include/llvm/Transforms/Scalar/LoopStrengthReduce.h | 3 ++- include/llvm/Transforms/Scalar/LoopUnrollPass.h | 3 ++- lib/Analysis/IVUsers.cpp | 4 ++-- lib/Analysis/LoopAccessAnalysis.cpp | 4 ++-- lib/Analysis/LoopPass.cpp | 2 +- lib/Passes/PassBuilder.cpp | 4 ++-- lib/Transforms/Scalar/IndVarSimplify.cpp | 2 +- lib/Transforms/Scalar/LICM.cpp | 2 +- lib/Transforms/Scalar/LoopDeletion.cpp | 2 +- lib/Transforms/Scalar/LoopIdiomRecognize.cpp | 2 +- lib/Transforms/Scalar/LoopInstSimplify.cpp | 2 +- lib/Transforms/Scalar/LoopRotation.cpp | 2 +- lib/Transforms/Scalar/LoopSimplifyCFG.cpp | 2 +- lib/Transforms/Scalar/LoopStrengthReduce.cpp | 2 +- lib/Transforms/Scalar/LoopUnrollPass.cpp | 2 +- unittests/Analysis/LoopPassManagerTest.cpp | 6 +++--- 25 files changed, 43 insertions(+), 32 deletions(-) diff --git a/include/llvm/Analysis/IVUsers.h b/include/llvm/Analysis/IVUsers.h index e68a77526b9..031085dddd2 100644 --- a/include/llvm/Analysis/IVUsers.h +++ b/include/llvm/Analysis/IVUsers.h @@ -16,6 +16,7 @@ #define LLVM_ANALYSIS_IVUSERS_H #include "llvm/Analysis/LoopPass.h" +#include "llvm/Analysis/LoopPassManager.h" #include "llvm/Analysis/ScalarEvolutionNormalization.h" #include "llvm/IR/ValueHandle.h" @@ -208,7 +209,7 @@ class IVUsersAnalysis : public AnalysisInfoMixin { public: typedef IVUsers Result; - IVUsers run(Loop &L, AnalysisManager &AM); + IVUsers run(Loop &L, LoopAnalysisManager &AM); }; /// Printer pass for the \c IVUsers for a loop. @@ -217,7 +218,7 @@ class IVUsersPrinterPass : public PassInfoMixin { public: explicit IVUsersPrinterPass(raw_ostream &OS) : OS(OS) {} - PreservedAnalyses run(Loop &L, AnalysisManager &AM); + PreservedAnalyses run(Loop &L, LoopAnalysisManager &AM); }; } diff --git a/include/llvm/Analysis/LoopAccessAnalysis.h b/include/llvm/Analysis/LoopAccessAnalysis.h index 367f2f4a3e2..a9674fb33bc 100644 --- a/include/llvm/Analysis/LoopAccessAnalysis.h +++ b/include/llvm/Analysis/LoopAccessAnalysis.h @@ -20,6 +20,7 @@ #include "llvm/ADT/SetVector.h" #include "llvm/Analysis/AliasAnalysis.h" #include "llvm/Analysis/AliasSetTracker.h" +#include "llvm/Analysis/LoopPassManager.h" #include "llvm/Analysis/ScalarEvolutionExpressions.h" #include "llvm/IR/ValueHandle.h" #include "llvm/Pass.h" @@ -775,7 +776,7 @@ class LoopAccessAnalysis public: typedef LoopAccessInfo Result; - Result run(Loop &, AnalysisManager &); + Result run(Loop &, LoopAnalysisManager &); static StringRef name() { return "LoopAccessAnalysis"; } }; @@ -786,7 +787,7 @@ class LoopAccessInfoPrinterPass public: explicit LoopAccessInfoPrinterPass(raw_ostream &OS) : OS(OS) {} - PreservedAnalyses run(Loop &L, AnalysisManager &AM); + PreservedAnalyses run(Loop &L, LoopAnalysisManager &AM); }; inline Instruction *MemoryDepChecker::Dependence::getSource( diff --git a/include/llvm/Transforms/Scalar/IndVarSimplify.h b/include/llvm/Transforms/Scalar/IndVarSimplify.h index 325bcc7bed8..24a31594b15 100644 --- a/include/llvm/Transforms/Scalar/IndVarSimplify.h +++ b/include/llvm/Transforms/Scalar/IndVarSimplify.h @@ -16,13 +16,14 @@ #define LLVM_TRANSFORMS_SCALAR_INDVARSIMPLIFY_H #include "llvm/Analysis/LoopInfo.h" +#include "llvm/Analysis/LoopPassManager.h" #include "llvm/IR/PassManager.h" namespace llvm { class IndVarSimplifyPass : public PassInfoMixin { public: - PreservedAnalyses run(Loop &L, AnalysisManager &AM); + PreservedAnalyses run(Loop &L, LoopAnalysisManager &AM); }; } diff --git a/include/llvm/Transforms/Scalar/LICM.h b/include/llvm/Transforms/Scalar/LICM.h index a050a43d617..39bbc72f8cb 100644 --- a/include/llvm/Transforms/Scalar/LICM.h +++ b/include/llvm/Transforms/Scalar/LICM.h @@ -34,6 +34,7 @@ #define LLVM_TRANSFORMS_SCALAR_LICM_H #include "llvm/Analysis/LoopInfo.h" +#include "llvm/Analysis/LoopPassManager.h" #include "llvm/IR/PassManager.h" namespace llvm { @@ -41,7 +42,7 @@ namespace llvm { /// Performs Loop Invariant Code Motion Pass. class LICMPass : public PassInfoMixin { public: - PreservedAnalyses run(Loop &L, AnalysisManager &AM); + PreservedAnalyses run(Loop &L, LoopAnalysisManager &AM); }; } // end namespace llvm diff --git a/include/llvm/Transforms/Scalar/LoopDeletion.h b/include/llvm/Transforms/Scalar/LoopDeletion.h index ed5a9833e57..891f08faa48 100644 --- a/include/llvm/Transforms/Scalar/LoopDeletion.h +++ b/include/llvm/Transforms/Scalar/LoopDeletion.h @@ -15,6 +15,7 @@ #define LLVM_TRANSFORMS_SCALAR_LOOPDELETION_H #include "llvm/Analysis/LoopInfo.h" +#include "llvm/Analysis/LoopPassManager.h" #include "llvm/Analysis/ScalarEvolution.h" #include "llvm/IR/PassManager.h" @@ -23,7 +24,7 @@ namespace llvm { class LoopDeletionPass : public PassInfoMixin { public: LoopDeletionPass() {} - PreservedAnalyses run(Loop &L, AnalysisManager &AM); + PreservedAnalyses run(Loop &L, LoopAnalysisManager &AM); bool runImpl(Loop *L, DominatorTree &DT, ScalarEvolution &SE, LoopInfo &loopInfo); diff --git a/include/llvm/Transforms/Scalar/LoopIdiomRecognize.h b/include/llvm/Transforms/Scalar/LoopIdiomRecognize.h index cc66156fba8..0c052ddd2fe 100644 --- a/include/llvm/Transforms/Scalar/LoopIdiomRecognize.h +++ b/include/llvm/Transforms/Scalar/LoopIdiomRecognize.h @@ -17,6 +17,7 @@ #define LLVM_TRANSFORMS_SCALAR_LOOPIDIOMRECOGNIZE_H #include "llvm/Analysis/LoopInfo.h" +#include "llvm/Analysis/LoopPassManager.h" #include "llvm/IR/PassManager.h" namespace llvm { @@ -24,7 +25,7 @@ namespace llvm { /// Performs Loop Idiom Recognize Pass. class LoopIdiomRecognizePass : public PassInfoMixin { public: - PreservedAnalyses run(Loop &L, AnalysisManager &AM); + PreservedAnalyses run(Loop &L, LoopAnalysisManager &AM); }; } // end namespace llvm diff --git a/include/llvm/Transforms/Scalar/LoopInstSimplify.h b/include/llvm/Transforms/Scalar/LoopInstSimplify.h index f67343f40a7..e30f4a97b78 100644 --- a/include/llvm/Transforms/Scalar/LoopInstSimplify.h +++ b/include/llvm/Transforms/Scalar/LoopInstSimplify.h @@ -15,6 +15,7 @@ #define LLVM_TRANSFORMS_SCALAR_LOOPINSTSIMPLIFY_H #include "llvm/Analysis/LoopInfo.h" +#include "llvm/Analysis/LoopPassManager.h" #include "llvm/IR/PassManager.h" namespace llvm { @@ -22,7 +23,7 @@ namespace llvm { /// Performs Loop Inst Simplify Pass. class LoopInstSimplifyPass : public PassInfoMixin { public: - PreservedAnalyses run(Loop &L, AnalysisManager &AM); + PreservedAnalyses run(Loop &L, LoopAnalysisManager &AM); }; } // end namespace llvm diff --git a/include/llvm/Transforms/Scalar/LoopRotation.h b/include/llvm/Transforms/Scalar/LoopRotation.h index b21c7313dc4..781ae81b09f 100644 --- a/include/llvm/Transforms/Scalar/LoopRotation.h +++ b/include/llvm/Transforms/Scalar/LoopRotation.h @@ -15,6 +15,7 @@ #define LLVM_TRANSFORMS_SCALAR_LOOPROTATION_H #include "llvm/Analysis/LoopInfo.h" +#include "llvm/Analysis/LoopPassManager.h" #include "llvm/IR/PassManager.h" namespace llvm { @@ -23,7 +24,7 @@ namespace llvm { class LoopRotatePass : public PassInfoMixin { public: LoopRotatePass(); - PreservedAnalyses run(Loop &L, AnalysisManager &AM); + PreservedAnalyses run(Loop &L, LoopAnalysisManager &AM); }; } diff --git a/include/llvm/Transforms/Scalar/LoopSimplifyCFG.h b/include/llvm/Transforms/Scalar/LoopSimplifyCFG.h index 7609bb26a1a..2f06782052c 100644 --- a/include/llvm/Transforms/Scalar/LoopSimplifyCFG.h +++ b/include/llvm/Transforms/Scalar/LoopSimplifyCFG.h @@ -18,6 +18,7 @@ #define LLVM_TRANSFORMS_SCALAR_LOOPSIMPLIFYCFG_H #include "llvm/Analysis/LoopInfo.h" +#include "llvm/Analysis/LoopPassManager.h" #include "llvm/IR/PassManager.h" namespace llvm { @@ -25,7 +26,7 @@ namespace llvm { /// Performs basic CFG simplifications to assist other loop passes. class LoopSimplifyCFGPass : public PassInfoMixin { public: - PreservedAnalyses run(Loop &L, AnalysisManager &AM); + PreservedAnalyses run(Loop &L, LoopAnalysisManager &AM); }; } // end namespace llvm diff --git a/include/llvm/Transforms/Scalar/LoopStrengthReduce.h b/include/llvm/Transforms/Scalar/LoopStrengthReduce.h index 92d5f90b793..11c0d9bce85 100644 --- a/include/llvm/Transforms/Scalar/LoopStrengthReduce.h +++ b/include/llvm/Transforms/Scalar/LoopStrengthReduce.h @@ -23,6 +23,7 @@ #define LLVM_TRANSFORMS_SCALAR_LOOPSTRENGTHREDUCE_H #include "llvm/Analysis/LoopInfo.h" +#include "llvm/Analysis/LoopPassManager.h" #include "llvm/IR/PassManager.h" namespace llvm { @@ -30,7 +31,7 @@ namespace llvm { /// Performs Loop Strength Reduce Pass. class LoopStrengthReducePass : public PassInfoMixin { public: - PreservedAnalyses run(Loop &L, AnalysisManager &AM); + PreservedAnalyses run(Loop &L, LoopAnalysisManager &AM); }; } // end namespace llvm diff --git a/include/llvm/Transforms/Scalar/LoopUnrollPass.h b/include/llvm/Transforms/Scalar/LoopUnrollPass.h index 6305ce5539a..b140a933e8e 100644 --- a/include/llvm/Transforms/Scalar/LoopUnrollPass.h +++ b/include/llvm/Transforms/Scalar/LoopUnrollPass.h @@ -11,6 +11,7 @@ #define LLVM_TRANSFORMS_SCALAR_LOOPUNROLLPASS_H #include "llvm/Analysis/LoopInfo.h" +#include "llvm/Analysis/LoopPassManager.h" #include "llvm/IR/PassManager.h" namespace llvm { @@ -21,7 +22,7 @@ struct LoopUnrollPass : public PassInfoMixin { Optional ProvidedAllowPartial; Optional ProvidedRuntime; - PreservedAnalyses run(Loop &L, AnalysisManager &AM); + PreservedAnalyses run(Loop &L, LoopAnalysisManager &AM); }; } // end namespace llvm diff --git a/lib/Analysis/IVUsers.cpp b/lib/Analysis/IVUsers.cpp index 43c0ba17fe4..11056fbd64f 100644 --- a/lib/Analysis/IVUsers.cpp +++ b/lib/Analysis/IVUsers.cpp @@ -36,7 +36,7 @@ using namespace llvm; char IVUsersAnalysis::PassID; -IVUsers IVUsersAnalysis::run(Loop &L, AnalysisManager &AM) { +IVUsers IVUsersAnalysis::run(Loop &L, LoopAnalysisManager &AM) { const auto &FAM = AM.getResult(L).getManager(); Function *F = L.getHeader()->getParent(); @@ -47,7 +47,7 @@ IVUsers IVUsersAnalysis::run(Loop &L, AnalysisManager &AM) { FAM.getCachedResult(*F)); } -PreservedAnalyses IVUsersPrinterPass::run(Loop &L, AnalysisManager &AM) { +PreservedAnalyses IVUsersPrinterPass::run(Loop &L, LoopAnalysisManager &AM) { AM.getResult(L).print(OS); return PreservedAnalyses::all(); } diff --git a/lib/Analysis/LoopAccessAnalysis.cpp b/lib/Analysis/LoopAccessAnalysis.cpp index 8f24cffef75..4ae31627f78 100644 --- a/lib/Analysis/LoopAccessAnalysis.cpp +++ b/lib/Analysis/LoopAccessAnalysis.cpp @@ -2030,7 +2030,7 @@ INITIALIZE_PASS_END(LoopAccessLegacyAnalysis, LAA_NAME, laa_name, false, true) char LoopAccessAnalysis::PassID; -LoopAccessInfo LoopAccessAnalysis::run(Loop &L, AnalysisManager &AM) { +LoopAccessInfo LoopAccessAnalysis::run(Loop &L, LoopAnalysisManager &AM) { const FunctionAnalysisManager &FAM = AM.getResult(L).getManager(); Function &F = *L.getHeader()->getParent(); @@ -2052,7 +2052,7 @@ LoopAccessInfo LoopAccessAnalysis::run(Loop &L, AnalysisManager &AM) { } PreservedAnalyses LoopAccessInfoPrinterPass::run(Loop &L, - AnalysisManager &AM) { + LoopAnalysisManager &AM) { Function &F = *L.getHeader()->getParent(); auto &LAI = AM.getResult(L); OS << "Loop access info in function '" << F.getName() << "':\n"; diff --git a/lib/Analysis/LoopPass.cpp b/lib/Analysis/LoopPass.cpp index 98103c12320..daaf2dc4a61 100644 --- a/lib/Analysis/LoopPass.cpp +++ b/lib/Analysis/LoopPass.cpp @@ -48,7 +48,7 @@ public: [](BasicBlock *BB) { return BB; }); if (BBI != L->blocks().end() && isFunctionInPrintList((*BBI)->getParent()->getName())) { - AnalysisManager DummyLAM; + LoopAnalysisManager DummyLAM; P.run(*L, DummyLAM); } return false; diff --git a/lib/Passes/PassBuilder.cpp b/lib/Passes/PassBuilder.cpp index e06a2fed142..82cc308ef1a 100644 --- a/lib/Passes/PassBuilder.cpp +++ b/lib/Passes/PassBuilder.cpp @@ -195,7 +195,7 @@ public: /// \brief No-op loop pass which does nothing. struct NoOpLoopPass { - PreservedAnalyses run(Loop &L, AnalysisManager &) { + PreservedAnalyses run(Loop &L, LoopAnalysisManager &) { return PreservedAnalyses::all(); } static StringRef name() { return "NoOpLoopPass"; } @@ -208,7 +208,7 @@ class NoOpLoopAnalysis : public AnalysisInfoMixin { public: struct Result {}; - Result run(Loop &, AnalysisManager &) { return Result(); } + Result run(Loop &, LoopAnalysisManager &) { return Result(); } static StringRef name() { return "NoOpLoopAnalysis"; } }; diff --git a/lib/Transforms/Scalar/IndVarSimplify.cpp b/lib/Transforms/Scalar/IndVarSimplify.cpp index f3de377cf69..4986b842e93 100644 --- a/lib/Transforms/Scalar/IndVarSimplify.cpp +++ b/lib/Transforms/Scalar/IndVarSimplify.cpp @@ -2213,7 +2213,7 @@ bool IndVarSimplify::run(Loop *L) { return Changed; } -PreservedAnalyses IndVarSimplifyPass::run(Loop &L, AnalysisManager &AM) { +PreservedAnalyses IndVarSimplifyPass::run(Loop &L, LoopAnalysisManager &AM) { auto &FAM = AM.getResult(L).getManager(); Function *F = L.getHeader()->getParent(); const DataLayout &DL = F->getParent()->getDataLayout(); diff --git a/lib/Transforms/Scalar/LICM.cpp b/lib/Transforms/Scalar/LICM.cpp index cdd17fc516a..9fc5120492f 100644 --- a/lib/Transforms/Scalar/LICM.cpp +++ b/lib/Transforms/Scalar/LICM.cpp @@ -173,7 +173,7 @@ private: }; } -PreservedAnalyses LICMPass::run(Loop &L, AnalysisManager &AM) { +PreservedAnalyses LICMPass::run(Loop &L, LoopAnalysisManager &AM) { const auto &FAM = AM.getResult(L).getManager(); Function *F = L.getHeader()->getParent(); diff --git a/lib/Transforms/Scalar/LoopDeletion.cpp b/lib/Transforms/Scalar/LoopDeletion.cpp index 19b2f89555c..187e6e3073c 100644 --- a/lib/Transforms/Scalar/LoopDeletion.cpp +++ b/lib/Transforms/Scalar/LoopDeletion.cpp @@ -215,7 +215,7 @@ bool LoopDeletionPass::runImpl(Loop *L, DominatorTree &DT, ScalarEvolution &SE, return Changed; } -PreservedAnalyses LoopDeletionPass::run(Loop &L, AnalysisManager &AM) { +PreservedAnalyses LoopDeletionPass::run(Loop &L, LoopAnalysisManager &AM) { auto &FAM = AM.getResult(L).getManager(); Function *F = L.getHeader()->getParent(); diff --git a/lib/Transforms/Scalar/LoopIdiomRecognize.cpp b/lib/Transforms/Scalar/LoopIdiomRecognize.cpp index 1468676a354..90e8bfa93c7 100644 --- a/lib/Transforms/Scalar/LoopIdiomRecognize.cpp +++ b/lib/Transforms/Scalar/LoopIdiomRecognize.cpp @@ -172,7 +172,7 @@ public: } // End anonymous namespace. PreservedAnalyses LoopIdiomRecognizePass::run(Loop &L, - AnalysisManager &AM) { + LoopAnalysisManager &AM) { const auto &FAM = AM.getResult(L).getManager(); Function *F = L.getHeader()->getParent(); diff --git a/lib/Transforms/Scalar/LoopInstSimplify.cpp b/lib/Transforms/Scalar/LoopInstSimplify.cpp index 629cb87d7a9..f6620ad1ade 100644 --- a/lib/Transforms/Scalar/LoopInstSimplify.cpp +++ b/lib/Transforms/Scalar/LoopInstSimplify.cpp @@ -184,7 +184,7 @@ public: } PreservedAnalyses LoopInstSimplifyPass::run(Loop &L, - AnalysisManager &AM) { + LoopAnalysisManager &AM) { const auto &FAM = AM.getResult(L).getManager(); Function *F = L.getHeader()->getParent(); diff --git a/lib/Transforms/Scalar/LoopRotation.cpp b/lib/Transforms/Scalar/LoopRotation.cpp index 7a06a25a707..cb95284a1d7 100644 --- a/lib/Transforms/Scalar/LoopRotation.cpp +++ b/lib/Transforms/Scalar/LoopRotation.cpp @@ -619,7 +619,7 @@ bool LoopRotate::processLoop(Loop *L) { LoopRotatePass::LoopRotatePass() {} -PreservedAnalyses LoopRotatePass::run(Loop &L, AnalysisManager &AM) { +PreservedAnalyses LoopRotatePass::run(Loop &L, LoopAnalysisManager &AM) { auto &FAM = AM.getResult(L).getManager(); Function *F = L.getHeader()->getParent(); diff --git a/lib/Transforms/Scalar/LoopSimplifyCFG.cpp b/lib/Transforms/Scalar/LoopSimplifyCFG.cpp index ec227932c09..d37339fc5fe 100644 --- a/lib/Transforms/Scalar/LoopSimplifyCFG.cpp +++ b/lib/Transforms/Scalar/LoopSimplifyCFG.cpp @@ -64,7 +64,7 @@ static bool simplifyLoopCFG(Loop &L, DominatorTree &DT, LoopInfo &LI) { return Changed; } -PreservedAnalyses LoopSimplifyCFGPass::run(Loop &L, AnalysisManager &AM) { +PreservedAnalyses LoopSimplifyCFGPass::run(Loop &L, LoopAnalysisManager &AM) { const auto &FAM = AM.getResult(L).getManager(); Function *F = L.getHeader()->getParent(); diff --git a/lib/Transforms/Scalar/LoopStrengthReduce.cpp b/lib/Transforms/Scalar/LoopStrengthReduce.cpp index ba4b6e146eb..c2a8f158fd9 100644 --- a/lib/Transforms/Scalar/LoopStrengthReduce.cpp +++ b/lib/Transforms/Scalar/LoopStrengthReduce.cpp @@ -5023,7 +5023,7 @@ bool LoopStrengthReduce::runOnLoop(Loop *L, LPPassManager & /*LPM*/) { } PreservedAnalyses LoopStrengthReducePass::run(Loop &L, - AnalysisManager &AM) { + LoopAnalysisManager &AM) { const auto &FAM = AM.getResult(L).getManager(); Function *F = L.getHeader()->getParent(); diff --git a/lib/Transforms/Scalar/LoopUnrollPass.cpp b/lib/Transforms/Scalar/LoopUnrollPass.cpp index 5c95bee36ee..0a45732a892 100644 --- a/lib/Transforms/Scalar/LoopUnrollPass.cpp +++ b/lib/Transforms/Scalar/LoopUnrollPass.cpp @@ -1058,7 +1058,7 @@ Pass *llvm::createSimpleLoopUnrollPass() { return llvm::createLoopUnrollPass(-1, -1, 0, 0); } -PreservedAnalyses LoopUnrollPass::run(Loop &L, AnalysisManager &AM) { +PreservedAnalyses LoopUnrollPass::run(Loop &L, LoopAnalysisManager &AM) { const auto &FAM = AM.getResult(L).getManager(); Function *F = L.getHeader()->getParent(); diff --git a/unittests/Analysis/LoopPassManagerTest.cpp b/unittests/Analysis/LoopPassManagerTest.cpp index 5858e174aab..b55ca7b6140 100644 --- a/unittests/Analysis/LoopPassManagerTest.cpp +++ b/unittests/Analysis/LoopPassManagerTest.cpp @@ -42,7 +42,7 @@ public: TestLoopAnalysis(int &Runs) : Runs(Runs) {} /// \brief Run the analysis pass over the loop and return a result. - Result run(Loop &L, AnalysisManager &AM) { + Result run(Loop &L, LoopAnalysisManager &AM) { ++Runs; int Count = 0; @@ -65,7 +65,7 @@ public: : VisitedLoops(VisitedLoops), AnalyzedBlockCount(AnalyzedBlockCount), OnlyUseCachedResults(OnlyUseCachedResults) {} - PreservedAnalyses run(Loop &L, AnalysisManager &AM) { + PreservedAnalyses run(Loop &L, LoopAnalysisManager &AM) { VisitedLoops.push_back(L.getName()); if (OnlyUseCachedResults) { @@ -91,7 +91,7 @@ class TestLoopInvalidatingPass { public: TestLoopInvalidatingPass(StringRef LoopName) : Name(LoopName) {} - PreservedAnalyses run(Loop &L, AnalysisManager &AM) { + PreservedAnalyses run(Loop &L, LoopAnalysisManager &AM) { return L.getName() == Name ? getLoopPassPreservedAnalyses() : PreservedAnalyses::all(); }