[llvm] [DomTreeUpdater] Move critical edge splitting code to updater (PR #115111)

via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 18 21:01:40 PST 2024


================
@@ -250,12 +270,23 @@ void GenericDomTreeUpdater<DerivedT, DomTreeT,
     return;
 
   // Only apply updates not are applied by DomTree.
-  if (hasPendingDomTreeUpdates()) {
-    const auto I = PendUpdates.begin() + PendDTUpdateIndex;
+  while (hasPendingDomTreeUpdates()) {
+    auto I = PendUpdates.begin() + PendDTUpdateIndex;
     const auto E = PendUpdates.end();
     assert(I < E && "Iterator range invalid; there should be DomTree updates.");
-    DT->applyUpdates(ArrayRef<typename DomTreeT::UpdateType>(I, E));
-    PendDTUpdateIndex = PendUpdates.size();
+    if (!I->IsCriticalEdgeSplit) {
+      SmallVector<UpdateT, 32> NormalUpdates;
+      while (I != E && !I->IsCriticalEdgeSplit)
+        NormalUpdates.push_back((I++)->Update);
+      DT->applyUpdates(NormalUpdates);
+      PendDTUpdateIndex += NormalUpdates.size();
+    } else {
+      SmallVector<CriticalEdge, 32> CriticalEdges;
----------------
paperchalice wrote:

Context: https://github.com/llvm/llvm-project/pull/100856#discussion_r1704987237

https://github.com/llvm/llvm-project/pull/115111


More information about the llvm-commits mailing list