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