[llvm] [DominanceFrontier] Support multiple root nodes for post-dom (PR #181257)

Luke Lau via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 2 04:44:35 PST 2026


================
@@ -90,13 +95,16 @@ void DominanceFrontierBase<BlockT, IsPostDom>::calculate(
     BlockT *parentBB = currentW->parentBB;
     const DomTreeNodeT *currentNode = currentW->Node;
     const DomTreeNodeT *parentNode = currentW->parentNode;
-    assert(currentBB && "Invalid work object. Missing current Basic Block");
     assert(currentNode && "Invalid work object. Missing current Node");
----------------
lukel97 wrote:

Nit, keep the currentBB assert but relax it to only when the DT node is virtual

```suggestion
    assert(currentNode && "Invalid work object. Missing current Node");
    assert((currentBB || DT.isVirtualRoot(CurrentNode)) && "Invalid work object. Missing current Basic Block");
```

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


More information about the llvm-commits mailing list