From 0e9e7fc0b2dc3b2f084b624f033235dabed264b9 Mon Sep 17 00:00:00 2001 From: Davide Italiano Date: Wed, 15 Jun 2016 18:51:25 +0000 Subject: [PATCH] [LoopSimplify] Analyses do not need to be member variables. In preparation for porting this pass to the new PM. llvm-svn: 272818 --- lib/Transforms/Utils/LoopSimplify.cpp | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/lib/Transforms/Utils/LoopSimplify.cpp b/lib/Transforms/Utils/LoopSimplify.cpp index 96ba9b4d1d6..2509b0a058f 100644 --- a/lib/Transforms/Utils/LoopSimplify.cpp +++ b/lib/Transforms/Utils/LoopSimplify.cpp @@ -728,11 +728,6 @@ namespace { initializeLoopSimplifyPass(*PassRegistry::getPassRegistry()); } - DominatorTree *DT; - LoopInfo *LI; - ScalarEvolution *SE; - AssumptionCache *AC; - bool runOnFunction(Function &F) override; void getAnalysisUsage(AnalysisUsage &AU) const override { @@ -778,11 +773,13 @@ Pass *llvm::createLoopSimplifyPass() { return new LoopSimplify(); } /// bool LoopSimplify::runOnFunction(Function &F) { bool Changed = false; - LI = &getAnalysis().getLoopInfo(); - DT = &getAnalysis().getDomTree(); + LoopInfo *LI = &getAnalysis().getLoopInfo(); + DominatorTree *DT = &getAnalysis().getDomTree(); auto *SEWP = getAnalysisIfAvailable(); - SE = SEWP ? &SEWP->getSE() : nullptr; - AC = &getAnalysis().getAssumptionCache(F); + ScalarEvolution *SE = SEWP ? &SEWP->getSE() : nullptr; + AssumptionCache *AC = + &getAnalysis().getAssumptionCache(F); + bool PreserveLCSSA = mustPreserveAnalysisID(LCSSAID); #ifndef NDEBUG if (PreserveLCSSA) {