[all-commits] [llvm/llvm-project] 3daa54: [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:29:50 PDT 2026


  Branch: refs/heads/users/pierre-vh/no-rulematcher-at-emit
  Home:   https://github.com/llvm/llvm-project
  Commit: 3daa545651897f8107b04d2a9b04dbbe95867cf3
      https://github.com/llvm/llvm-project/commit/3daa545651897f8107b04d2a9b04dbbe95867cf3
  Author: Pierre-vh <29600849+Pierre-vh at users.noreply.github.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.



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