[clang] [llvm] AMDGPU: Handle more TargetParser queries in tablegen (PR #212357)

Chinmay Deshpande via cfe-commits cfe-commits at lists.llvm.org
Wed Jul 29 09:11:31 PDT 2026


================
@@ -291,12 +291,9 @@ void AMDGPUTargetInfo::getTargetDefines(const LangOptions &Opts,
       (getTriple().isAMDGCN() ? getArchNameAMDGCN(GPUKind)
                               : getArchNameR600(GPUKind));
 
-  // Sanitize the name of generic targets.
+  // Sanitize the name of generic targets, the only names containing '-'.
   // e.g. gfx10-1-generic -> gfx10_1_generic
-  if (GPUKind >= llvm::AMDGPU::GK_AMDGPU_GENERIC_FIRST &&
-      GPUKind <= llvm::AMDGPU::GK_AMDGPU_GENERIC_LAST) {
-    llvm::replace(CanonName, '-', '_');
-  }
+  llvm::replace(CanonName, '-', '_');
----------------
chinmaydd wrote:

Could we add an example / test for the generic and generic-hsa targets? We could fail here : https://github.com/llvm/llvm-project/blob/main/clang/lib/Basic/Targets/AMDGPU.cpp#L304

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


More information about the cfe-commits mailing list