[clang] [llvm] [TargetParser] Parse Intel GPU architecture names, and use the list in clang (PR #223199)
Srividya Sundaram via cfe-commits
cfe-commits at lists.llvm.org
Fri Oct 2 15:50:36 PDT 2026
================
@@ -716,8 +716,14 @@ static Error runAOTCompileIntelGPU(StringRef InputFile, StringRef OutputFile,
StringRef Arch(Args.getLastArgValue(OPT_arch_EQ));
assert(!Arch.empty() && "Arch must be specified for AOT compilation");
+ // ocloc spells a device without the "xe-" prefix and with "_" between words,
+ // e.g. "bmg_g21" for "xe-bmg-g21", so translate any accepted spelling.
+ std::string Device = StringRef(OffloadArchToString(StringToOffloadArch(Arch)))
+ .drop_front(strlen("xe-"))
+ .str();
+ llvm::replace(Device, '-', '_');
CmdArgs.push_back("-device");
- CmdArgs.push_back(Arch);
+ CmdArgs.push_back(Args.MakeArgString(Device));
----------------
srividya-sundaram wrote:
Fixed.
https://github.com/llvm/llvm-project/pull/223199
More information about the cfe-commits
mailing list