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

via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 5 23:37:47 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;
----------------
paperchalice wrote:

Tested with bzip2:
<details>
```sh
maximum: 92
average: 8.70909
```
Most will not exceed 7.
</details>

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


More information about the llvm-commits mailing list