[all-commits] [llvm/llvm-project] 3ec6ca: [TableGen] Reduce number of call to FactorNodes. NFC
Craig Topper via All-commits
all-commits at lists.llvm.org
Sun Feb 15 17:02:06 PST 2026
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 3ec6ca7d58c4a1a7ee68df41388d71c4e4b858d0
https://github.com/llvm/llvm-project/commit/3ec6ca7d58c4a1a7ee68df41388d71c4e4b858d0
Author: Craig Topper <craig.topper at sifive.com>
Date: 2026-02-15 (Sun, 15 Feb 2026)
Changed paths:
M llvm/utils/TableGen/DAGISelMatcherOpt.cpp
Log Message:
-----------
[TableGen] Reduce number of call to FactorNodes. NFC
Previously we recursively called FactorNodes all the way down the
tree any time FactorNodes was called. Additionally, on returning
from the recursiion we would flatten any child ScopeMatchers into
the parent.
There are additional calls to FactorNodes every time a new ScopeMatcher
is created. These calls cause a lot of visiting of parts of the tree that
have already been factored as much as possible.
We can remove the primary recursion by ensuring we flatten
scopes when building a new ScopeMatcher. If the Matcher we are
going to insert into the new ScopeMatcher is itself a ScopeMatcher,
we add the children into the new ScopeMatcher instead. This makes
the FactorNodes call for the newly created scope more powerful
eliminating the need for the recursion.
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list