[clang] [llvm] [TargetParser] Parse Intel GPU architecture names, and use the list in clang (PR #223199)
Srividya Sundaram via llvm-commits
llvm-commits at lists.llvm.org
Thu Oct 1 15:53:48 PDT 2026
================
@@ -73,18 +74,17 @@ OffloadArch StringToOffloadArch(llvm::StringRef S) {
return OffloadArch::getAMDGCNSPIRV();
if (S == "generic")
return OffloadArch::getGeneric();
+ // Intel CPU offload has a single processor and no TargetParser list.
if (S == "graniterapids")
- return OffloadArch::getIntel(OffloadArch::TargetArch::IntelCPU,
- OffloadArch::IntelArch::GRANITERAPIDS);
- if (S == "bmg_g21")
- return OffloadArch::getIntel(OffloadArch::TargetArch::IntelGPU,
- OffloadArch::IntelArch::BMG_G21);
+ return OffloadArch::getIntelCPU();
// Otherwise defer to the vendor TargetParser GPU lists.
if (llvm::NVPTX::GPUKind NV = llvm::NVPTX::parseArch(S))
return OffloadArch::getNVPTX(NV);
if (llvm::AMDGPU::GPUKind AK = llvm::AMDGPU::parseArchAMDGCN(S))
return OffloadArch::getAMDGPU(AK);
+ if (llvm::IntelGPU::GPUKind IK = llvm::IntelGPU::parseArch(S))
+ return OffloadArch::getIntelGPU(IK);
----------------
srividya-sundaram wrote:
`Map accepted Intel names to their ocloc device spelling at this boundary, retaining bmg_g21 support, and test the canonical-name invocation.`
Done.
The clang-sycl-linker now converts any accepted name into ocloc's spelling,` e.g. xe-bmg-g21 and xe_20.1.0 both become -device bmg_g21`, so AOT keeps working. Added tests.
**Note**: ocloc is also adding the `xe-device` and `xe_version` names, so this mapping will go away later.
https://github.com/llvm/llvm-project/pull/223199
More information about the llvm-commits
mailing list