[llvm] [NFCI][AMDGPU] Remove more redundant code from `GCNSubtarget.h` (PR #177297)

via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 21 18:07:12 PST 2026


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-backend-amdgpu

Author: Shilei Tian (shiltian)

<details>
<summary>Changes</summary>



---
Full diff: https://github.com/llvm/llvm-project/pull/177297.diff


2 Files Affected:

- (modified) llvm/lib/Target/AMDGPU/AMDGPU.td (+3-4) 
- (modified) llvm/lib/Target/AMDGPU/GCNSubtarget.h (+8-29) 


``````````diff
diff --git a/llvm/lib/Target/AMDGPU/AMDGPU.td b/llvm/lib/Target/AMDGPU/AMDGPU.td
index 570778aecd02e..7273eb1b22939 100644
--- a/llvm/lib/Target/AMDGPU/AMDGPU.td
+++ b/llvm/lib/Target/AMDGPU/AMDGPU.td
@@ -1186,10 +1186,9 @@ defm TrigReducedRange : AMDGPUSubtargetFeature<"trig-reduced-range",
   /*GenPredicate=*/0
 >;
 
-def FeatureKernargPreload : SubtargetFeature <"kernarg-preload",
-  "KernargPreload",
-  "true",
-  "Hardware supports preloading of kernel arguments in user SGPRs."
+defm KernargPreload : AMDGPUSubtargetFeature <"kernarg-preload",
+  "Hardware supports preloading of kernel arguments in user SGPRs.",
+  /*GenPredicate=*/0
 >;
 
 // Alignment enforcement is controlled by a configuration register:
diff --git a/llvm/lib/Target/AMDGPU/GCNSubtarget.h b/llvm/lib/Target/AMDGPU/GCNSubtarget.h
index 6dbea62c24f7a..f3e0bd7849316 100644
--- a/llvm/lib/Target/AMDGPU/GCNSubtarget.h
+++ b/llvm/lib/Target/AMDGPU/GCNSubtarget.h
@@ -54,18 +54,11 @@
   X(CIInsts)                                                                   \
   X(FastDenormalF32)                                                           \
   X(GCN3Encoding)                                                              \
-  X(GFX10_3Insts)                                                              \
-  X(GFX10_AEncoding)                                                           \
-  X(GFX10_BEncoding)                                                           \
   X(GFX10Insts)                                                                \
   X(GFX11Insts)                                                                \
-  X(GFX1250Insts)                                                              \
   X(GFX12Insts)                                                                \
   X(GFX7GFX8GFX9Insts)                                                         \
   X(GFX8Insts)                                                                 \
-  X(GFX90AInsts)                                                               \
-  X(GFX940Insts)                                                               \
-  X(GFX950Insts)                                                               \
   X(GFX9Insts)                                                                 \
   X(UnalignedBufferAccess)                                                     \
   X(UnalignedScratchAccess)
@@ -147,6 +140,13 @@
   X(G16)                                                                       \
   X(GDS)                                                                       \
   X(GetWaveIdInst)                                                             \
+  X(GFX10_3Insts)                                                              \
+  X(GFX10_AEncoding)                                                           \
+  X(GFX10_BEncoding)                                                           \
+  X(GFX1250Insts)                                                              \
+  X(GFX90AInsts)                                                               \
+  X(GFX940Insts)                                                               \
+  X(GFX950Insts)                                                               \
   X(GloballyAddressableScratch)                                                \
   X(GWS)                                                                       \
   X(HalfRate64Ops)                                                             \
@@ -156,6 +156,7 @@
   X(ImageStoreD16Bug)                                                          \
   X(InstFwdPrefetchBug)                                                        \
   X(IntClamp)                                                                  \
+  X(KernargPreload)                                                            \
   X(LdsBarrierArriveAtomic)                                                    \
   X(LdsBranchVmemWARHazard)                                                    \
   X(LerpInst)                                                                  \
@@ -283,7 +284,6 @@ class GCNSubtarget final : public AMDGPUGenSubtargetInfo,
   bool AutoWaitcntBeforeBarrier = false;
   bool BackOffBarrier = false;
   bool SupportsXNACK = false;
-  bool KernargPreload = false;
 
   // This should not be used directly. 'TargetID' tracks the dynamic settings
   // for XNACK.
@@ -769,12 +769,6 @@ class GCNSubtarget final : public AMDGPUGenSubtargetInfo,
     return AMDGPU::getNSAMaxSize(*this, HasSampler);
   }
 
-  bool hasGFX10_AEncoding() const { return HasGFX10_AEncoding; }
-
-  bool hasGFX10_BEncoding() const { return HasGFX10_BEncoding; }
-
-  bool hasGFX10_3Insts() const { return HasGFX10_3Insts; }
-
   bool hasMadF16() const;
 
   bool hasMovB64() const { return HasGFX940Insts || HasGFX1250Insts; }
@@ -843,8 +837,6 @@ class GCNSubtarget final : public AMDGPUGenSubtargetInfo,
 
   bool hasHardClauses() const { return MaxHardClauseLength > 0; }
 
-  bool hasGFX90AInsts() const { return HasGFX90AInsts; }
-
   bool hasFPAtomicToDenormModeHazard() const {
     return getGeneration() == GFX10;
   }
@@ -894,14 +886,6 @@ class GCNSubtarget final : public AMDGPUGenSubtargetInfo,
   /// Return true if the target has the S_DELAY_ALU instruction.
   bool hasDelayAlu() const { return HasGFX11Insts; }
 
-  // GFX94* is a derivation to GFX90A. hasGFX940Insts() being true implies that
-  // hasGFX90AInsts is also true.
-  bool hasGFX940Insts() const { return HasGFX940Insts; }
-
-  // GFX950 is a derivation to GFX94*. hasGFX950Insts() implies that
-  // hasGFX940Insts and hasGFX90AInsts are also true.
-  bool hasGFX950Insts() const { return HasGFX950Insts; }
-
   /// Returns true if the target supports
   /// global_load_lds_dwordx3/global_load_lds_dwordx4 or
   /// buffer_load_dwordx3/buffer_load_dwordx4 with the lds bit.
@@ -977,9 +961,6 @@ class GCNSubtarget final : public AMDGPUGenSubtargetInfo,
   // \returns true if the target supports the pre-NGG legacy geometry path.
   bool hasLegacyGeometry() const { return getGeneration() < GFX11; }
 
-  // \returns true if preloading kernel arguments is supported.
-  bool hasKernargPreload() const { return KernargPreload; }
-
   // \returns true if the target has split barriers feature
   bool hasSplitBarriers() const { return getGeneration() >= GFX12; }
 
@@ -996,8 +977,6 @@ class GCNSubtarget final : public AMDGPUGenSubtargetInfo,
   /// values.
   bool hasSignedScratchOffsets() const { return getGeneration() >= GFX12; }
 
-  bool hasGFX1250Insts() const { return HasGFX1250Insts; }
-
   bool hasINVWBL2WaitCntRequirement() const { return HasGFX1250Insts; }
 
   bool hasVOPD3() const { return HasGFX1250Insts; }

``````````

</details>


https://github.com/llvm/llvm-project/pull/177297


More information about the llvm-commits mailing list