LLVM 20.0.0git
TargetParser.cpp
Go to the documentation of this file.
1//===-- TargetParser - Parser for target features ---------------*- C++ -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8//
9// This file implements a target parser to recognise hardware features such as
10// FPU/CPU/ARCH names as well as specific support such as HDIV, etc.
11//
12//===----------------------------------------------------------------------===//
13
15#include "llvm/ADT/ArrayRef.h"
17
18using namespace llvm;
19using namespace AMDGPU;
20
21namespace {
22
23struct GPUInfo {
25 StringLiteral CanonicalName;
27 unsigned Features;
28};
29
30constexpr GPUInfo R600GPUs[] = {
31 // Name Canonical Kind Features
32 // Name
33 {{"r600"}, {"r600"}, GK_R600, FEATURE_NONE },
34 {{"rv630"}, {"r600"}, GK_R600, FEATURE_NONE },
35 {{"rv635"}, {"r600"}, GK_R600, FEATURE_NONE },
36 {{"r630"}, {"r630"}, GK_R630, FEATURE_NONE },
37 {{"rs780"}, {"rs880"}, GK_RS880, FEATURE_NONE },
38 {{"rs880"}, {"rs880"}, GK_RS880, FEATURE_NONE },
39 {{"rv610"}, {"rs880"}, GK_RS880, FEATURE_NONE },
40 {{"rv620"}, {"rs880"}, GK_RS880, FEATURE_NONE },
41 {{"rv670"}, {"rv670"}, GK_RV670, FEATURE_NONE },
42 {{"rv710"}, {"rv710"}, GK_RV710, FEATURE_NONE },
43 {{"rv730"}, {"rv730"}, GK_RV730, FEATURE_NONE },
44 {{"rv740"}, {"rv770"}, GK_RV770, FEATURE_NONE },
45 {{"rv770"}, {"rv770"}, GK_RV770, FEATURE_NONE },
46 {{"cedar"}, {"cedar"}, GK_CEDAR, FEATURE_NONE },
47 {{"palm"}, {"cedar"}, GK_CEDAR, FEATURE_NONE },
48 {{"cypress"}, {"cypress"}, GK_CYPRESS, FEATURE_FMA },
49 {{"hemlock"}, {"cypress"}, GK_CYPRESS, FEATURE_FMA },
50 {{"juniper"}, {"juniper"}, GK_JUNIPER, FEATURE_NONE },
51 {{"redwood"}, {"redwood"}, GK_REDWOOD, FEATURE_NONE },
52 {{"sumo"}, {"sumo"}, GK_SUMO, FEATURE_NONE },
53 {{"sumo2"}, {"sumo"}, GK_SUMO, FEATURE_NONE },
54 {{"barts"}, {"barts"}, GK_BARTS, FEATURE_NONE },
55 {{"caicos"}, {"caicos"}, GK_CAICOS, FEATURE_NONE },
56 {{"aruba"}, {"cayman"}, GK_CAYMAN, FEATURE_FMA },
57 {{"cayman"}, {"cayman"}, GK_CAYMAN, FEATURE_FMA },
58 {{"turks"}, {"turks"}, GK_TURKS, FEATURE_NONE }
59};
60
61// This table should be sorted by the value of GPUKind
62// Don't bother listing the implicitly true features
63constexpr GPUInfo AMDGCNGPUs[] = {
64 // clang-format off
65 // Name Canonical Kind Features
66 // Name
67 {{"gfx600"}, {"gfx600"}, GK_GFX600, FEATURE_FAST_FMA_F32},
68 {{"tahiti"}, {"gfx600"}, GK_GFX600, FEATURE_FAST_FMA_F32},
69 {{"gfx601"}, {"gfx601"}, GK_GFX601, FEATURE_NONE},
70 {{"pitcairn"}, {"gfx601"}, GK_GFX601, FEATURE_NONE},
71 {{"verde"}, {"gfx601"}, GK_GFX601, FEATURE_NONE},
72 {{"gfx602"}, {"gfx602"}, GK_GFX602, FEATURE_NONE},
73 {{"hainan"}, {"gfx602"}, GK_GFX602, FEATURE_NONE},
74 {{"oland"}, {"gfx602"}, GK_GFX602, FEATURE_NONE},
75 {{"gfx700"}, {"gfx700"}, GK_GFX700, FEATURE_NONE},
76 {{"kaveri"}, {"gfx700"}, GK_GFX700, FEATURE_NONE},
77 {{"gfx701"}, {"gfx701"}, GK_GFX701, FEATURE_FAST_FMA_F32},
78 {{"hawaii"}, {"gfx701"}, GK_GFX701, FEATURE_FAST_FMA_F32},
79 {{"gfx702"}, {"gfx702"}, GK_GFX702, FEATURE_FAST_FMA_F32},
80 {{"gfx703"}, {"gfx703"}, GK_GFX703, FEATURE_NONE},
81 {{"kabini"}, {"gfx703"}, GK_GFX703, FEATURE_NONE},
82 {{"mullins"}, {"gfx703"}, GK_GFX703, FEATURE_NONE},
83 {{"gfx704"}, {"gfx704"}, GK_GFX704, FEATURE_NONE},
84 {{"bonaire"}, {"gfx704"}, GK_GFX704, FEATURE_NONE},
85 {{"gfx705"}, {"gfx705"}, GK_GFX705, FEATURE_NONE},
88 {{"gfx802"}, {"gfx802"}, GK_GFX802, FEATURE_FAST_DENORMAL_F32},
89 {{"iceland"}, {"gfx802"}, GK_GFX802, FEATURE_FAST_DENORMAL_F32},
90 {{"tonga"}, {"gfx802"}, GK_GFX802, FEATURE_FAST_DENORMAL_F32},
91 {{"gfx803"}, {"gfx803"}, GK_GFX803, FEATURE_FAST_DENORMAL_F32},
92 {{"fiji"}, {"gfx803"}, GK_GFX803, FEATURE_FAST_DENORMAL_F32},
93 {{"polaris10"}, {"gfx803"}, GK_GFX803, FEATURE_FAST_DENORMAL_F32},
94 {{"polaris11"}, {"gfx803"}, GK_GFX803, FEATURE_FAST_DENORMAL_F32},
95 {{"gfx805"}, {"gfx805"}, GK_GFX805, FEATURE_FAST_DENORMAL_F32},
96 {{"tongapro"}, {"gfx805"}, GK_GFX805, FEATURE_FAST_DENORMAL_F32},
97 {{"gfx810"}, {"gfx810"}, GK_GFX810, FEATURE_FAST_DENORMAL_F32|FEATURE_XNACK},
98 {{"stoney"}, {"gfx810"}, GK_GFX810, FEATURE_FAST_DENORMAL_F32|FEATURE_XNACK},
130
136 // clang-format on
137};
138
139const GPUInfo *getArchEntry(AMDGPU::GPUKind AK, ArrayRef<GPUInfo> Table) {
140 GPUInfo Search = { {""}, {""}, AK, AMDGPU::FEATURE_NONE };
141
142 auto I =
143 llvm::lower_bound(Table, Search, [](const GPUInfo &A, const GPUInfo &B) {
144 return A.Kind < B.Kind;
145 });
146
147 if (I == Table.end() || I->Kind != Search.Kind)
148 return nullptr;
149 return I;
150}
151
152} // namespace
153
155 switch (AK) {
157 return "gfx9";
160 return "gfx10";
162 return "gfx11";
164 return "gfx12";
165 default: {
166 StringRef ArchName = getArchNameAMDGCN(AK);
167 return ArchName.empty() ? "" : ArchName.drop_back(2);
168 }
169 }
170}
171
173 if (const auto *Entry = getArchEntry(AK, AMDGCNGPUs))
174 return Entry->CanonicalName;
175 return "";
176}
177
179 if (const auto *Entry = getArchEntry(AK, R600GPUs))
180 return Entry->CanonicalName;
181 return "";
182}
183
185 for (const auto &C : AMDGCNGPUs) {
186 if (CPU == C.Name)
187 return C.Kind;
188 }
189
190 return AMDGPU::GPUKind::GK_NONE;
191}
192
194 for (const auto &C : R600GPUs) {
195 if (CPU == C.Name)
196 return C.Kind;
197 }
198
199 return AMDGPU::GPUKind::GK_NONE;
200}
201
203 if (const auto *Entry = getArchEntry(AK, AMDGCNGPUs))
204 return Entry->Features;
205 return FEATURE_NONE;
206}
207
209 if (const auto *Entry = getArchEntry(AK, R600GPUs))
210 return Entry->Features;
211 return FEATURE_NONE;
212}
213
215 // XXX: Should this only report unique canonical names?
216 for (const auto &C : AMDGCNGPUs)
217 Values.push_back(C.Name);
218}
219
221 for (const auto &C : R600GPUs)
222 Values.push_back(C.Name);
223}
224
227 if (AK == AMDGPU::GPUKind::GK_NONE) {
228 if (GPU == "generic-hsa")
229 return {7, 0, 0};
230 if (GPU == "generic")
231 return {6, 0, 0};
232 return {0, 0, 0};
233 }
234
235 // clang-format off
236 switch (AK) {
237 case GK_GFX600: return {6, 0, 0};
238 case GK_GFX601: return {6, 0, 1};
239 case GK_GFX602: return {6, 0, 2};
240 case GK_GFX700: return {7, 0, 0};
241 case GK_GFX701: return {7, 0, 1};
242 case GK_GFX702: return {7, 0, 2};
243 case GK_GFX703: return {7, 0, 3};
244 case GK_GFX704: return {7, 0, 4};
245 case GK_GFX705: return {7, 0, 5};
246 case GK_GFX801: return {8, 0, 1};
247 case GK_GFX802: return {8, 0, 2};
248 case GK_GFX803: return {8, 0, 3};
249 case GK_GFX805: return {8, 0, 5};
250 case GK_GFX810: return {8, 1, 0};
251 case GK_GFX900: return {9, 0, 0};
252 case GK_GFX902: return {9, 0, 2};
253 case GK_GFX904: return {9, 0, 4};
254 case GK_GFX906: return {9, 0, 6};
255 case GK_GFX908: return {9, 0, 8};
256 case GK_GFX909: return {9, 0, 9};
257 case GK_GFX90A: return {9, 0, 10};
258 case GK_GFX90C: return {9, 0, 12};
259 case GK_GFX940: return {9, 4, 0};
260 case GK_GFX941: return {9, 4, 1};
261 case GK_GFX942: return {9, 4, 2};
262 case GK_GFX1010: return {10, 1, 0};
263 case GK_GFX1011: return {10, 1, 1};
264 case GK_GFX1012: return {10, 1, 2};
265 case GK_GFX1013: return {10, 1, 3};
266 case GK_GFX1030: return {10, 3, 0};
267 case GK_GFX1031: return {10, 3, 1};
268 case GK_GFX1032: return {10, 3, 2};
269 case GK_GFX1033: return {10, 3, 3};
270 case GK_GFX1034: return {10, 3, 4};
271 case GK_GFX1035: return {10, 3, 5};
272 case GK_GFX1036: return {10, 3, 6};
273 case GK_GFX1100: return {11, 0, 0};
274 case GK_GFX1101: return {11, 0, 1};
275 case GK_GFX1102: return {11, 0, 2};
276 case GK_GFX1103: return {11, 0, 3};
277 case GK_GFX1150: return {11, 5, 0};
278 case GK_GFX1151: return {11, 5, 1};
279 case GK_GFX1152: return {11, 5, 2};
280 case GK_GFX1200: return {12, 0, 0};
281 case GK_GFX1201: return {12, 0, 1};
282
283 // Generic targets return the lowest common denominator
284 // within their family. That is, the ISA that is the most
285 // restricted in terms of features.
286 //
287 // gfx9-generic is tricky because there is no lowest
288 // common denominator, so we return gfx900 which has mad-mix
289 // but this family doesn't have it.
290 //
291 // This API should never be used to check for a particular
292 // feature anyway.
293 //
294 // TODO: Split up this API depending on its caller so
295 // generic target handling is more obvious and less risky.
296 case GK_GFX9_GENERIC: return {9, 0, 0};
297 case GK_GFX10_1_GENERIC: return {10, 1, 0};
298 case GK_GFX10_3_GENERIC: return {10, 3, 0};
299 case GK_GFX11_GENERIC: return {11, 0, 3};
300 case GK_GFX12_GENERIC: return {12, 0, 0};
301 default: return {0, 0, 0};
302 }
303 // clang-format on
304}
305
307 assert(T.isAMDGPU());
308 auto ProcKind = T.isAMDGCN() ? parseArchAMDGCN(Arch) : parseArchR600(Arch);
309 if (ProcKind == GK_NONE)
310 return StringRef();
311
312 return T.isAMDGCN() ? getArchNameAMDGCN(ProcKind) : getArchNameR600(ProcKind);
313}
314
316 StringMap<bool> &Features) {
317 // XXX - What does the member GPU mean if device name string passed here?
318 if (T.isSPIRV() && T.getOS() == Triple::OSType::AMDHSA) {
319 // AMDGCN SPIRV must support the union of all AMDGCN features.
320 Features["atomic-ds-pk-add-16-insts"] = true;
321 Features["atomic-flat-pk-add-16-insts"] = true;
322 Features["atomic-buffer-global-pk-add-f16-insts"] = true;
323 Features["atomic-global-pk-add-bf16-inst"] = true;
324 Features["atomic-fadd-rtn-insts"] = true;
325 Features["ci-insts"] = true;
326 Features["dot1-insts"] = true;
327 Features["dot2-insts"] = true;
328 Features["dot3-insts"] = true;
329 Features["dot4-insts"] = true;
330 Features["dot5-insts"] = true;
331 Features["dot7-insts"] = true;
332 Features["dot8-insts"] = true;
333 Features["dot9-insts"] = true;
334 Features["dot10-insts"] = true;
335 Features["dot11-insts"] = true;
336 Features["dl-insts"] = true;
337 Features["16-bit-insts"] = true;
338 Features["dpp"] = true;
339 Features["gfx8-insts"] = true;
340 Features["gfx9-insts"] = true;
341 Features["gfx90a-insts"] = true;
342 Features["gfx940-insts"] = true;
343 Features["gfx10-insts"] = true;
344 Features["gfx10-3-insts"] = true;
345 Features["gfx11-insts"] = true;
346 Features["gfx12-insts"] = true;
347 Features["image-insts"] = true;
348 Features["fp8-conversion-insts"] = true;
349 Features["s-memrealtime"] = true;
350 Features["s-memtime-inst"] = true;
351 Features["gws"] = true;
352 Features["fp8-insts"] = true;
353 Features["fp8-conversion-insts"] = true;
354 Features["atomic-ds-pk-add-16-insts"] = true;
355 Features["mai-insts"] = true;
356 Features["wavefrontsize32"] = true;
357 Features["wavefrontsize64"] = true;
358 } else if (T.isAMDGCN()) {
359 switch (parseArchAMDGCN(GPU)) {
360 case GK_GFX1201:
361 case GK_GFX1200:
362 case GK_GFX12_GENERIC:
363 Features["ci-insts"] = true;
364 Features["dot7-insts"] = true;
365 Features["dot8-insts"] = true;
366 Features["dot9-insts"] = true;
367 Features["dot10-insts"] = true;
368 Features["dot11-insts"] = true;
369 Features["dl-insts"] = true;
370 Features["atomic-ds-pk-add-16-insts"] = true;
371 Features["atomic-flat-pk-add-16-insts"] = true;
372 Features["atomic-buffer-global-pk-add-f16-insts"] = true;
373 Features["atomic-global-pk-add-bf16-inst"] = true;
374 Features["16-bit-insts"] = true;
375 Features["dpp"] = true;
376 Features["gfx8-insts"] = true;
377 Features["gfx9-insts"] = true;
378 Features["gfx10-insts"] = true;
379 Features["gfx10-3-insts"] = true;
380 Features["gfx11-insts"] = true;
381 Features["gfx12-insts"] = true;
382 Features["atomic-fadd-rtn-insts"] = true;
383 Features["image-insts"] = true;
384 Features["fp8-conversion-insts"] = true;
385 break;
386 case GK_GFX1152:
387 case GK_GFX1151:
388 case GK_GFX1150:
389 case GK_GFX1103:
390 case GK_GFX1102:
391 case GK_GFX1101:
392 case GK_GFX1100:
393 case GK_GFX11_GENERIC:
394 Features["ci-insts"] = true;
395 Features["dot5-insts"] = true;
396 Features["dot7-insts"] = true;
397 Features["dot8-insts"] = true;
398 Features["dot9-insts"] = true;
399 Features["dot10-insts"] = true;
400 Features["dl-insts"] = true;
401 Features["16-bit-insts"] = true;
402 Features["dpp"] = true;
403 Features["gfx8-insts"] = true;
404 Features["gfx9-insts"] = true;
405 Features["gfx10-insts"] = true;
406 Features["gfx10-3-insts"] = true;
407 Features["gfx11-insts"] = true;
408 Features["atomic-fadd-rtn-insts"] = true;
409 Features["image-insts"] = true;
410 Features["gws"] = true;
411 break;
412 case GK_GFX1036:
413 case GK_GFX1035:
414 case GK_GFX1034:
415 case GK_GFX1033:
416 case GK_GFX1032:
417 case GK_GFX1031:
418 case GK_GFX1030:
420 Features["ci-insts"] = true;
421 Features["dot1-insts"] = true;
422 Features["dot2-insts"] = true;
423 Features["dot5-insts"] = true;
424 Features["dot6-insts"] = true;
425 Features["dot7-insts"] = true;
426 Features["dot10-insts"] = true;
427 Features["dl-insts"] = true;
428 Features["16-bit-insts"] = true;
429 Features["dpp"] = true;
430 Features["gfx8-insts"] = true;
431 Features["gfx9-insts"] = true;
432 Features["gfx10-insts"] = true;
433 Features["gfx10-3-insts"] = true;
434 Features["image-insts"] = true;
435 Features["s-memrealtime"] = true;
436 Features["s-memtime-inst"] = true;
437 Features["gws"] = true;
438 break;
439 case GK_GFX1012:
440 case GK_GFX1011:
441 Features["dot1-insts"] = true;
442 Features["dot2-insts"] = true;
443 Features["dot5-insts"] = true;
444 Features["dot6-insts"] = true;
445 Features["dot7-insts"] = true;
446 Features["dot10-insts"] = true;
447 [[fallthrough]];
448 case GK_GFX1013:
449 case GK_GFX1010:
451 Features["dl-insts"] = true;
452 Features["ci-insts"] = true;
453 Features["16-bit-insts"] = true;
454 Features["dpp"] = true;
455 Features["gfx8-insts"] = true;
456 Features["gfx9-insts"] = true;
457 Features["gfx10-insts"] = true;
458 Features["image-insts"] = true;
459 Features["s-memrealtime"] = true;
460 Features["s-memtime-inst"] = true;
461 Features["gws"] = true;
462 break;
463 case GK_GFX942:
464 case GK_GFX941:
465 case GK_GFX940:
466 Features["gfx940-insts"] = true;
467 Features["fp8-insts"] = true;
468 Features["fp8-conversion-insts"] = true;
469 Features["atomic-ds-pk-add-16-insts"] = true;
470 Features["atomic-flat-pk-add-16-insts"] = true;
471 Features["atomic-global-pk-add-bf16-inst"] = true;
472 Features["gfx90a-insts"] = true;
473 Features["atomic-buffer-global-pk-add-f16-insts"] = true;
474 Features["atomic-fadd-rtn-insts"] = true;
475 Features["dot3-insts"] = true;
476 Features["dot4-insts"] = true;
477 Features["dot5-insts"] = true;
478 Features["dot6-insts"] = true;
479 Features["mai-insts"] = true;
480 Features["dl-insts"] = true;
481 Features["dot1-insts"] = true;
482 Features["dot2-insts"] = true;
483 Features["dot7-insts"] = true;
484 Features["dot10-insts"] = true;
485 Features["gfx9-insts"] = true;
486 Features["gfx8-insts"] = true;
487 Features["16-bit-insts"] = true;
488 Features["dpp"] = true;
489 Features["s-memrealtime"] = true;
490 Features["ci-insts"] = true;
491 Features["s-memtime-inst"] = true;
492 Features["gws"] = true;
493 break;
494 case GK_GFX90A:
495 Features["gfx90a-insts"] = true;
496 Features["atomic-buffer-global-pk-add-f16-insts"] = true;
497 Features["atomic-fadd-rtn-insts"] = true;
498 [[fallthrough]];
499 case GK_GFX908:
500 Features["dot3-insts"] = true;
501 Features["dot4-insts"] = true;
502 Features["dot5-insts"] = true;
503 Features["dot6-insts"] = true;
504 Features["mai-insts"] = true;
505 [[fallthrough]];
506 case GK_GFX906:
507 Features["dl-insts"] = true;
508 Features["dot1-insts"] = true;
509 Features["dot2-insts"] = true;
510 Features["dot7-insts"] = true;
511 Features["dot10-insts"] = true;
512 [[fallthrough]];
513 case GK_GFX90C:
514 case GK_GFX909:
515 case GK_GFX904:
516 case GK_GFX902:
517 case GK_GFX900:
518 case GK_GFX9_GENERIC:
519 Features["gfx9-insts"] = true;
520 [[fallthrough]];
521 case GK_GFX810:
522 case GK_GFX805:
523 case GK_GFX803:
524 case GK_GFX802:
525 case GK_GFX801:
526 Features["gfx8-insts"] = true;
527 Features["16-bit-insts"] = true;
528 Features["dpp"] = true;
529 Features["s-memrealtime"] = true;
530 [[fallthrough]];
531 case GK_GFX705:
532 case GK_GFX704:
533 case GK_GFX703:
534 case GK_GFX702:
535 case GK_GFX701:
536 case GK_GFX700:
537 Features["ci-insts"] = true;
538 [[fallthrough]];
539 case GK_GFX602:
540 case GK_GFX601:
541 case GK_GFX600:
542 Features["image-insts"] = true;
543 Features["s-memtime-inst"] = true;
544 Features["gws"] = true;
545 break;
546 case GK_NONE:
547 break;
548 default:
549 llvm_unreachable("Unhandled GPU!");
550 }
551 } else {
552 if (GPU.empty())
553 GPU = "r600";
554
555 switch (llvm::AMDGPU::parseArchR600(GPU)) {
556 case GK_CAYMAN:
557 case GK_CYPRESS:
558 case GK_RV770:
559 case GK_RV670:
560 // TODO: Add fp64 when implemented.
561 break;
562 case GK_TURKS:
563 case GK_CAICOS:
564 case GK_BARTS:
565 case GK_SUMO:
566 case GK_REDWOOD:
567 case GK_JUNIPER:
568 case GK_CEDAR:
569 case GK_RV730:
570 case GK_RV710:
571 case GK_RS880:
572 case GK_R630:
573 case GK_R600:
574 break;
575 default:
576 llvm_unreachable("Unhandled GPU!");
577 }
578 }
579}
580
581static bool isWave32Capable(StringRef GPU, const Triple &T) {
582 bool IsWave32Capable = false;
583 // XXX - What does the member GPU mean if device name string passed here?
584 if (T.isAMDGCN()) {
585 switch (parseArchAMDGCN(GPU)) {
586 case GK_GFX1201:
587 case GK_GFX1200:
588 case GK_GFX1152:
589 case GK_GFX1151:
590 case GK_GFX1150:
591 case GK_GFX1103:
592 case GK_GFX1102:
593 case GK_GFX1101:
594 case GK_GFX1100:
595 case GK_GFX1036:
596 case GK_GFX1035:
597 case GK_GFX1034:
598 case GK_GFX1033:
599 case GK_GFX1032:
600 case GK_GFX1031:
601 case GK_GFX1030:
602 case GK_GFX1012:
603 case GK_GFX1011:
604 case GK_GFX1013:
605 case GK_GFX1010:
606 case GK_GFX12_GENERIC:
607 case GK_GFX11_GENERIC:
610 IsWave32Capable = true;
611 break;
612 default:
613 break;
614 }
615 }
616 return IsWave32Capable;
617}
618
619std::pair<FeatureError, StringRef>
621 StringMap<bool> &Features) {
622 bool IsWave32Capable = isWave32Capable(GPU, T);
623 const bool IsNullGPU = GPU.empty();
624 const bool HaveWave32 = Features.count("wavefrontsize32");
625 const bool HaveWave64 = Features.count("wavefrontsize64");
626 if (HaveWave32 && HaveWave64) {
628 "'wavefrontsize32' and 'wavefrontsize64' are mutually exclusive"};
629 }
630 if (HaveWave32 && !IsNullGPU && !IsWave32Capable) {
631 return {AMDGPU::UNSUPPORTED_TARGET_FEATURE, "wavefrontsize32"};
632 }
633 // Don't assume any wavesize with an unknown subtarget.
634 if (!IsNullGPU) {
635 // Default to wave32 if available, or wave64 if not
636 if (!HaveWave32 && !HaveWave64) {
637 StringRef DefaultWaveSizeFeature =
638 IsWave32Capable ? "wavefrontsize32" : "wavefrontsize64";
639 Features.insert(std::make_pair(DefaultWaveSizeFeature, true));
640 }
641 }
642 return {NO_ERROR, StringRef()};
643}
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
static GCRegistry::Add< ErlangGC > A("erlang", "erlang-compatible garbage collector")
#define I(x, y, z)
Definition: MD5.cpp:58
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),...
Definition: ArrayRef.h:41
iterator end() const
Definition: ArrayRef.h:154
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
Definition: SmallVector.h:586
void push_back(const T &Elt)
Definition: SmallVector.h:426
A wrapper around a string literal that serves as a proxy for constructing global tables of StringRefs...
Definition: StringRef.h:838
StringMap - This is an unconventional map that is specialized for handling keys that are "strings",...
Definition: StringMap.h:128
size_type count(StringRef Key) const
count - Return 1 if the element is in the map, 0 otherwise.
Definition: StringMap.h:276
bool insert(MapEntryTy *KeyValue)
insert - Insert the specified key/value pair into the map.
Definition: StringMap.h:308
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:50
constexpr bool empty() const
empty - Check if the string is empty.
Definition: StringRef.h:134
StringRef drop_back(size_t N=1) const
Return a StringRef equal to 'this' but with the last N elements dropped.
Definition: StringRef.h:601
Triple - Helper class for working with autoconf configuration names.
Definition: Triple.h:44
#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.
Definition: TargetParser.h:35
StringRef getCanonicalArchName(const Triple &T, StringRef Arch)
void fillValidArchListR600(SmallVectorImpl< StringRef > &Values)
StringRef getArchFamilyNameAMDGCN(GPUKind AK)
IsaVersion getIsaVersion(StringRef GPU)
void fillAMDGPUFeatureMap(StringRef GPU, const Triple &T, StringMap< bool > &Features)
Fills Features map with default values for given target GPU.
std::pair< FeatureError, StringRef > insertWaveSizeFeature(StringRef GPU, const Triple &T, StringMap< bool > &Features)
Inserts wave size feature for given GPU into features map.
void fillValidArchListAMDGCN(SmallVectorImpl< StringRef > &Values)
GPUKind parseArchAMDGCN(StringRef CPU)
@ UNSUPPORTED_TARGET_FEATURE
Definition: TargetParser.h:163
@ INVALID_FEATURE_COMBINATION
Definition: TargetParser.h:162
@ FEATURE_FAST_DENORMAL_F32
Definition: TargetParser.h:145
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.
Definition: CallingConv.h:34
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18
auto lower_bound(R &&Range, T &&Value)
Provide wrappers to std::lower_bound which take ranges instead of having to pass begin/end explicitly...
Definition: STLExtras.h:1961
Instruction set architecture version.
Definition: TargetParser.h:127