[llvm-branch-commits] [llvm] AMDGPU: Remove override of TargetInstrInfo::getRegClass (PR #159886)
Matt Arsenault via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Wed Oct 22 03:55:14 PDT 2025
https://github.com/arsenm updated https://github.com/llvm/llvm-project/pull/159886
>From ea0b9ab4f2fc7811fc38fbe9b4fcd9993478564c Mon Sep 17 00:00:00 2001
From: Matt Arsenault <Matthew.Arsenault at amd.com>
Date: Thu, 18 Sep 2025 08:54:13 +0900
Subject: [PATCH] AMDGPU: Remove override of TargetInstrInfo::getRegClass
This should not be overridable and the special case hacks
have been replaced with RegClassByHwMode
---
llvm/lib/Target/AMDGPU/SIInstrInfo.cpp | 13 -------------
llvm/lib/Target/AMDGPU/SIInstrInfo.h | 4 ----
2 files changed, 17 deletions(-)
diff --git a/llvm/lib/Target/AMDGPU/SIInstrInfo.cpp b/llvm/lib/Target/AMDGPU/SIInstrInfo.cpp
index 98b9a336c1bd8..dd705230314e1 100644
--- a/llvm/lib/Target/AMDGPU/SIInstrInfo.cpp
+++ b/llvm/lib/Target/AMDGPU/SIInstrInfo.cpp
@@ -6021,19 +6021,6 @@ SIInstrInfo::getWholeWaveFunctionSetup(MachineFunction &MF) const {
llvm_unreachable("Couldn't find SI_SETUP_WHOLE_WAVE_FUNC instruction");
}
-// FIXME: This should not be an overridable function. All subtarget dependent
-// operand modifications should go through isLookupRegClassByHwMode in the
-// generic handling.
-const TargetRegisterClass *
-SIInstrInfo::getRegClass(const MCInstrDesc &TID, unsigned OpNum,
- const TargetRegisterInfo *TRI) const {
- if (OpNum >= TID.getNumOperands())
- return nullptr;
- const MCOperandInfo &OpInfo = TID.operands()[OpNum];
- int16_t RegClass = getOpRegClassID(OpInfo);
- return RegClass < 0 ? nullptr : RI.getRegClass(RegClass);
-}
-
const TargetRegisterClass *SIInstrInfo::getOpRegClass(const MachineInstr &MI,
unsigned OpNo) const {
const MCInstrDesc &Desc = get(MI.getOpcode());
diff --git a/llvm/lib/Target/AMDGPU/SIInstrInfo.h b/llvm/lib/Target/AMDGPU/SIInstrInfo.h
index e1d7a07b0d169..55de771607140 100644
--- a/llvm/lib/Target/AMDGPU/SIInstrInfo.h
+++ b/llvm/lib/Target/AMDGPU/SIInstrInfo.h
@@ -1576,10 +1576,6 @@ class SIInstrInfo final : public AMDGPUGenInstrInfo {
/// Return true if this opcode should not be used by codegen.
bool isAsmOnlyOpcode(int MCOp) const;
- const TargetRegisterClass *
- getRegClass(const MCInstrDesc &TID, unsigned OpNum,
- const TargetRegisterInfo *TRI) const override;
-
void fixImplicitOperands(MachineInstr &MI) const;
MachineInstr *foldMemoryOperandImpl(MachineFunction &MF, MachineInstr &MI,
More information about the llvm-branch-commits
mailing list