[llvm] [Support] Store dominator tree nodes in a vector (PR #101705)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 2 11:32:01 PDT 2024


================
@@ -258,37 +258,40 @@ class DominatorTreeBase {
   // Dominators always have a single root, postdominators can have more.
   SmallVector<NodeT *, IsPostDom ? 4 : 1> Roots;
 
-  using DomTreeNodeMapType =
-     DenseMap<NodeT *, std::unique_ptr<DomTreeNodeBase<NodeT>>>;
-  DomTreeNodeMapType DomTreeNodes;
+  using DomTreeNodeStorageTy =
+      SmallVector<std::unique_ptr<DomTreeNodeBase<NodeT>>>;
+  DomTreeNodeStorageTy DomTreeNodes;
+  // For graphs where block don't have numbers, create a numbering here.
----------------
nikic wrote:

```suggestion
  // For graphs where blocks don't have numbers, create a numbering here.
```

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


More information about the llvm-commits mailing list