[llvm] [X86] Remove X86RegisterInfo::getSEHRegNum. (PR #106866)

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Sat Aug 31 11:32:36 PDT 2024


https://github.com/topperc created https://github.com/llvm/llvm-project/pull/106866

As far as I can tell, there's no way to call this. There are no calls in the X86 directory. It has the same name as a function in MCRegisterInfo, but that function takes a MCRegister and isn't virtual.

The function in MCRegisterInfo uses a DenseMap populated by `X86_MC::initLLVMToSEHAndCVRegMapping`. The DenseMap is populated for every physical register using the encoding value. I think that means the function in MCRegisterInfo would return the same value as the function in X86RegisterInfo.

>From cb2765bf3efa2bc8a1687204f6145d04f38d7af5 Mon Sep 17 00:00:00 2001
From: Craig Topper <craig.topper at sifive.com>
Date: Sat, 31 Aug 2024 11:24:55 -0700
Subject: [PATCH] [X86] Remove X86RegisterInfo::getSEHRegNum.

As far as I can tell, there's no way to call this. There are no
calls in the X86 directory. It has the same name as a function
in MCRegisterInfo, but that function takes a MCRegister and isn't
virtual.

The function in MCRegisterInfo uses a DenseMap populated by
initLLVMToSEHAndCVRegMapping. The DenseMap is populated for every
physical register using the encoding value. I think that means
the function in MCRegisterInfo would return the same value as the
function in X86RegisterInfo.
---
 llvm/lib/Target/X86/X86RegisterInfo.cpp | 5 -----
 llvm/lib/Target/X86/X86RegisterInfo.h   | 3 ---
 2 files changed, 8 deletions(-)

diff --git a/llvm/lib/Target/X86/X86RegisterInfo.cpp b/llvm/lib/Target/X86/X86RegisterInfo.cpp
index 638eb1c4f11e41..1d8808f4e2b7d0 100644
--- a/llvm/lib/Target/X86/X86RegisterInfo.cpp
+++ b/llvm/lib/Target/X86/X86RegisterInfo.cpp
@@ -83,11 +83,6 @@ X86RegisterInfo::X86RegisterInfo(const Triple &TT)
   }
 }
 
-int
-X86RegisterInfo::getSEHRegNum(unsigned i) const {
-  return getEncodingValue(i);
-}
-
 const TargetRegisterClass *
 X86RegisterInfo::getSubClassWithSubReg(const TargetRegisterClass *RC,
                                        unsigned Idx) const {
diff --git a/llvm/lib/Target/X86/X86RegisterInfo.h b/llvm/lib/Target/X86/X86RegisterInfo.h
index 7296a5f021e4ad..2f73698a4b94d3 100644
--- a/llvm/lib/Target/X86/X86RegisterInfo.h
+++ b/llvm/lib/Target/X86/X86RegisterInfo.h
@@ -54,9 +54,6 @@ class X86RegisterInfo final : public X86GenRegisterInfo {
   /// Return the number of registers for the function.
   unsigned getNumSupportedRegs(const MachineFunction &MF) const override;
 
-  // FIXME: This should be tablegen'd like getDwarfRegNum is
-  int getSEHRegNum(unsigned i) const;
-
   /// getMatchingSuperRegClass - Return a subclass of the specified register
   /// class A so that each register in it has a sub-register of the
   /// specified sub-register index which is in the specified register class B.



More information about the llvm-commits mailing list