[all-commits] [llvm/llvm-project] ed4ed6: [GlobalISel] Do not depend on the RuleMatcher at M...

Pierre van Houtryve via All-commits all-commits at lists.llvm.org
Thu Jun 4 03:31:46 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: ed4ed6f41e94e24035e07406af737502a8e149a6
      https://github.com/llvm/llvm-project/commit/ed4ed6f41e94e24035e07406af737502a8e149a6
  Author: Pierre van Houtryve <pierre.vanhoutryve at amd.com>
  Date:   2026-06-04 (Thu, 04 Jun 2026)

  Changed paths:
    M llvm/utils/TableGen/Common/GlobalISel/MatchTable/Matchers.cpp
    M llvm/utils/TableGen/Common/GlobalISel/MatchTable/Matchers.h
    M llvm/utils/TableGen/GlobalISelCombinerEmitter.cpp
    M llvm/utils/TableGen/GlobalISelEmitter.cpp

  Log Message:
  -----------
  [GlobalISel] Do not depend on the RuleMatcher at MatchTable emission (#200799)

Some PredicateMatchers/MatchAction/OperandRenderers relied on accessing
RuleMatcher at emission as a crutch.
Instead, make these classes collect all necessary information in the
constructor so the `emit` methods don't depend on RuleMatcher anymore.

The primary motivation for this is that I've been looking at ways to
optimize the MatchTable better,
and the fact that Predicates/Actions/Renderers are not "pure" objects,
in the sense that they keep
accessing a bunch of data all over the place even as late as emission,
was a consistent pain.

This is NFCI. There are no changes to any of the match table for
AMDGPU/AArch64 in this patch.

This patch has a bunch of noise due to function signature changes so
I'll highlight the following interesting changes:
- `SameOperandMatcher` needed a bit of an update in its
`canHoistOutsideOf` function. I had to rewrite it
  but I think the end result is the same.
- `EraseInstAction` has been updated as well, and its users in both
Combiner/ISel backends have been updated to.
Instead of ignoring this action if the Inst was already erased, it's now
the responsibility of the
builder to never insert it in the first place. `BuildMIAction` had a
small update because of that too.

Assisted-By: Claude Sonnet 4.6
Context-of-Use: I used Claude to mass-remove the `RuleMatcher&`
arguments from the `emitPredicateOpcode`
methods. It did not write any logic.

Co-authored-by: Pierre-vh <29600849+Pierre-vh at users.noreply.github.com>



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