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