LLVM  15.0.0git
AMDGPUTargetStreamer.cpp
Go to the documentation of this file.
1 //===-- AMDGPUTargetStreamer.cpp - Mips Target Streamer Methods -----------===//
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 provides AMDGPU specific target streamer methods.
10 //
11 //===----------------------------------------------------------------------===//
12 
13 #include "AMDGPUTargetStreamer.h"
14 #include "AMDGPUPTNote.h"
15 #include "AMDKernelCodeT.h"
16 #include "Utils/AMDGPUBaseInfo.h"
19 #include "llvm/BinaryFormat/ELF.h"
20 #include "llvm/MC/MCAssembler.h"
21 #include "llvm/MC/MCContext.h"
22 #include "llvm/MC/MCELFStreamer.h"
23 #include "llvm/MC/MCSectionELF.h"
27 #include "llvm/Support/Casting.h"
30 
31 using namespace llvm;
32 using namespace llvm::AMDGPU;
33 
34 //===----------------------------------------------------------------------===//
35 // AMDGPUTargetStreamer
36 //===----------------------------------------------------------------------===//
37 
38 static void convertIsaVersionV2(uint32_t &Major, uint32_t &Minor,
39  uint32_t &Stepping, bool Sramecc, bool Xnack) {
40  if (Major == 9 && Minor == 0) {
41  switch (Stepping) {
42  case 0:
43  case 2:
44  case 4:
45  case 6:
46  if (Xnack)
47  Stepping++;
48  }
49  }
50 }
51 
53  HSAMD::Metadata HSAMetadata;
54  if (HSAMD::fromString(HSAMetadataString, HSAMetadata))
55  return false;
56  return EmitHSAMetadata(HSAMetadata);
57 }
58 
60  msgpack::Document HSAMetadataDoc;
61  if (!HSAMetadataDoc.fromYAML(HSAMetadataString))
62  return false;
63  return EmitHSAMetadata(HSAMetadataDoc, false);
64 }
65 
67  AMDGPU::GPUKind AK;
68 
69  switch (ElfMach) {
70  default: llvm_unreachable("Unhandled ELF::EF_AMDGPU type");
71  case ELF::EF_AMDGPU_MACH_R600_R600: AK = GK_R600; break;
72  case ELF::EF_AMDGPU_MACH_R600_R630: AK = GK_R630; break;
73  case ELF::EF_AMDGPU_MACH_R600_RS880: AK = GK_RS880; break;
74  case ELF::EF_AMDGPU_MACH_R600_RV670: AK = GK_RV670; break;
75  case ELF::EF_AMDGPU_MACH_R600_RV710: AK = GK_RV710; break;
76  case ELF::EF_AMDGPU_MACH_R600_RV730: AK = GK_RV730; break;
77  case ELF::EF_AMDGPU_MACH_R600_RV770: AK = GK_RV770; break;
78  case ELF::EF_AMDGPU_MACH_R600_CEDAR: AK = GK_CEDAR; break;
82  case ELF::EF_AMDGPU_MACH_R600_SUMO: AK = GK_SUMO; break;
83  case ELF::EF_AMDGPU_MACH_R600_BARTS: AK = GK_BARTS; break;
86  case ELF::EF_AMDGPU_MACH_R600_TURKS: AK = GK_TURKS; break;
125  case ELF::EF_AMDGPU_MACH_NONE: AK = GK_NONE; break;
126  }
127 
128  StringRef GPUName = getArchNameAMDGCN(AK);
129  if (GPUName != "")
130  return GPUName;
131  return getArchNameR600(AK);
132 }
133 
136  if (AK == AMDGPU::GPUKind::GK_NONE)
137  AK = parseArchR600(GPU);
138 
139  switch (AK) {
194  case GK_NONE: return ELF::EF_AMDGPU_MACH_NONE;
195  }
196 
197  llvm_unreachable("unknown GPU");
198 }
199 
200 //===----------------------------------------------------------------------===//
201 // AMDGPUTargetAsmStreamer
202 //===----------------------------------------------------------------------===//
203 
206  : AMDGPUTargetStreamer(S), OS(OS) { }
207 
208 // A hook for emitting stuff at the end.
209 // We use it for emitting the accumulated PAL metadata as directives.
210 // The PAL metadata is reset after it is emitted.
212  std::string S;
214  OS << S;
215 
216  // Reset the pal metadata so its data will not affect a compilation that
217  // reuses this object.
218  getPALMetadata()->reset();
219 }
220 
222  OS << "\t.amdgcn_target \"" << getTargetID()->toString() << "\"\n";
223 }
224 
226  uint32_t Major, uint32_t Minor) {
227  OS << "\t.hsa_code_object_version " <<
228  Twine(Major) << "," << Twine(Minor) << '\n';
229 }
230 
231 void
233  uint32_t Minor,
234  uint32_t Stepping,
235  StringRef VendorName,
236  StringRef ArchName) {
237  convertIsaVersionV2(Major, Minor, Stepping, TargetID->isSramEccOnOrAny(), TargetID->isXnackOnOrAny());
238  OS << "\t.hsa_code_object_isa " << Twine(Major) << "," << Twine(Minor) << ","
239  << Twine(Stepping) << ",\"" << VendorName << "\",\"" << ArchName << "\"\n";
240 }
241 
242 void
244  OS << "\t.amd_kernel_code_t\n";
245  dumpAmdKernelCode(&Header, OS, "\t\t");
246  OS << "\t.end_amd_kernel_code_t\n";
247 }
248 
250  unsigned Type) {
251  switch (Type) {
252  default: llvm_unreachable("Invalid AMDGPU symbol type");
254  OS << "\t.amdgpu_hsa_kernel " << SymbolName << '\n' ;
255  break;
256  }
257 }
258 
260  Align Alignment) {
261  OS << "\t.amdgpu_lds " << Symbol->getName() << ", " << Size << ", "
262  << Alignment.value() << '\n';
263 }
264 
266  OS << "\t.amd_amdgpu_isa \"" << getTargetID()->toString() << "\"\n";
267  return true;
268 }
269 
271  const AMDGPU::HSAMD::Metadata &HSAMetadata) {
272  std::string HSAMetadataString;
273  if (HSAMD::toString(HSAMetadata, HSAMetadataString))
274  return false;
275 
276  OS << '\t' << HSAMD::AssemblerDirectiveBegin << '\n';
277  OS << HSAMetadataString << '\n';
278  OS << '\t' << HSAMD::AssemblerDirectiveEnd << '\n';
279  return true;
280 }
281 
283  msgpack::Document &HSAMetadataDoc, bool Strict) {
285  if (!Verifier.verify(HSAMetadataDoc.getRoot()))
286  return false;
287 
288  std::string HSAMetadataString;
289  raw_string_ostream StrOS(HSAMetadataString);
290  HSAMetadataDoc.toYAML(StrOS);
291 
292  OS << '\t' << HSAMD::V3::AssemblerDirectiveBegin << '\n';
293  OS << StrOS.str() << '\n';
294  OS << '\t' << HSAMD::V3::AssemblerDirectiveEnd << '\n';
295  return true;
296 }
297 
299  const uint32_t Encoded_s_code_end = 0xbf9f0000;
300  const uint32_t Encoded_s_nop = 0xbf800000;
301  uint32_t Encoded_pad = Encoded_s_code_end;
302 
303  // Instruction cache line size in bytes.
304  const unsigned Log2CacheLineSize = AMDGPU::isGFX11Plus(STI) ? 7 : 6;
305  const unsigned CacheLineSize = 1u << Log2CacheLineSize;
306 
307  // Extra padding amount in bytes to support prefetch mode 3.
308  unsigned FillSize = 3 * CacheLineSize;
309 
310  if (AMDGPU::isGFX90A(STI)) {
311  Encoded_pad = Encoded_s_nop;
312  FillSize = 16 * CacheLineSize;
313  }
314 
315  OS << "\t.p2alignl " << Log2CacheLineSize << ", " << Encoded_pad << '\n';
316  OS << "\t.fill " << (FillSize / 4) << ", 4, " << Encoded_pad << '\n';
317  return true;
318 }
319 
321  const MCSubtargetInfo &STI, StringRef KernelName,
322  const amdhsa::kernel_descriptor_t &KD, uint64_t NextVGPR, uint64_t NextSGPR,
323  bool ReserveVCC, bool ReserveFlatScr) {
324  IsaVersion IVersion = getIsaVersion(STI.getCPU());
325 
326  OS << "\t.amdhsa_kernel " << KernelName << '\n';
327 
328 #define PRINT_FIELD(STREAM, DIRECTIVE, KERNEL_DESC, MEMBER_NAME, FIELD_NAME) \
329  STREAM << "\t\t" << DIRECTIVE << " " \
330  << AMDHSA_BITS_GET(KERNEL_DESC.MEMBER_NAME, FIELD_NAME) << '\n';
331 
332  OS << "\t\t.amdhsa_group_segment_fixed_size " << KD.group_segment_fixed_size
333  << '\n';
334  OS << "\t\t.amdhsa_private_segment_fixed_size "
335  << KD.private_segment_fixed_size << '\n';
336  OS << "\t\t.amdhsa_kernarg_size " << KD.kernarg_size << '\n';
337 
338  PRINT_FIELD(OS, ".amdhsa_user_sgpr_count", KD,
339  compute_pgm_rsrc2,
340  amdhsa::COMPUTE_PGM_RSRC2_USER_SGPR_COUNT);
341 
342  if (!hasArchitectedFlatScratch(STI))
343  PRINT_FIELD(
344  OS, ".amdhsa_user_sgpr_private_segment_buffer", KD,
345  kernel_code_properties,
346  amdhsa::KERNEL_CODE_PROPERTY_ENABLE_SGPR_PRIVATE_SEGMENT_BUFFER);
347  PRINT_FIELD(OS, ".amdhsa_user_sgpr_dispatch_ptr", KD,
348  kernel_code_properties,
349  amdhsa::KERNEL_CODE_PROPERTY_ENABLE_SGPR_DISPATCH_PTR);
350  PRINT_FIELD(OS, ".amdhsa_user_sgpr_queue_ptr", KD,
351  kernel_code_properties,
352  amdhsa::KERNEL_CODE_PROPERTY_ENABLE_SGPR_QUEUE_PTR);
353  PRINT_FIELD(OS, ".amdhsa_user_sgpr_kernarg_segment_ptr", KD,
354  kernel_code_properties,
355  amdhsa::KERNEL_CODE_PROPERTY_ENABLE_SGPR_KERNARG_SEGMENT_PTR);
356  PRINT_FIELD(OS, ".amdhsa_user_sgpr_dispatch_id", KD,
357  kernel_code_properties,
358  amdhsa::KERNEL_CODE_PROPERTY_ENABLE_SGPR_DISPATCH_ID);
359  if (!hasArchitectedFlatScratch(STI))
360  PRINT_FIELD(OS, ".amdhsa_user_sgpr_flat_scratch_init", KD,
361  kernel_code_properties,
362  amdhsa::KERNEL_CODE_PROPERTY_ENABLE_SGPR_FLAT_SCRATCH_INIT);
363  PRINT_FIELD(OS, ".amdhsa_user_sgpr_private_segment_size", KD,
364  kernel_code_properties,
365  amdhsa::KERNEL_CODE_PROPERTY_ENABLE_SGPR_PRIVATE_SEGMENT_SIZE);
366  if (IVersion.Major >= 10)
367  PRINT_FIELD(OS, ".amdhsa_wavefront_size32", KD,
368  kernel_code_properties,
369  amdhsa::KERNEL_CODE_PROPERTY_ENABLE_WAVEFRONT_SIZE32);
370  PRINT_FIELD(OS,
372  ? ".amdhsa_enable_private_segment"
373  : ".amdhsa_system_sgpr_private_segment_wavefront_offset"),
374  KD, compute_pgm_rsrc2,
375  amdhsa::COMPUTE_PGM_RSRC2_ENABLE_PRIVATE_SEGMENT);
376  PRINT_FIELD(OS, ".amdhsa_system_sgpr_workgroup_id_x", KD,
377  compute_pgm_rsrc2,
378  amdhsa::COMPUTE_PGM_RSRC2_ENABLE_SGPR_WORKGROUP_ID_X);
379  PRINT_FIELD(OS, ".amdhsa_system_sgpr_workgroup_id_y", KD,
380  compute_pgm_rsrc2,
381  amdhsa::COMPUTE_PGM_RSRC2_ENABLE_SGPR_WORKGROUP_ID_Y);
382  PRINT_FIELD(OS, ".amdhsa_system_sgpr_workgroup_id_z", KD,
383  compute_pgm_rsrc2,
384  amdhsa::COMPUTE_PGM_RSRC2_ENABLE_SGPR_WORKGROUP_ID_Z);
385  PRINT_FIELD(OS, ".amdhsa_system_sgpr_workgroup_info", KD,
386  compute_pgm_rsrc2,
387  amdhsa::COMPUTE_PGM_RSRC2_ENABLE_SGPR_WORKGROUP_INFO);
388  PRINT_FIELD(OS, ".amdhsa_system_vgpr_workitem_id", KD,
389  compute_pgm_rsrc2,
390  amdhsa::COMPUTE_PGM_RSRC2_ENABLE_VGPR_WORKITEM_ID);
391 
392  // These directives are required.
393  OS << "\t\t.amdhsa_next_free_vgpr " << NextVGPR << '\n';
394  OS << "\t\t.amdhsa_next_free_sgpr " << NextSGPR << '\n';
395 
396  if (AMDGPU::isGFX90A(STI))
397  OS << "\t\t.amdhsa_accum_offset " <<
399  amdhsa::COMPUTE_PGM_RSRC3_GFX90A_ACCUM_OFFSET) + 1) * 4
400  << '\n';
401 
402  if (!ReserveVCC)
403  OS << "\t\t.amdhsa_reserve_vcc " << ReserveVCC << '\n';
404  if (IVersion.Major >= 7 && !ReserveFlatScr && !hasArchitectedFlatScratch(STI))
405  OS << "\t\t.amdhsa_reserve_flat_scratch " << ReserveFlatScr << '\n';
406 
407  if (Optional<uint8_t> HsaAbiVer = getHsaAbiVersion(&STI)) {
408  switch (*HsaAbiVer) {
409  default:
410  break;
412  break;
416  if (getTargetID()->isXnackSupported())
417  OS << "\t\t.amdhsa_reserve_xnack_mask " << getTargetID()->isXnackOnOrAny() << '\n';
418  break;
419  }
420  }
421 
422  PRINT_FIELD(OS, ".amdhsa_float_round_mode_32", KD,
423  compute_pgm_rsrc1,
424  amdhsa::COMPUTE_PGM_RSRC1_FLOAT_ROUND_MODE_32);
425  PRINT_FIELD(OS, ".amdhsa_float_round_mode_16_64", KD,
426  compute_pgm_rsrc1,
427  amdhsa::COMPUTE_PGM_RSRC1_FLOAT_ROUND_MODE_16_64);
428  PRINT_FIELD(OS, ".amdhsa_float_denorm_mode_32", KD,
429  compute_pgm_rsrc1,
430  amdhsa::COMPUTE_PGM_RSRC1_FLOAT_DENORM_MODE_32);
431  PRINT_FIELD(OS, ".amdhsa_float_denorm_mode_16_64", KD,
432  compute_pgm_rsrc1,
433  amdhsa::COMPUTE_PGM_RSRC1_FLOAT_DENORM_MODE_16_64);
434  PRINT_FIELD(OS, ".amdhsa_dx10_clamp", KD,
435  compute_pgm_rsrc1,
436  amdhsa::COMPUTE_PGM_RSRC1_ENABLE_DX10_CLAMP);
437  PRINT_FIELD(OS, ".amdhsa_ieee_mode", KD,
438  compute_pgm_rsrc1,
439  amdhsa::COMPUTE_PGM_RSRC1_ENABLE_IEEE_MODE);
440  if (IVersion.Major >= 9)
441  PRINT_FIELD(OS, ".amdhsa_fp16_overflow", KD,
442  compute_pgm_rsrc1,
443  amdhsa::COMPUTE_PGM_RSRC1_FP16_OVFL);
444  if (AMDGPU::isGFX90A(STI))
445  PRINT_FIELD(OS, ".amdhsa_tg_split", KD,
446  compute_pgm_rsrc3,
447  amdhsa::COMPUTE_PGM_RSRC3_GFX90A_TG_SPLIT);
448  if (IVersion.Major >= 10) {
449  PRINT_FIELD(OS, ".amdhsa_workgroup_processor_mode", KD,
450  compute_pgm_rsrc1,
451  amdhsa::COMPUTE_PGM_RSRC1_WGP_MODE);
452  PRINT_FIELD(OS, ".amdhsa_memory_ordered", KD,
453  compute_pgm_rsrc1,
454  amdhsa::COMPUTE_PGM_RSRC1_MEM_ORDERED);
455  PRINT_FIELD(OS, ".amdhsa_forward_progress", KD,
456  compute_pgm_rsrc1,
457  amdhsa::COMPUTE_PGM_RSRC1_FWD_PROGRESS);
458  PRINT_FIELD(OS, ".amdhsa_shared_vgpr_count", KD, compute_pgm_rsrc3,
459  amdhsa::COMPUTE_PGM_RSRC3_GFX10_PLUS_SHARED_VGPR_COUNT);
460  }
461  PRINT_FIELD(
462  OS, ".amdhsa_exception_fp_ieee_invalid_op", KD,
463  compute_pgm_rsrc2,
464  amdhsa::COMPUTE_PGM_RSRC2_ENABLE_EXCEPTION_IEEE_754_FP_INVALID_OPERATION);
465  PRINT_FIELD(OS, ".amdhsa_exception_fp_denorm_src", KD,
466  compute_pgm_rsrc2,
467  amdhsa::COMPUTE_PGM_RSRC2_ENABLE_EXCEPTION_FP_DENORMAL_SOURCE);
468  PRINT_FIELD(
469  OS, ".amdhsa_exception_fp_ieee_div_zero", KD,
470  compute_pgm_rsrc2,
471  amdhsa::COMPUTE_PGM_RSRC2_ENABLE_EXCEPTION_IEEE_754_FP_DIVISION_BY_ZERO);
472  PRINT_FIELD(OS, ".amdhsa_exception_fp_ieee_overflow", KD,
473  compute_pgm_rsrc2,
474  amdhsa::COMPUTE_PGM_RSRC2_ENABLE_EXCEPTION_IEEE_754_FP_OVERFLOW);
475  PRINT_FIELD(OS, ".amdhsa_exception_fp_ieee_underflow", KD,
476  compute_pgm_rsrc2,
477  amdhsa::COMPUTE_PGM_RSRC2_ENABLE_EXCEPTION_IEEE_754_FP_UNDERFLOW);
478  PRINT_FIELD(OS, ".amdhsa_exception_fp_ieee_inexact", KD,
479  compute_pgm_rsrc2,
480  amdhsa::COMPUTE_PGM_RSRC2_ENABLE_EXCEPTION_IEEE_754_FP_INEXACT);
481  PRINT_FIELD(OS, ".amdhsa_exception_int_div_zero", KD,
482  compute_pgm_rsrc2,
483  amdhsa::COMPUTE_PGM_RSRC2_ENABLE_EXCEPTION_INT_DIVIDE_BY_ZERO);
484 #undef PRINT_FIELD
485 
486  OS << "\t.end_amdhsa_kernel\n";
487 }
488 
489 //===----------------------------------------------------------------------===//
490 // AMDGPUTargetELFStreamer
491 //===----------------------------------------------------------------------===//
492 
494  const MCSubtargetInfo &STI)
495  : AMDGPUTargetStreamer(S), STI(STI), Streamer(S) {}
496 
498  return static_cast<MCELFStreamer &>(Streamer);
499 }
500 
501 // A hook for emitting stuff at the end.
502 // We use it for emitting the accumulated PAL metadata as a .note record.
503 // The PAL metadata is reset after it is emitted.
506  MCA.setELFHeaderEFlags(getEFlags());
507 
508  std::string Blob;
509  const char *Vendor = getPALMetadata()->getVendor();
510  unsigned Type = getPALMetadata()->getType();
511  getPALMetadata()->toBlob(Type, Blob);
512  if (Blob.empty())
513  return;
514  EmitNote(Vendor, MCConstantExpr::create(Blob.size(), getContext()), Type,
515  [&](MCELFStreamer &OS) { OS.emitBytes(Blob); });
516 
517  // Reset the pal metadata so its data will not affect a compilation that
518  // reuses this object.
519  getPALMetadata()->reset();
520 }
521 
522 void AMDGPUTargetELFStreamer::EmitNote(
523  StringRef Name, const MCExpr *DescSZ, unsigned NoteType,
524  function_ref<void(MCELFStreamer &)> EmitDesc) {
525  auto &S = getStreamer();
526  auto &Context = S.getContext();
527 
528  auto NameSZ = Name.size() + 1;
529 
530  unsigned NoteFlags = 0;
531  // TODO Apparently, this is currently needed for OpenCL as mentioned in
532  // https://reviews.llvm.org/D74995
533  if (STI.getTargetTriple().getOS() == Triple::AMDHSA)
534  NoteFlags = ELF::SHF_ALLOC;
535 
536  S.pushSection();
537  S.switchSection(
538  Context.getELFSection(ElfNote::SectionName, ELF::SHT_NOTE, NoteFlags));
539  S.emitInt32(NameSZ); // namesz
540  S.emitValue(DescSZ, 4); // descz
541  S.emitInt32(NoteType); // type
542  S.emitBytes(Name); // name
543  S.emitValueToAlignment(4, 0, 1, 0); // padding 0
544  EmitDesc(S); // desc
545  S.emitValueToAlignment(4, 0, 1, 0); // padding 0
546  S.popSection();
547 }
548 
549 unsigned AMDGPUTargetELFStreamer::getEFlags() {
550  switch (STI.getTargetTriple().getArch()) {
551  default:
552  llvm_unreachable("Unsupported Arch");
553  case Triple::r600:
554  return getEFlagsR600();
555  case Triple::amdgcn:
556  return getEFlagsAMDGCN();
557  }
558 }
559 
560 unsigned AMDGPUTargetELFStreamer::getEFlagsR600() {
562 
563  return getElfMach(STI.getCPU());
564 }
565 
566 unsigned AMDGPUTargetELFStreamer::getEFlagsAMDGCN() {
568 
569  switch (STI.getTargetTriple().getOS()) {
570  default:
571  // TODO: Why are some tests have "mingw" listed as OS?
572  // llvm_unreachable("Unsupported OS");
573  case Triple::UnknownOS:
574  return getEFlagsUnknownOS();
575  case Triple::AMDHSA:
576  return getEFlagsAMDHSA();
577  case Triple::AMDPAL:
578  return getEFlagsAMDPAL();
579  case Triple::Mesa3D:
580  return getEFlagsMesa3D();
581  }
582 }
583 
584 unsigned AMDGPUTargetELFStreamer::getEFlagsUnknownOS() {
585  // TODO: Why are some tests have "mingw" listed as OS?
586  // assert(STI.getTargetTriple().getOS() == Triple::UnknownOS);
587 
588  return getEFlagsV3();
589 }
590 
591 unsigned AMDGPUTargetELFStreamer::getEFlagsAMDHSA() {
593 
594  if (Optional<uint8_t> HsaAbiVer = getHsaAbiVersion(&STI)) {
595  switch (*HsaAbiVer) {
598  return getEFlagsV3();
601  return getEFlagsV4();
602  }
603  }
604 
605  llvm_unreachable("HSA OS ABI Version identification must be defined");
606 }
607 
608 unsigned AMDGPUTargetELFStreamer::getEFlagsAMDPAL() {
610 
611  return getEFlagsV3();
612 }
613 
614 unsigned AMDGPUTargetELFStreamer::getEFlagsMesa3D() {
616 
617  return getEFlagsV3();
618 }
619 
620 unsigned AMDGPUTargetELFStreamer::getEFlagsV3() {
621  unsigned EFlagsV3 = 0;
622 
623  // mach.
624  EFlagsV3 |= getElfMach(STI.getCPU());
625 
626  // xnack.
627  if (getTargetID()->isXnackOnOrAny())
629  // sramecc.
630  if (getTargetID()->isSramEccOnOrAny())
632 
633  return EFlagsV3;
634 }
635 
636 unsigned AMDGPUTargetELFStreamer::getEFlagsV4() {
637  unsigned EFlagsV4 = 0;
638 
639  // mach.
640  EFlagsV4 |= getElfMach(STI.getCPU());
641 
642  // xnack.
643  switch (getTargetID()->getXnackSetting()) {
646  break;
649  break;
652  break;
655  break;
656  }
657  // sramecc.
658  switch (getTargetID()->getSramEccSetting()) {
661  break;
664  break;
667  break;
670  break;
671  }
672 
673  return EFlagsV4;
674 }
675 
677 
679  uint32_t Major, uint32_t Minor) {
680 
683  OS.emitInt32(Major);
684  OS.emitInt32(Minor);
685  });
686 }
687 
688 void
690  uint32_t Minor,
691  uint32_t Stepping,
692  StringRef VendorName,
693  StringRef ArchName) {
694  uint16_t VendorNameSize = VendorName.size() + 1;
695  uint16_t ArchNameSize = ArchName.size() + 1;
696 
697  unsigned DescSZ = sizeof(VendorNameSize) + sizeof(ArchNameSize) +
698  sizeof(Major) + sizeof(Minor) + sizeof(Stepping) +
699  VendorNameSize + ArchNameSize;
700 
701  convertIsaVersionV2(Major, Minor, Stepping, TargetID->isSramEccOnOrAny(), TargetID->isXnackOnOrAny());
704  OS.emitInt16(VendorNameSize);
705  OS.emitInt16(ArchNameSize);
706  OS.emitInt32(Major);
707  OS.emitInt32(Minor);
708  OS.emitInt32(Stepping);
709  OS.emitBytes(VendorName);
710  OS.emitInt8(0); // NULL terminate VendorName
711  OS.emitBytes(ArchName);
712  OS.emitInt8(0); // NULL terminate ArchName
713  });
714 }
715 
716 void
718 
719  MCStreamer &OS = getStreamer();
720  OS.pushSection();
721  OS.emitBytes(StringRef((const char*)&Header, sizeof(Header)));
722  OS.popSection();
723 }
724 
726  unsigned Type) {
727  MCSymbolELF *Symbol = cast<MCSymbolELF>(
728  getStreamer().getContext().getOrCreateSymbol(SymbolName));
729  Symbol->setType(Type);
730 }
731 
733  Align Alignment) {
734  MCSymbolELF *SymbolELF = cast<MCSymbolELF>(Symbol);
735  SymbolELF->setType(ELF::STT_OBJECT);
736 
737  if (!SymbolELF->isBindingSet()) {
738  SymbolELF->setBinding(ELF::STB_GLOBAL);
739  SymbolELF->setExternal(true);
740  }
741 
742  if (SymbolELF->declareCommon(Size, Alignment.value(), true)) {
743  report_fatal_error("Symbol: " + Symbol->getName() +
744  " redeclared as different type");
745  }
746 
747  SymbolELF->setIndex(ELF::SHN_AMDGPU_LDS);
749 }
750 
752  // Create two labels to mark the beginning and end of the desc field
753  // and a MCExpr to calculate the size of the desc field.
754  auto &Context = getContext();
755  auto *DescBegin = Context.createTempSymbol();
756  auto *DescEnd = Context.createTempSymbol();
757  auto *DescSZ = MCBinaryExpr::createSub(
760 
762  [&](MCELFStreamer &OS) {
763  OS.emitLabel(DescBegin);
764  OS.emitBytes(getTargetID()->toString());
765  OS.emitLabel(DescEnd);
766  });
767  return true;
768 }
769 
771  bool Strict) {
773  if (!Verifier.verify(HSAMetadataDoc.getRoot()))
774  return false;
775 
776  std::string HSAMetadataString;
777  HSAMetadataDoc.writeToBlob(HSAMetadataString);
778 
779  // Create two labels to mark the beginning and end of the desc field
780  // and a MCExpr to calculate the size of the desc field.
781  auto &Context = getContext();
782  auto *DescBegin = Context.createTempSymbol();
783  auto *DescEnd = Context.createTempSymbol();
784  auto *DescSZ = MCBinaryExpr::createSub(
787 
789  [&](MCELFStreamer &OS) {
790  OS.emitLabel(DescBegin);
791  OS.emitBytes(HSAMetadataString);
792  OS.emitLabel(DescEnd);
793  });
794  return true;
795 }
796 
798  const AMDGPU::HSAMD::Metadata &HSAMetadata) {
799  std::string HSAMetadataString;
800  if (HSAMD::toString(HSAMetadata, HSAMetadataString))
801  return false;
802 
803  // Create two labels to mark the beginning and end of the desc field
804  // and a MCExpr to calculate the size of the desc field.
805  auto &Context = getContext();
806  auto *DescBegin = Context.createTempSymbol();
807  auto *DescEnd = Context.createTempSymbol();
808  auto *DescSZ = MCBinaryExpr::createSub(
811 
813  [&](MCELFStreamer &OS) {
814  OS.emitLabel(DescBegin);
815  OS.emitBytes(HSAMetadataString);
816  OS.emitLabel(DescEnd);
817  });
818  return true;
819 }
820 
822  const uint32_t Encoded_s_code_end = 0xbf9f0000;
823  const uint32_t Encoded_s_nop = 0xbf800000;
824  uint32_t Encoded_pad = Encoded_s_code_end;
825 
826  // Instruction cache line size in bytes.
827  const unsigned Log2CacheLineSize = AMDGPU::isGFX11Plus(STI) ? 7 : 6;
828  const unsigned CacheLineSize = 1u << Log2CacheLineSize;
829 
830  // Extra padding amount in bytes to support prefetch mode 3.
831  unsigned FillSize = 3 * CacheLineSize;
832 
833  if (AMDGPU::isGFX90A(STI)) {
834  Encoded_pad = Encoded_s_nop;
835  FillSize = 16 * CacheLineSize;
836  }
837 
838  MCStreamer &OS = getStreamer();
839  OS.pushSection();
840  OS.emitValueToAlignment(CacheLineSize, Encoded_pad, 4);
841  for (unsigned I = 0; I < FillSize; I += 4)
842  OS.emitInt32(Encoded_pad);
843  OS.popSection();
844  return true;
845 }
846 
848  const MCSubtargetInfo &STI, StringRef KernelName,
849  const amdhsa::kernel_descriptor_t &KernelDescriptor, uint64_t NextVGPR,
850  uint64_t NextSGPR, bool ReserveVCC, bool ReserveFlatScr) {
851  auto &Streamer = getStreamer();
852  auto &Context = Streamer.getContext();
853 
854  MCSymbolELF *KernelCodeSymbol = cast<MCSymbolELF>(
855  Context.getOrCreateSymbol(Twine(KernelName)));
856  MCSymbolELF *KernelDescriptorSymbol = cast<MCSymbolELF>(
857  Context.getOrCreateSymbol(Twine(KernelName) + Twine(".kd")));
858 
859  // Copy kernel descriptor symbol's binding, other and visibility from the
860  // kernel code symbol.
861  KernelDescriptorSymbol->setBinding(KernelCodeSymbol->getBinding());
862  KernelDescriptorSymbol->setOther(KernelCodeSymbol->getOther());
863  KernelDescriptorSymbol->setVisibility(KernelCodeSymbol->getVisibility());
864  // Kernel descriptor symbol's type and size are fixed.
865  KernelDescriptorSymbol->setType(ELF::STT_OBJECT);
866  KernelDescriptorSymbol->setSize(
867  MCConstantExpr::create(sizeof(KernelDescriptor), Context));
868 
869  // The visibility of the kernel code symbol must be protected or less to allow
870  // static relocations from the kernel descriptor to be used.
871  if (KernelCodeSymbol->getVisibility() == ELF::STV_DEFAULT)
872  KernelCodeSymbol->setVisibility(ELF::STV_PROTECTED);
873 
874  Streamer.emitLabel(KernelDescriptorSymbol);
875  Streamer.emitInt32(KernelDescriptor.group_segment_fixed_size);
876  Streamer.emitInt32(KernelDescriptor.private_segment_fixed_size);
877  Streamer.emitInt32(KernelDescriptor.kernarg_size);
878 
879  for (uint8_t Res : KernelDescriptor.reserved0)
880  Streamer.emitInt8(Res);
881 
882  // FIXME: Remove the use of VK_AMDGPU_REL64 in the expression below. The
883  // expression being created is:
884  // (start of kernel code) - (start of kernel descriptor)
885  // It implies R_AMDGPU_REL64, but ends up being R_AMDGPU_ABS64.
888  KernelCodeSymbol, MCSymbolRefExpr::VK_AMDGPU_REL64, Context),
890  KernelDescriptorSymbol, MCSymbolRefExpr::VK_None, Context),
891  Context),
892  sizeof(KernelDescriptor.kernel_code_entry_byte_offset));
893  for (uint8_t Res : KernelDescriptor.reserved1)
894  Streamer.emitInt8(Res);
895  Streamer.emitInt32(KernelDescriptor.compute_pgm_rsrc3);
896  Streamer.emitInt32(KernelDescriptor.compute_pgm_rsrc1);
897  Streamer.emitInt32(KernelDescriptor.compute_pgm_rsrc2);
898  Streamer.emitInt16(KernelDescriptor.kernel_code_properties);
899  for (uint8_t Res : KernelDescriptor.reserved2)
900  Streamer.emitInt8(Res);
901 }
llvm::ELF::EF_AMDGPU_MACH_R600_SUMO
@ EF_AMDGPU_MACH_R600_SUMO
Definition: ELF.h:718
llvm::Check::Size
@ Size
Definition: FileCheck.h:77
AMDGPUPTNote.h
llvm::AMDGPUTargetStreamer::getTargetID
const Optional< AMDGPU::IsaInfo::AMDGPUTargetID > & getTargetID() const
Definition: AMDGPUTargetStreamer.h:97
llvm::ELF::EF_AMDGPU_MACH_AMDGCN_GFX1031
@ EF_AMDGPU_MACH_AMDGCN_GFX1031
Definition: ELF.h:757
llvm::AMDGPU::GK_GFX802
@ GK_GFX802
Definition: TargetParser.h:76
llvm::AMDGPU::GK_GFX703
@ GK_GFX703
Definition: TargetParser.h:71
llvm::AMDGPU::GK_GFX1034
@ GK_GFX1034
Definition: TargetParser.h:99
llvm
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:17
llvm::AMDGPU::GK_GFX801
@ GK_GFX801
Definition: TargetParser.h:75
llvm::MCSymbol
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
Definition: MCSymbol.h:41
llvm::ELF::EF_AMDGPU_MACH_AMDGCN_GFX1030
@ EF_AMDGPU_MACH_AMDGCN_GFX1030
Definition: ELF.h:756
llvm::AMDGPU::GPUKind
GPUKind
GPU kinds supported by the AMDGPU target.
Definition: TargetParser.h:38
llvm::ELF::EF_AMDGPU_MACH_AMDGCN_GFX1036
@ EF_AMDGPU_MACH_AMDGCN_GFX1036
Definition: ELF.h:771
llvm::AMDGPUTargetStreamer::getContext
MCContext & getContext() const
Definition: AMDGPUTargetStreamer.h:41
llvm::AMDGPU::GK_CAYMAN
@ GK_CAYMAN
Definition: TargetParser.h:57
convertIsaVersionV2
static void convertIsaVersionV2(uint32_t &Major, uint32_t &Minor, uint32_t &Stepping, bool Sramecc, bool Xnack)
Definition: AMDGPUTargetStreamer.cpp:38
llvm::ELF::EF_AMDGPU_MACH_AMDGCN_GFX703
@ EF_AMDGPU_MACH_AMDGCN_GFX703
Definition: ELF.h:739
llvm::ELF::EF_AMDGPU_FEATURE_XNACK_ANY_V4
@ EF_AMDGPU_FEATURE_XNACK_ANY_V4
Definition: ELF.h:808
llvm::AMDGPUTargetAsmStreamer::EmitISAVersion
bool EmitISAVersion() override
Definition: AMDGPUTargetStreamer.cpp:265
llvm::AMDGPU::GK_RV670
@ GK_RV670
Definition: TargetParser.h:46
llvm::MCELFStreamer::emitLabel
void emitLabel(MCSymbol *Symbol, SMLoc Loc=SMLoc()) override
Emit a label for Symbol into the current section.
Definition: MCELFStreamer.cpp:100
llvm::AMDGPU::GK_RV730
@ GK_RV730
Definition: TargetParser.h:48
llvm::ELF::EF_AMDGPU_MACH_R600_RV730
@ EF_AMDGPU_MACH_R600_RV730
Definition: ELF.h:711
llvm::AMDGPU::isGFX11Plus
bool isGFX11Plus(const MCSubtargetInfo &STI)
Definition: AMDGPUBaseInfo.cpp:1752
llvm::ELF::NT_AMD_HSA_ISA_VERSION
@ NT_AMD_HSA_ISA_VERSION
Definition: ELF.h:1706
llvm::AMDGPU::getIsaVersion
IsaVersion getIsaVersion(StringRef GPU)
Definition: TargetParser.cpp:193
llvm::AMDGPU::GK_GFX900
@ GK_GFX900
Definition: TargetParser.h:81
llvm::ELF::EF_AMDGPU_MACH_AMDGCN_GFX601
@ EF_AMDGPU_MACH_AMDGCN_GFX601
Definition: ELF.h:735
llvm::AMDGPUTargetAsmStreamer::AMDGPUTargetAsmStreamer
AMDGPUTargetAsmStreamer(MCStreamer &S, formatted_raw_ostream &OS)
Definition: AMDGPUTargetStreamer.cpp:204
llvm::ELF::EF_AMDGPU_MACH_AMDGCN_GFX1011
@ EF_AMDGPU_MACH_AMDGCN_GFX1011
Definition: ELF.h:754
llvm::ELF::EF_AMDGPU_MACH_AMDGCN_GFX90C
@ EF_AMDGPU_MACH_AMDGCN_GFX90C
Definition: ELF.h:752
llvm::AMDGPU::GK_R600
@ GK_R600
Definition: TargetParser.h:43
llvm::dumpAmdKernelCode
void dumpAmdKernelCode(const amd_kernel_code_t *C, raw_ostream &OS, const char *tab)
Definition: AMDKernelCodeTUtils.cpp:104
llvm::raw_string_ostream
A raw_ostream that writes to an std::string.
Definition: raw_ostream.h:632
llvm::AMDGPU::parseArchR600
GPUKind parseArchR600(StringRef CPU)
Definition: TargetParser.cpp:161
llvm::MCConstantExpr::create
static const MCConstantExpr * create(int64_t Value, MCContext &Ctx, bool PrintInHex=false, unsigned SizeInBytes=0)
Definition: MCExpr.cpp:194
llvm::AMDGPU::IsaInfo::TargetIDSetting::Unsupported
@ Unsupported
MCSectionELF.h
llvm::MCStreamer::emitInt8
void emitInt8(uint64_t Value)
Definition: MCStreamer.h:736
llvm::AMDGPUTargetAsmStreamer::EmitAmdhsaKernelDescriptor
void EmitAmdhsaKernelDescriptor(const MCSubtargetInfo &STI, StringRef KernelName, const amdhsa::kernel_descriptor_t &KernelDescriptor, uint64_t NextVGPR, uint64_t NextSGPR, bool ReserveVCC, bool ReserveFlatScr) override
Definition: AMDGPUTargetStreamer.cpp:320
llvm::ELF::EF_AMDGPU_MACH_AMDGCN_GFX1013
@ EF_AMDGPU_MACH_AMDGCN_GFX1013
Definition: ELF.h:768
llvm::AMDGPU::IsaInfo::TargetIDSetting::On
@ On
llvm::Triple::amdgcn
@ amdgcn
Definition: Triple.h:74
llvm::AMDGPU::GK_GFX1013
@ GK_GFX1013
Definition: TargetParser.h:94
llvm::MCSymbolELF::getVisibility
unsigned getVisibility() const
Definition: MCSymbolELF.cpp:152
llvm::AMDGPU::GK_GFX810
@ GK_GFX810
Definition: TargetParser.h:79
AMDGPUMetadataVerifier.h
llvm::ELF::EF_AMDGPU_FEATURE_SRAMECC_OFF_V4
@ EF_AMDGPU_FEATURE_SRAMECC_OFF_V4
Definition: ELF.h:823
llvm::AMDGPU::hasArchitectedFlatScratch
bool hasArchitectedFlatScratch(const MCSubtargetInfo &STI)
Definition: AMDGPUBaseInfo.cpp:1792
llvm::AMDGPU::getHsaAbiVersion
Optional< uint8_t > getHsaAbiVersion(const MCSubtargetInfo *STI)
Definition: AMDGPUBaseInfo.cpp:105
llvm::ELF::EF_AMDGPU_MACH_AMDGCN_GFX1103
@ EF_AMDGPU_MACH_AMDGCN_GFX1103
Definition: ELF.h:770
llvm::ELF::EF_AMDGPU_MACH_AMDGCN_GFX1100
@ EF_AMDGPU_MACH_AMDGCN_GFX1100
Definition: ELF.h:767
llvm::ELF::EF_AMDGPU_MACH_AMDGCN_GFX805
@ EF_AMDGPU_MACH_AMDGCN_GFX805
Definition: ELF.h:762
MCAssembler.h
llvm::ELF::EF_AMDGPU_MACH_AMDGCN_GFX602
@ EF_AMDGPU_MACH_AMDGCN_GFX602
Definition: ELF.h:760
llvm::AMDGPUPALMetadata::toString
void toString(std::string &S)
Definition: AMDGPUPALMetadata.cpp:664
llvm::MCStreamer::emitValue
void emitValue(const MCExpr *Value, unsigned Size, SMLoc Loc=SMLoc())
Definition: MCStreamer.cpp:178
llvm::AMDGPU::GK_GFX700
@ GK_GFX700
Definition: TargetParser.h:68
llvm::AMDGPU::GK_GFX803
@ GK_GFX803
Definition: TargetParser.h:77
llvm::Type
The instances of the Type class are immutable: once they are created, they are never changed.
Definition: Type.h:45
llvm::MCStreamer::popSection
bool popSection()
Restore the current and previous section from the section stack.
Definition: MCStreamer.h:420
llvm::MCStreamer::emitInt32
void emitInt32(uint64_t Value)
Definition: MCStreamer.h:738
llvm::AMDGPU::GK_CEDAR
@ GK_CEDAR
Definition: TargetParser.h:50
llvm::AMDGPUTargetAsmStreamer::EmitDirectiveHSACodeObjectVersion
void EmitDirectiveHSACodeObjectVersion(uint32_t Major, uint32_t Minor) override
Definition: AMDGPUTargetStreamer.cpp:225
llvm::Optional< uint8_t >
llvm::AMDGPU::GK_GFX90C
@ GK_GFX90C
Definition: TargetParser.h:88
llvm::MCSymbolELF::setOther
void setOther(unsigned Other)
Definition: MCSymbolELF.cpp:157
llvm::ELF::EF_AMDGPU_MACH_AMDGCN_GFX802
@ EF_AMDGPU_MACH_AMDGCN_GFX802
Definition: ELF.h:743
llvm::AMDGPU::IsaInfo::TargetIDSetting::Any
@ Any
llvm::ELF::SHF_ALLOC
@ SHF_ALLOC
Definition: ELF.h:1038
llvm::AMDGPU::GK_GFX602
@ GK_GFX602
Definition: TargetParser.h:66
llvm::ELF::EF_AMDGPU_MACH_R600_RS880
@ EF_AMDGPU_MACH_R600_RS880
Definition: ELF.h:707
TargetParser.h
llvm::ELF::EF_AMDGPU_MACH_R600_RV710
@ EF_AMDGPU_MACH_R600_RV710
Definition: ELF.h:710
llvm::AMDGPU::GK_CAICOS
@ GK_CAICOS
Definition: TargetParser.h:56
llvm::amdhsa::kernel_descriptor_t::compute_pgm_rsrc2
uint32_t compute_pgm_rsrc2
Definition: AMDHSAKernelDescriptor.h:178
llvm::ELF::NT_AMD_HSA_METADATA
@ NT_AMD_HSA_METADATA
Definition: ELF.h:1708
llvm::AMDGPU::IsaVersion::Major
unsigned Major
Definition: TargetParser.h:114
llvm::wasm::toString
llvm::StringRef toString(WasmSymbolType type)
Definition: Wasm.cpp:11
llvm::AMDGPU::GK_RV770
@ GK_RV770
Definition: TargetParser.h:49
llvm::ELF::EF_AMDGPU_MACH_AMDGCN_GFX908
@ EF_AMDGPU_MACH_AMDGCN_GFX908
Definition: ELF.h:750
llvm::MCSymbolELF::setVisibility
void setVisibility(unsigned Visibility)
Definition: MCSymbolELF.cpp:144
MCELFStreamer.h
llvm::AMDGPUTargetELFStreamer::EmitHSAMetadata
bool EmitHSAMetadata(msgpack::Document &HSAMetadata, bool Strict) override
Definition: AMDGPUTargetStreamer.cpp:770
AMDHSAKernelDescriptor.h
llvm::AMDGPU::GK_RS880
@ GK_RS880
Definition: TargetParser.h:45
llvm::ELF::EF_AMDGPU_FEATURE_SRAMECC_UNSUPPORTED_V4
@ EF_AMDGPU_FEATURE_SRAMECC_UNSUPPORTED_V4
Definition: ELF.h:819
llvm::AMDGPUTargetStreamer::TargetID
Optional< AMDGPU::IsaInfo::AMDGPUTargetID > TargetID
Definition: AMDGPUTargetStreamer.h:39
llvm::MCSymbolELF
Definition: MCSymbolELF.h:14
llvm::AMDGPU::GK_GFX702
@ GK_GFX702
Definition: TargetParser.h:70
Context
LLVMContext & Context
Definition: NVVMIntrRange.cpp:66
llvm::AMDGPU::IsaVersion
Instruction set architecture version.
Definition: TargetParser.h:113
llvm::AMDGPU::HSAMD::fromString
std::error_code fromString(StringRef String, Metadata &HSAMetadata)
Converts String to HSAMetadata.
Definition: AMDGPUMetadata.cpp:213
llvm::AMDGPUTargetELFStreamer::EmitCodeEnd
bool EmitCodeEnd(const MCSubtargetInfo &STI) override
Definition: AMDGPUTargetStreamer.cpp:821
FormattedStream.h
llvm::MCStreamer
Streaming machine code generation interface.
Definition: MCStreamer.h:212
llvm::ELF::EF_AMDGPU_MACH_AMDGCN_GFX900
@ EF_AMDGPU_MACH_AMDGCN_GFX900
Definition: ELF.h:746
llvm::AMDGPU::isGFX90A
bool isGFX90A(const MCSubtargetInfo &STI)
Definition: AMDGPUBaseInfo.cpp:1784
llvm::AMDGPUTargetAsmStreamer::EmitAMDKernelCodeT
void EmitAMDKernelCodeT(const amd_kernel_code_t &Header) override
Definition: AMDGPUTargetStreamer.cpp:243
llvm::AMDGPU::GK_GFX1100
@ GK_GFX1100
Definition: TargetParser.h:103
ELF.h
llvm::MCELFStreamer
Definition: MCELFStreamer.h:31
llvm::AMDGPUTargetAsmStreamer::EmitAMDGPUSymbolType
void EmitAMDGPUSymbolType(StringRef SymbolName, unsigned Type) override
Definition: AMDGPUTargetStreamer.cpp:249
llvm::ELF::STB_GLOBAL
@ STB_GLOBAL
Definition: ELF.h:1192
llvm::AMDGPU::GK_CYPRESS
@ GK_CYPRESS
Definition: TargetParser.h:51
llvm::Triple::Mesa3D
@ Mesa3D
Definition: Triple.h:214
llvm::AMDGPU::GK_GFX1012
@ GK_GFX1012
Definition: TargetParser.h:93
llvm::ELF::EF_AMDGPU_MACH_AMDGCN_GFX940
@ EF_AMDGPU_MACH_AMDGCN_GFX940
Definition: ELF.h:766
llvm::AMDGPU::GK_GFX1036
@ GK_GFX1036
Definition: TargetParser.h:101
llvm::ELF::EF_AMDGPU_MACH_AMDGCN_GFX810
@ EF_AMDGPU_MACH_AMDGCN_GFX810
Definition: ELF.h:745
llvm::MCSubtargetInfo::getTargetTriple
const Triple & getTargetTriple() const
Definition: MCSubtargetInfo.h:108
MCContext.h
llvm::AMDGPU::GK_GFX1032
@ GK_GFX1032
Definition: TargetParser.h:97
llvm::MCStreamer::emitLabel
virtual void emitLabel(MCSymbol *Symbol, SMLoc Loc=SMLoc())
Emit a label for Symbol into the current section.
Definition: MCStreamer.cpp:423
llvm::ELF::EF_AMDGPU_MACH_R600_REDWOOD
@ EF_AMDGPU_MACH_R600_REDWOOD
Definition: ELF.h:717
llvm::amdhsa::kernel_descriptor_t::group_segment_fixed_size
uint32_t group_segment_fixed_size
Definition: AMDHSAKernelDescriptor.h:170
llvm::ELF::EF_AMDGPU_MACH_AMDGCN_GFX1010
@ EF_AMDGPU_MACH_AMDGCN_GFX1010
Definition: ELF.h:753
llvm::MCSymbolRefExpr::VK_AMDGPU_REL64
@ VK_AMDGPU_REL64
Definition: MCExpr.h:338
llvm::ELF::ELFABIVERSION_AMDGPU_HSA_V5
@ ELFABIVERSION_AMDGPU_HSA_V5
Definition: ELF.h:377
llvm::ELF::EF_AMDGPU_MACH_AMDGCN_GFX704
@ EF_AMDGPU_MACH_AMDGCN_GFX704
Definition: ELF.h:740
MCSubtargetInfo.h
llvm::ELF::EF_AMDGPU_MACH_AMDGCN_GFX1012
@ EF_AMDGPU_MACH_AMDGCN_GFX1012
Definition: ELF.h:755
llvm::AMDGPU
Definition: AMDGPUMetadataVerifier.h:34
llvm::ELF::EF_AMDGPU_MACH_R600_JUNIPER
@ EF_AMDGPU_MACH_R600_JUNIPER
Definition: ELF.h:716
llvm::Triple::r600
@ r600
Definition: Triple.h:73
llvm::AMDGPU::GK_GFX1102
@ GK_GFX1102
Definition: TargetParser.h:105
llvm::report_fatal_error
void report_fatal_error(Error Err, bool gen_crash_diag=true)
Report a serious error, calling any installed error handler.
Definition: Error.cpp:143
llvm::msgpack::Document
Simple in-memory representation of a document of msgpack objects with ability to find and create arra...
Definition: MsgPackDocument.h:272
llvm::AMDGPU::ElfNote::SectionName
const char SectionName[]
Definition: AMDGPUPTNote.h:24
llvm::ELF::EF_AMDGPU_MACH_AMDGCN_GFX1034
@ EF_AMDGPU_MACH_AMDGCN_GFX1034
Definition: ELF.h:764
llvm::AMDGPU::GK_GFX909
@ GK_GFX909
Definition: TargetParser.h:86
llvm::MCSymbol::setIndex
void setIndex(uint32_t Value) const
Set the (implementation defined) index.
Definition: MCSymbol.h:314
llvm::AMDGPU::GK_GFX805
@ GK_GFX805
Definition: TargetParser.h:78
llvm::AMDGPU::GK_GFX906
@ GK_GFX906
Definition: TargetParser.h:84
llvm::ELF::EF_AMDGPU_MACH_AMDGCN_GFX909
@ EF_AMDGPU_MACH_AMDGCN_GFX909
Definition: ELF.h:751
AMDHSA_BITS_GET
#define AMDHSA_BITS_GET(SRC, MSK)
Definition: AMDHSAKernelDescriptor.h:37
llvm::AMDGPU::HSAMD::Metadata
In-memory representation of HSA metadata.
Definition: AMDGPUMetadata.h:436
llvm::AMDGPUTargetELFStreamer::EmitDirectiveAMDGCNTarget
void EmitDirectiveAMDGCNTarget() override
Definition: AMDGPUTargetStreamer.cpp:676
llvm::amdhsa::kernel_descriptor_t::kernel_code_properties
uint16_t kernel_code_properties
Definition: AMDHSAKernelDescriptor.h:179
llvm::ELF::STV_DEFAULT
@ STV_DEFAULT
Definition: ELF.h:1221
llvm::ELF::EF_AMDGPU_MACH_AMDGCN_GFX705
@ EF_AMDGPU_MACH_AMDGCN_GFX705
Definition: ELF.h:761
llvm::amdhsa::kernel_descriptor_t::reserved2
uint8_t reserved2[6]
Definition: AMDHSAKernelDescriptor.h:180
llvm::Align
This struct is a compact representation of a valid (non-zero power of two) alignment.
Definition: Alignment.h:39
llvm::Triple::getArch
ArchType getArch() const
Get the parsed architecture type of this triple.
Definition: Triple.h:345
llvm::ELF::EF_AMDGPU_FEATURE_XNACK_OFF_V4
@ EF_AMDGPU_FEATURE_XNACK_OFF_V4
Definition: ELF.h:810
llvm::AMDGPUTargetELFStreamer::EmitDirectiveHSACodeObjectISAV2
void EmitDirectiveHSACodeObjectISAV2(uint32_t Major, uint32_t Minor, uint32_t Stepping, StringRef VendorName, StringRef ArchName) override
Definition: AMDGPUTargetStreamer.cpp:689
llvm::ELF::NT_AMD_HSA_ISA_NAME
@ NT_AMD_HSA_ISA_NAME
Definition: ELF.h:1709
llvm::amdhsa::kernel_descriptor_t::compute_pgm_rsrc3
uint32_t compute_pgm_rsrc3
Definition: AMDHSAKernelDescriptor.h:176
llvm::msgpack::Document::fromYAML
bool fromYAML(StringRef S)
Read YAML text into the MsgPack document. Returns false on failure.
Definition: MsgPackDocumentYAML.cpp:242
llvm::AMDGPU::GK_GFX940
@ GK_GFX940
Definition: TargetParser.h:89
llvm::ELF::EF_AMDGPU_FEATURE_SRAMECC_ON_V4
@ EF_AMDGPU_FEATURE_SRAMECC_ON_V4
Definition: ELF.h:825
llvm::function_ref
An efficient, type-erasing, non-owning reference to a callable.
Definition: STLFunctionalExtras.h:36
llvm::Triple::AMDHSA
@ AMDHSA
Definition: Triple.h:207
llvm::AMDGPU::GK_BARTS
@ GK_BARTS
Definition: TargetParser.h:55
Verifier
verify safepoint Safepoint IR Verifier
Definition: SafepointIRVerifier.cpp:251
llvm::MCStreamer::emitInt16
void emitInt16(uint64_t Value)
Definition: MCStreamer.h:737
llvm::amdhsa::kernel_descriptor_t::private_segment_fixed_size
uint32_t private_segment_fixed_size
Definition: AMDHSAKernelDescriptor.h:171
llvm::AMDGPUTargetELFStreamer::EmitDirectiveHSACodeObjectVersion
void EmitDirectiveHSACodeObjectVersion(uint32_t Major, uint32_t Minor) override
Definition: AMDGPUTargetStreamer.cpp:678
llvm::MCAssembler
Definition: MCAssembler.h:73
llvm::AMDGPUTargetAsmStreamer::EmitDirectiveAMDGCNTarget
void EmitDirectiveAMDGCNTarget() override
Definition: AMDGPUTargetStreamer.cpp:221
AMDGPUTargetStreamer.h
CacheLineSize
static cl::opt< unsigned > CacheLineSize("cache-line-size", cl::init(0), cl::Hidden, cl::desc("Use this to override the target cache line size when " "specified by the user."))
llvm::AMDGPUTargetAsmStreamer::finish
void finish() override
Definition: AMDGPUTargetStreamer.cpp:211
uint64_t
llvm::AMDGPUTargetAsmStreamer::EmitDirectiveHSACodeObjectISAV2
void EmitDirectiveHSACodeObjectISAV2(uint32_t Major, uint32_t Minor, uint32_t Stepping, StringRef VendorName, StringRef ArchName) override
Definition: AMDGPUTargetStreamer.cpp:232
llvm::ELF::EF_AMDGPU_MACH_R600_R630
@ EF_AMDGPU_MACH_R600_R630
Definition: ELF.h:706
llvm::ELF::NT_AMD_HSA_CODE_OBJECT_VERSION
@ NT_AMD_HSA_CODE_OBJECT_VERSION
Definition: ELF.h:1704
llvm::Triple::getOS
OSType getOS() const
Get the parsed operating system type of this triple.
Definition: Triple.h:354
llvm::ELF::SHN_AMDGPU_LDS
@ SHN_AMDGPU_LDS
Definition: ELF.h:1699
llvm::AMDGPU::GK_GFX1035
@ GK_GFX1035
Definition: TargetParser.h:100
llvm::AMDGPU::ElfNote::NoteNameV3
const char NoteNameV3[]
Definition: AMDGPUPTNote.h:27
llvm::ELF::EF_AMDGPU_MACH_R600_CYPRESS
@ EF_AMDGPU_MACH_R600_CYPRESS
Definition: ELF.h:715
llvm::AMDGPU::HSAMD::V3::MetadataVerifier
Verifier for AMDGPU HSA metadata.
Definition: AMDGPUMetadataVerifier.h:45
llvm::ELF::EF_AMDGPU_MACH_NONE
@ EF_AMDGPU_MACH_NONE
Definition: ELF.h:700
llvm::ELF::EF_AMDGPU_MACH_R600_CAYMAN
@ EF_AMDGPU_MACH_R600_CAYMAN
Definition: ELF.h:722
llvm::AMDGPUTargetStreamer::EmitHSAMetadataV2
virtual bool EmitHSAMetadataV2(StringRef HSAMetadataString)
Definition: AMDGPUTargetStreamer.cpp:52
llvm::AMDGPUPALMetadata::toBlob
void toBlob(unsigned Type, std::string &S)
Definition: AMDGPUPALMetadata.cpp:716
llvm::AMDGPU::GK_GFX904
@ GK_GFX904
Definition: TargetParser.h:83
llvm::AMDGPU::GK_GFX704
@ GK_GFX704
Definition: TargetParser.h:72
llvm::MCSubtargetInfo::getCPU
StringRef getCPU() const
Definition: MCSubtargetInfo.h:109
I
#define I(x, y, z)
Definition: MD5.cpp:58
llvm::ELF::EF_AMDGPU_MACH_AMDGCN_GFX1032
@ EF_AMDGPU_MACH_AMDGCN_GFX1032
Definition: ELF.h:758
llvm::AMDGPU::GK_GFX701
@ GK_GFX701
Definition: TargetParser.h:69
llvm::ELF::EF_AMDGPU_MACH_AMDGCN_GFX702
@ EF_AMDGPU_MACH_AMDGCN_GFX702
Definition: ELF.h:738
AMDKernelCodeTUtils.h
llvm::ELF::ELFABIVERSION_AMDGPU_HSA_V2
@ ELFABIVERSION_AMDGPU_HSA_V2
Definition: ELF.h:374
llvm::MCAssembler::setELFHeaderEFlags
void setELFHeaderEFlags(unsigned Flags)
Definition: MCAssembler.h:277
llvm::AMDGPU::GK_TURKS
@ GK_TURKS
Definition: TargetParser.h:58
llvm::formatted_raw_ostream
formatted_raw_ostream - A raw_ostream that wraps another one and keeps track of line and column posit...
Definition: FormattedStream.h:30
llvm::MCStreamer::pushSection
void pushSection()
Save the current and previous section on the section stack.
Definition: MCStreamer.h:411
llvm::AMDGPU::getArchNameAMDGCN
StringRef getArchNameAMDGCN(GPUKind AK)
Definition: TargetParser.cpp:140
assert
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
llvm::AMDGPUPALMetadata::getVendor
const char * getVendor() const
Definition: AMDGPUPALMetadata.cpp:849
llvm::AMDGPU::GK_GFX705
@ GK_GFX705
Definition: TargetParser.h:73
llvm::MCSymbolELF::isBindingSet
bool isBindingSet() const
Definition: MCSymbolELF.cpp:193
llvm::MCBinaryExpr::createSub
static const MCBinaryExpr * createSub(const MCExpr *LHS, const MCExpr *RHS, MCContext &Ctx)
Definition: MCExpr.h:610
llvm::AMDGPUTargetELFStreamer::getStreamer
MCELFStreamer & getStreamer()
Definition: AMDGPUTargetStreamer.cpp:497
llvm::AMDGPUTargetStreamer::EmitHSAMetadataV3
virtual bool EmitHSAMetadataV3(StringRef HSAMetadataString)
Definition: AMDGPUTargetStreamer.cpp:59
llvm::AMDGPU::IsaInfo::TargetIDSetting::Off
@ Off
llvm::AMDGPUTargetELFStreamer::emitAMDGPULDS
void emitAMDGPULDS(MCSymbol *Sym, unsigned Size, Align Alignment) override
Definition: AMDGPUTargetStreamer.cpp:732
llvm::AMDGPUTargetELFStreamer::EmitAMDKernelCodeT
void EmitAMDKernelCodeT(const amd_kernel_code_t &Header) override
Definition: AMDGPUTargetStreamer.cpp:717
llvm::ELF::EF_AMDGPU_MACH_R600_TURKS
@ EF_AMDGPU_MACH_R600_TURKS
Definition: ELF.h:723
llvm::AMDGPU::GK_GFX1030
@ GK_GFX1030
Definition: TargetParser.h:95
llvm::MCObjectStreamer::getAssembler
MCAssembler & getAssembler()
Definition: MCObjectStreamer.h:128
llvm::AMDGPUTargetELFStreamer::EmitAmdhsaKernelDescriptor
void EmitAmdhsaKernelDescriptor(const MCSubtargetInfo &STI, StringRef KernelName, const amdhsa::kernel_descriptor_t &KernelDescriptor, uint64_t NextVGPR, uint64_t NextSGPR, bool ReserveVCC, bool ReserveFlatScr) override
Definition: AMDGPUTargetStreamer.cpp:847
llvm::ELF::SHT_NOTE
@ SHT_NOTE
Definition: ELF.h:961
llvm::amdhsa::kernel_descriptor_t::reserved1
uint8_t reserved1[20]
Definition: AMDHSAKernelDescriptor.h:175
llvm::StringRef
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:58
llvm_unreachable
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
Definition: ErrorHandling.h:143
uint32_t
llvm::AMDGPU::GK_GFX908
@ GK_GFX908
Definition: TargetParser.h:85
S
add sub stmia L5 ldr r0 bl L_printf $stub Instead of a and a wouldn t it be better to do three moves *Return an aggregate type is even return S
Definition: README.txt:210
llvm::MCSymbolELF::getBinding
unsigned getBinding() const
Definition: MCSymbolELF.cpp:63
llvm::AMDGPUTargetStreamer
Definition: AMDGPUTargetStreamer.h:34
amd_kernel_code_t
AMD Kernel Code Object (amd_kernel_code_t).
Definition: AMDKernelCodeT.h:526
llvm::AMDGPU::HSAMD::AssemblerDirectiveBegin
constexpr char AssemblerDirectiveBegin[]
HSA metadata beginning assembler directive.
Definition: AMDGPUMetadata.h:53
llvm::MCSymbol::declareCommon
bool declareCommon(uint64_t Size, unsigned Align, bool Target=false)
Declare this symbol as being 'common'.
Definition: MCSymbol.h:370
llvm::AMDGPU::getArchNameR600
StringRef getArchNameR600(GPUKind AK)
Definition: TargetParser.cpp:146
llvm::amdhsa::kernel_descriptor_t::kernarg_size
uint32_t kernarg_size
Definition: AMDHSAKernelDescriptor.h:172
llvm::ELF::EF_AMDGPU_MACH_R600_RV770
@ EF_AMDGPU_MACH_R600_RV770
Definition: ELF.h:712
llvm::ELF::EF_AMDGPU_FEATURE_XNACK_ON_V4
@ EF_AMDGPU_FEATURE_XNACK_ON_V4
Definition: ELF.h:812
llvm::ELF::EF_AMDGPU_MACH_AMDGCN_GFX1035
@ EF_AMDGPU_MACH_AMDGCN_GFX1035
Definition: ELF.h:763
llvm::amdhsa::kernel_descriptor_t::reserved0
uint8_t reserved0[4]
Definition: AMDHSAKernelDescriptor.h:173
llvm::AMDGPU::GK_GFX1103
@ GK_GFX1103
Definition: TargetParser.h:106
llvm::msgpack::Document::writeToBlob
void writeToBlob(std::string &Blob)
Write a MsgPack document to a binary MsgPack blob.
Definition: MsgPackDocument.cpp:247
llvm::AMDGPU::GK_R630
@ GK_R630
Definition: TargetParser.h:44
llvm::StringRef::size
constexpr LLVM_NODISCARD size_t size() const
size - Get the string size.
Definition: StringRef.h:157
llvm::ELF::ELFABIVERSION_AMDGPU_HSA_V4
@ ELFABIVERSION_AMDGPU_HSA_V4
Definition: ELF.h:376
llvm::ELF::EF_AMDGPU_MACH_AMDGCN_GFX801
@ EF_AMDGPU_MACH_AMDGCN_GFX801
Definition: ELF.h:742
llvm::ELF::STV_PROTECTED
@ STV_PROTECTED
Definition: ELF.h:1224
llvm::AMDGPU::HSAMD::Kernel::Key::SymbolName
constexpr char SymbolName[]
Key for Kernel::Metadata::mSymbolName.
Definition: AMDGPUMetadata.h:386
llvm::msgpack::Document::toYAML
void toYAML(raw_ostream &OS)
Convert MsgPack Document to YAML text.
Definition: MsgPackDocumentYAML.cpp:236
llvm::Twine
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
Definition: Twine.h:83
llvm::MCSymbol::setExternal
void setExternal(bool Value) const
Definition: MCSymbol.h:402
llvm::AMDGPU::GK_GFX1031
@ GK_GFX1031
Definition: TargetParser.h:96
llvm::GraphProgram::Name
Name
Definition: GraphWriter.h:50
llvm::AMDGPU::HSAMD::AssemblerDirectiveEnd
constexpr char AssemblerDirectiveEnd[]
HSA metadata ending assembler directive.
Definition: AMDGPUMetadata.h:55
llvm::ELF::EF_AMDGPU_MACH_R600_CAICOS
@ EF_AMDGPU_MACH_R600_CAICOS
Definition: ELF.h:721
uint16_t
llvm::AMDGPUTargetELFStreamer::finish
void finish() override
Definition: AMDGPUTargetStreamer.cpp:504
llvm::toString
const char * toString(DWARFSectionKind Kind)
Definition: DWARFUnitIndex.h:67
llvm::AMDGPU::ElfNote::NoteNameV2
const char NoteNameV2[]
Definition: AMDGPUPTNote.h:26
llvm::FPOpFusion::Strict
@ Strict
Definition: TargetOptions.h:39
llvm::ELF::STT_OBJECT
@ STT_OBJECT
Definition: ELF.h:1204
llvm::AMDGPU::GK_GFX1010
@ GK_GFX1010
Definition: TargetParser.h:91
llvm::Triple::AMDPAL
@ AMDPAL
Definition: Triple.h:216
Casting.h
llvm::AMDGPU::GK_GFX1101
@ GK_GFX1101
Definition: TargetParser.h:104
llvm::amdhsa::kernel_descriptor_t::kernel_code_entry_byte_offset
int64_t kernel_code_entry_byte_offset
Definition: AMDHSAKernelDescriptor.h:174
llvm::ELF::EF_AMDGPU_MACH_R600_RV670
@ EF_AMDGPU_MACH_R600_RV670
Definition: ELF.h:708
llvm::ELF::EF_AMDGPU_FEATURE_SRAMECC_ANY_V4
@ EF_AMDGPU_FEATURE_SRAMECC_ANY_V4
Definition: ELF.h:821
llvm::amdhsa::kernel_descriptor_t
Definition: AMDHSAKernelDescriptor.h:169
llvm::AMDGPU::GK_JUNIPER
@ GK_JUNIPER
Definition: TargetParser.h:52
llvm::AMDGPUTargetStreamer::getArchNameFromElfMach
static StringRef getArchNameFromElfMach(unsigned ElfMach)
Definition: AMDGPUTargetStreamer.cpp:66
llvm::MCSymbolRefExpr::create
static const MCSymbolRefExpr * create(const MCSymbol *Symbol, MCContext &Ctx)
Definition: MCExpr.h:386
llvm::ELF::STT_AMDGPU_HSA_KERNEL
@ STT_AMDGPU_HSA_KERNEL
Definition: ELF.h:1217
llvm::AMDGPU::GK_GFX1011
@ GK_GFX1011
Definition: TargetParser.h:92
llvm::AMDGPU::GK_RV710
@ GK_RV710
Definition: TargetParser.h:47
llvm::ELF::EF_AMDGPU_MACH_AMDGCN_GFX803
@ EF_AMDGPU_MACH_AMDGCN_GFX803
Definition: ELF.h:744
llvm::AMDGPU::GK_GFX600
@ GK_GFX600
Definition: TargetParser.h:64
llvm::AMDGPU::parseArchAMDGCN
GPUKind parseArchAMDGCN(StringRef CPU)
Definition: TargetParser.cpp:152
llvm::amdhsa::kernel_descriptor_t::compute_pgm_rsrc1
uint32_t compute_pgm_rsrc1
Definition: AMDHSAKernelDescriptor.h:177
llvm::AMDGPUTargetELFStreamer::EmitAMDGPUSymbolType
void EmitAMDGPUSymbolType(StringRef SymbolName, unsigned Type) override
Definition: AMDGPUTargetStreamer.cpp:725
llvm::ARMBuildAttrs::Symbol
@ Symbol
Definition: ARMBuildAttributes.h:83
llvm::ELF::EF_AMDGPU_MACH_AMDGCN_GFX906
@ EF_AMDGPU_MACH_AMDGCN_GFX906
Definition: ELF.h:749
llvm::ELF::EF_AMDGPU_FEATURE_SRAMECC_V3
@ EF_AMDGPU_FEATURE_SRAMECC_V3
Definition: ELF.h:799
llvm::ELF::EF_AMDGPU_MACH_AMDGCN_GFX701
@ EF_AMDGPU_MACH_AMDGCN_GFX701
Definition: ELF.h:737
llvm::ELF::EF_AMDGPU_MACH_AMDGCN_GFX600
@ EF_AMDGPU_MACH_AMDGCN_GFX600
Definition: ELF.h:734
llvm::MCSymbolELF::getOther
unsigned getOther() const
Definition: MCSymbolELF.cpp:165
llvm::MCObjectStreamer::emitBytes
void emitBytes(StringRef Data) override
Emit the bytes in Data into the output.
Definition: MCObjectStreamer.cpp:637
AMDGPUMetadata.h
llvm::ELF::EF_AMDGPU_MACH_AMDGCN_GFX1102
@ EF_AMDGPU_MACH_AMDGCN_GFX1102
Definition: ELF.h:773
llvm::MCStreamer::getContext
MCContext & getContext() const
Definition: MCStreamer.h:293
llvm::MCSymbolELF::setType
void setType(unsigned Type) const
Definition: MCSymbolELF.cpp:91
llvm::AMDGPU::GK_REDWOOD
@ GK_REDWOOD
Definition: TargetParser.h:53
llvm::ELF::EF_AMDGPU_MACH_AMDGCN_GFX700
@ EF_AMDGPU_MACH_AMDGCN_GFX700
Definition: ELF.h:736
llvm::AMDGPU::GK_NONE
@ GK_NONE
Definition: TargetParser.h:40
AMDKernelCodeT.h
llvm::AMDGPU::GK_GFX902
@ GK_GFX902
Definition: TargetParser.h:82
llvm::AMDGPU::GK_SUMO
@ GK_SUMO
Definition: TargetParser.h:54
llvm::MCSymbolELF::setSize
void setSize(const MCExpr *SS)
Definition: MCSymbolELF.h:22
llvm::msgpack::Document::getRoot
DocNode & getRoot()
Get ref to the document's root element.
Definition: MsgPackDocument.h:296
llvm::MCStreamer::emitValueToAlignment
virtual void emitValueToAlignment(unsigned ByteAlignment, int64_t Value=0, unsigned ValueSize=1, unsigned MaxBytesToEmit=0)
Emit some number of copies of Value until the byte alignment ByteAlignment is reached.
Definition: MCStreamer.cpp:1212
llvm::ELF::NT_AMDGPU_METADATA
@ NT_AMDGPU_METADATA
Definition: ELF.h:1716
llvm::ELF::EF_AMDGPU_MACH_R600_BARTS
@ EF_AMDGPU_MACH_R600_BARTS
Definition: ELF.h:720
llvm::ELF::EF_AMDGPU_MACH_AMDGCN_GFX1033
@ EF_AMDGPU_MACH_AMDGCN_GFX1033
Definition: ELF.h:759
llvm::MCStreamer::emitBytes
virtual void emitBytes(StringRef Data)
Emit the bytes in Data into the output.
Definition: MCStreamer.cpp:1202
llvm::ELF::EF_AMDGPU_MACH_AMDGCN_GFX1101
@ EF_AMDGPU_MACH_AMDGCN_GFX1101
Definition: ELF.h:772
llvm::ELF::EF_AMDGPU_MACH_AMDGCN_GFX90A
@ EF_AMDGPU_MACH_AMDGCN_GFX90A
Definition: ELF.h:765
llvm::AMDGPU::GK_GFX601
@ GK_GFX601
Definition: TargetParser.h:65
llvm::MCSymbolRefExpr::VK_None
@ VK_None
Definition: MCExpr.h:195
llvm::AMDGPUPALMetadata::reset
void reset()
Definition: AMDGPUPALMetadata.cpp:872
PRINT_FIELD
#define PRINT_FIELD(STREAM, DIRECTIVE, KERNEL_DESC, MEMBER_NAME, FIELD_NAME)
llvm::ELF::EF_AMDGPU_MACH_AMDGCN_GFX902
@ EF_AMDGPU_MACH_AMDGCN_GFX902
Definition: ELF.h:747
llvm::AMDGPU::GK_GFX1033
@ GK_GFX1033
Definition: TargetParser.h:98
llvm::AMDGPUTargetStreamer::getPALMetadata
AMDGPUPALMetadata * getPALMetadata()
Definition: AMDGPUTargetStreamer.h:46
llvm::Triple::UnknownOS
@ UnknownOS
Definition: Triple.h:182
llvm::ELF::EF_AMDGPU_MACH_R600_CEDAR
@ EF_AMDGPU_MACH_R600_CEDAR
Definition: ELF.h:714
llvm::AMDGPUTargetAsmStreamer::EmitHSAMetadata
bool EmitHSAMetadata(msgpack::Document &HSAMetadata, bool Strict) override
Definition: AMDGPUTargetStreamer.cpp:282
llvm::AMDGPUPALMetadata::getType
unsigned getType() const
Definition: AMDGPUPALMetadata.cpp:857
llvm::MCSymbolELF::setBinding
void setBinding(unsigned Binding) const
Definition: MCSymbolELF.cpp:40
llvm::ELF::EF_AMDGPU_MACH_AMDGCN_GFX904
@ EF_AMDGPU_MACH_AMDGCN_GFX904
Definition: ELF.h:748
llvm::ELF::EF_AMDGPU_FEATURE_XNACK_UNSUPPORTED_V4
@ EF_AMDGPU_FEATURE_XNACK_UNSUPPORTED_V4
Definition: ELF.h:806
llvm::AMDGPUTargetELFStreamer::EmitISAVersion
bool EmitISAVersion() override
Definition: AMDGPUTargetStreamer.cpp:751
llvm::raw_string_ostream::str
std::string & str()
Returns the string's reference.
Definition: raw_ostream.h:650
llvm::AMDGPU::GK_GFX90A
@ GK_GFX90A
Definition: TargetParser.h:87
llvm::MCSubtargetInfo
Generic base class for all target subtargets.
Definition: MCSubtargetInfo.h:76
llvm::AMDGPUTargetAsmStreamer::EmitCodeEnd
bool EmitCodeEnd(const MCSubtargetInfo &STI) override
Definition: AMDGPUTargetStreamer.cpp:298
llvm::ELF::EF_AMDGPU_MACH_R600_R600
@ EF_AMDGPU_MACH_R600_R600
Definition: ELF.h:705
llvm::ELF::ELFABIVERSION_AMDGPU_HSA_V3
@ ELFABIVERSION_AMDGPU_HSA_V3
Definition: ELF.h:375
llvm::MCExpr
Base class for the full range of assembler expressions which are needed for parsing.
Definition: MCExpr.h:35
llvm::AMDGPUTargetAsmStreamer::emitAMDGPULDS
void emitAMDGPULDS(MCSymbol *Sym, unsigned Size, Align Alignment) override
Definition: AMDGPUTargetStreamer.cpp:259
llvm::ELF::EF_AMDGPU_FEATURE_XNACK_V3
@ EF_AMDGPU_FEATURE_XNACK_V3
Definition: ELF.h:794
llvm::AMDGPUTargetELFStreamer::AMDGPUTargetELFStreamer
AMDGPUTargetELFStreamer(MCStreamer &S, const MCSubtargetInfo &STI)
Definition: AMDGPUTargetStreamer.cpp:493
AMDGPUBaseInfo.h
llvm::AMDGPUTargetStreamer::getElfMach
static unsigned getElfMach(StringRef GPU)
Definition: AMDGPUTargetStreamer.cpp:134