19using namespace AMDGPU;
30constexpr GPUInfo R600GPUs[] = {
63constexpr GPUInfo AMDGCNGPUs[] = {
137 return A.Kind <
B.Kind;
140 if (
I == Table.
end() ||
I->Kind != Search.Kind)
148 if (
const auto *Entry = getArchEntry(AK, AMDGCNGPUs))
149 return Entry->CanonicalName;
154 if (
const auto *Entry = getArchEntry(AK, R600GPUs))
155 return Entry->CanonicalName;
160 for (
const auto &
C : AMDGCNGPUs) {
165 return AMDGPU::GPUKind::GK_NONE;
169 for (
const auto &
C : R600GPUs) {
174 return AMDGPU::GPUKind::GK_NONE;
178 if (
const auto *Entry = getArchEntry(AK, AMDGCNGPUs))
179 return Entry->Features;
184 if (
const auto *Entry = getArchEntry(AK, R600GPUs))
185 return Entry->Features;
191 for (
const auto &
C : AMDGCNGPUs)
196 for (
const auto &
C : R600GPUs)
202 if (AK == AMDGPU::GPUKind::GK_NONE) {
203 if (GPU ==
"generic-hsa")
205 if (GPU ==
"generic")
256 default:
return {0, 0, 0};
277 Features[
"ci-insts"] =
true;
278 Features[
"dot5-insts"] =
true;
279 Features[
"dot7-insts"] =
true;
280 Features[
"dot8-insts"] =
true;
281 Features[
"dot9-insts"] =
true;
282 Features[
"dot10-insts"] =
true;
283 Features[
"dl-insts"] =
true;
284 Features[
"16-bit-insts"] =
true;
285 Features[
"dpp"] =
true;
286 Features[
"gfx8-insts"] =
true;
287 Features[
"gfx9-insts"] =
true;
288 Features[
"gfx10-insts"] =
true;
289 Features[
"gfx10-3-insts"] =
true;
290 Features[
"gfx11-insts"] =
true;
291 Features[
"gfx12-insts"] =
true;
292 Features[
"atomic-fadd-rtn-insts"] =
true;
293 Features[
"image-insts"] =
true;
294 Features[
"gws"] =
true;
302 Features[
"ci-insts"] =
true;
303 Features[
"dot5-insts"] =
true;
304 Features[
"dot7-insts"] =
true;
305 Features[
"dot8-insts"] =
true;
306 Features[
"dot9-insts"] =
true;
307 Features[
"dot10-insts"] =
true;
308 Features[
"dl-insts"] =
true;
309 Features[
"16-bit-insts"] =
true;
310 Features[
"dpp"] =
true;
311 Features[
"gfx8-insts"] =
true;
312 Features[
"gfx9-insts"] =
true;
313 Features[
"gfx10-insts"] =
true;
314 Features[
"gfx10-3-insts"] =
true;
315 Features[
"gfx11-insts"] =
true;
316 Features[
"atomic-fadd-rtn-insts"] =
true;
317 Features[
"image-insts"] =
true;
318 Features[
"gws"] =
true;
327 Features[
"ci-insts"] =
true;
328 Features[
"dot1-insts"] =
true;
329 Features[
"dot2-insts"] =
true;
330 Features[
"dot5-insts"] =
true;
331 Features[
"dot6-insts"] =
true;
332 Features[
"dot7-insts"] =
true;
333 Features[
"dot10-insts"] =
true;
334 Features[
"dl-insts"] =
true;
335 Features[
"16-bit-insts"] =
true;
336 Features[
"dpp"] =
true;
337 Features[
"gfx8-insts"] =
true;
338 Features[
"gfx9-insts"] =
true;
339 Features[
"gfx10-insts"] =
true;
340 Features[
"gfx10-3-insts"] =
true;
341 Features[
"image-insts"] =
true;
342 Features[
"s-memrealtime"] =
true;
343 Features[
"s-memtime-inst"] =
true;
344 Features[
"gws"] =
true;
348 Features[
"dot1-insts"] =
true;
349 Features[
"dot2-insts"] =
true;
350 Features[
"dot5-insts"] =
true;
351 Features[
"dot6-insts"] =
true;
352 Features[
"dot7-insts"] =
true;
353 Features[
"dot10-insts"] =
true;
357 Features[
"dl-insts"] =
true;
358 Features[
"ci-insts"] =
true;
359 Features[
"16-bit-insts"] =
true;
360 Features[
"dpp"] =
true;
361 Features[
"gfx8-insts"] =
true;
362 Features[
"gfx9-insts"] =
true;
363 Features[
"gfx10-insts"] =
true;
364 Features[
"image-insts"] =
true;
365 Features[
"s-memrealtime"] =
true;
366 Features[
"s-memtime-inst"] =
true;
367 Features[
"gws"] =
true;
372 Features[
"gfx940-insts"] =
true;
373 Features[
"fp8-insts"] =
true;
374 Features[
"atomic-ds-pk-add-16-insts"] =
true;
375 Features[
"atomic-flat-pk-add-16-insts"] =
true;
376 Features[
"atomic-global-pk-add-bf16-inst"] =
true;
377 Features[
"gfx90a-insts"] =
true;
378 Features[
"atomic-buffer-global-pk-add-f16-insts"] =
true;
379 Features[
"atomic-fadd-rtn-insts"] =
true;
380 Features[
"dot3-insts"] =
true;
381 Features[
"dot4-insts"] =
true;
382 Features[
"dot5-insts"] =
true;
383 Features[
"dot6-insts"] =
true;
384 Features[
"mai-insts"] =
true;
385 Features[
"dl-insts"] =
true;
386 Features[
"dot1-insts"] =
true;
387 Features[
"dot2-insts"] =
true;
388 Features[
"dot7-insts"] =
true;
389 Features[
"dot10-insts"] =
true;
390 Features[
"gfx9-insts"] =
true;
391 Features[
"gfx8-insts"] =
true;
392 Features[
"16-bit-insts"] =
true;
393 Features[
"dpp"] =
true;
394 Features[
"s-memrealtime"] =
true;
395 Features[
"ci-insts"] =
true;
396 Features[
"s-memtime-inst"] =
true;
397 Features[
"gws"] =
true;
400 Features[
"gfx90a-insts"] =
true;
401 Features[
"atomic-buffer-global-pk-add-f16-insts"] =
true;
402 Features[
"atomic-fadd-rtn-insts"] =
true;
405 Features[
"dot3-insts"] =
true;
406 Features[
"dot4-insts"] =
true;
407 Features[
"dot5-insts"] =
true;
408 Features[
"dot6-insts"] =
true;
409 Features[
"mai-insts"] =
true;
412 Features[
"dl-insts"] =
true;
413 Features[
"dot1-insts"] =
true;
414 Features[
"dot2-insts"] =
true;
415 Features[
"dot7-insts"] =
true;
416 Features[
"dot10-insts"] =
true;
423 Features[
"gfx9-insts"] =
true;
430 Features[
"gfx8-insts"] =
true;
431 Features[
"16-bit-insts"] =
true;
432 Features[
"dpp"] =
true;
433 Features[
"s-memrealtime"] =
true;
441 Features[
"ci-insts"] =
true;
446 Features[
"image-insts"] =
true;
447 Features[
"s-memtime-inst"] =
true;
448 Features[
"gws"] =
true;
486 bool IsWave32Capable =
false;
509 IsWave32Capable =
true;
515 return IsWave32Capable;
520 std::string &ErrorMsg) {
522 const bool IsNullGPU = GPU.
empty();
524 const bool HaveWave32 =
525 (IsWave32Capable || IsNullGPU) && Features.
count(
"wavefrontsize32");
526 const bool HaveWave64 = Features.
count(
"wavefrontsize64");
527 if (HaveWave32 && HaveWave64) {
528 ErrorMsg =
"'wavefrontsize32' and 'wavefrontsize64' are mutually exclusive";
534 if (!HaveWave32 && !HaveWave64) {
536 IsWave32Capable ?
"wavefrontsize32" :
"wavefrontsize64";
537 Features.
insert(std::make_pair(DefaultWaveSizeFeature,
true));
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
static GCRegistry::Add< ErlangGC > A("erlang", "erlang-compatible garbage collector")
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
static bool isWave32Capable(StringRef GPU, const Triple &T)
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
void push_back(const T &Elt)
A wrapper around a string literal that serves as a proxy for constructing global tables of StringRefs...
StringMap - This is an unconventional map that is specialized for handling keys that are "strings",...
size_type count(StringRef Key) const
count - Return 1 if the element is in the map, 0 otherwise.
bool insert(MapEntryTy *KeyValue)
insert - Insert the specified key/value pair into the map.
StringRef - Represent a constant reference to a string, i.e.
constexpr bool empty() const
empty - Check if the string is empty.
Triple - Helper class for working with autoconf configuration names.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
StringRef getArchNameR600(GPUKind AK)
GPUKind
GPU kinds supported by the AMDGPU target.
StringRef getCanonicalArchName(const Triple &T, StringRef Arch)
void fillValidArchListR600(SmallVectorImpl< StringRef > &Values)
IsaVersion getIsaVersion(StringRef GPU)
void fillAMDGPUFeatureMap(StringRef GPU, const Triple &T, StringMap< bool > &Features)
Fills Features map with default values for given target GPU.
void fillValidArchListAMDGCN(SmallVectorImpl< StringRef > &Values)
GPUKind parseArchAMDGCN(StringRef CPU)
bool insertWaveSizeFeature(StringRef GPU, const Triple &T, StringMap< bool > &Features, std::string &ErrorMsg)
Inserts wave size feature for given GPU into features map.
@ FEATURE_FAST_DENORMAL_F32
StringRef getArchNameAMDGCN(GPUKind AK)
unsigned getArchAttrAMDGCN(GPUKind AK)
unsigned getArchAttrR600(GPUKind AK)
GPUKind parseArchR600(StringRef CPU)
@ C
The default llvm calling convention, compatible with C.
This is an optimization pass for GlobalISel generic memory operations.
auto lower_bound(R &&Range, T &&Value)
Provide wrappers to std::lower_bound which take ranges instead of having to pass begin/end explicitly...
Instruction set architecture version.