[PATCH] D36216: [PM] Fix proxy invalidation

Philip Pfaffe via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 2 05:29:51 PDT 2017


philip.pfaffe created this revision.
Herald added a reviewer: bollu.

I made a mistake in handling transitive invalidation of analysis results. I've updated the list of preserved analyses as well as the correct result dependences.


https://reviews.llvm.org/D36216

Files:
  include/polly/ScopPass.h
  lib/Analysis/ScopPass.cpp


Index: lib/Analysis/ScopPass.cpp
===================================================================
--- lib/Analysis/ScopPass.cpp
+++ lib/Analysis/ScopPass.cpp
@@ -78,12 +78,10 @@
   // First, check whether our ScopInfo is about to be invalidated
   auto PAC = PA.getChecker<ScopAnalysisManagerFunctionProxy>();
   if (!(PAC.preserved() || PAC.preservedSet<AllAnalysesOn<Function>>() ||
-        Inv.invalidate<ScopAnalysis>(F, PA) ||
+        Inv.invalidate<ScopInfoAnalysis>(F, PA) ||
         Inv.invalidate<ScalarEvolutionAnalysis>(F, PA) ||
         Inv.invalidate<LoopAnalysis>(F, PA) ||
-        Inv.invalidate<AAManager>(F, PA) ||
-        Inv.invalidate<DominatorTreeAnalysis>(F, PA) ||
-        Inv.invalidate<AssumptionAnalysis>(F, PA))) {
+        Inv.invalidate<DominatorTreeAnalysis>(F, PA))) {
 
     // As everything depends on ScopInfo, we must drop all existing results
     for (auto &S : *SI)
Index: include/polly/ScopPass.h
===================================================================
--- include/polly/ScopPass.h
+++ include/polly/ScopPass.h
@@ -177,6 +177,7 @@
 
 struct ScopStandardAnalysisResults {
   DominatorTree &DT;
+  ScopInfo &SI;
   ScalarEvolution &SE;
   LoopInfo &LI;
   RegionInfo &RI;
@@ -210,14 +211,15 @@
     if (Scops.empty())
       return PA;
 
-    ScopAnalysisManager &SAM =
-        AM.getResult<ScopAnalysisManagerFunctionProxy>(F).getManager();
-
     ScopStandardAnalysisResults AR = {AM.getResult<DominatorTreeAnalysis>(F),
+                                      AM.getResult<ScopInfoAnalysis>(F),
                                       AM.getResult<ScalarEvolutionAnalysis>(F),
                                       AM.getResult<LoopAnalysis>(F),
                                       AM.getResult<RegionInfoAnalysis>(F)};
 
+    ScopAnalysisManager &SAM =
+        AM.getResult<ScopAnalysisManagerFunctionProxy>(F).getManager();
+
     SmallPriorityWorklist<Scop *, 4> Worklist;
     SPMUpdater Updater{Worklist, SAM};
 
@@ -235,6 +237,12 @@
 
     PA.preserveSet<AllAnalysesOn<Scop>>();
     PA.preserve<ScopAnalysisManagerFunctionProxy>();
+    PA.preserve<DominatorTreeAnalysis>();
+    PA.preserve<ScopAnalysis>();
+    PA.preserve<ScopInfoAnalysis>();
+    PA.preserve<ScalarEvolutionAnalysis>();
+    PA.preserve<LoopAnalysis>();
+    PA.preserve<RegionInfoAnalysis>();
     return PA;
   }
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D36216.109324.patch
Type: text/x-patch
Size: 2362 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170802/5583863c/attachment.bin>


More information about the llvm-commits mailing list