[llvm] [Support][NFCI] Store DomTree children as linked list (PR #176409)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Sat Jan 17 09:33:21 PST 2026


================
@@ -60,25 +60,45 @@ template <class NodeT> class DomTreeNodeBase {
   NodeT *TheBB;
   DomTreeNodeBase *IDom;
   unsigned Level;
-  SmallVector<DomTreeNodeBase *, 4> Children;
+  DomTreeNodeBase *FirstChild = nullptr;
+  DomTreeNodeBase *Sibling = nullptr;
+  DomTreeNodeBase **AppendPtr = &FirstChild;
----------------
nikic wrote:

Agree with @aengelke that extracting the rather trivial list handling is just going to make this code more complex and harder to modify in the future.

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


More information about the llvm-commits mailing list