[PATCH] D58369: [Dominators] Delete UpdateLevelsAfterInsertion in edge insertion of depth-based search for release builds

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 19 18:35:00 PST 2019


This revision was automatically updated to reflect the committed changes.
Closed by commit rL354429: [Dominators] Delete UpdateLevelsAfterInsertion in edge insertion of depth-based… (authored by MaskRay, committed by ).

Changed prior to commit:
  https://reviews.llvm.org/D58369?vs=187482&id=187489#toc

Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D58369/new/

https://reviews.llvm.org/D58369

Files:
  llvm/trunk/include/llvm/Support/GenericDomTreeConstruction.h


Index: llvm/trunk/include/llvm/Support/GenericDomTreeConstruction.h
===================================================================
--- llvm/trunk/include/llvm/Support/GenericDomTreeConstruction.h
+++ llvm/trunk/include/llvm/Support/GenericDomTreeConstruction.h
@@ -632,7 +632,9 @@
         Bucket;
     SmallDenseSet<TreeNodePtr, 8> Visited;
     SmallVector<TreeNodePtr, 8> Affected;
-    SmallVector<TreeNodePtr, 8> VisitedNotAffectedQueue;
+#ifndef NDEBUG
+    SmallVector<TreeNodePtr, 8> VisitedUnaffected;
+#endif
   };
 
   static void InsertEdge(DomTreeT &DT, const BatchUpdatePtr BUI,
@@ -800,8 +802,10 @@
             // vertices. Store it in UnaffectedOnCurrentLevel.
             LLVM_DEBUG(dbgs() << "\t\tMarking visited not affected "
                               << BlockNamePrinter(Succ) << "\n");
-            II.VisitedNotAffectedQueue.push_back(SuccTN);
             UnaffectedOnCurrentLevel.push_back(SuccTN);
+#ifndef NDEBUG
+            II.VisitedUnaffected.push_back(SuccTN);
+#endif
           } else {
             // The condition is satisfied (Succ is affected). Add Succ to the
             // bucket queue.
@@ -833,20 +837,13 @@
       TN->setIDom(NCD);
     }
 
-    UpdateLevelsAfterInsertion(II);
-    if (IsPostDom) UpdateRootsAfterUpdate(DT, BUI);
-  }
+#ifndef NDEBUG
+    for (const TreeNodePtr TN : II.VisitedUnaffected)
+      assert(TN->getLevel() == TN->getIDom()->getLevel() + 1 &&
+             "TN should have been updated by an affected ancestor");
+#endif
 
-  static void UpdateLevelsAfterInsertion(InsertionInfo &II) {
-    LLVM_DEBUG(
-        dbgs() << "Updating levels for visited but not affected nodes\n");
-
-    for (const TreeNodePtr TN : II.VisitedNotAffectedQueue) {
-      LLVM_DEBUG(dbgs() << "\tlevel(" << BlockNamePrinter(TN) << ") = ("
-                        << BlockNamePrinter(TN->getIDom()) << ") "
-                        << TN->getIDom()->getLevel() << " + 1\n");
-      TN->UpdateLevel();
-    }
+    if (IsPostDom) UpdateRootsAfterUpdate(DT, BUI);
   }
 
   // Handles insertion to previously unreachable nodes.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D58369.187489.patch
Type: text/x-patch
Size: 2090 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190220/997ccfdd/attachment.bin>


More information about the llvm-commits mailing list