57#define INTEL_GPU(NAME, KIND, MAJOR, MINOR, IGCA_TARGET, IGCA_FEATURE_SETS) \
58 if (Device == packDevice(MAJOR, MINOR)) \
60#include "llvm/TargetParser/IntelGPUTargetParser.def"
68 return (
"xe_" +
Twine(Major) +
"." +
Twine(Minor) +
"." +
Twine(Revision))
76#define INTEL_GPU(NAME, KIND, MAJOR, MINOR, IGCA_TARGET, IGCA_FEATURE_SETS) \
79#define INTEL_GPU_COMPAT(NAME, KIND, IGCA_TARGET, IGCA_FEATURE_SETS) \
82#include "llvm/TargetParser/IntelGPUTargetParser.def"
91 if (Name.starts_with(
"xe_")) {
92 auto [
Device, Revision] = Name.rsplit(
'.');
93 if (
Device.count(
'.') != 1 || Revision.empty() ||
100#define INTEL_GPU(NAME, KIND, MAJOR, MINOR, IGCA_TARGET, IGCA_FEATURE_SETS) \
101 .Case(NAME, GK_##KIND).Case("xe_" #MAJOR "." #MINOR, GK_##KIND)
102#define INTEL_GPU_COMPAT(NAME, KIND, IGCA_TARGET, IGCA_FEATURE_SETS) \
103 .Case(NAME, GK_##KIND)
104#define INTEL_GPU_ALIAS(NAME, KIND) .Case(NAME, GK_##KIND)
105#include "llvm/TargetParser/IntelGPUTargetParser.def"
113struct DeviceIGCATarget {
117constexpr DeviceIGCATarget DeviceIGCATargets[] = {
118#define INTEL_GPU(NAME, KIND, MAJOR, MINOR, IGCA_TARGET, IGCA_FEATURE_SETS) \
119 {IGCA_TARGET, IGCAFeatureSet::IGCA_FEATURE_SETS},
120#define INTEL_GPU_COMPAT(NAME, KIND, IGCA_TARGET, IGCA_FEATURE_SETS) \
121 {IGCA_TARGET, IGCAFeatureSet::IGCA_FEATURE_SETS},
122#include "llvm/TargetParser/IntelGPUTargetParser.def"
129#define IGCA_TARGET_NAMES(TARGET) \
130 {{"igca_" #TARGET}, {TARGET, IGCAFeatureSet::Core}}, \
131 {{"igca_" #TARGET "c"}, {TARGET, IGCAFeatureSet::Compute}}, \
132 {{"igca_" #TARGET "ca"}, {TARGET, IGCAFeatureSet::ComputeExact}}, \
133 {{"igca_" #TARGET "r"}, {TARGET, IGCAFeatureSet::Render}}, \
134 {{"igca_" #TARGET "ra"}, {TARGET, IGCAFeatureSet::RenderExact}},
136#define INTEL_GPU(NAME, KIND, MAJOR, MINOR, IGCA_TARGET, IGCA_FEATURE_SETS) \
137 IGCA_TARGET_NAMES(IGCA_TARGET)
138#define INTEL_GPU_COMPAT(NAME, KIND, IGCA_TARGET, IGCA_FEATURE_SETS) \
139 IGCA_TARGET_NAMES(IGCA_TARGET)
140#include "llvm/TargetParser/IntelGPUTargetParser.def"
142#undef IGCA_TARGET_NAMES
154 if (RequestedFeatureSet == IGCAFeatureSet::Core)
157 if (RequestedFeatureSet == DeviceFeatureSet)
161 if (DeviceFeatureSet == IGCAFeatureSet::ComputeExact)
162 return RequestedFeatureSet == IGCAFeatureSet::Compute;
163 if (DeviceFeatureSet == IGCAFeatureSet::RenderExact)
164 return RequestedFeatureSet == IGCAFeatureSet::Render;
168bool llvm::IntelGPU::IGCATarget::isKnownIGCATarget(
uint32_t Packed) {
171 if (Packed & ReservedMask)
175 uint16_t RequestedTarget = uint16_t(Packed >> TargetShift);
176 auto RequestedFeatureSet =
IGCAFeatureSet(Packed & FeatureSetMask);
177 for (
const DeviceIGCATarget &
D : DeviceIGCATargets)
178 if (
D.Target == RequestedTarget &&
185 for (
const auto &E : IGCATargetNames)
186 if (MaybeTarget == E.name())
187 return IGCATarget(E.value().Target, E.value().FeatureSet);
192 for (
const auto &E : IGCATargetNames)
193 if (E.value().Target ==
T.getTarget() &&
194 E.value().FeatureSet ==
T.getFeatureSet())
203#define INTEL_GPU(NAME, KIND, MAJOR, MINOR, IGCA_TARGET, IGCA_FEATURE_SETS) \
205 return IGCATarget(IGCA_TARGET, IGCAFeatureSet::IGCA_FEATURE_SETS);
206#define INTEL_GPU_COMPAT(NAME, KIND, IGCA_TARGET, IGCA_FEATURE_SETS) \
208 return IGCATarget(IGCA_TARGET, IGCAFeatureSet::IGCA_FEATURE_SETS);
209#include "llvm/TargetParser/IntelGPUTargetParser.def"
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
static GCRegistry::Add< StatepointGC > D("statepoint-example", "an example strategy for statepoint")
#define BUILD_ENUM_STRINGS(Tab)
static constexpr uint32_t GPUIPMajorMask
static constexpr uint32_t GPUIPMajorShift
static constexpr uint32_t GPUIPRevisionMask
static constexpr uint32_t GPUIPMinorMask
static constexpr uint32_t packDevice(uint32_t Major, uint32_t Minor)
static constexpr uint32_t GPUIPMinorShift
static bool deviceCanRunIGCAFeatureSet(IGCAFeatureSet DeviceFeatureSet, IGCAFeatureSet RequestedFeatureSet)
static constexpr uint32_t GPUIPDeviceMask
This file implements the StringSwitch template, which mimics a switch() statement whose cases are str...
Wrapper around an IGCA target's uint32_t representation, packed using the following format:
static constexpr IGCATarget invalid()
Represent a constant reference to a string, i.e.
A switch()-like statement whose cases are string literals.
Target - Wrapper for Target specific information.
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
LLVM_ABI GPUKind parseArch(StringRef Name)
LLVM_ABI std::string getNumericArchName(uint32_t GPUIPVersion)
LLVM_ABI IGCATarget getIGCATarget(GPUKind Kind)
IGCAFeatureSet
Represents an IGCA feature set, including whether or not it is exact.
LLVM_ABI IGCATarget parseIGCATarget(StringRef MaybeTarget)
Parse an IGCA target string such as "igca_20ca".
LLVM_ABI StringRef getIGCATargetName(IGCATarget Target)
LLVM_ABI StringRef getArchName(uint32_t GPUIPVersion)
GPUKind
Intel GPU architecture names, covering both physical devices and the compatibility names that stand f...
This is an optimization pass for GlobalISel generic memory operations.
bool all_of(R &&range, UnaryPredicate P)
Provide wrappers to std::all_of which take ranges instead of having to pass begin/end explicitly.
bool isDigit(char C)
Checks if character C is one of the 10 decimal digits.
Compile-time data representation of enum entries.