[all-commits] [llvm/llvm-project] dee70a: [TableGen] Generate `getRegClassFromMatchKind()` f...

Alexander Richardson via All-commits all-commits at lists.llvm.org
Tue Aug 4 12:55:38 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: dee70a0fc948ce9060f4225ee5b707af4287e5dc
      https://github.com/llvm/llvm-project/commit/dee70a0fc948ce9060f4225ee5b707af4287e5dc
  Author: Alexander Richardson <alexrichardson at google.com>
  Date:   2026-08-04 (Tue, 04 Aug 2026)

  Changed paths:
    M llvm/lib/Target/AVR/AsmParser/AVRAsmParser.cpp
    M llvm/lib/Target/BPF/AsmParser/BPFAsmParser.cpp
    M llvm/lib/Target/Lanai/AsmParser/LanaiAsmParser.cpp
    M llvm/lib/Target/M68k/AsmParser/M68kAsmParser.cpp
    M llvm/lib/Target/MSP430/AsmParser/MSP430AsmParser.cpp
    M llvm/lib/Target/Mips/AsmParser/MipsAsmParser.cpp
    M llvm/lib/Target/PowerPC/AsmParser/PPCAsmParser.cpp
    M llvm/lib/Target/SystemZ/AsmParser/SystemZAsmParser.cpp
    M llvm/lib/Target/VE/AsmParser/VEAsmParser.cpp
    M llvm/lib/Target/WebAssembly/AsmParser/WebAssemblyAsmParser.cpp
    A llvm/test/TableGen/getRegClassFromMatchKind.td
    M llvm/utils/TableGen/AsmMatcherEmitter.cpp

  Log Message:
  -----------
  [TableGen] Generate `getRegClassFromMatchKind()` for AsmMatchers

This helper can be useful in validateTargetOperandClass to get the
MCRegisterClass for the MCK_* enum.
Migrate the RVY logic to use this new generated function. Checking all
register classes instead of just the RVY ones will marginally slow down
validateTargetOperandClass, but since this is already a slow path it
should not matter.

If multiple RegisterOperands share a ParserMatchClass but map to different
RegisterClasses, omit them from the generated getRegClassFromMatchKind
mapping function. I originally tried to emit an error here, but it turns
out there are many targets that rely on sharing the ParserMatchClass with
different (but similar) RegisterClasses so ignoring them is safer.

Reviewed By: lenary

Pull Request: https://github.com/llvm/llvm-project/pull/200453



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