[llvm] bf927b2 - [NFC][SPIR-V] Remove unused SPIRVGlobalRegistry methods (#214270)

via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 7 06:58:37 PDT 2026


Author: Arseniy Obolenskiy
Date: 2026-08-07T15:58:31+02:00
New Revision: bf927b2c4029d0f29ec32c99d6d689efa09edff1

URL: https://github.com/llvm/llvm-project/commit/bf927b2c4029d0f29ec32c99d6d689efa09edff1
DIFF: https://github.com/llvm/llvm-project/commit/bf927b2c4029d0f29ec32c99d6d689efa09edff1.diff

LOG: [NFC][SPIR-V] Remove unused SPIRVGlobalRegistry methods (#214270)

Added: 
    

Modified: 
    llvm/lib/Target/SPIRV/SPIRVGlobalRegistry.cpp
    llvm/lib/Target/SPIRV/SPIRVGlobalRegistry.h

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/SPIRV/SPIRVGlobalRegistry.cpp b/llvm/lib/Target/SPIRV/SPIRVGlobalRegistry.cpp
index b2c941db99736..4c99c5cee6ba6 100644
--- a/llvm/lib/Target/SPIRV/SPIRVGlobalRegistry.cpp
+++ b/llvm/lib/Target/SPIRV/SPIRVGlobalRegistry.cpp
@@ -107,24 +107,6 @@ SPIRVGlobalRegistry::assignIntTypeToVReg(unsigned BitWidth, Register VReg,
   return SpirvType;
 }
 
-SPIRVTypeInst
-SPIRVGlobalRegistry::assignFloatTypeToVReg(unsigned BitWidth, Register VReg,
-                                           MachineInstr &I,
-                                           const SPIRVInstrInfo &TII) {
-  SPIRVTypeInst SpirvType = getOrCreateSPIRVFloatType(BitWidth, I, TII);
-  assignSPIRVTypeToVReg(SpirvType, VReg, *CurMF);
-  return SpirvType;
-}
-
-SPIRVTypeInst SPIRVGlobalRegistry::assignVectTypeToVReg(
-    SPIRVTypeInst BaseType, unsigned NumElements, Register VReg,
-    MachineInstr &I, const SPIRVInstrInfo &TII) {
-  SPIRVTypeInst SpirvType =
-      getOrCreateSPIRVVectorType(BaseType, NumElements, I, TII);
-  assignSPIRVTypeToVReg(SpirvType, VReg, *CurMF);
-  return SpirvType;
-}
-
 SPIRVTypeInst SPIRVGlobalRegistry::assignTypeToVReg(
     const Type *Type, Register VReg, MachineIRBuilder &MIRBuilder,
     SPIRV::AccessQualifier::AccessQualifier AccessQual, bool EmitIR) {
@@ -1085,16 +1067,6 @@ SPIRVTypeInst SPIRVGlobalRegistry::getOpTypePointer(
   });
 }
 
-SPIRVTypeInst SPIRVGlobalRegistry::getOpTypeForwardPointer(
-    SPIRV::StorageClass::StorageClass SC, MachineIRBuilder &MIRBuilder) {
-  return createConstOrTypeAtFunctionEntry(MIRBuilder, [&](MachineIRBuilder
-                                                              &MIRBuilder) {
-    return MIRBuilder.buildInstr(SPIRV::OpTypeForwardPointer)
-        .addUse(createTypeVReg(MIRBuilder))
-        .addImm(static_cast<uint32_t>(SC));
-  });
-}
-
 SPIRVTypeInst SPIRVGlobalRegistry::getOpTypeFunction(
     const FunctionType *Ty, SPIRVTypeInst RetType,
     const SmallVectorImpl<SPIRVTypeInst> &ArgTypes,
@@ -1482,11 +1454,6 @@ SPIRVTypeInst SPIRVGlobalRegistry::getPointeeType(SPIRVTypeInst PtrType) {
              : nullptr;
 }
 
-unsigned SPIRVGlobalRegistry::getPointeeTypeOp(Register PtrReg) {
-  SPIRVTypeInst ElemType = getPointeeType(getSPIRVTypeForVReg(PtrReg));
-  return ElemType ? ElemType->getOpcode() : 0;
-}
-
 bool SPIRVGlobalRegistry::isBitcastCompatible(SPIRVTypeInst Type1,
                                               SPIRVTypeInst Type2) const {
   if (!Type1 || !Type2)

diff  --git a/llvm/lib/Target/SPIRV/SPIRVGlobalRegistry.h b/llvm/lib/Target/SPIRV/SPIRVGlobalRegistry.h
index b52ca5dc5f5b7..6ff6cdf769b8d 100644
--- a/llvm/lib/Target/SPIRV/SPIRVGlobalRegistry.h
+++ b/llvm/lib/Target/SPIRV/SPIRVGlobalRegistry.h
@@ -289,13 +289,6 @@ class SPIRVGlobalRegistry : public SPIRVIRMapping {
                                  bool EmitIR);
   SPIRVTypeInst assignIntTypeToVReg(unsigned BitWidth, Register VReg,
                                     MachineInstr &I, const SPIRVInstrInfo &TII);
-  SPIRVTypeInst assignFloatTypeToVReg(unsigned BitWidth, Register VReg,
-                                      MachineInstr &I,
-                                      const SPIRVInstrInfo &TII);
-  SPIRVTypeInst assignVectTypeToVReg(SPIRVTypeInst BaseType,
-                                     unsigned NumElements, Register VReg,
-                                     MachineInstr &I,
-                                     const SPIRVInstrInfo &TII);
 
   // In cases where the SPIR-V type is already known, this function can be
   // used to map it to the given VReg.
@@ -329,8 +322,6 @@ class SPIRVGlobalRegistry : public SPIRVIRMapping {
 
   // Return a pointee's type, or nullptr otherwise.
   SPIRVTypeInst getPointeeType(SPIRVTypeInst PtrType);
-  // Return a pointee's type op code, or 0 otherwise.
-  unsigned getPointeeTypeOp(Register PtrReg);
 
   // Either generate a new OpTypeXXX instruction or return an existing one
   // corresponding to the given string containing the name of the builtin type.
@@ -352,11 +343,6 @@ class SPIRVGlobalRegistry : public SPIRVIRMapping {
   // Return the result type of the instruction defining the register.
   SPIRVTypeInst getResultType(Register VReg, MachineFunction *MF = nullptr);
 
-  // Whether the given VReg has a SPIR-V type mapped to it yet.
-  bool hasSPIRVTypeForVReg(Register VReg) const {
-    return getSPIRVTypeForVReg(VReg) != nullptr;
-  }
-
   // Return the VReg holding the result of the given OpTypeXXX instruction.
   Register getSPIRVTypeID(SPIRVTypeInst SpirvType) const;
 
@@ -470,9 +456,6 @@ class SPIRVGlobalRegistry : public SPIRVIRMapping {
                                  SPIRVTypeInst ElemType,
                                  MachineIRBuilder &MIRBuilder, Register Reg);
 
-  SPIRVTypeInst getOpTypeForwardPointer(SPIRV::StorageClass::StorageClass SC,
-                                        MachineIRBuilder &MIRBuilder);
-
   SPIRVTypeInst
   getOpTypeFunction(const FunctionType *Ty, SPIRVTypeInst RetType,
                     const SmallVectorImpl<SPIRVTypeInst> &ArgTypes,


        


More information about the llvm-commits mailing list