[clang] clang/AMDGPU: Mark more capability target features read-only (PR #214954)

via cfe-commits cfe-commits at lists.llvm.org
Sat Aug 8 04:13:55 PDT 2026


llvmorg-github-actions[bot] wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-backend-amdgpu

Author: Matt Arsenault (arsenm)

<details>
<summary>Changes</summary>

Really all amdgpu subtarget features should be read-only, except
for a handful of legitimately configurable modes which should be moved
out of subtarget features. Add a few special cases here which will help
unblock progressing towards using the new generated feature bitset.

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


1 Files Affected:

- (modified) clang/lib/Basic/Targets/AMDGPU.cpp (+3-1) 


``````````diff
diff --git a/clang/lib/Basic/Targets/AMDGPU.cpp b/clang/lib/Basic/Targets/AMDGPU.cpp
index 4109066ec910e..c15ac0462918d 100644
--- a/clang/lib/Basic/Targets/AMDGPU.cpp
+++ b/clang/lib/Basic/Targets/AMDGPU.cpp
@@ -229,7 +229,9 @@ AMDGPUTargetInfo::AMDGPUTargetInfo(const llvm::Triple &Triple,
   MaxAtomicPromoteWidth = MaxAtomicInlineWidth = 64;
   CUMode = !(GPUFeatures & llvm::AMDGPU::FEATURE_WGP);
 
-  for (auto F : {"image-insts", "gws", "vmem-to-lds-load-insts"}) {
+  for (auto F : {"image-insts", "gws", "vmem-to-lds-load-insts", "supports-wgp",
+                 "supports-wave32", "xnack-support", "sramecc-support",
+                 "xnack-on-off-modes"}) {
     if (GPUKind != llvm::AMDGPU::GK_NONE)
       ReadOnlyFeatures.insert(F);
   }

``````````

</details>


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


More information about the cfe-commits mailing list