[llvm] [DomTreeUpdater] Handle critical edge splitting (PR #100856)

Jakub Kuderski via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 5 20:17:14 PDT 2024


================
@@ -243,6 +267,35 @@ class GenericDomTreeUpdater {
   /// Drop all updates applied by all available trees and delete BasicBlocks if
   /// all available trees are up-to-date.
   void dropOutOfDateUpdates();
+
+private:
+  /// Helper structure used to hold all the basic blocks
+  /// involved in the split of a critical edge.
+  struct CriticalEdge {
+    BasicBlockT *FromBB;
+    BasicBlockT *ToBB;
+    BasicBlockT *NewBB;
+  };
+
+  /// Pile up all the critical edges to be split.
+  /// The splitting of a critical edge is local and thus, it is possible
+  /// to apply several of those changes at the same time.
+  SmallVector<CriticalEdge, 32> CriticalEdgesToSplit;
----------------
kuhar wrote:

If this is local, what's the benefit of enqueuing critical edge updates vs. performing them eagerly?

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


More information about the llvm-commits mailing list