[llvm] [AMDGPU][NFC] Add CuModeOnly feature (PR #201134)

via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 2 07:43:55 PDT 2026


llvmorg-github-actions[bot] wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-backend-amdgpu

Author: Mariusz Sikora (mariusz-sikora-at-amd)

<details>
<summary>Changes</summary>

Introduce a dedicated subtarget feature for targets that only support CU mode. Use it instead of isGFX1250.

GFX13 can support both CU and WGP modes while still exposing GFX1250 instructions, so checking isGFX1250 is not specific enough for CU-mode-only behavior.

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


2 Files Affected:

- (modified) llvm/lib/Target/AMDGPU/AMDGPU.td (+8-1) 
- (modified) llvm/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.cpp (+1-1) 


``````````diff
diff --git a/llvm/lib/Target/AMDGPU/AMDGPU.td b/llvm/lib/Target/AMDGPU/AMDGPU.td
index 73321dabf4af2..a3f4d82c8d7dd 100644
--- a/llvm/lib/Target/AMDGPU/AMDGPU.td
+++ b/llvm/lib/Target/AMDGPU/AMDGPU.td
@@ -236,6 +236,13 @@ def FeatureCuMode : SubtargetFeature<"cumode",
   "Enable CU wavefront execution mode"
 >;
 
+defm CuModeOnly : AMDGPUSubtargetFeature<"cumode-only",
+  "Target supports only CU mode",
+  /*GenPredicate=*/1,
+  /*GenAssemblerPredicate=*/1,
+  [FeatureCuMode]
+>;
+
 def FeaturePreciseMemory
     : SubtargetFeature<"precise-memory", "EnablePreciseMemory",
                        "true", "Enable precise memory mode">;
@@ -2094,7 +2101,7 @@ def FeatureISAVersion12_50_Common : FeatureSet<
    FeatureGFX1250Insts,
    FeatureBackOffBarrier,
    FeatureRequiresAlignedVGPRs,
-   FeatureCuMode,
+   FeatureCuModeOnly,
    Feature1024AddressableVGPRs,
    Feature64BitLiterals,
    FeatureLDSBankCount32,
diff --git a/llvm/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.cpp b/llvm/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.cpp
index 33df51e8a7e07..7cbb20fac0683 100644
--- a/llvm/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.cpp
+++ b/llvm/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.cpp
@@ -1246,7 +1246,7 @@ unsigned getEUsPerCU(const MCSubtargetInfo &STI) {
   // workgroup must share".
 
   // GFX12.5 only supports CU mode, which contains four SIMDs.
-  if (isGFX1250(STI)) {
+  if (STI.getFeatureBits().test(FeatureCuModeOnly)) {
     assert(STI.getFeatureBits().test(FeatureCuMode));
     return 4;
   }

``````````

</details>


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


More information about the llvm-commits mailing list