[all-commits] [llvm/llvm-project] 53504f: [TableGen] Support HwMode registers in CompressIns...

Alexander Richardson via All-commits all-commits at lists.llvm.org
Tue Sep 29 16:16:15 PDT 2026


  Branch: refs/heads/users/arichardson/spr/tablegen-support-hwmode-registers-in-compressinstemitter
  Home:   https://github.com/llvm/llvm-project
  Commit: 53504f5bec61abe417291f1f13a5799f94196ea6
      https://github.com/llvm/llvm-project/commit/53504f5bec61abe417291f1f13a5799f94196ea6
  Author: Alex Richardson <alexrichardson at google.com>
  Date:   2026-09-29 (Tue, 29 Sep 2026)

  Changed paths:
    M llvm/test/TableGen/RegClassByHwModeCompressPat.td
    A llvm/test/TableGen/RegClassByHwModeCompressPat4Modes.td
    A llvm/test/TableGen/RegClassByHwModeCompressPatError.td
    M llvm/utils/TableGen/Common/CodeGenHwModes.cpp
    M llvm/utils/TableGen/Common/CodeGenHwModes.h
    M llvm/utils/TableGen/Common/SubtargetFeatureInfo.cpp
    M llvm/utils/TableGen/Common/SubtargetFeatureInfo.h
    M llvm/utils/TableGen/CompressInstEmitter.cpp

  Log Message:
  -----------
  [TableGen] Support HwMode registers in CompressInstEmitter

Previously, CompressInstEmitter only handled plain Register and
RegisterClass records when matching and validating operands in
CompressPat definitions. Attempting to use a RegisterByHwMode (such as a
mode-dependent stack pointer) or a RegClassByHwMode with mode-dependent
registers failed because CompressInstEmitter could not resolve the
underlying register or register class for a given subtarget configuration.

Introduce HwModePredicates in CodeGenHwModes to resolve HwModeSelect
records using the subtarget features required by a CompressPat (with
predicates implying the absence of all non-default modes resolving to
DefaultMode). This allows using a single instruction definition for
compressed instructions like RISC-V C_ADDI4SPN/C_ADDI16SP across HwModes
instead of duplicating the instruction definitions for each mode.

This commit was created with the help of AI tools



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