[llvm] r251067 - LoopPass: Remove redoLoop, it isn't used. NFC

Justin Bogner via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 22 14:31:34 PDT 2015


Author: bogner
Date: Thu Oct 22 16:31:34 2015
New Revision: 251067

URL: http://llvm.org/viewvc/llvm-project?rev=251067&view=rev
Log:
LoopPass: Remove redoLoop, it isn't used. NFC

In r251064 I removed a logically unreachable call to `redoLoop`, and
now there aren't any callers of this API at all. Remove the needless
complexity.

Modified:
    llvm/trunk/include/llvm/Analysis/LoopPass.h
    llvm/trunk/lib/Analysis/LoopPass.cpp

Modified: llvm/trunk/include/llvm/Analysis/LoopPass.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/LoopPass.h?rev=251067&r1=251066&r2=251067&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Analysis/LoopPass.h (original)
+++ llvm/trunk/include/llvm/Analysis/LoopPass.h Thu Oct 22 16:31:34 2015
@@ -134,11 +134,6 @@ public:
   // the top level if \c ParentLoop is null.
   Loop &addLoop(Loop *ParentLoop);
 
-  // Reoptimize this loop. LPPassManager will re-insert this loop into the
-  // queue. This allows LoopPass to change loop nest for the loop. This
-  // utility may send LPPassManager into infinite loops so use caution.
-  void redoLoop(Loop *L);
-
   //===--------------------------------------------------------------------===//
   /// SimpleAnalysis - Provides simple interface to update analysis info
   /// maintained by various passes. Note, if required this interface can
@@ -161,7 +156,6 @@ public:
 private:
   std::deque<Loop *> LQ;
   bool skipThisLoop;
-  bool redoThisLoop;
   LoopInfo *LI;
   Loop *CurrentLoop;
 };

Modified: llvm/trunk/lib/Analysis/LoopPass.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/LoopPass.cpp?rev=251067&r1=251066&r2=251067&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/LoopPass.cpp (original)
+++ llvm/trunk/lib/Analysis/LoopPass.cpp Thu Oct 22 16:31:34 2015
@@ -67,7 +67,6 @@ char LPPassManager::ID = 0;
 LPPassManager::LPPassManager()
   : FunctionPass(ID), PMDataManager() {
   skipThisLoop = false;
-  redoThisLoop = false;
   LI = nullptr;
   CurrentLoop = nullptr;
 }
@@ -126,14 +125,6 @@ Loop &LPPassManager::addLoop(Loop *Paren
   return *L;
 }
 
-// Reoptimize this loop. LPPassManager will re-insert this loop into the
-// queue. This allows LoopPass to change loop nest for the loop. This
-// utility may send LPPassManager into infinite loops so use caution.
-void LPPassManager::redoLoop(Loop *L) {
-  assert (CurrentLoop == L && "Can redo only CurrentLoop");
-  redoThisLoop = true;
-}
-
 /// cloneBasicBlockSimpleAnalysis - Invoke cloneBasicBlockAnalysis hook for
 /// all loop passes.
 void LPPassManager::cloneBasicBlockSimpleAnalysis(BasicBlock *From,
@@ -223,7 +214,6 @@ bool LPPassManager::runOnFunction(Functi
 
     CurrentLoop  = LQ.back();
     skipThisLoop = false;
-    redoThisLoop = false;
 
     // Run all passes on the current Loop.
     for (unsigned Index = 0; Index < getNumContainedPasses(); ++Index) {
@@ -288,9 +278,6 @@ bool LPPassManager::runOnFunction(Functi
 
     // Pop the loop from queue after running all passes.
     LQ.pop_back();
-
-    if (redoThisLoop)
-      LQ.push_back(CurrentLoop);
   }
 
   // Finalization




More information about the llvm-commits mailing list