[llvm] 958abe0 - [NFC] Clean up always false variables

Arthur Eubanks via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 21 10:55:19 PDT 2020


Author: Arthur Eubanks
Date: 2020-10-21T10:54:55-07:00
New Revision: 958abe01802ca33d506e54f88f6a2563b95154f5

URL: https://github.com/llvm/llvm-project/commit/958abe01802ca33d506e54f88f6a2563b95154f5
DIFF: https://github.com/llvm/llvm-project/commit/958abe01802ca33d506e54f88f6a2563b95154f5.diff

LOG: [NFC] Clean up always false variables

Reviewed By: arsenm

Differential Revision: https://reviews.llvm.org/D89023

Added: 
    

Modified: 
    llvm/include/llvm/Analysis/RegionPass.h
    llvm/lib/Analysis/RegionPass.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/include/llvm/Analysis/RegionPass.h b/llvm/include/llvm/Analysis/RegionPass.h
index 995c5dca3de3..5c7fa5f56693 100644
--- a/llvm/include/llvm/Analysis/RegionPass.h
+++ b/llvm/include/llvm/Analysis/RegionPass.h
@@ -85,8 +85,6 @@ class RegionPass : public Pass {
 /// The pass manager to schedule RegionPasses.
 class RGPassManager : public FunctionPass, public PMDataManager {
   std::deque<Region*> RQ;
-  bool skipThisRegion;
-  bool redoThisRegion;
   RegionInfo *RI;
   Region *CurrentRegion;
 

diff  --git a/llvm/lib/Analysis/RegionPass.cpp b/llvm/lib/Analysis/RegionPass.cpp
index ace682465abb..a73607dbef61 100644
--- a/llvm/lib/Analysis/RegionPass.cpp
+++ b/llvm/lib/Analysis/RegionPass.cpp
@@ -31,8 +31,6 @@ char RGPassManager::ID = 0;
 
 RGPassManager::RGPassManager()
   : FunctionPass(ID), PMDataManager() {
-  skipThisRegion = false;
-  redoThisRegion = false;
   RI = nullptr;
   CurrentRegion = nullptr;
 }
@@ -76,8 +74,6 @@ bool RGPassManager::runOnFunction(Function &F) {
   while (!RQ.empty()) {
 
     CurrentRegion  = RQ.back();
-    skipThisRegion = false;
-    redoThisRegion = false;
 
     // Run all passes on the current Region.
     for (unsigned Index = 0; Index < getNumContainedPasses(); ++Index) {
@@ -115,54 +111,36 @@ bool RGPassManager::runOnFunction(Function &F) {
       if (isPassDebuggingExecutionsOrMore()) {
         if (LocalChanged)
           dumpPassInfo(P, MODIFICATION_MSG, ON_REGION_MSG,
-                       skipThisRegion ? "<deleted>" :
                                       CurrentRegion->getNameStr());
         dumpPreservedSet(P);
       }
 
-      if (!skipThisRegion) {
-        // Manually check that this region is still healthy. This is done
-        // instead of relying on RegionInfo::verifyRegion since RegionInfo
-        // is a function pass and it's really expensive to verify every
-        // Region in the function every time. That level of checking can be
-        // enabled with the -verify-region-info option.
-        {
-          TimeRegion PassTimer(getPassTimer(P));
-          CurrentRegion->verifyRegion();
-        }
-
-        // Then call the regular verifyAnalysis functions.
-        verifyPreservedAnalysis(P);
+      // Manually check that this region is still healthy. This is done
+      // instead of relying on RegionInfo::verifyRegion since RegionInfo
+      // is a function pass and it's really expensive to verify every
+      // Region in the function every time. That level of checking can be
+      // enabled with the -verify-region-info option.
+      {
+        TimeRegion PassTimer(getPassTimer(P));
+        CurrentRegion->verifyRegion();
       }
 
+      // Then call the regular verifyAnalysis functions.
+      verifyPreservedAnalysis(P);
+
       if (LocalChanged)
         removeNotPreservedAnalysis(P);
       recordAvailableAnalysis(P);
       removeDeadPasses(P,
-                       (!isPassDebuggingExecutionsOrMore() || skipThisRegion) ?
-                       "<deleted>" :  CurrentRegion->getNameStr(),
+                       (!isPassDebuggingExecutionsOrMore())
+                           ? "<deleted>"
+                           : CurrentRegion->getNameStr(),
                        ON_REGION_MSG);
-
-      if (skipThisRegion)
-        // Do not run other passes on this region.
-        break;
     }
 
-    // If the region was deleted, release all the region passes. This frees up
-    // some memory, and avoids trouble with the pass manager trying to call
-    // verifyAnalysis on them.
-    if (skipThisRegion)
-      for (unsigned Index = 0; Index < getNumContainedPasses(); ++Index) {
-        Pass *P = getContainedPass(Index);
-        freePass(P, "<deleted>", ON_REGION_MSG);
-      }
-
     // Pop the region from queue after running all passes.
     RQ.pop_back();
 
-    if (redoThisRegion)
-      RQ.push_back(CurrentRegion);
-
     // Free all region nodes created in region passes.
     RI->clearNodeCache();
   }


        


More information about the llvm-commits mailing list