[clang] [llvm] [TargetParser][clang] Parse and store Intel IGCA virtual architecture as an OffloadArch (PR #227468)

Srividya Sundaram via cfe-commits cfe-commits at lists.llvm.org
Tue Oct 6 22:01:07 PDT 2026


================
@@ -44,6 +128,18 @@ LLVM_ABI StringRef getArchName(uint32_t GPUIPVersion);
 /// \return the numeric name of \p GPUIPVersion, e.g. "xe_35.11.0".
 LLVM_ABI std::string getNumericArchName(uint32_t GPUIPVersion);
 
+/// Parse an IGCA target string, such as "igca_20ca". \return an invalid
+/// IGCATarget if \p TargetStr is not a known target in
+/// IntelGPUTargetParser.def
+LLVM_ABI IGCATarget parseIGCATarget(StringRef TargetStr);
+
+/// \return the \p Target as a string, i.e. "igca_20ca". \return an empty string
+/// if \p Target is invalid or not a known target in IntelGPUTargetParser.def.
+LLVM_ABI StringRef getIGCATargetName(IGCATarget Target);
----------------
srividya-sundaram wrote:

#229247 adds getIGCAName(GPUKind), which also produces names like "igca_20ca", but from its own macros. 
With both PRs in, two functions build the same string. 
I'd keep one: #229247 can return an IGCATarget for a device, and the name can come from getIGCATargetName. 
Once #229247 lands, we can update this one.

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


More information about the cfe-commits mailing list