[all-commits] [llvm/llvm-project] 23374f: Reapply "[TableGen] Reduce number of call to Facto...

Craig Topper via All-commits all-commits at lists.llvm.org
Sun Feb 15 21:01:01 PST 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 23374f95ed1362cfcabcb1a1a95bc81fc58b70b9
      https://github.com/llvm/llvm-project/commit/23374f95ed1362cfcabcb1a1a95bc81fc58b70b9
  Author: Craig Topper <craig.topper at sifive.com>
  Date:   2026-02-15 (Sun, 15 Feb 2026)

  Changed paths:
    M llvm/utils/TableGen/DAGISelMatcher.h
    M llvm/utils/TableGen/DAGISelMatcherOpt.cpp

  Log Message:
  -----------
  Reapply "[TableGen] Reduce number of call to FactorNodes. NFC"

With more fixes to avoid deferencing a before_begin iterator.

Original commit message:

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