LLVM  16.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);
371  PRINT_FIELD(OS, ".amdhsa_uses_dynamic_stack", KD, kernel_code_properties,
372  amdhsa::KERNEL_CODE_PROPERTY_USES_DYNAMIC_STACK);
373  PRINT_FIELD(OS,
375  ? ".amdhsa_enable_private_segment"
376  : ".amdhsa_system_sgpr_private_segment_wavefront_offset"),
377  KD, compute_pgm_rsrc2,
378  amdhsa::COMPUTE_PGM_RSRC2_ENABLE_PRIVATE_SEGMENT);
379  PRINT_FIELD(OS, ".amdhsa_system_sgpr_workgroup_id_x", KD,
380  compute_pgm_rsrc2,
381  amdhsa::COMPUTE_PGM_RSRC2_ENABLE_SGPR_WORKGROUP_ID_X);
382  PRINT_FIELD(OS, ".amdhsa_system_sgpr_workgroup_id_y", KD,
383  compute_pgm_rsrc2,
384  amdhsa::COMPUTE_PGM_RSRC2_ENABLE_SGPR_WORKGROUP_ID_Y);
385  PRINT_FIELD(OS, ".amdhsa_system_sgpr_workgroup_id_z", KD,
386  compute_pgm_rsrc2,
387  amdhsa::COMPUTE_PGM_RSRC2_ENABLE_SGPR_WORKGROUP_ID_Z);
388  PRINT_FIELD(OS, ".amdhsa_system_sgpr_workgroup_info", KD,
389  compute_pgm_rsrc2,
390  amdhsa::COMPUTE_PGM_RSRC2_ENABLE_SGPR_WORKGROUP_INFO);
391  PRINT_FIELD(OS, ".amdhsa_system_vgpr_workitem_id", KD,
392  compute_pgm_rsrc2,
393  amdhsa::COMPUTE_PGM_RSRC2_ENABLE_VGPR_WORKITEM_ID);
394 
395  // These directives are required.
396  OS << "\t\t.amdhsa_next_free_vgpr " << NextVGPR << '\n';
397  OS << "\t\t.amdhsa_next_free_sgpr " << NextSGPR << '\n';
398 
399  if (AMDGPU::isGFX90A(STI))
400  OS << "\t\t.amdhsa_accum_offset " <<
402  amdhsa::COMPUTE_PGM_RSRC3_GFX90A_ACCUM_OFFSET) + 1) * 4
403  << '\n';
404 
405  if (!ReserveVCC)
406  OS << "\t\t.amdhsa_reserve_vcc " << ReserveVCC << '\n';
407  if (IVersion.Major >= 7 && !ReserveFlatScr && !hasArchitectedFlatScratch(STI))
408  OS << "\t\t.amdhsa_reserve_flat_scratch " << ReserveFlatScr << '\n';
409 
410  if (Optional<uint8_t> HsaAbiVer = getHsaAbiVersion(&STI)) {
411  switch (*HsaAbiVer) {
412  default:
413  break;
415  break;
419  if (getTargetID()->isXnackSupported())
420  OS << "\t\t.amdhsa_reserve_xnack_mask " << getTargetID()->isXnackOnOrAny() << '\n';
421  break;
422  }
423  }
424 
425  PRINT_FIELD(OS, ".amdhsa_float_round_mode_32", KD,
426  compute_pgm_rsrc1,
427  amdhsa::COMPUTE_PGM_RSRC1_FLOAT_ROUND_MODE_32);
428  PRINT_FIELD(OS, ".amdhsa_float_round_mode_16_64", KD,
429  compute_pgm_rsrc1,
430  amdhsa::COMPUTE_PGM_RSRC1_FLOAT_ROUND_MODE_16_64);
431  PRINT_FIELD(OS, ".amdhsa_float_denorm_mode_32", KD,
432  compute_pgm_rsrc1,
433  amdhsa::COMPUTE_PGM_RSRC1_FLOAT_DENORM_MODE_32);
434  PRINT_FIELD(OS, ".amdhsa_float_denorm_mode_16_64", KD,
435  compute_pgm_rsrc1,
436  amdhsa::COMPUTE_PGM_RSRC1_FLOAT_DENORM_MODE_16_64);
437  PRINT_FIELD(OS, ".amdhsa_dx10_clamp", KD,
438  compute_pgm_rsrc1,
439  amdhsa::COMPUTE_PGM_RSRC1_ENABLE_DX10_CLAMP);
440  PRINT_FIELD(OS, ".amdhsa_ieee_mode", KD,
441  compute_pgm_rsrc1,
442  amdhsa::COMPUTE_PGM_RSRC1_ENABLE_IEEE_MODE);
443  if (IVersion.Major >= 9)
444  PRINT_FIELD(OS, ".amdhsa_fp16_overflow", KD,
445  compute_pgm_rsrc1,
446  amdhsa::COMPUTE_PGM_RSRC1_FP16_OVFL);
447  if (AMDGPU::isGFX90A(STI))
448  PRINT_FIELD(OS, ".amdhsa_tg_split", KD,
449  compute_pgm_rsrc3,
450  amdhsa::COMPUTE_PGM_RSRC3_GFX90A_TG_SPLIT);
451  if (IVersion.Major >= 10) {
452  PRINT_FIELD(OS, ".amdhsa_workgroup_processor_mode", KD,
453  compute_pgm_rsrc1,
454  amdhsa::COMPUTE_PGM_RSRC1_WGP_MODE);
455  PRINT_FIELD(OS, ".amdhsa_memory_ordered", KD,
456  compute_pgm_rsrc1,
457  amdhsa::COMPUTE_PGM_RSRC1_MEM_ORDERED);
458  PRINT_FIELD(OS, ".amdhsa_forward_progress", KD,
459  compute_pgm_rsrc1,
460  amdhsa::COMPUTE_PGM_RSRC1_FWD_PROGRESS);
461  PRINT_FIELD(OS, ".amdhsa_shared_vgpr_count", KD, compute_pgm_rsrc3,
462  amdhsa::COMPUTE_PGM_RSRC3_GFX10_PLUS_SHARED_VGPR_COUNT);
463  }
464  PRINT_FIELD(
465  OS, ".amdhsa_exception_fp_ieee_invalid_op", KD,
466  compute_pgm_rsrc2,
467  amdhsa::COMPUTE_PGM_RSRC2_ENABLE_EXCEPTION_IEEE_754_FP_INVALID_OPERATION);
468  PRINT_FIELD(OS, ".amdhsa_exception_fp_denorm_src", KD,
469  compute_pgm_rsrc2,
470  amdhsa::COMPUTE_PGM_RSRC2_ENABLE_EXCEPTION_FP_DENORMAL_SOURCE);
471  PRINT_FIELD(
472  OS, ".amdhsa_exception_fp_ieee_div_zero", KD,
473  compute_pgm_rsrc2,
474  amdhsa::COMPUTE_PGM_RSRC2_ENABLE_EXCEPTION_IEEE_754_FP_DIVISION_BY_ZERO);
475  PRINT_FIELD(OS, ".amdhsa_exception_fp_ieee_overflow", KD,
476  compute_pgm_rsrc2,
477  amdhsa::COMPUTE_PGM_RSRC2_ENABLE_EXCEPTION_IEEE_754_FP_OVERFLOW);
478  PRINT_FIELD(OS, ".amdhsa_exception_fp_ieee_underflow", KD,
479  compute_pgm_rsrc2,
480  amdhsa::COMPUTE_PGM_RSRC2_ENABLE_EXCEPTION_IEEE_754_FP_UNDERFLOW);
481  PRINT_FIELD(OS, ".amdhsa_exception_fp_ieee_inexact", KD,
482  compute_pgm_rsrc2,
483  amdhsa::COMPUTE_PGM_RSRC2_ENABLE_EXCEPTION_IEEE_754_FP_INEXACT);
484  PRINT_FIELD(OS, ".amdhsa_exception_int_div_zero", KD,
485  compute_pgm_rsrc2,
486  amdhsa::COMPUTE_PGM_RSRC2_ENABLE_EXCEPTION_INT_DIVIDE_BY_ZERO);
487 #undef PRINT_FIELD
488 
489  OS << "\t.end_amdhsa_kernel\n";
490 }
491 
492 //===----------------------------------------------------------------------===//
493 // AMDGPUTargetELFStreamer
494 //===----------------------------------------------------------------------===//
495 
497  const MCSubtargetInfo &STI)
498  : AMDGPUTargetStreamer(S), STI(STI), Streamer(S) {}
499 
501  return static_cast<MCELFStreamer &>(Streamer);
502 }
503 
504 // A hook for emitting stuff at the end.
505 // We use it for emitting the accumulated PAL metadata as a .note record.
506 // The PAL metadata is reset after it is emitted.
509  MCA.setELFHeaderEFlags(getEFlags());
510 
511  std::string Blob;
512  const char *Vendor = getPALMetadata()->getVendor();
513  unsigned Type = getPALMetadata()->getType();
514  getPALMetadata()->toBlob(Type, Blob);
515  if (Blob.empty())
516  return;
517  EmitNote(Vendor, MCConstantExpr::create(Blob.size(), getContext()), Type,
518  [&](MCELFStreamer &OS) { OS.emitBytes(Blob); });
519 
520  // Reset the pal metadata so its data will not affect a compilation that
521  // reuses this object.
522  getPALMetadata()->reset();
523 }
524 
525 void AMDGPUTargetELFStreamer::EmitNote(
526  StringRef Name, const MCExpr *DescSZ, unsigned NoteType,
527  function_ref<void(MCELFStreamer &)> EmitDesc) {
528  auto &S = getStreamer();
529  auto &Context = S.getContext();
530 
531  auto NameSZ = Name.size() + 1;
532 
533  unsigned NoteFlags = 0;
534  // TODO Apparently, this is currently needed for OpenCL as mentioned in
535  // https://reviews.llvm.org/D74995
536  if (STI.getTargetTriple().getOS() == Triple::AMDHSA)
537  NoteFlags = ELF::SHF_ALLOC;
538 
539  S.pushSection();
540  S.switchSection(
541  Context.getELFSection(ElfNote::SectionName, ELF::SHT_NOTE, NoteFlags));
542  S.emitInt32(NameSZ); // namesz
543  S.emitValue(DescSZ, 4); // descz
544  S.emitInt32(NoteType); // type
545  S.emitBytes(Name); // name
546  S.emitValueToAlignment(Align(4), 0, 1, 0); // padding 0
547  EmitDesc(S); // desc
548  S.emitValueToAlignment(Align(4), 0, 1, 0); // padding 0
549  S.popSection();
550 }
551 
552 unsigned AMDGPUTargetELFStreamer::getEFlags() {
553  switch (STI.getTargetTriple().getArch()) {
554  default:
555  llvm_unreachable("Unsupported Arch");
556  case Triple::r600:
557  return getEFlagsR600();
558  case Triple::amdgcn:
559  return getEFlagsAMDGCN();
560  }
561 }
562 
563 unsigned AMDGPUTargetELFStreamer::getEFlagsR600() {
565 
566  return getElfMach(STI.getCPU());
567 }
568 
569 unsigned AMDGPUTargetELFStreamer::getEFlagsAMDGCN() {
571 
572  switch (STI.getTargetTriple().getOS()) {
573  default:
574  // TODO: Why are some tests have "mingw" listed as OS?
575  // llvm_unreachable("Unsupported OS");
576  case Triple::UnknownOS:
577  return getEFlagsUnknownOS();
578  case Triple::AMDHSA:
579  return getEFlagsAMDHSA();
580  case Triple::AMDPAL:
581  return getEFlagsAMDPAL();
582  case Triple::Mesa3D:
583  return getEFlagsMesa3D();
584  }
585 }
586 
587 unsigned AMDGPUTargetELFStreamer::getEFlagsUnknownOS() {
588  // TODO: Why are some tests have "mingw" listed as OS?
589  // assert(STI.getTargetTriple().getOS() == Triple::UnknownOS);
590 
591  return getEFlagsV3();
592 }
593 
594 unsigned AMDGPUTargetELFStreamer::getEFlagsAMDHSA() {
596 
597  if (Optional<uint8_t> HsaAbiVer = getHsaAbiVersion(&STI)) {
598  switch (*HsaAbiVer) {
601  return getEFlagsV3();
604  return getEFlagsV4();
605  }
606  }
607 
608  llvm_unreachable("HSA OS ABI Version identification must be defined");
609 }
610 
611 unsigned AMDGPUTargetELFStreamer::getEFlagsAMDPAL() {
613 
614  return getEFlagsV3();
615 }
616 
617 unsigned AMDGPUTargetELFStreamer::getEFlagsMesa3D() {
619 
620  return getEFlagsV3();
621 }
622 
623 unsigned AMDGPUTargetELFStreamer::getEFlagsV3() {
624  unsigned EFlagsV3 = 0;
625 
626  // mach.
627  EFlagsV3 |= getElfMach(STI.getCPU());
628 
629  // xnack.
630  if (getTargetID()->isXnackOnOrAny())
632  // sramecc.
633  if (getTargetID()->isSramEccOnOrAny())
635 
636  return EFlagsV3;
637 }
638 
639 unsigned AMDGPUTargetELFStreamer::getEFlagsV4() {
640  unsigned EFlagsV4 = 0;
641 
642  // mach.
643  EFlagsV4 |= getElfMach(STI.getCPU());
644 
645  // xnack.
646  switch (getTargetID()->getXnackSetting()) {
649  break;
652  break;
655  break;
658  break;
659  }
660  // sramecc.
661  switch (getTargetID()->getSramEccSetting()) {
664  break;
667  break;
670  break;
673  break;
674  }
675 
676  return EFlagsV4;
677 }
678 
680 
682  uint32_t Major, uint32_t Minor) {
683 
686  OS.emitInt32(Major);
687  OS.emitInt32(Minor);
688  });
689 }
690 
691 void
693  uint32_t Minor,
694  uint32_t Stepping,
695  StringRef VendorName,
696  StringRef ArchName) {
697  uint16_t VendorNameSize = VendorName.size() + 1;
698  uint16_t ArchNameSize = ArchName.size() + 1;
699 
700  unsigned DescSZ = sizeof(VendorNameSize) + sizeof(ArchNameSize) +
701  sizeof(Major) + sizeof(Minor) + sizeof(Stepping) +
702  VendorNameSize + ArchNameSize;
703 
704  convertIsaVersionV2(Major, Minor, Stepping, TargetID->isSramEccOnOrAny(), TargetID->isXnackOnOrAny());
707  OS.emitInt16(VendorNameSize);
708  OS.emitInt16(ArchNameSize);
709  OS.emitInt32(Major);
710  OS.emitInt32(Minor);
711  OS.emitInt32(Stepping);
712  OS.emitBytes(VendorName);
713  OS.emitInt8(0); // NULL terminate VendorName
714  OS.emitBytes(ArchName);
715  OS.emitInt8(0); // NULL terminate ArchName
716  });
717 }
718 
719 void
721 
722  MCStreamer &OS = getStreamer();
723  OS.pushSection();
724  OS.emitBytes(StringRef((const char*)&Header, sizeof(Header)));
725  OS.popSection();
726 }
727 
729  unsigned Type) {
730  MCSymbolELF *Symbol = cast<MCSymbolELF>(
731  getStreamer().getContext().getOrCreateSymbol(SymbolName));
732  Symbol->setType(Type);
733 }
734 
736  Align Alignment) {
737  MCSymbolELF *SymbolELF = cast<MCSymbolELF>(Symbol);
738  SymbolELF->setType(ELF::STT_OBJECT);
739 
740  if (!SymbolELF->isBindingSet()) {
741  SymbolELF->setBinding(ELF::STB_GLOBAL);
742  SymbolELF->setExternal(true);
743  }
744 
745  if (SymbolELF->declareCommon(Size, Alignment.value(), true)) {
746  report_fatal_error("Symbol: " + Symbol->getName() +
747  " redeclared as different type");
748  }
749 
750  SymbolELF->setIndex(ELF::SHN_AMDGPU_LDS);
752 }
753 
755  // Create two labels to mark the beginning and end of the desc field
756  // and a MCExpr to calculate the size of the desc field.
757  auto &Context = getContext();
758  auto *DescBegin = Context.createTempSymbol();
759  auto *DescEnd = Context.createTempSymbol();
760  auto *DescSZ = MCBinaryExpr::createSub(
763 
765  [&](MCELFStreamer &OS) {
766  OS.emitLabel(DescBegin);
767  OS.emitBytes(getTargetID()->toString());
768  OS.emitLabel(DescEnd);
769  });
770  return true;
771 }
772 
774  bool Strict) {
776  if (!Verifier.verify(HSAMetadataDoc.getRoot()))
777  return false;
778 
779  std::string HSAMetadataString;
780  HSAMetadataDoc.writeToBlob(HSAMetadataString);
781 
782  // Create two labels to mark the beginning and end of the desc field
783  // and a MCExpr to calculate the size of the desc field.
784  auto &Context = getContext();
785  auto *DescBegin = Context.createTempSymbol();
786  auto *DescEnd = Context.createTempSymbol();
787  auto *DescSZ = MCBinaryExpr::createSub(
790 
792  [&](MCELFStreamer &OS) {
793  OS.emitLabel(DescBegin);
794  OS.emitBytes(HSAMetadataString);
795  OS.emitLabel(DescEnd);
796  });
797  return true;
798 }
799 
801  const AMDGPU::HSAMD::Metadata &HSAMetadata) {
802  std::string HSAMetadataString;
803  if (HSAMD::toString(HSAMetadata, HSAMetadataString))
804  return false;
805 
806  // Create two labels to mark the beginning and end of the desc field
807  // and a MCExpr to calculate the size of the desc field.
808  auto &Context = getContext();
809  auto *DescBegin = Context.createTempSymbol();
810  auto *DescEnd = Context.createTempSymbol();
811  auto *DescSZ = MCBinaryExpr::createSub(
814 
816  [&](MCELFStreamer &OS) {
817  OS.emitLabel(DescBegin);
818  OS.emitBytes(HSAMetadataString);
819  OS.emitLabel(DescEnd);
820  });
821  return true;
822 }
823 
825  const uint32_t Encoded_s_code_end = 0xbf9f0000;
826  const uint32_t Encoded_s_nop = 0xbf800000;
827  uint32_t Encoded_pad = Encoded_s_code_end;
828 
829  // Instruction cache line size in bytes.
830  const unsigned Log2CacheLineSize = AMDGPU::isGFX11Plus(STI) ? 7 : 6;
831  const unsigned CacheLineSize = 1u << Log2CacheLineSize;
832 
833  // Extra padding amount in bytes to support prefetch mode 3.
834  unsigned FillSize = 3 * CacheLineSize;
835 
836  if (AMDGPU::isGFX90A(STI)) {
837  Encoded_pad = Encoded_s_nop;
838  FillSize = 16 * CacheLineSize;
839  }
840 
841  MCStreamer &OS = getStreamer();
842  OS.pushSection();
843  OS.emitValueToAlignment(Align(CacheLineSize), Encoded_pad, 4);
844  for (unsigned I = 0; I < FillSize; I += 4)
845  OS.emitInt32(Encoded_pad);
846  OS.popSection();
847  return true;
848 }
849 
851  const MCSubtargetInfo &STI, StringRef KernelName,
852  const amdhsa::kernel_descriptor_t &KernelDescriptor, uint64_t NextVGPR,
853  uint64_t NextSGPR, bool ReserveVCC, bool ReserveFlatScr) {
854  auto &Streamer = getStreamer();
855  auto &Context = Streamer.getContext();
856 
857  MCSymbolELF *KernelCodeSymbol = cast<MCSymbolELF>(
858  Context.getOrCreateSymbol(Twine(KernelName)));
859  MCSymbolELF *KernelDescriptorSymbol = cast<MCSymbolELF>(
860  Context.getOrCreateSymbol(Twine(KernelName) + Twine(".kd")));
861 
862  // Copy kernel descriptor symbol's binding, other and visibility from the
863  // kernel code symbol.
864  KernelDescriptorSymbol->setBinding(KernelCodeSymbol->getBinding());
865  KernelDescriptorSymbol->setOther(KernelCodeSymbol->getOther());
866  KernelDescriptorSymbol->setVisibility(KernelCodeSymbol->getVisibility());
867  // Kernel descriptor symbol's type and size are fixed.
868  KernelDescriptorSymbol->setType(ELF::STT_OBJECT);
869  KernelDescriptorSymbol->setSize(
870  MCConstantExpr::create(sizeof(KernelDescriptor), Context));
871 
872  // The visibility of the kernel code symbol must be protected or less to allow
873  // static relocations from the kernel descriptor to be used.
874  if (KernelCodeSymbol->getVisibility() == ELF::STV_DEFAULT)
875  KernelCodeSymbol->setVisibility(ELF::STV_PROTECTED);
876 
877  Streamer.emitLabel(KernelDescriptorSymbol);
878  Streamer.emitInt32(KernelDescriptor.group_segment_fixed_size);
879  Streamer.emitInt32(KernelDescriptor.private_segment_fixed_size);
880  Streamer.emitInt32(KernelDescriptor.kernarg_size);
881 
882  for (uint8_t Res : KernelDescriptor.reserved0)
883  Streamer.emitInt8(Res);
884 
885  // FIXME: Remove the use of VK_AMDGPU_REL64 in the expression below. The
886  // expression being created is:
887  // (start of kernel code) - (start of kernel descriptor)
888  // It implies R_AMDGPU_REL64, but ends up being R_AMDGPU_ABS64.
891  KernelCodeSymbol, MCSymbolRefExpr::VK_AMDGPU_REL64, Context),
893  KernelDescriptorSymbol, MCSymbolRefExpr::VK_None, Context),
894  Context),
895  sizeof(KernelDescriptor.kernel_code_entry_byte_offset));
896  for (uint8_t Res : KernelDescriptor.reserved1)
897  Streamer.emitInt8(Res);
898  Streamer.emitInt32(KernelDescriptor.compute_pgm_rsrc3);
899  Streamer.emitInt32(KernelDescriptor.compute_pgm_rsrc1);
900  Streamer.emitInt32(KernelDescriptor.compute_pgm_rsrc2);
901  Streamer.emitInt16(KernelDescriptor.kernel_code_properties);
902  for (uint8_t Res : KernelDescriptor.reserved2)
903  Streamer.emitInt8(Res);
904 }
llvm::ELF::EF_AMDGPU_MACH_R600_SUMO
@ EF_AMDGPU_MACH_R600_SUMO
Definition: ELF.h:725
AMDGPUPTNote.h
llvm::AMDGPUTargetStreamer::getTargetID
const Optional< AMDGPU::IsaInfo::AMDGPUTargetID > & getTargetID() const
Definition: AMDGPUTargetStreamer.h:101
llvm::ELF::EF_AMDGPU_MACH_AMDGCN_GFX1031
@ EF_AMDGPU_MACH_AMDGCN_GFX1031
Definition: ELF.h:764
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:18
llvm::ELF::STB_GLOBAL
@ STB_GLOBAL
Definition: ELF.h:1222
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:763
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:778
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:746
llvm::ELF::EF_AMDGPU_FEATURE_XNACK_ANY_V4
@ EF_AMDGPU_FEATURE_XNACK_ANY_V4
Definition: ELF.h:815
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:101
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:718
llvm::AMDGPU::isGFX11Plus
bool isGFX11Plus(const MCSubtargetInfo &STI)
Definition: AMDGPUBaseInfo.cpp:1930
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:742
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:761
llvm::ELF::EF_AMDGPU_MACH_AMDGCN_GFX90C
@ EF_AMDGPU_MACH_AMDGCN_GFX90C
Definition: ELF.h:759
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:629
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:745
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:775
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:155
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:830
llvm::AMDGPU::hasArchitectedFlatScratch
bool hasArchitectedFlatScratch(const MCSubtargetInfo &STI)
Definition: AMDGPUBaseInfo.cpp:1970
llvm::AMDGPU::getHsaAbiVersion
Optional< uint8_t > getHsaAbiVersion(const MCSubtargetInfo *STI)
Definition: AMDGPUBaseInfo.cpp:101
llvm::ELF::EF_AMDGPU_MACH_AMDGCN_GFX1103
@ EF_AMDGPU_MACH_AMDGCN_GFX1103
Definition: ELF.h:777
llvm::ELF::EF_AMDGPU_MACH_AMDGCN_GFX1100
@ EF_AMDGPU_MACH_AMDGCN_GFX1100
Definition: ELF.h:774
llvm::ELF::EF_AMDGPU_MACH_AMDGCN_GFX805
@ EF_AMDGPU_MACH_AMDGCN_GFX805
Definition: ELF.h:769
MCAssembler.h
llvm::ELF::EF_AMDGPU_MACH_AMDGCN_GFX602
@ EF_AMDGPU_MACH_AMDGCN_GFX602
Definition: ELF.h:767
llvm::AMDGPUPALMetadata::toString
void toString(std::string &S)
Definition: AMDGPUPALMetadata.cpp:664
llvm::AMDGPU::getAmdhsaCodeObjectVersion
unsigned getAmdhsaCodeObjectVersion()
Definition: AMDGPUBaseInfo.cpp:149
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:747
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::ELF::NT_AMD_HSA_ISA_VERSION
@ NT_AMD_HSA_ISA_VERSION
Definition: ELF.h:1740
llvm::MCSymbolELF::setOther
void setOther(unsigned Other)
Definition: MCSymbolELF.cpp:160
llvm::ELF::EF_AMDGPU_MACH_AMDGCN_GFX802
@ EF_AMDGPU_MACH_AMDGCN_GFX802
Definition: ELF.h:750
llvm::AMDGPU::IsaInfo::TargetIDSetting::Any
@ Any
llvm::AMDGPU::GK_GFX602
@ GK_GFX602
Definition: TargetParser.h:66
llvm::ELF::SHN_AMDGPU_LDS
@ SHN_AMDGPU_LDS
Definition: ELF.h:1733
llvm::ELF::EF_AMDGPU_MACH_R600_RS880
@ EF_AMDGPU_MACH_R600_RS880
Definition: ELF.h:714
TargetParser.h
llvm::ELF::EF_AMDGPU_MACH_R600_RV710
@ EF_AMDGPU_MACH_R600_RV710
Definition: ELF.h:717
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:179
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:757
llvm::MCSymbolELF::setVisibility
void setVisibility(unsigned Visibility)
Definition: MCSymbolELF.cpp:147
MCELFStreamer.h
llvm::AMDGPUTargetELFStreamer::EmitHSAMetadata
bool EmitHSAMetadata(msgpack::Document &HSAMetadata, bool Strict) override
Definition: AMDGPUTargetStreamer.cpp:773
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:826
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:824
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:753
llvm::AMDGPU::isGFX90A
bool isGFX90A(const MCSubtargetInfo &STI)
Definition: AMDGPUBaseInfo.cpp:1962
llvm::AMDGPUTargetAsmStreamer::EmitAMDKernelCodeT
void EmitAMDKernelCodeT(const amd_kernel_code_t &Header) override
Definition: AMDGPUTargetStreamer.cpp:243
llvm::ELF::STV_PROTECTED
@ STV_PROTECTED
Definition: ELF.h:1254
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::AMDGPU::GK_CYPRESS
@ GK_CYPRESS
Definition: TargetParser.h:51
llvm::Triple::Mesa3D
@ Mesa3D
Definition: Triple.h:217
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:773
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:752
llvm::MCSubtargetInfo::getTargetTriple
const Triple & getTargetTriple() const
Definition: MCSubtargetInfo.h:109
MCContext.h
llvm::ELF::NT_AMD_HSA_CODE_OBJECT_VERSION
@ NT_AMD_HSA_CODE_OBJECT_VERSION
Definition: ELF.h:1738
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:724
llvm::amdhsa::kernel_descriptor_t::group_segment_fixed_size
uint32_t group_segment_fixed_size
Definition: AMDHSAKernelDescriptor.h:171
llvm::ELF::EF_AMDGPU_MACH_AMDGCN_GFX1010
@ EF_AMDGPU_MACH_AMDGCN_GFX1010
Definition: ELF.h:760
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:747
MCSubtargetInfo.h
llvm::ELF::EF_AMDGPU_MACH_AMDGCN_GFX1012
@ EF_AMDGPU_MACH_AMDGCN_GFX1012
Definition: ELF.h:762
llvm::AMDGPU
Definition: AMDGPUMetadataVerifier.h:34
llvm::ELF::EF_AMDGPU_MACH_R600_JUNIPER
@ EF_AMDGPU_MACH_R600_JUNIPER
Definition: ELF.h:723
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:145
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:771
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::NT_AMD_HSA_ISA_NAME
@ NT_AMD_HSA_ISA_NAME
Definition: ELF.h:1743
llvm::ELF::EF_AMDGPU_MACH_AMDGCN_GFX909
@ EF_AMDGPU_MACH_AMDGCN_GFX909
Definition: ELF.h:758
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:679
llvm::amdhsa::kernel_descriptor_t::kernel_code_properties
uint16_t kernel_code_properties
Definition: AMDHSAKernelDescriptor.h:180
llvm::ELF::EF_AMDGPU_MACH_AMDGCN_GFX705
@ EF_AMDGPU_MACH_AMDGCN_GFX705
Definition: ELF.h:768
llvm::amdhsa::kernel_descriptor_t::reserved2
uint8_t reserved2[6]
Definition: AMDHSAKernelDescriptor.h:181
Align
uint64_t Align
Definition: ELFObjHandler.cpp:82
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:354
llvm::ELF::EF_AMDGPU_FEATURE_XNACK_OFF_V4
@ EF_AMDGPU_FEATURE_XNACK_OFF_V4
Definition: ELF.h:817
llvm::AMDGPUTargetELFStreamer::EmitDirectiveHSACodeObjectISAV2
void EmitDirectiveHSACodeObjectISAV2(uint32_t Major, uint32_t Minor, uint32_t Stepping, StringRef VendorName, StringRef ArchName) override
Definition: AMDGPUTargetStreamer.cpp:692
llvm::amdhsa::kernel_descriptor_t::compute_pgm_rsrc3
uint32_t compute_pgm_rsrc3
Definition: AMDHSAKernelDescriptor.h:177
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:832
llvm::function_ref
An efficient, type-erasing, non-owning reference to a callable.
Definition: STLFunctionalExtras.h:36
llvm::Triple::AMDHSA
@ AMDHSA
Definition: Triple.h:210
llvm::AMDGPU::GK_BARTS
@ GK_BARTS
Definition: TargetParser.h:55
llvm::ELF::NT_AMDGPU_METADATA
@ NT_AMDGPU_METADATA
Definition: ELF.h:1750
Verifier
verify safepoint Safepoint IR Verifier
Definition: SafepointIRVerifier.cpp:251
llvm::MCStreamer::emitInt16
void emitInt16(uint64_t Value)
Definition: MCStreamer.h:746
llvm::amdhsa::kernel_descriptor_t::private_segment_fixed_size
uint32_t private_segment_fixed_size
Definition: AMDHSAKernelDescriptor.h:172
llvm::AMDGPUTargetELFStreamer::EmitDirectiveHSACodeObjectVersion
void EmitDirectiveHSACodeObjectVersion(uint32_t Major, uint32_t Minor) override
Definition: AMDGPUTargetStreamer.cpp:681
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:713
llvm::Triple::getOS
OSType getOS() const
Get the parsed operating system type of this triple.
Definition: Triple.h:363
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:722
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:707
llvm::ELF::EF_AMDGPU_MACH_R600_CAYMAN
@ EF_AMDGPU_MACH_R600_CAYMAN
Definition: ELF.h:729
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:110
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:765
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:745
llvm::ELF::SHF_ALLOC
@ SHF_ALLOC
Definition: ELF.h:1068
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::ELF::SHT_NOTE
@ SHT_NOTE
Definition: ELF.h:986
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::ELF::NT_AMD_HSA_METADATA
@ NT_AMD_HSA_METADATA
Definition: ELF.h:1742
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:196
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:500
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:735
llvm::AMDGPUTargetELFStreamer::EmitAMDKernelCodeT
void EmitAMDKernelCodeT(const amd_kernel_code_t &Header) override
Definition: AMDGPUTargetStreamer.cpp:720
llvm::ELF::EF_AMDGPU_MACH_R600_TURKS
@ EF_AMDGPU_MACH_R600_TURKS
Definition: ELF.h:730
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:850
llvm::amdhsa::kernel_descriptor_t::reserved1
uint8_t reserved1[20]
Definition: AMDHSAKernelDescriptor.h:176
llvm::StringRef
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:50
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
llvm::MCStreamer::emitValueToAlignment
virtual void emitValueToAlignment(Align Alignment, 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:1222
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:66
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:173
llvm::ELF::EF_AMDGPU_MACH_R600_RV770
@ EF_AMDGPU_MACH_R600_RV770
Definition: ELF.h:719
llvm::ELF::EF_AMDGPU_FEATURE_XNACK_ON_V4
@ EF_AMDGPU_FEATURE_XNACK_ON_V4
Definition: ELF.h:819
llvm::ELF::EF_AMDGPU_MACH_AMDGCN_GFX1035
@ EF_AMDGPU_MACH_AMDGCN_GFX1035
Definition: ELF.h:770
llvm::amdhsa::kernel_descriptor_t::reserved0
uint8_t reserved0[4]
Definition: AMDHSAKernelDescriptor.h:174
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::StringRef::size
constexpr size_t size() const
size - Get the string size.
Definition: StringRef.h:137
llvm::AMDGPU::GK_R630
@ GK_R630
Definition: TargetParser.h:44
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:749
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:81
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:728
uint16_t
llvm::AMDGPUTargetELFStreamer::finish
void finish() override
Definition: AMDGPUTargetStreamer.cpp:507
llvm::ELF::STT_AMDGPU_HSA_KERNEL
@ STT_AMDGPU_HSA_KERNEL
Definition: ELF.h:1247
llvm::toString
const char * toString(DWARFSectionKind Kind)
Definition: DWARFUnitIndex.h:67
llvm::AMDGPU::ElfNote::NoteNameV2
const char NoteNameV2[]
Definition: AMDGPUPTNote.h:26
llvm::Align::value
uint64_t value() const
This is a hole in the type system and should not be abused.
Definition: Alignment.h:85
llvm::FPOpFusion::Strict
@ Strict
Definition: TargetOptions.h:39
llvm::AMDGPU::GK_GFX1010
@ GK_GFX1010
Definition: TargetParser.h:91
llvm::Triple::AMDPAL
@ AMDPAL
Definition: Triple.h:219
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:175
llvm::ELF::EF_AMDGPU_MACH_R600_RV670
@ EF_AMDGPU_MACH_R600_RV670
Definition: ELF.h:715
llvm::ELF::EF_AMDGPU_FEATURE_SRAMECC_ANY_V4
@ EF_AMDGPU_FEATURE_SRAMECC_ANY_V4
Definition: ELF.h:828
llvm::amdhsa::kernel_descriptor_t
Definition: AMDHSAKernelDescriptor.h:170
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::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:751
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:178
llvm::AMDGPUTargetELFStreamer::EmitAMDGPUSymbolType
void EmitAMDGPUSymbolType(StringRef SymbolName, unsigned Type) override
Definition: AMDGPUTargetStreamer.cpp:728
llvm::ARMBuildAttrs::Symbol
@ Symbol
Definition: ARMBuildAttributes.h:83
llvm::ELF::EF_AMDGPU_MACH_AMDGCN_GFX906
@ EF_AMDGPU_MACH_AMDGCN_GFX906
Definition: ELF.h:756
llvm::ELF::EF_AMDGPU_FEATURE_SRAMECC_V3
@ EF_AMDGPU_FEATURE_SRAMECC_V3
Definition: ELF.h:806
llvm::ELF::EF_AMDGPU_MACH_AMDGCN_GFX701
@ EF_AMDGPU_MACH_AMDGCN_GFX701
Definition: ELF.h:744
llvm::ELF::EF_AMDGPU_MACH_AMDGCN_GFX600
@ EF_AMDGPU_MACH_AMDGCN_GFX600
Definition: ELF.h:741
llvm::MCSymbolELF::getOther
unsigned getOther() const
Definition: MCSymbolELF.cpp:168
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:780
llvm::MCStreamer::getContext
MCContext & getContext() const
Definition: MCStreamer.h:293
llvm::MCSymbolELF::setType
void setType(unsigned Type) const
Definition: MCSymbolELF.cpp:94
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:743
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::ELF::STV_DEFAULT
@ STV_DEFAULT
Definition: ELF.h:1251
llvm::ELF::EF_AMDGPU_MACH_R600_BARTS
@ EF_AMDGPU_MACH_R600_BARTS
Definition: ELF.h:727
llvm::ELF::EF_AMDGPU_MACH_AMDGCN_GFX1033
@ EF_AMDGPU_MACH_AMDGCN_GFX1033
Definition: ELF.h:766
llvm::MCStreamer::emitBytes
virtual void emitBytes(StringRef Data)
Emit the bytes in Data into the output.
Definition: MCStreamer.cpp:1212
llvm::ELF::EF_AMDGPU_MACH_AMDGCN_GFX1101
@ EF_AMDGPU_MACH_AMDGCN_GFX1101
Definition: ELF.h:779
llvm::ELF::EF_AMDGPU_MACH_AMDGCN_GFX90A
@ EF_AMDGPU_MACH_AMDGCN_GFX90A
Definition: ELF.h:772
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)
InlinePriorityMode::Size
@ Size
llvm::ELF::EF_AMDGPU_MACH_AMDGCN_GFX902
@ EF_AMDGPU_MACH_AMDGCN_GFX902
Definition: ELF.h:754
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:185
llvm::ELF::EF_AMDGPU_MACH_R600_CEDAR
@ EF_AMDGPU_MACH_R600_CEDAR
Definition: ELF.h:721
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:43
llvm::ELF::EF_AMDGPU_MACH_AMDGCN_GFX904
@ EF_AMDGPU_MACH_AMDGCN_GFX904
Definition: ELF.h:755
llvm::ELF::EF_AMDGPU_FEATURE_XNACK_UNSUPPORTED_V4
@ EF_AMDGPU_FEATURE_XNACK_UNSUPPORTED_V4
Definition: ELF.h:813
llvm::AMDGPUTargetELFStreamer::EmitISAVersion
bool EmitISAVersion() override
Definition: AMDGPUTargetStreamer.cpp:754
llvm::raw_string_ostream::str
std::string & str()
Returns the string's reference.
Definition: raw_ostream.h:647
llvm::AMDGPU::GK_GFX90A
@ GK_GFX90A
Definition: TargetParser.h:87
llvm::MCSubtargetInfo
Generic base class for all target subtargets.
Definition: MCSubtargetInfo.h:77
llvm::ELF::STT_OBJECT
@ STT_OBJECT
Definition: ELF.h:1234
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:712
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:801
llvm::AMDGPUTargetELFStreamer::AMDGPUTargetELFStreamer
AMDGPUTargetELFStreamer(MCStreamer &S, const MCSubtargetInfo &STI)
Definition: AMDGPUTargetStreamer.cpp:496
AMDGPUBaseInfo.h
llvm::AMDGPUTargetStreamer::getElfMach
static unsigned getElfMach(StringRef GPU)
Definition: AMDGPUTargetStreamer.cpp:134