Skip to content

[TargetParser] Parse Intel GPU architecture names, and use the list in clang - #223199

Draft
srividya-sundaram wants to merge 3 commits into
llvm:mainfrom
srividya-sundaram:igca-78107
Draft

[TargetParser] Parse Intel GPU architecture names, and use the list in clang#223199
srividya-sundaram wants to merge 3 commits into
llvm:mainfrom
srividya-sundaram:igca-78107

Conversation

@srividya-sundaram

Copy link
Copy Markdown
Contributor

Stacked on #222072 — its two commits are in this branch; review only the last one. Draft until it lands.

#222072 goes from the GMDID that the Level Zero driver reports for an installed GPU to that device's architecture name, which is what offload-arch prints. This adds the reverse direction, from an architecture name the user writes on --offload-arch, such as xe-pvc, to the device in the list it denotes, via IntelGPU::parseArch; and it points clang's OffloadArch at the list instead of its two hardcoded strings. Together they close a round trip: whatever offload-arch prints for an installed GPU is now a name --offload-arch accepts back.

KornevNikita and others added 2 commits September 12, 2026 13:02
Currently offload-arch prints Intel GPU names which are not a legal parameter
for --offload-arch, e.g. "Intel(R) Data Center GPU Max 1100".

Print an architecture name instead, e.g. "xe-pvc". The driver reports a GPU IP
version, the GMDID, for every device. Add a table that maps a GMDID to a name,
and look the device up in it.

The table goes in llvm/TargetParser, next to the other GPU lists, because
other tools need it too. Some of them are LLVM libraries, which cannot
include a clang header.

Every row of IntelGPUTargetParser.def holds three things: a name that
--offload-arch accepts, the GMDID that the device reports, and the IGCA
(Intel Graphics Compute Architecture) level, which is the virtual
architecture that the compiler targets. A few names, such as xe-dg2,
cover a whole product line. No device reports a GMDID for those, so
offload-arch never prints them.

A device that is not in the table is reported as an error. Making up a
name from its GMDID would not help, because the compiler would not know
which IGCA level to compile for.

The header declares only the functions that offload-arch needs. More will
follow when something needs them.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Fold the numeric fallback into getIntelGPUArchName(), so that the GMDID is
decoded once and every device gets a name.
@github-actions

github-actions Bot commented Sep 13, 2026

Copy link
Copy Markdown

✅ With the latest revision this PR passed the C/C++ code formatter.

…n clang

The Intel GPU list could only name the device a driver reports; add parseArch
for the other direction, accepting the friendly, compatibility, alias and
numeric spellings, plus getIGCAName for the level to compile for. In clang,
drop the two hardcoded Intel architecture strings and consult the list instead.
A numeric name whose fields do not fit their GMDID names no device.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants