LLVM  14.0.0git
AMDGPUMetadata.cpp
Go to the documentation of this file.
1 //===--- AMDGPUMetadata.cpp -------------------------------------*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 /// \file
10 /// AMDGPU metadata definitions and in-memory representations.
11 ///
12 //
13 //===----------------------------------------------------------------------===//
14 
17 
18 using namespace llvm::AMDGPU;
19 using namespace llvm::AMDGPU::HSAMD;
20 
23 
24 namespace llvm {
25 namespace yaml {
26 
27 template <>
28 struct ScalarEnumerationTraits<AccessQualifier> {
29  static void enumeration(IO &YIO, AccessQualifier &EN) {
30  YIO.enumCase(EN, "Default", AccessQualifier::Default);
31  YIO.enumCase(EN, "ReadOnly", AccessQualifier::ReadOnly);
32  YIO.enumCase(EN, "WriteOnly", AccessQualifier::WriteOnly);
33  YIO.enumCase(EN, "ReadWrite", AccessQualifier::ReadWrite);
34  }
35 };
36 
37 template <>
38 struct ScalarEnumerationTraits<AddressSpaceQualifier> {
39  static void enumeration(IO &YIO, AddressSpaceQualifier &EN) {
40  YIO.enumCase(EN, "Private", AddressSpaceQualifier::Private);
41  YIO.enumCase(EN, "Global", AddressSpaceQualifier::Global);
42  YIO.enumCase(EN, "Constant", AddressSpaceQualifier::Constant);
43  YIO.enumCase(EN, "Local", AddressSpaceQualifier::Local);
44  YIO.enumCase(EN, "Generic", AddressSpaceQualifier::Generic);
45  YIO.enumCase(EN, "Region", AddressSpaceQualifier::Region);
46  }
47 };
48 
49 template <>
50 struct ScalarEnumerationTraits<ValueKind> {
51  static void enumeration(IO &YIO, ValueKind &EN) {
52  YIO.enumCase(EN, "ByValue", ValueKind::ByValue);
53  YIO.enumCase(EN, "GlobalBuffer", ValueKind::GlobalBuffer);
54  YIO.enumCase(EN, "DynamicSharedPointer", ValueKind::DynamicSharedPointer);
55  YIO.enumCase(EN, "Sampler", ValueKind::Sampler);
56  YIO.enumCase(EN, "Image", ValueKind::Image);
57  YIO.enumCase(EN, "Pipe", ValueKind::Pipe);
58  YIO.enumCase(EN, "Queue", ValueKind::Queue);
59  YIO.enumCase(EN, "HiddenGlobalOffsetX", ValueKind::HiddenGlobalOffsetX);
60  YIO.enumCase(EN, "HiddenGlobalOffsetY", ValueKind::HiddenGlobalOffsetY);
61  YIO.enumCase(EN, "HiddenGlobalOffsetZ", ValueKind::HiddenGlobalOffsetZ);
62  YIO.enumCase(EN, "HiddenNone", ValueKind::HiddenNone);
63  YIO.enumCase(EN, "HiddenPrintfBuffer", ValueKind::HiddenPrintfBuffer);
64  YIO.enumCase(EN, "HiddenHostcallBuffer", ValueKind::HiddenHostcallBuffer);
65  YIO.enumCase(EN, "HiddenDefaultQueue", ValueKind::HiddenDefaultQueue);
66  YIO.enumCase(EN, "HiddenCompletionAction",
68  YIO.enumCase(EN, "HiddenMultiGridSyncArg",
70  }
71 };
72 
73 template <>
74 struct ScalarEnumerationTraits<ValueType> {
75  static void enumeration(IO &YIO, ValueType &EN) {
76  YIO.enumCase(EN, "Struct", ValueType::Struct);
77  YIO.enumCase(EN, "I8", ValueType::I8);
78  YIO.enumCase(EN, "U8", ValueType::U8);
79  YIO.enumCase(EN, "I16", ValueType::I16);
80  YIO.enumCase(EN, "U16", ValueType::U16);
81  YIO.enumCase(EN, "F16", ValueType::F16);
82  YIO.enumCase(EN, "I32", ValueType::I32);
83  YIO.enumCase(EN, "U32", ValueType::U32);
84  YIO.enumCase(EN, "F32", ValueType::F32);
85  YIO.enumCase(EN, "I64", ValueType::I64);
86  YIO.enumCase(EN, "U64", ValueType::U64);
87  YIO.enumCase(EN, "F64", ValueType::F64);
88  }
89 };
90 
91 template <>
92 struct MappingTraits<Kernel::Attrs::Metadata> {
93  static void mapping(IO &YIO, Kernel::Attrs::Metadata &MD) {
95  MD.mReqdWorkGroupSize, std::vector<uint32_t>());
97  MD.mWorkGroupSizeHint, std::vector<uint32_t>());
98  YIO.mapOptional(Kernel::Attrs::Key::VecTypeHint,
99  MD.mVecTypeHint, std::string());
101  std::string());
102  }
103 };
104 
105 template <>
106 struct MappingTraits<Kernel::Arg::Metadata> {
107  static void mapping(IO &YIO, Kernel::Arg::Metadata &MD) {
108  YIO.mapOptional(Kernel::Arg::Key::Name, MD.mName, std::string());
109  YIO.mapOptional(Kernel::Arg::Key::TypeName, MD.mTypeName, std::string());
110  YIO.mapRequired(Kernel::Arg::Key::Size, MD.mSize);
111  YIO.mapRequired(Kernel::Arg::Key::Align, MD.mAlign);
112  YIO.mapRequired(Kernel::Arg::Key::ValueKind, MD.mValueKind);
113 
114  // Removed. Accepted for parsing compatibility, but not emitted.
115  Optional<ValueType> Unused;
116  YIO.mapOptional(Kernel::Arg::Key::ValueType, Unused);
117 
118  YIO.mapOptional(Kernel::Arg::Key::PointeeAlign, MD.mPointeeAlign,
119  uint32_t(0));
122  YIO.mapOptional(Kernel::Arg::Key::AccQual, MD.mAccQual,
126  YIO.mapOptional(Kernel::Arg::Key::IsConst, MD.mIsConst, false);
127  YIO.mapOptional(Kernel::Arg::Key::IsRestrict, MD.mIsRestrict, false);
128  YIO.mapOptional(Kernel::Arg::Key::IsVolatile, MD.mIsVolatile, false);
129  YIO.mapOptional(Kernel::Arg::Key::IsPipe, MD.mIsPipe, false);
130  }
131 };
132 
133 template <>
134 struct MappingTraits<Kernel::CodeProps::Metadata> {
135  static void mapping(IO &YIO, Kernel::CodeProps::Metadata &MD) {
145  MD.mWavefrontSize);
146  YIO.mapOptional(Kernel::CodeProps::Key::NumSGPRs,
147  MD.mNumSGPRs, uint16_t(0));
148  YIO.mapOptional(Kernel::CodeProps::Key::NumVGPRs,
149  MD.mNumVGPRs, uint16_t(0));
153  MD.mIsDynamicCallStack, false);
155  MD.mIsXNACKEnabled, false);
157  MD.mNumSpilledSGPRs, uint16_t(0));
159  MD.mNumSpilledVGPRs, uint16_t(0));
160  }
161 };
162 
163 template <>
164 struct MappingTraits<Kernel::DebugProps::Metadata> {
165  static void mapping(IO &YIO, Kernel::DebugProps::Metadata &MD) {
167  MD.mDebuggerABIVersion, std::vector<uint32_t>());
169  MD.mReservedNumVGPRs, uint16_t(0));
171  MD.mReservedFirstVGPR, uint16_t(-1));
176  }
177 };
178 
179 template <>
181  static void mapping(IO &YIO, Kernel::Metadata &MD) {
182  YIO.mapRequired(Kernel::Key::Name, MD.mName);
183  YIO.mapRequired(Kernel::Key::SymbolName, MD.mSymbolName);
184  YIO.mapOptional(Kernel::Key::Language, MD.mLanguage, std::string());
186  std::vector<uint32_t>());
187  if (!MD.mAttrs.empty() || !YIO.outputting())
188  YIO.mapOptional(Kernel::Key::Attrs, MD.mAttrs);
189  if (!MD.mArgs.empty() || !YIO.outputting())
190  YIO.mapOptional(Kernel::Key::Args, MD.mArgs);
191  if (!MD.mCodeProps.empty() || !YIO.outputting())
192  YIO.mapOptional(Kernel::Key::CodeProps, MD.mCodeProps);
193  if (!MD.mDebugProps.empty() || !YIO.outputting())
194  YIO.mapOptional(Kernel::Key::DebugProps, MD.mDebugProps);
195  }
196 };
197 
198 template <>
199 struct MappingTraits<HSAMD::Metadata> {
200  static void mapping(IO &YIO, HSAMD::Metadata &MD) {
201  YIO.mapRequired(Key::Version, MD.mVersion);
202  YIO.mapOptional(Key::Printf, MD.mPrintf, std::vector<std::string>());
203  if (!MD.mKernels.empty() || !YIO.outputting())
204  YIO.mapOptional(Key::Kernels, MD.mKernels);
205  }
206 };
207 
208 } // end namespace yaml
209 
210 namespace AMDGPU {
211 namespace HSAMD {
212 
213 std::error_code fromString(StringRef String, Metadata &HSAMetadata) {
214  yaml::Input YamlInput(String);
215  YamlInput >> HSAMetadata;
216  return YamlInput.error();
217 }
218 
219 std::error_code toString(Metadata HSAMetadata, std::string &String) {
220  raw_string_ostream YamlStream(String);
221  yaml::Output YamlOutput(YamlStream, nullptr, std::numeric_limits<int>::max());
222  YamlOutput << HSAMetadata;
223  return std::error_code();
224 }
225 
226 } // end namespace HSAMD
227 } // end namespace AMDGPU
228 } // end namespace llvm
llvm::AMDGPU::HSAMD::Kernel::Arg::Metadata::mAccQual
AccessQualifier mAccQual
Access qualifier. Optional.
Definition: AMDGPUMetadata.h:218
llvm::AMDGPU::HSAMD::Kernel::DebugProps::Metadata::mPrivateSegmentBufferSGPR
uint16_t mPrivateSegmentBufferSGPR
Fixed SGPR of the first of 4 SGPRs used to hold the scratch V# used for the entire kernel execution.
Definition: AMDGPUMetadata.h:353
llvm::AMDGPU::HSAMD::Kernel::DebugProps::Metadata
In-memory representation of kernel debug properties metadata.
Definition: AMDGPUMetadata.h:341
llvm
---------------------— PointerInfo ------------------------------------—
Definition: AllocatorList.h:23
llvm::AMDGPU::HSAMD::ValueType::U16
@ U16
llvm::AMDGPU::HSAMD::AccessQualifier::Unknown
@ Unknown
llvm::AMDGPU::HSAMD::Kernel::CodeProps::Metadata::empty
bool empty() const
Definition: AMDGPUMetadata.h:307
llvm::AMDGPU::HSAMD::Kernel::Arg::Key::ValueKind
constexpr char ValueKind[]
Key for Kernel::Arg::Metadata::mValueKind.
Definition: AMDGPUMetadata.h:178
llvm::AMDGPU::HSAMD::Kernel::Metadata::mArgs
std::vector< Arg::Metadata > mArgs
Arguments metadata. Optional.
Definition: AMDGPUMetadata.h:409
llvm::AMDGPU::HSAMD::Kernel::CodeProps::Key::NumSGPRs
constexpr char NumSGPRs[]
Key for Kernel::CodeProps::Metadata::mNumSGPRs.
Definition: AMDGPUMetadata.h:253
llvm::AMDGPU::HSAMD::Kernel::DebugProps::Metadata::mReservedFirstVGPR
uint16_t mReservedFirstVGPR
First fixed VGPR reserved.
Definition: AMDGPUMetadata.h:349
llvm::AMDGPU::HSAMD::Kernel::CodeProps::Key::KernargSegmentSize
constexpr char KernargSegmentSize[]
Key for Kernel::CodeProps::Metadata::mKernargSegmentSize.
Definition: AMDGPUMetadata.h:243
llvm::AMDGPU::HSAMD::Metadata::mVersion
std::vector< uint32_t > mVersion
HSA metadata version. Required.
Definition: AMDGPUMetadata.h:433
llvm::AMDGPU::HSAMD::Kernel::Key::Attrs
constexpr char Attrs[]
Key for Kernel::Metadata::mAttrs.
Definition: AMDGPUMetadata.h:387
llvm::AMDGPU::HSAMD::ValueKind::ByValue
@ ByValue
llvm::AMDGPU::HSAMD::Kernel::Arg::Metadata::mIsConst
bool mIsConst
True if 'const' qualifier is specified. Optional.
Definition: AMDGPUMetadata.h:222
llvm::raw_string_ostream
A raw_ostream that writes to an std::string.
Definition: raw_ostream.h:625
llvm::AMDGPU::HSAMD::Kernel::Arg::Metadata::mValueKind
ValueKind mValueKind
Value kind. Required.
Definition: AMDGPUMetadata.h:212
llvm::AMDGPU::HSAMD::Kernel::Arg::Key::AddrSpaceQual
constexpr char AddrSpaceQual[]
Key for Kernel::Arg::Metadata::mAddrSpaceQual.
Definition: AMDGPUMetadata.h:184
llvm::AMDGPU::HSAMD::ValueType::I8
@ I8
llvm::AMDGPU::HSAMD
Definition: AMDGPUMetadataVerifier.h:23
llvm::AMDGPU::HSAMD::ValueType::U32
@ U32
llvm::AMDGPU::HSAMD::Key::Version
constexpr char Version[]
Key for HSA::Metadata::mVersion.
Definition: AMDGPUMetadata.h:423
llvm::AMDGPU::HSAMD::AddressSpaceQualifier::Region
@ Region
llvm::AMDGPU::HSAMD::Kernel::CodeProps::Metadata::mPrivateSegmentFixedSize
uint32_t mPrivateSegmentFixedSize
Size in bytes of the private segment memory required by a workitem.
Definition: AMDGPUMetadata.h:279
LLVM_YAML_IS_SEQUENCE_VECTOR
#define LLVM_YAML_IS_SEQUENCE_VECTOR(type)
llvm::AMDGPU::HSAMD::Kernel::Key::Name
constexpr char Name[]
Key for Kernel::Metadata::mName.
Definition: AMDGPUMetadata.h:379
llvm::AMDGPU::HSAMD::Kernel::Arg::Key::IsPipe
constexpr char IsPipe[]
Key for Kernel::Arg::Metadata::mIsPipe.
Definition: AMDGPUMetadata.h:196
llvm::Optional
Definition: APInt.h:33
llvm::AMDGPU::HSAMD::Kernel::Arg::Metadata
In-memory representation of kernel argument metadata.
Definition: AMDGPUMetadata.h:200
llvm::AMDGPU::HSAMD::Kernel::Arg::Metadata::mActualAccQual
AccessQualifier mActualAccQual
Actual access qualifier. Optional.
Definition: AMDGPUMetadata.h:220
llvm::AMDGPU::HSAMD::Kernel::Attrs::Key::ReqdWorkGroupSize
constexpr char ReqdWorkGroupSize[]
Key for Kernel::Attr::Metadata::mReqdWorkGroupSize.
Definition: AMDGPUMetadata.h:123
llvm::AMDGPU::HSAMD::Kernel::CodeProps::Metadata::mWavefrontSize
uint32_t mWavefrontSize
Wavefront size. Required.
Definition: AMDGPUMetadata.h:284
llvm::yaml::MappingTraits
Definition: ModuleSummaryIndex.h:52
llvm::AMDGPU::HSAMD::Kernel::DebugProps::Key::WavefrontPrivateSegmentOffsetSGPR
constexpr char WavefrontPrivateSegmentOffsetSGPR[]
Key for Kernel::DebugProps::Metadata::mWavefrontPrivateSegmentOffsetSGPR.
Definition: AMDGPUMetadata.h:336
llvm::yaml::MappingTraits< Kernel::Arg::Metadata >::mapping
static void mapping(IO &YIO, Kernel::Arg::Metadata &MD)
Definition: AMDGPUMetadata.cpp:107
llvm::AMDGPU::HSAMD::ValueKind::Queue
@ Queue
llvm::AMDGPU::HSAMD::Kernel::CodeProps::Key::MaxFlatWorkGroupSize
constexpr char MaxFlatWorkGroupSize[]
Key for Kernel::CodeProps::Metadata::mMaxFlatWorkGroupSize.
Definition: AMDGPUMetadata.h:257
llvm::AMDGPU::HSAMD::AccessQualifier
AccessQualifier
Access qualifiers.
Definition: AMDGPUMetadata.h:53
llvm::AMDGPU::HSAMD::Kernel::Key::DebugProps
constexpr char DebugProps[]
Key for Kernel::Metadata::mDebugProps.
Definition: AMDGPUMetadata.h:393
llvm::AMDGPU::HSAMD::fromString
std::error_code fromString(StringRef String, Metadata &HSAMetadata)
Converts String to HSAMetadata.
Definition: AMDGPUMetadata.cpp:213
llvm::AMDGPU::HSAMD::Key::Kernels
constexpr char Kernels[]
Key for HSA::Metadata::mKernels.
Definition: AMDGPUMetadata.h:427
llvm::AMDGPU::HSAMD::ValueKind
ValueKind
Value kinds.
Definition: AMDGPUMetadata.h:73
llvm::AMDGPU::HSAMD::Kernel::Attrs::Key::WorkGroupSizeHint
constexpr char WorkGroupSizeHint[]
Key for Kernel::Attr::Metadata::mWorkGroupSizeHint.
Definition: AMDGPUMetadata.h:125
llvm::AMDGPU::HSAMD::ValueType::F64
@ F64
llvm::AMDGPU::HSAMD::Kernel::CodeProps::Metadata::mIsXNACKEnabled
bool mIsXNACKEnabled
True if the generated machine code is capable of supporting XNACK.
Definition: AMDGPUMetadata.h:296
llvm::AMDGPU::HSAMD::Kernel::Attrs::Key::VecTypeHint
constexpr char VecTypeHint[]
Key for Kernel::Attr::Metadata::mVecTypeHint.
Definition: AMDGPUMetadata.h:127
llvm::AMDGPU::HSAMD::Kernel::CodeProps::Metadata::mNumSGPRs
uint16_t mNumSGPRs
Total number of SGPRs used by a wavefront. Optional.
Definition: AMDGPUMetadata.h:286
llvm::AMDGPU::HSAMD::ValueType::I32
@ I32
llvm::AMDGPU::HSAMD::ValueKind::HiddenCompletionAction
@ HiddenCompletionAction
llvm::AMDGPU::HSAMD::Kernel::CodeProps::Key::NumSpilledVGPRs
constexpr char NumSpilledVGPRs[]
Key for Kernel::CodeProps::Metadata::mNumSpilledVGPRs.
Definition: AMDGPUMetadata.h:265
llvm::AMDGPU::HSAMD::ValueType::U64
@ U64
llvm::AMDGPU::HSAMD::Kernel::Key::Language
constexpr char Language[]
Key for Kernel::Metadata::mLanguage.
Definition: AMDGPUMetadata.h:383
llvm::AMDGPU::HSAMD::Kernel::CodeProps::Key::PrivateSegmentFixedSize
constexpr char PrivateSegmentFixedSize[]
Key for Kernel::CodeProps::Metadata::mPrivateSegmentFixedSize.
Definition: AMDGPUMetadata.h:247
llvm::AMDGPU::HSAMD::Kernel::Metadata::mLanguage
std::string mLanguage
Language. Optional.
Definition: AMDGPUMetadata.h:403
llvm::AMDGPU::HSAMD::Kernel::Arg::Key::AccQual
constexpr char AccQual[]
Key for Kernel::Arg::Metadata::mAccQual.
Definition: AMDGPUMetadata.h:186
llvm::AMDGPU::HSAMD::Kernel::Key::CodeProps
constexpr char CodeProps[]
Key for Kernel::Metadata::mCodeProps.
Definition: AMDGPUMetadata.h:391
llvm::AMDGPU::HSAMD::Kernel::Arg::Metadata::mTypeName
std::string mTypeName
Type name. Optional.
Definition: AMDGPUMetadata.h:204
llvm::AMDGPU::HSAMD::ValueKind::HiddenGlobalOffsetY
@ HiddenGlobalOffsetY
llvm::AMDGPU::HSAMD::Kernel::Arg::Key::ValueType
constexpr char ValueType[]
Key for Kernel::Arg::Metadata::mValueType. (deprecated)
Definition: AMDGPUMetadata.h:180
llvm::AMDGPU::HSAMD::Kernel::Arg::Metadata::mIsPipe
bool mIsPipe
True if 'pipe' qualifier is specified. Optional.
Definition: AMDGPUMetadata.h:228
llvm::AMDGPU
Definition: AMDGPUMetadataVerifier.h:22
llvm::AMDGPU::HSAMD::ValueKind::HiddenGlobalOffsetZ
@ HiddenGlobalOffsetZ
llvm::AMDGPU::HSAMD::Metadata
In-memory representation of HSA metadata.
Definition: AMDGPUMetadata.h:431
llvm::AMDGPU::HSAMD::Kernel::Arg::Metadata::mSize
uint32_t mSize
Size in bytes. Required.
Definition: AMDGPUMetadata.h:206
llvm::AMDGPU::HSAMD::ValueKind::GlobalBuffer
@ GlobalBuffer
llvm::AMDGPU::HSAMD::ValueType::I64
@ I64
llvm::Metadata
Root of the metadata hierarchy.
Definition: Metadata.h:62
llvm::AMDGPU::HSAMD::Kernel::Arg::Key::Name
constexpr char Name[]
Key for Kernel::Arg::Metadata::mName.
Definition: AMDGPUMetadata.h:168
llvm::AMDGPU::HSAMD::Kernel::Arg::Metadata::mIsVolatile
bool mIsVolatile
True if 'volatile' qualifier is specified. Optional.
Definition: AMDGPUMetadata.h:226
llvm::AMDGPU::HSAMD::AddressSpaceQualifier::Global
@ Global
llvm::AMDGPU::HSAMD::Kernel::CodeProps::Metadata::mKernargSegmentAlign
uint32_t mKernargSegmentAlign
Maximum byte alignment of variables used by the kernel in the kernarg memory segment.
Definition: AMDGPUMetadata.h:282
llvm::AMDGPU::HSAMD::AccessQualifier::WriteOnly
@ WriteOnly
llvm::AMDGPU::HSAMD::ValueType::F16
@ F16
llvm::AMDGPU::HSAMD::Kernel::Attrs::Metadata::empty
bool empty() const
Definition: AMDGPUMetadata.h:148
llvm::AMDGPU::HSAMD::ValueKind::Image
@ Image
llvm::AMDGPU::HSAMD::Kernel::Attrs::Metadata::mVecTypeHint
std::string mVecTypeHint
'vec_type_hint' attribute. Optional.
Definition: AMDGPUMetadata.h:139
llvm::AMDGPU::HSAMD::Metadata::mPrintf
std::vector< std::string > mPrintf
Printf metadata. Optional.
Definition: AMDGPUMetadata.h:435
llvm::AMDGPU::HSAMD::Kernel::CodeProps::Metadata::mNumSpilledSGPRs
uint16_t mNumSpilledSGPRs
Number of SGPRs spilled by a wavefront. Optional.
Definition: AMDGPUMetadata.h:298
llvm::AMDGPU::HSAMD::AddressSpaceQualifier::Local
@ Local
llvm::AMDGPU::HSAMD::Kernel::Metadata::mAttrs
Attrs::Metadata mAttrs
Attributes metadata. Optional.
Definition: AMDGPUMetadata.h:407
llvm::AMDGPU::HSAMD::AccessQualifier::ReadOnly
@ ReadOnly
llvm::AMDGPU::HSAMD::AccessQualifier::ReadWrite
@ ReadWrite
llvm::omp::Kernel
Function * Kernel
Summary of a kernel (=entry point for target offloading).
Definition: OpenMPOpt.h:21
llvm::AMDGPU::HSAMD::Kernel::DebugProps::Key::ReservedFirstVGPR
constexpr char ReservedFirstVGPR[]
Key for Kernel::DebugProps::Metadata::mReservedFirstVGPR.
Definition: AMDGPUMetadata.h:331
llvm::yaml::MappingTraits< Kernel::Attrs::Metadata >::mapping
static void mapping(IO &YIO, Kernel::Attrs::Metadata &MD)
Definition: AMDGPUMetadata.cpp:93
llvm::AMDGPU::HSAMD::ValueType::F32
@ F32
llvm::AMDGPU::HSAMD::Kernel::Metadata
In-memory representation of kernel metadata.
Definition: AMDGPUMetadata.h:397
llvm::AMDGPU::HSAMD::ValueKind::HiddenDefaultQueue
@ HiddenDefaultQueue
llvm::AMDGPU::HSAMD::Kernel::DebugProps::Key::DebuggerABIVersion
constexpr char DebuggerABIVersion[]
Key for Kernel::DebugProps::Metadata::mDebuggerABIVersion.
Definition: AMDGPUMetadata.h:327
llvm::AMDGPU::HSAMD::Kernel::Metadata::mLanguageVersion
std::vector< uint32_t > mLanguageVersion
Language version. Optional.
Definition: AMDGPUMetadata.h:405
llvm::AMDGPU::HSAMD::Kernel::DebugProps::Metadata::mReservedNumVGPRs
uint16_t mReservedNumVGPRs
Consecutive number of VGPRs reserved for debugger use.
Definition: AMDGPUMetadata.h:346
llvm::AMDGPU::HSAMD::Kernel::Arg::Metadata::mAlign
uint32_t mAlign
Alignment in bytes. Required.
Definition: AMDGPUMetadata.h:210
llvm::AMDGPU::HSAMD::Kernel::CodeProps::Key::GroupSegmentFixedSize
constexpr char GroupSegmentFixedSize[]
Key for Kernel::CodeProps::Metadata::mGroupSegmentFixedSize.
Definition: AMDGPUMetadata.h:245
llvm::AMDGPU::HSAMD::Kernel::CodeProps::Key::KernargSegmentAlign
constexpr char KernargSegmentAlign[]
Key for Kernel::CodeProps::Metadata::mKernargSegmentAlign.
Definition: AMDGPUMetadata.h:249
llvm::AMDGPU::HSAMD::ValueKind::HiddenNone
@ HiddenNone
llvm::AMDGPU::HSAMD::Kernel::Arg::Key::PointeeAlign
constexpr char PointeeAlign[]
Key for Kernel::Arg::Metadata::mPointeeAlign.
Definition: AMDGPUMetadata.h:182
llvm::AMDGPU::HSAMD::AddressSpaceQualifier::Generic
@ Generic
llvm::AMDGPU::HSAMD::ValueKind::Pipe
@ Pipe
llvm::yaml::ScalarEnumerationTraits< AddressSpaceQualifier >::enumeration
static void enumeration(IO &YIO, AddressSpaceQualifier &EN)
Definition: AMDGPUMetadata.cpp:39
llvm::AMDGPU::HSAMD::ValueType::I16
@ I16
llvm::AMDGPU::HSAMD::Kernel::Arg::Key::Align
constexpr char Align[]
Key for Kernel::Arg::Metadata::mAlign.
Definition: AMDGPUMetadata.h:176
llvm::AMDGPU::HSAMD::Kernel::Metadata::mCodeProps
CodeProps::Metadata mCodeProps
Code properties metadata. Optional.
Definition: AMDGPUMetadata.h:411
llvm::yaml::ScalarEnumerationTraits< AccessQualifier >::enumeration
static void enumeration(IO &YIO, AccessQualifier &EN)
Definition: AMDGPUMetadata.cpp:29
llvm::AMDGPU::HSAMD::AddressSpaceQualifier::Unknown
@ Unknown
llvm::AMDGPU::HSAMD::Kernel::CodeProps::Metadata
In-memory representation of kernel code properties metadata.
Definition: AMDGPUMetadata.h:269
llvm::AMDGPU::HSAMD::AddressSpaceQualifier::Constant
@ Constant
llvm::AMDGPU::HSAMD::ValueKind::HiddenPrintfBuffer
@ HiddenPrintfBuffer
llvm::AMDGPU::HSAMD::Kernel::DebugProps::Key::ReservedNumVGPRs
constexpr char ReservedNumVGPRs[]
Key for Kernel::DebugProps::Metadata::mReservedNumVGPRs.
Definition: AMDGPUMetadata.h:329
llvm::AMDGPU::HSAMD::Kernel::Arg::Metadata::mPointeeAlign
uint32_t mPointeeAlign
Pointee alignment in bytes. Optional.
Definition: AMDGPUMetadata.h:214
YAMLTraits.h
llvm::AMDGPU::HSAMD::Kernel::DebugProps::Metadata::mWavefrontPrivateSegmentOffsetSGPR
uint16_t mWavefrontPrivateSegmentOffsetSGPR
Fixed SGPR used to hold the wave scratch offset for the entire kernel execution.
Definition: AMDGPUMetadata.h:357
llvm::AMDGPU::HSAMD::Kernel::Arg::Key::IsConst
constexpr char IsConst[]
Key for Kernel::Arg::Metadata::mIsConst.
Definition: AMDGPUMetadata.h:190
llvm::AMDGPU::HSAMD::Kernel::Metadata::mName
std::string mName
Kernel source name. Required.
Definition: AMDGPUMetadata.h:399
llvm::StringRef
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:58
llvm::yaml::MappingTraits< Kernel::Metadata >::mapping
static void mapping(IO &YIO, Kernel::Metadata &MD)
Definition: AMDGPUMetadata.cpp:181
llvm::AMDGPU::HSAMD::Kernel::Metadata::mDebugProps
DebugProps::Metadata mDebugProps
Debug properties metadata. Optional.
Definition: AMDGPUMetadata.h:413
llvm::AMDGPU::HSAMD::ValueKind::Sampler
@ Sampler
uint32_t
llvm::AMDGPU::HSAMD::Kernel::Key::LanguageVersion
constexpr char LanguageVersion[]
Key for Kernel::Metadata::mLanguageVersion.
Definition: AMDGPUMetadata.h:385
llvm::AMDGPU::HSAMD::ValueType::U8
@ U8
llvm::AMDGPU::HSAMD::Metadata::mKernels
std::vector< Kernel::Metadata > mKernels
Kernels metadata. Required.
Definition: AMDGPUMetadata.h:437
llvm::yaml::ScalarEnumerationTraits< ValueKind >::enumeration
static void enumeration(IO &YIO, ValueKind &EN)
Definition: AMDGPUMetadata.cpp:51
llvm::AMDGPU::HSAMD::Kernel::Metadata::mSymbolName
std::string mSymbolName
Kernel descriptor name. Required.
Definition: AMDGPUMetadata.h:401
llvm::AMDGPU::HSAMD::Kernel::CodeProps::Metadata::mNumSpilledVGPRs
uint16_t mNumSpilledVGPRs
Number of VGPRs spilled by a workitem. Optional.
Definition: AMDGPUMetadata.h:300
llvm::AMDGPU::HSAMD::Kernel::Attrs::Metadata
In-memory representation of kernel attributes metadata.
Definition: AMDGPUMetadata.h:133
llvm::AMDGPU::HSAMD::Kernel::Arg::Key::IsRestrict
constexpr char IsRestrict[]
Key for Kernel::Arg::Metadata::mIsRestrict.
Definition: AMDGPUMetadata.h:192
llvm::AMDGPU::HSAMD::Kernel::Arg::Key::IsVolatile
constexpr char IsVolatile[]
Key for Kernel::Arg::Metadata::mIsVolatile.
Definition: AMDGPUMetadata.h:194
llvm::yaml::MappingTraits< Kernel::CodeProps::Metadata >::mapping
static void mapping(IO &YIO, Kernel::CodeProps::Metadata &MD)
Definition: AMDGPUMetadata.cpp:135
llvm::AMDGPU::HSAMD::ValueKind::HiddenMultiGridSyncArg
@ HiddenMultiGridSyncArg
llvm::AMDGPU::HSAMD::AddressSpaceQualifier
AddressSpaceQualifier
Address space qualifiers.
Definition: AMDGPUMetadata.h:62
llvm::yaml::ScalarEnumerationTraits< ValueType >::enumeration
static void enumeration(IO &YIO, ValueType &EN)
Definition: AMDGPUMetadata.cpp:75
llvm::PointerUnion< const Value *, const PseudoSourceValue * >
llvm::AMDGPU::HSAMD::Kernel::CodeProps::Metadata::mMaxFlatWorkGroupSize
uint32_t mMaxFlatWorkGroupSize
Maximum flat work-group size supported by the kernel. Optional.
Definition: AMDGPUMetadata.h:290
llvm::AMDGPU::HSAMD::ValueKind::DynamicSharedPointer
@ DynamicSharedPointer
llvm::AMDGPU::HSAMD::ValueKind::HiddenHostcallBuffer
@ HiddenHostcallBuffer
llvm::AMDGPU::HSAMD::Kernel::CodeProps::Metadata::mIsDynamicCallStack
bool mIsDynamicCallStack
True if the generated machine code is using a dynamically sized call stack.
Definition: AMDGPUMetadata.h:293
llvm::AMDGPU::HSAMD::Kernel::Key::SymbolName
constexpr char SymbolName[]
Key for Kernel::Metadata::mSymbolName.
Definition: AMDGPUMetadata.h:381
llvm::AMDGPU::HSAMD::Kernel::DebugProps::Metadata::mDebuggerABIVersion
std::vector< uint32_t > mDebuggerABIVersion
Debugger ABI version. Optional.
Definition: AMDGPUMetadata.h:343
llvm::yaml::MappingTraits< HSAMD::Metadata >::mapping
static void mapping(IO &YIO, HSAMD::Metadata &MD)
Definition: AMDGPUMetadata.cpp:200
uint16_t
llvm::AMDGPU::HSAMD::Kernel::Arg::Key::TypeName
constexpr char TypeName[]
Key for Kernel::Arg::Metadata::mTypeName.
Definition: AMDGPUMetadata.h:170
llvm::yaml::MappingTraits< Kernel::DebugProps::Metadata >::mapping
static void mapping(IO &YIO, Kernel::DebugProps::Metadata &MD)
Definition: AMDGPUMetadata.cpp:165
llvm::AMDGPU::HSAMD::ValueType::Struct
@ Struct
llvm::AMDGPU::HSAMD::Kernel::CodeProps::Metadata::mKernargSegmentSize
uint64_t mKernargSegmentSize
Size in bytes of the kernarg segment memory.
Definition: AMDGPUMetadata.h:272
llvm::AMDGPU::HSAMD::Kernel::Attrs::Key::RuntimeHandle
constexpr char RuntimeHandle[]
Key for Kernel::Attr::Metadata::mRuntimeHandle.
Definition: AMDGPUMetadata.h:129
llvm::AMDGPU::HSAMD::AccessQualifier::Default
@ Default
llvm::AMDGPU::HSAMD::Key::Printf
constexpr char Printf[]
Key for HSA::Metadata::mPrintf.
Definition: AMDGPUMetadata.h:425
llvm::AMDGPU::HSAMD::Kernel::Attrs::Metadata::mReqdWorkGroupSize
std::vector< uint32_t > mReqdWorkGroupSize
'reqd_work_group_size' attribute. Optional.
Definition: AMDGPUMetadata.h:135
llvm::AMDGPU::HSAMD::Kernel::DebugProps::Metadata::empty
bool empty() const
Definition: AMDGPUMetadata.h:364
AMDGPUMetadata.h
llvm::AMDGPU::HSAMD::AddressSpaceQualifier::Private
@ Private
llvm::AMDGPU::HSAMD::Kernel::Arg::Metadata::mIsRestrict
bool mIsRestrict
True if 'restrict' qualifier is specified. Optional.
Definition: AMDGPUMetadata.h:224
llvm::AMDGPU::HSAMD::Kernel::Arg::Metadata::mName
std::string mName
Name. Optional.
Definition: AMDGPUMetadata.h:202
llvm::AMDGPU::HSAMD::Kernel::DebugProps::Key::PrivateSegmentBufferSGPR
constexpr char PrivateSegmentBufferSGPR[]
Key for Kernel::DebugProps::Metadata::mPrivateSegmentBufferSGPR.
Definition: AMDGPUMetadata.h:333
llvm::max
Align max(MaybeAlign Lhs, Align Rhs)
Definition: Alignment.h:340
llvm::AMDGPU::HSAMD::Kernel::CodeProps::Key::WavefrontSize
constexpr char WavefrontSize[]
Key for Kernel::CodeProps::Metadata::mWavefrontSize.
Definition: AMDGPUMetadata.h:251
llvm::AMDGPU::HSAMD::Kernel::CodeProps::Key::NumVGPRs
constexpr char NumVGPRs[]
Key for Kernel::CodeProps::Metadata::mNumVGPRs.
Definition: AMDGPUMetadata.h:255
llvm::AMDGPU::HSAMD::Kernel::Arg::Metadata::mAddrSpaceQual
AddressSpaceQualifier mAddrSpaceQual
Address space qualifier. Optional.
Definition: AMDGPUMetadata.h:216
llvm::AMDGPU::HSAMD::Kernel::CodeProps::Key::NumSpilledSGPRs
constexpr char NumSpilledSGPRs[]
Key for Kernel::CodeProps::Metadata::mNumSpilledSGPRs.
Definition: AMDGPUMetadata.h:263
llvm::AMDGPU::HSAMD::Kernel::Key::Args
constexpr char Args[]
Key for Kernel::Metadata::mArgs.
Definition: AMDGPUMetadata.h:389
llvm::AMDGPU::HSAMD::Kernel::Attrs::Metadata::mRuntimeHandle
std::string mRuntimeHandle
External symbol created by runtime to store the kernel address for enqueued blocks.
Definition: AMDGPUMetadata.h:142
llvm::AMDGPU::HSAMD::Kernel::CodeProps::Key::IsDynamicCallStack
constexpr char IsDynamicCallStack[]
Key for Kernel::CodeProps::Metadata::mIsDynamicCallStack.
Definition: AMDGPUMetadata.h:259
llvm::AMDGPU::HSAMD::Kernel::CodeProps::Metadata::mGroupSegmentFixedSize
uint32_t mGroupSegmentFixedSize
Size in bytes of the group segment memory required by a workgroup.
Definition: AMDGPUMetadata.h:276
llvm::AMDGPU::HSAMD::Kernel::Attrs::Metadata::mWorkGroupSizeHint
std::vector< uint32_t > mWorkGroupSizeHint
'work_group_size_hint' attribute. Optional.
Definition: AMDGPUMetadata.h:137
llvm::AMDGPU::HSAMD::Kernel::CodeProps::Key::IsXNACKEnabled
constexpr char IsXNACKEnabled[]
Key for Kernel::CodeProps::Metadata::mIsXNACKEnabled.
Definition: AMDGPUMetadata.h:261
llvm::AMDGPU::HSAMD::Kernel::CodeProps::Metadata::mNumVGPRs
uint16_t mNumVGPRs
Total number of VGPRs used by a workitem. Optional.
Definition: AMDGPUMetadata.h:288
llvm::AMDGPU::HSAMD::Kernel::Arg::Key::ActualAccQual
constexpr char ActualAccQual[]
Key for Kernel::Arg::Metadata::mActualAccQual.
Definition: AMDGPUMetadata.h:188
llvm::AMDGPU::HSAMD::ValueKind::HiddenGlobalOffsetX
@ HiddenGlobalOffsetX
llvm::AMDGPU::HSAMD::Kernel::Arg::Key::Size
constexpr char Size[]
Key for Kernel::Arg::Metadata::mSize.
Definition: AMDGPUMetadata.h:172
llvm::AMDGPU::HSAMD::toString
std::error_code toString(Metadata HSAMetadata, std::string &String)
Converts HSAMetadata to String.
Definition: AMDGPUMetadata.cpp:219