[llvm] [DominanceFrontier] Support multiple root nodes for post-dom (PR #181257)
Luke Lau via llvm-commits
llvm-commits at lists.llvm.org
Fri Feb 20 09:07:42 PST 2026
================
@@ -101,16 +101,11 @@ class DominanceFrontierBase {
#endif
void analyze(DomTreeT &DT) {
- assert((IsPostDom || DT.root_size() == 1) &&
----------------
lukel97 wrote:
I would have added the assert in it until we had some multi-entry IR form that we could test with. That way when someone does implement such an IR and uses a DominanceFrontier on it, they would hit the assert and be reminded to add tests.
But for the case in this PR, I'm also noticing we have the `assert(IsPostDom && "For forward frontiers only root node` on DominanceFrontierImpl.h line 139. So I think we would just end up hitting a different assert with multi entry forward domfront.
I'm happy if we want to relax this so that we don't assert at all for forward domfronts, but if we do want to restrict it then we should keep the existing earlier assert instead of asserting later
https://github.com/llvm/llvm-project/pull/181257
More information about the llvm-commits
mailing list