llvm.org GIT mirror llvm / d2fea82
AMDGPU: Emit runtime metadata version 2 as YAML Differential Revision: https://reviews.llvm.org/D25046 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289674 91177308-0d34-0410-b5e6-96231b3b80d8 Yaxun Liu 3 years ago
14 changed file(s) with 808 addition(s) and 2708 deletion(s). Raw diff Collapse all Expand all
118118 "AMD", "AMDGPU");
119119
120120 // Emit runtime metadata.
121 TS->emitRuntimeMetadataAsNoteElement(M);
121 TS->emitRuntimeMetadata(M);
122122 }
123123
124124 bool AMDGPUAsmPrinter::isBlockOnlyReachableByFallthrough(
823823 *TM.getSubtargetImpl(*MF->getFunction())->getRegisterInfo());
824824 return false;
825825 }
826
1313 /// Runtime requests certain information (metadata) about kernels to be able
1414 /// to execute the kernels and answer the queries about the kernels.
1515 /// The metadata is represented as a note element in the .note ELF section of a
16 /// binary (code object). The desc field of the note element consists of
17 /// key-value pairs. Each key is an 8 bit unsigned integer. Each value can be
18 /// an integer, a string, or a stream of key-value pairs. There are 3 levels of
19 /// key-value pair streams. At the beginning of the ELF section is the top level
20 /// key-value pair stream. A kernel-level key-value pair stream starts after
21 /// encountering KeyKernelBegin and ends immediately before encountering
22 /// KeyKernelEnd. A kernel-argument-level key-value pair stream starts
23 /// after encountering KeyArgBegin and ends immediately before encountering
24 /// KeyArgEnd. A kernel-level key-value pair stream can only appear in a top
25 /// level key-value pair stream. A kernel-argument-level key-value pair stream
26 /// can only appear in a kernel-level key-value pair stream.
16 /// binary (code object). The desc field of the note element is a YAML string
17 /// consisting of key-value pairs. Each key is a string. Each value can be
18 /// an integer, a string, or an YAML sequence. There are 3 levels of YAML maps.
19 /// At the beginning of the YAML string is the module level YAML map. A
20 /// kernel-level YAML map is in the amd.Kernels sequence. A
21 /// kernel-argument-level map is in the amd.Args sequence.
2722 ///
2823 /// The format should be kept backward compatible. New enum values and bit
2924 /// fields should be appended at the end. It is suggested to bump up the
3631 #ifndef LLVM_LIB_TARGET_AMDGPU_AMDGPURUNTIMEMETADATA_H
3732 #define LLVM_LIB_TARGET_AMDGPU_AMDGPURUNTIMEMETADATA_H
3833
34 #include
35 #include
36 #include
37
3938 namespace AMDGPU {
4039
4140 namespace RuntimeMD {
4241
4342 // Version and revision of runtime metadata
44 const unsigned char MDVersion = 1;
43 const unsigned char MDVersion = 2;
4544 const unsigned char MDRevision = 0;
4645
47 // Enumeration values of keys in runtime metadata.
48 enum Key {
49 KeyNull = 0, // Place holder. Ignored when encountered
50 KeyMDVersion = 1, // Runtime metadata version
51 KeyLanguage = 2, // Language
52 KeyLanguageVersion = 3, // Language version
53 KeyKernelBegin = 4, // Beginning of kernel-level stream
54 KeyKernelEnd = 5, // End of kernel-level stream
55 KeyKernelName = 6, // Kernel name
56 KeyArgBegin = 7, // Beginning of kernel-arg-level stream
57 KeyArgEnd = 8, // End of kernel-arg-level stream
58 KeyArgSize = 9, // Kernel arg size
59 KeyArgAlign = 10, // Kernel arg alignment
60 KeyArgTypeName = 11, // Kernel type name
61 KeyArgName = 12, // Kernel name
62 KeyArgKind = 13, // Kernel argument kind
63 KeyArgValueType = 14, // Kernel argument value type
64 KeyArgAddrQual = 15, // Kernel argument address qualifier
65 KeyArgAccQual = 16, // Kernel argument access qualifier
66 KeyArgIsConst = 17, // Kernel argument is const qualified
67 KeyArgIsRestrict = 18, // Kernel argument is restrict qualified
68 KeyArgIsVolatile = 19, // Kernel argument is volatile qualified
69 KeyArgIsPipe = 20, // Kernel argument is pipe qualified
70 KeyReqdWorkGroupSize = 21, // Required work group size
71 KeyWorkGroupSizeHint = 22, // Work group size hint
72 KeyVecTypeHint = 23, // Vector type hint
73 KeyKernelIndex = 24, // Kernel index for device enqueue
74 KeyMinWavesPerSIMD = 25, // Minimum number of waves per SIMD
75 KeyMaxWavesPerSIMD = 26, // Maximum number of waves per SIMD
76 KeyFlatWorkGroupSizeLimits = 27, // Flat work group size limits
77 KeyMaxWorkGroupSize = 28, // Maximum work group size
78 KeyNoPartialWorkGroups = 29, // No partial work groups
79 KeyPrintfInfo = 30, // Prinf function call information
80 KeyArgActualAcc = 31, // The actual kernel argument access qualifier
81 KeyArgPointeeAlign = 32, // Alignment of pointee type
82 };
83
84 enum Language : uint8_t {
85 OpenCL_C = 0,
86 HCC = 1,
87 OpenMP = 2,
88 OpenCL_CPP = 3,
89 };
90
91 enum LanguageVersion : uint16_t {
92 V100 = 100,
93 V110 = 110,
94 V120 = 120,
95 V200 = 200,
96 V210 = 210,
46 // Name of keys for runtime metadata.
47 namespace KeyName {
48 const char MDVersion[] = "amd.MDVersion"; // Runtime metadata version
49 const char Language[] = "amd.Language"; // Language
50 const char LanguageVersion[] = "amd.LanguageVersion"; // Language version
51 const char Kernels[] = "amd.Kernels"; // Kernels
52 const char KernelName[] = "amd.KernelName"; // Kernel name
53 const char Args[] = "amd.Args"; // Kernel arguments
54 const char ArgSize[] = "amd.ArgSize"; // Kernel arg size
55 const char ArgAlign[] = "amd.ArgAlign"; // Kernel arg alignment
56 const char ArgTypeName[] = "amd.ArgTypeName"; // Kernel type name
57 const char ArgName[] = "amd.ArgName"; // Kernel name
58 const char ArgKind[] = "amd.ArgKind"; // Kernel argument kind
59 const char ArgValueType[] = "amd.ArgValueType"; // Kernel argument value type
60 const char ArgAddrQual[] = "amd.ArgAddrQual"; // Kernel argument address qualifier
61 const char ArgAccQual[] = "amd.ArgAccQual"; // Kernel argument access qualifier
62 const char ArgIsConst[] = "amd.ArgIsConst"; // Kernel argument is const qualified
63 const char ArgIsRestrict[] = "amd.ArgIsRestrict"; // Kernel argument is restrict qualified
64 const char ArgIsVolatile[] = "amd.ArgIsVolatile"; // Kernel argument is volatile qualified
65 const char ArgIsPipe[] = "amd.ArgIsPipe"; // Kernel argument is pipe qualified
66 const char ReqdWorkGroupSize[] = "amd.ReqdWorkGroupSize"; // Required work group size
67 const char WorkGroupSizeHint[] = "amd.WorkGroupSizeHint"; // Work group size hint
68 const char VecTypeHint[] = "amd.VecTypeHint"; // Vector type hint
69 const char KernelIndex[] = "amd.KernelIndex"; // Kernel index for device enqueue
70 const char NoPartialWorkGroups[] = "amd.NoPartialWorkGroups"; // No partial work groups
71 const char PrintfInfo[] = "amd.PrintfInfo"; // Prinf function call information
72 const char ArgActualAcc[] = "amd.ArgActualAcc"; // The actual kernel argument access qualifier
73 const char ArgPointeeAlign[] = "amd.ArgPointeeAlign"; // Alignment of pointee type
9774 };
9875
9976 namespace KernelArg {
129106 F64 = 11,
130107 };
131108
109 // Avoid using 'None' since it conflicts with a macro in X11 header file.
132110 enum AccessQualifer : uint8_t {
133 None = 0,
111 AccNone = 0,
134112 ReadOnly = 1,
135113 WriteOnly = 2,
136114 ReadWrite = 3,
145123 Region = 5,
146124 };
147125 } // namespace KernelArg
126
127 // Invalid values are used to indicate an optional key should not be emitted.
128 const uint8_t INVALID_ADDR_QUAL = 0xff;
129 const uint8_t INVALID_ACC_QUAL = 0xff;
130 const uint32_t INVALID_KERNEL_INDEX = ~0U;
131
132 namespace KernelArg {
133 // In-memory representation of kernel argument information.
134 struct Metadata {
135 uint32_t Size;
136 uint32_t Align;
137 uint32_t PointeeAlign;
138 uint8_t Kind;
139 uint16_t ValueType;
140 std::string TypeName;
141 std::string Name;
142 uint8_t AddrQual;
143 uint8_t AccQual;
144 uint8_t IsVolatile;
145 uint8_t IsConst;
146 uint8_t IsRestrict;
147 uint8_t IsPipe;
148 Metadata() : Size(0), Align(0), PointeeAlign(0), Kind(0), ValueType(0),
149 AddrQual(INVALID_ADDR_QUAL), AccQual(INVALID_ACC_QUAL), IsVolatile(0),
150 IsConst(0), IsRestrict(0), IsPipe(0) {}
151 };
152 }
153
154 namespace Kernel {
155 // In-memory representation of kernel information.
156 struct Metadata {
157 std::string Name;
158 std::string Language;
159 std::vector LanguageVersion;
160 std::vector ReqdWorkGroupSize;
161 std::vector WorkGroupSizeHint;
162 std::string VecTypeHint;
163 uint32_t KernelIndex;
164 uint8_t NoPartialWorkGroups;
165 std::vector Args;
166 Metadata() : KernelIndex(INVALID_KERNEL_INDEX), NoPartialWorkGroups(0) {}
167 };
168 }
169
170 namespace Program {
171 // In-memory representation of program information.
172 struct Metadata {
173 std::vector MDVersionSeq;
174 std::vector PrintfInfo;
175 std::vector Kernels;
176
177 explicit Metadata(){}
178
179 // Construct from an YAML string.
180 explicit Metadata(const std::string &YAML);
181
182 // Convert to YAML string.
183 std::string toYAML();
184
185 // Convert from YAML string.
186 static Metadata fromYAML(const std::string &S);
187 };
188 }
148189 } // namespace RuntimeMD
149190 } // namespace AMDGPU
150191
0 //===-- AMDGPURuntimeMD.cpp - Generates runtime metadata ------------------===//
1 //
2 // The LLVM Compiler Infrastructure
3 //
4 // This file is distributed under the University of Illinois Open Source
5 // License. See LICENSE.TXT for details.
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 /// \file
10 ///
11 /// Generates AMDGPU runtime metadata for YAML mapping.
12 //
13 //===----------------------------------------------------------------------===//
14 //
15
16 #include "AMDGPU.h"
17 #include "AMDGPURuntimeMetadata.h"
18 #include "llvm/ADT/StringRef.h"
19 #include "llvm/ADT/StringSwitch.h"
20 #include "llvm/IR/Constants.h"
21 #include "llvm/IR/DataLayout.h"
22 #include "llvm/IR/Module.h"
23 #include "llvm/Support/CommandLine.h"
24 #include "llvm/Support/raw_ostream.h"
25 #include "llvm/Support/YAMLTraits.h"
26 #include
27 #include "AMDGPURuntimeMD.h"
28
29 using namespace llvm;
30 using namespace ::AMDGPU::RuntimeMD;
31
32 static cl::opt
33 DumpRuntimeMD("amdgpu-dump-rtmd",
34 cl::desc("Dump AMDGPU runtime metadata"));
35
36 static cl::opt
37 CheckRuntimeMDParser("amdgpu-check-rtmd-parser", cl::Hidden,
38 cl::desc("Check AMDGPU runtime metadata YAML parser"));
39
40 LLVM_YAML_IS_FLOW_SEQUENCE_VECTOR(uint8_t)
41 LLVM_YAML_IS_FLOW_SEQUENCE_VECTOR(uint32_t)
42 LLVM_YAML_IS_FLOW_SEQUENCE_VECTOR(std::string)
43 LLVM_YAML_IS_SEQUENCE_VECTOR(Kernel::Metadata)
44 LLVM_YAML_IS_SEQUENCE_VECTOR(KernelArg::Metadata)
45
46 namespace llvm {
47 namespace yaml {
48
49 template <> struct MappingTraits {
50 static void mapping(IO &YamlIO, KernelArg::Metadata &A) {
51 YamlIO.mapRequired(KeyName::ArgSize, A.Size);
52 YamlIO.mapRequired(KeyName::ArgAlign, A.Align);
53 YamlIO.mapOptional(KeyName::ArgPointeeAlign, A.PointeeAlign, 0U);
54 YamlIO.mapRequired(KeyName::ArgKind, A.Kind);
55 YamlIO.mapRequired(KeyName::ArgValueType, A.ValueType);
56 YamlIO.mapOptional(KeyName::ArgTypeName, A.TypeName, std::string());
57 YamlIO.mapOptional(KeyName::ArgName, A.Name, std::string());
58 YamlIO.mapOptional(KeyName::ArgAddrQual, A.AddrQual, INVALID_ADDR_QUAL);
59 YamlIO.mapOptional(KeyName::ArgAccQual, A.AccQual, INVALID_ACC_QUAL);
60 YamlIO.mapOptional(KeyName::ArgIsVolatile, A.IsVolatile, uint8_t(0));
61 YamlIO.mapOptional(KeyName::ArgIsConst, A.IsConst, uint8_t(0));
62 YamlIO.mapOptional(KeyName::ArgIsRestrict, A.IsRestrict, uint8_t(0));
63 YamlIO.mapOptional(KeyName::ArgIsPipe, A.IsPipe, uint8_t(0));
64 }
65 static const bool flow = true;
66 };
67
68 template <> struct MappingTraits {
69 static void mapping(IO &YamlIO, Kernel::Metadata &K) {
70 YamlIO.mapRequired(KeyName::KernelName, K.Name);
71 YamlIO.mapOptional(KeyName::Language, K.Language, std::string());
72 YamlIO.mapOptional(KeyName::LanguageVersion, K.LanguageVersion);
73 YamlIO.mapOptional(KeyName::ReqdWorkGroupSize, K.ReqdWorkGroupSize);
74 YamlIO.mapOptional(KeyName::WorkGroupSizeHint, K.WorkGroupSizeHint);
75 YamlIO.mapOptional(KeyName::VecTypeHint, K.VecTypeHint, std::string());
76 YamlIO.mapOptional(KeyName::KernelIndex, K.KernelIndex,
77 INVALID_KERNEL_INDEX);
78 YamlIO.mapOptional(KeyName::NoPartialWorkGroups, K.NoPartialWorkGroups,
79 uint8_t(0));
80 YamlIO.mapRequired(KeyName::Args, K.Args);
81 }
82 static const bool flow = true;
83 };
84
85 template <> struct MappingTraits {
86 static void mapping(IO &YamlIO, Program::Metadata &Prog) {
87 YamlIO.mapRequired(KeyName::MDVersion, Prog.MDVersionSeq);
88 YamlIO.mapOptional(KeyName::PrintfInfo, Prog.PrintfInfo);
89 YamlIO.mapOptional(KeyName::Kernels, Prog.Kernels);
90 }
91 static const bool flow = true;
92 };
93
94 } // end namespace yaml
95 } // end namespace llvm
96
97 // Get a vector of three integer values from MDNode \p Node;
98 static std::vector getThreeInt32(MDNode *Node) {
99 assert(Node->getNumOperands() == 3);
100 std::vector V;
101 for (const MDOperand &Op : Node->operands()) {
102 const ConstantInt *CI = mdconst::extract(Op);
103 V.push_back(CI->getZExtValue());
104 }
105 return V;
106 }
107
108 static std::string getOCLTypeName(Type *Ty, bool Signed) {
109 switch (Ty->getTypeID()) {
110 case Type::HalfTyID:
111 return "half";
112 case Type::FloatTyID:
113 return "float";
114 case Type::DoubleTyID:
115 return "double";
116 case Type::IntegerTyID: {
117 if (!Signed)
118 return (Twine('u') + getOCLTypeName(Ty, true)).str();
119 unsigned BW = Ty->getIntegerBitWidth();
120 switch (BW) {
121 case 8:
122 return "char";
123 case 16:
124 return "short";
125 case 32:
126 return "int";
127 case 64:
128 return "long";
129 default:
130 return (Twine('i') + Twine(BW)).str();
131 }
132 }
133 case Type::VectorTyID: {
134 VectorType *VecTy = cast(Ty);
135 Type *EleTy = VecTy->getElementType();
136 unsigned Size = VecTy->getVectorNumElements();
137 return (Twine(getOCLTypeName(EleTy, Signed)) + Twine(Size)).str();
138 }
139 default:
140 return "unknown";
141 }
142 }
143
144 static KernelArg::ValueType getRuntimeMDValueType(
145 Type *Ty, StringRef TypeName) {
146 switch (Ty->getTypeID()) {
147 case Type::HalfTyID:
148 return KernelArg::F16;
149 case Type::FloatTyID:
150 return KernelArg::F32;
151 case Type::DoubleTyID:
152 return KernelArg::F64;
153 case Type::IntegerTyID: {
154 bool Signed = !TypeName.startswith("u");
155 switch (Ty->getIntegerBitWidth()) {
156 case 8:
157 return Signed ? KernelArg::I8 : KernelArg::U8;
158 case 16:
159 return Signed ? KernelArg::I16 : KernelArg::U16;
160 case 32:
161 return Signed ? KernelArg::I32 : KernelArg::U32;
162 case 64:
163 return Signed ? KernelArg::I64 : KernelArg::U64;
164 default:
165 // Runtime does not recognize other integer types. Report as struct type.
166 return KernelArg::Struct;
167 }
168 }
169 case Type::VectorTyID:
170 return getRuntimeMDValueType(Ty->getVectorElementType(), TypeName);
171 case Type::PointerTyID:
172 return getRuntimeMDValueType(Ty->getPointerElementType(), TypeName);
173 default:
174 return KernelArg::Struct;
175 }
176 }
177
178 static KernelArg::AddressSpaceQualifer getRuntimeAddrSpace(
179 AMDGPUAS::AddressSpaces A) {
180 switch (A) {
181 case AMDGPUAS::GLOBAL_ADDRESS:
182 return KernelArg::Global;
183 case AMDGPUAS::CONSTANT_ADDRESS:
184 return KernelArg::Constant;
185 case AMDGPUAS::LOCAL_ADDRESS:
186 return KernelArg::Local;
187 case AMDGPUAS::FLAT_ADDRESS:
188 return KernelArg::Generic;
189 case AMDGPUAS::REGION_ADDRESS:
190 return KernelArg::Region;
191 default:
192 return KernelArg::Private;
193 }
194 }
195
196 static KernelArg::Metadata getRuntimeMDForKernelArg(const DataLayout &DL,
197 Type *T, KernelArg::Kind Kind, StringRef BaseTypeName = "",
198 StringRef TypeName = "", StringRef ArgName = "", StringRef TypeQual = "",
199 StringRef AccQual = "") {
200
201 KernelArg::Metadata Arg;
202
203 // Set ArgSize and ArgAlign.
204 Arg.Size = DL.getTypeAllocSize(T);
205 Arg.Align = DL.getABITypeAlignment(T);
206 if (auto PT = dyn_cast(T)) {
207 auto ET = PT->getElementType();
208 if (PT->getAddressSpace() == AMDGPUAS::LOCAL_ADDRESS && ET->isSized())
209 Arg.PointeeAlign = DL.getABITypeAlignment(ET);
210 }
211
212 // Set ArgTypeName.
213 Arg.TypeName = TypeName;
214
215 // Set ArgName.
216 Arg.Name = ArgName;
217
218 // Set ArgIsVolatile, ArgIsRestrict, ArgIsConst and ArgIsPipe.
219 SmallVector SplitQ;
220 TypeQual.split(SplitQ, " ", -1, false /* Drop empty entry */);
221
222 for (StringRef KeyName : SplitQ) {
223 auto *P = StringSwitch(KeyName)
224 .Case("volatile", &Arg.IsVolatile)
225 .Case("restrict", &Arg.IsRestrict)
226 .Case("const", &Arg.IsConst)
227 .Case("pipe", &Arg.IsPipe)
228 .Default(nullptr);
229 if (P)
230 *P = 1;
231 }
232
233 // Set ArgKind.
234 Arg.Kind = Kind;
235
236 // Set ArgValueType.
237 Arg.ValueType = getRuntimeMDValueType(T, BaseTypeName);
238
239 // Set ArgAccQual.
240 if (!AccQual.empty()) {
241 Arg.AccQual = StringSwitch(AccQual)
242 .Case("read_only", KernelArg::ReadOnly)
243 .Case("write_only", KernelArg::WriteOnly)
244 .Case("read_write", KernelArg::ReadWrite)
245 .Default(KernelArg::AccNone);
246 }
247
248 // Set ArgAddrQual.
249 if (auto *PT = dyn_cast(T)) {
250 Arg.AddrQual = getRuntimeAddrSpace(static_cast(
251 PT->getAddressSpace()));
252 }
253
254 return Arg;
255 }
256
257 static Kernel::Metadata getRuntimeMDForKernel(const Function &F) {
258 Kernel::Metadata Kernel;
259 Kernel.Name = F.getName();
260 auto &M = *F.getParent();
261
262 // Set Language and LanguageVersion.
263 if (auto MD = M.getNamedMetadata("opencl.ocl.version")) {
264 if (MD->getNumOperands() != 0) {
265 auto Node = MD->getOperand(0);
266 if (Node->getNumOperands() > 1) {
267 Kernel.Language = "OpenCL C";
268 uint16_t Major = mdconst::extract(Node->getOperand(0))
269 ->getZExtValue();
270 uint16_t Minor = mdconst::extract(Node->getOperand(1))
271 ->getZExtValue();
272 Kernel.LanguageVersion.push_back(Major);
273 Kernel.LanguageVersion.push_back(Minor);
274 }
275 }
276 }
277
278 const DataLayout &DL = F.getParent()->getDataLayout();
279 for (auto &Arg : F.args()) {
280 unsigned I = Arg.getArgNo();
281 Type *T = Arg.getType();
282 auto TypeName = dyn_cast(F.getMetadata(
283 "kernel_arg_type")->getOperand(I))->getString();
284 auto BaseTypeName = cast(F.getMetadata(
285 "kernel_arg_base_type")->getOperand(I))->getString();
286 StringRef ArgName;
287 if (auto ArgNameMD = F.getMetadata("kernel_arg_name"))
288 ArgName = cast(ArgNameMD->getOperand(I))->getString();
289 auto TypeQual = cast(F.getMetadata(
290 "kernel_arg_type_qual")->getOperand(I))->getString();
291 auto AccQual = cast(F.getMetadata(
292 "kernel_arg_access_qual")->getOperand(I))->getString();
293 KernelArg::Kind Kind;
294 if (TypeQual.find("pipe") != StringRef::npos)
295 Kind = KernelArg::Pipe;
296 else Kind = StringSwitch(BaseTypeName)
297 .Case("sampler_t", KernelArg::Sampler)
298 .Case("queue_t", KernelArg::Queue)
299 .Cases("image1d_t", "image1d_array_t", "image1d_buffer_t",
300 "image2d_t" , "image2d_array_t", KernelArg::Image)
301 .Cases("image2d_depth_t", "image2d_array_depth_t",
302 "image2d_msaa_t", "image2d_array_msaa_t",
303 "image2d_msaa_depth_t", KernelArg::Image)
304 .Cases("image2d_array_msaa_depth_t", "image3d_t",
305 KernelArg::Image)
306 .Default(isa(T) ?
307 (T->getPointerAddressSpace() == AMDGPUAS::LOCAL_ADDRESS ?
308 KernelArg::DynamicSharedPointer :
309 KernelArg::GlobalBuffer) :
310 KernelArg::ByValue);
311 Kernel.Args.emplace_back(getRuntimeMDForKernelArg(DL, T, Kind,
312 BaseTypeName, TypeName, ArgName, TypeQual, AccQual));
313 }
314
315 // Emit hidden kernel arguments for OpenCL kernels.
316 if (F.getParent()->getNamedMetadata("opencl.ocl.version")) {
317 auto Int64T = Type::getInt64Ty(F.getContext());
318 Kernel.Args.emplace_back(getRuntimeMDForKernelArg(DL, Int64T,
319 KernelArg::HiddenGlobalOffsetX));
320 Kernel.Args.emplace_back(getRuntimeMDForKernelArg(DL, Int64T,
321 KernelArg::HiddenGlobalOffsetY));
322 Kernel.Args.emplace_back(getRuntimeMDForKernelArg(DL, Int64T,
323 KernelArg::HiddenGlobalOffsetZ));
324 if (F.getParent()->getNamedMetadata("llvm.printf.fmts")) {
325 auto Int8PtrT = Type::getInt8PtrTy(F.getContext(),
326 KernelArg::Global);
327 Kernel.Args.emplace_back(getRuntimeMDForKernelArg(DL, Int8PtrT,
328 KernelArg::HiddenPrintfBuffer));
329 }
330 }
331
332 // Set ReqdWorkGroupSize, WorkGroupSizeHint, and VecTypeHint.
333 if (auto RWGS = F.getMetadata("reqd_work_group_size"))
334 Kernel.ReqdWorkGroupSize = getThreeInt32(RWGS);
335
336 if (auto WGSH = F.getMetadata("work_group_size_hint"))
337 Kernel.WorkGroupSizeHint = getThreeInt32(WGSH);
338
339 if (auto VTH = F.getMetadata("vec_type_hint"))
340 Kernel.VecTypeHint = getOCLTypeName(cast(
341 VTH->getOperand(0))->getType(), mdconst::extract(
342 VTH->getOperand(1))->getZExtValue());
343
344 return Kernel;
345 }
346
347 Program::Metadata::Metadata(const std::string &YAML) {
348 yaml::Input Input(YAML);
349 Input >> *this;
350 }
351
352 std::string Program::Metadata::toYAML(void) {
353 std::string Text;
354 raw_string_ostream Stream(Text);
355 yaml::Output Output(Stream, nullptr, INT_MAX /* do not wrap line */);
356 Output << *this;
357 return Stream.str();
358 }
359
360 Program::Metadata Program::Metadata::fromYAML(const std::string &S) {
361 return Program::Metadata(S);
362 }
363
364 // Check if the YAML string can be parsed.
365 static void checkRuntimeMDYAMLString(const std::string &YAML) {
366 auto P = Program::Metadata::fromYAML(YAML);
367 auto S = P.toYAML();
368 llvm::errs() << "AMDGPU runtime metadata parser test "
369 << (YAML == S ? "passes" : "fails") << ".\n";
370 if (YAML != S) {
371 llvm::errs() << "First output: " << YAML << '\n'
372 << "Second output: " << S << '\n';
373 }
374 }
375
376 std::string llvm::getRuntimeMDYAMLString(Module &M) {
377 Program::Metadata Prog;
378 Prog.MDVersionSeq.push_back(MDVersion);
379 Prog.MDVersionSeq.push_back(MDRevision);
380
381 // Set PrintfInfo.
382 if (auto MD = M.getNamedMetadata("llvm.printf.fmts")) {
383 for (unsigned I = 0; I < MD->getNumOperands(); ++I) {
384 auto Node = MD->getOperand(I);
385 if (Node->getNumOperands() > 0)
386 Prog.PrintfInfo.push_back(cast(Node->getOperand(0))
387 ->getString());
388 }
389 }
390
391 // Set Kernels.
392 for (auto &F: M.functions()) {
393 if (!F.getMetadata("kernel_arg_type"))
394 continue;
395 Prog.Kernels.emplace_back(getRuntimeMDForKernel(F));
396 }
397
398 auto YAML = Prog.toYAML();
399
400 if (DumpRuntimeMD)
401 llvm::errs() << "AMDGPU runtime metadata:\n" << YAML << '\n';
402
403 if (CheckRuntimeMDParser)
404 checkRuntimeMDYAMLString(YAML);
405
406 return YAML;
407 }
0 //===- AMDGPURuntimeMD.h - Generate runtime metadata ---------------*- C++ -*-//
1 //
2 // The LLVM Compiler Infrastructure
3 //
4 // This file is distributed under the University of Illinois Open Source
5 // License. See LICENSE.TXT for details.
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This file declares functions for generating runtime metadata.
10 //
11 //===----------------------------------------------------------------------===//
12
13 #ifndef LLVM_LIB_TARGET_AMDGPU_MCTARGETDESC_AMDGPURUNTIMEMD_H
14 #define LLVM_LIB_TARGET_AMDGPU_MCTARGETDESC_AMDGPURUNTIMEMD_H
15
16 #include
17
18 namespace llvm {
19 class Module;
20
21 // Get runtime metadata as YAML string.
22 std::string getRuntimeMDYAMLString(Module &M);
23
24 }
25 #endif
2626 #include "llvm/MC/MCSectionELF.h"
2727 #include "llvm/Support/ELF.h"
2828 #include "llvm/Support/FormattedStream.h"
29 #include "AMDGPURuntimeMD.h"
2930
3031 namespace llvm {
3132 #include "AMDGPUPTNote.h"
196197 Symbol->setBinding(ELF::STB_GLOBAL);
197198 }
198199
199 void AMDGPUTargetStreamer::emitRuntimeMDIntValue(RuntimeMD::Key K, uint64_t V,
200 unsigned Size) {
201 auto &S = getStreamer();
202 S.EmitIntValue(K, 1);
203 S.EmitIntValue(V, Size);
204 }
205
206 void AMDGPUTargetStreamer::emitRuntimeMDStringValue(RuntimeMD::Key K,
207 StringRef R) {
208 auto &S = getStreamer();
209 S.EmitIntValue(K, 1);
210 S.EmitIntValue(R.size(), 4);
211 S.EmitBytes(R);
212 }
213
214 void AMDGPUTargetStreamer::emitRuntimeMDThreeIntValues(RuntimeMD::Key K,
215 MDNode *Node,
216 unsigned Size) {
217 assert(Node->getNumOperands() == 3);
218
219 auto &S = getStreamer();
220 S.EmitIntValue(K, 1);
221 for (const MDOperand &Op : Node->operands()) {
222 const ConstantInt *CI = mdconst::extract(Op);
223 S.EmitIntValue(CI->getZExtValue(), Size);
224 }
225 }
226
227 void AMDGPUTargetStreamer::emitStartOfRuntimeMetadata(const Module &M) {
228 emitRuntimeMDIntValue(RuntimeMD::KeyMDVersion,
229 RuntimeMD::MDVersion << 8 | RuntimeMD::MDRevision, 2);
230 if (auto MD = M.getNamedMetadata("opencl.ocl.version")) {
231 if (MD->getNumOperands() != 0) {
232 auto Node = MD->getOperand(0);
233 if (Node->getNumOperands() > 1) {
234 emitRuntimeMDIntValue(RuntimeMD::KeyLanguage,
235 RuntimeMD::OpenCL_C, 1);
236 uint16_t Major = mdconst::extract(Node->getOperand(0))
237 ->getZExtValue();
238 uint16_t Minor = mdconst::extract(Node->getOperand(1))
239 ->getZExtValue();
240 emitRuntimeMDIntValue(RuntimeMD::KeyLanguageVersion,
241 Major * 100 + Minor * 10, 2);
242 }
243 }
244 }
245
246 if (auto MD = M.getNamedMetadata("llvm.printf.fmts")) {
247 for (unsigned I = 0; I < MD->getNumOperands(); ++I) {
248 auto Node = MD->getOperand(I);
249 if (Node->getNumOperands() > 0)
250 emitRuntimeMDStringValue(RuntimeMD::KeyPrintfInfo,
251 cast(Node->getOperand(0))->getString());
252 }
253 }
254 }
255
256 static std::string getOCLTypeName(Type *Ty, bool Signed) {
257 switch (Ty->getTypeID()) {
258 case Type::HalfTyID:
259 return "half";
260 case Type::FloatTyID:
261 return "float";
262 case Type::DoubleTyID:
263 return "double";
264 case Type::IntegerTyID: {
265 if (!Signed)
266 return (Twine('u') + getOCLTypeName(Ty, true)).str();
267 unsigned BW = Ty->getIntegerBitWidth();
268 switch (BW) {
269 case 8:
270 return "char";
271 case 16:
272 return "short";
273 case 32:
274 return "int";
275 case 64:
276 return "long";
277 default:
278 return (Twine('i') + Twine(BW)).str();
279 }
280 }
281 case Type::VectorTyID: {
282 VectorType *VecTy = cast(Ty);
283 Type *EleTy = VecTy->getElementType();
284 unsigned Size = VecTy->getVectorNumElements();
285 return (Twine(getOCLTypeName(EleTy, Signed)) + Twine(Size)).str();
286 }
287 default:
288 return "unknown";
289 }
290 }
291
292 static RuntimeMD::KernelArg::ValueType getRuntimeMDValueType(
293 Type *Ty, StringRef TypeName) {
294 switch (Ty->getTypeID()) {
295 case Type::HalfTyID:
296 return RuntimeMD::KernelArg::F16;
297 case Type::FloatTyID:
298 return RuntimeMD::KernelArg::F32;
299 case Type::DoubleTyID:
300 return RuntimeMD::KernelArg::F64;
301 case Type::IntegerTyID: {
302 bool Signed = !TypeName.startswith("u");
303 switch (Ty->getIntegerBitWidth()) {
304 case 8:
305 return Signed ? RuntimeMD::KernelArg::I8 : RuntimeMD::KernelArg::U8;
306 case 16:
307 return Signed ? RuntimeMD::KernelArg::I16 : RuntimeMD::KernelArg::U16;
308 case 32:
309 return Signed ? RuntimeMD::KernelArg::I32 : RuntimeMD::KernelArg::U32;
310 case 64:
311 return Signed ? RuntimeMD::KernelArg::I64 : RuntimeMD::KernelArg::U64;
312 default:
313 // Runtime does not recognize other integer types. Report as struct type.
314 return RuntimeMD::KernelArg::Struct;
315 }
316 }
317 case Type::VectorTyID:
318 return getRuntimeMDValueType(Ty->getVectorElementType(), TypeName);
319 case Type::PointerTyID:
320 return getRuntimeMDValueType(Ty->getPointerElementType(), TypeName);
321 default:
322 return RuntimeMD::KernelArg::Struct;
323 }
324 }
325
326 static RuntimeMD::KernelArg::AddressSpaceQualifer getRuntimeAddrSpace(
327 AMDGPUAS::AddressSpaces A) {
328 switch (A) {
329 case AMDGPUAS::GLOBAL_ADDRESS:
330 return RuntimeMD::KernelArg::Global;
331 case AMDGPUAS::CONSTANT_ADDRESS:
332 return RuntimeMD::KernelArg::Constant;
333 case AMDGPUAS::LOCAL_ADDRESS:
334 return RuntimeMD::KernelArg::Local;
335 case AMDGPUAS::FLAT_ADDRESS:
336 return RuntimeMD::KernelArg::Generic;
337 case AMDGPUAS::REGION_ADDRESS:
338 return RuntimeMD::KernelArg::Region;
339 default:
340 return RuntimeMD::KernelArg::Private;
341 }
342 }
343
344 void AMDGPUTargetStreamer::emitRuntimeMetadataForKernelArg(const DataLayout &DL,
345 Type *T, RuntimeMD::KernelArg::Kind Kind,
346 StringRef BaseTypeName, StringRef TypeName,
347 StringRef ArgName, StringRef TypeQual, StringRef AccQual) {
348 auto &S = getStreamer();
349
350 // Emit KeyArgBegin.
351 S.EmitIntValue(RuntimeMD::KeyArgBegin, 1);
352
353 // Emit KeyArgSize and KeyArgAlign.
354 emitRuntimeMDIntValue(RuntimeMD::KeyArgSize,
355 DL.getTypeAllocSize(T), 4);
356 emitRuntimeMDIntValue(RuntimeMD::KeyArgAlign,
357 DL.getABITypeAlignment(T), 4);
358 if (auto PT = dyn_cast(T)) {
359 auto ET = PT->getElementType();
360 if (PT->getAddressSpace() == AMDGPUAS::LOCAL_ADDRESS && ET->isSized())
361 emitRuntimeMDIntValue(RuntimeMD::KeyArgPointeeAlign,
362 DL.getABITypeAlignment(ET), 4);
363 }
364
365 // Emit KeyArgTypeName.
366 if (!TypeName.empty())
367 emitRuntimeMDStringValue(RuntimeMD::KeyArgTypeName, TypeName);
368
369 // Emit KeyArgName.
370 if (!ArgName.empty())
371 emitRuntimeMDStringValue(RuntimeMD::KeyArgName, ArgName);
372
373 // Emit KeyArgIsVolatile, KeyArgIsRestrict, KeyArgIsConst and KeyArgIsPipe.
374 SmallVector SplitQ;
375 TypeQual.split(SplitQ, " ", -1, false /* Drop empty entry */);
376
377 for (StringRef KeyName : SplitQ) {
378 auto Key = StringSwitch(KeyName)
379 .Case("volatile", RuntimeMD::KeyArgIsVolatile)
380 .Case("restrict", RuntimeMD::KeyArgIsRestrict)
381 .Case("const", RuntimeMD::KeyArgIsConst)
382 .Case("pipe", RuntimeMD::KeyArgIsPipe)
383 .Default(RuntimeMD::KeyNull);
384 S.EmitIntValue(Key, 1);
385 }
386
387 // Emit KeyArgKind.
388 emitRuntimeMDIntValue(RuntimeMD::KeyArgKind, Kind, 1);
389
390 // Emit KeyArgValueType.
391 emitRuntimeMDIntValue(RuntimeMD::KeyArgValueType,
392 getRuntimeMDValueType(T, BaseTypeName), 2);
393
394 // Emit KeyArgAccQual.
395 if (!AccQual.empty()) {
396 auto AQ = StringSwitch(AccQual)
397 .Case("read_only", RuntimeMD::KernelArg::ReadOnly)
398 .Case("write_only", RuntimeMD::KernelArg::WriteOnly)
399 .Case("read_write", RuntimeMD::KernelArg::ReadWrite)
400 .Default(RuntimeMD::KernelArg::None);
401 emitRuntimeMDIntValue(RuntimeMD::KeyArgAccQual, AQ, 1);
402 }
403
404 // Emit KeyArgAddrQual.
405 if (auto *PT = dyn_cast(T))
406 emitRuntimeMDIntValue(RuntimeMD::KeyArgAddrQual,
407 getRuntimeAddrSpace(static_cast(
408 PT->getAddressSpace())), 1);
409
410 // Emit KeyArgEnd
411 S.EmitIntValue(RuntimeMD::KeyArgEnd, 1);
412 }
413
414 void AMDGPUTargetStreamer::emitRuntimeMetadata(const Function &F) {
415 if (!F.getMetadata("kernel_arg_type"))
416 return;
417 auto &S = getStreamer();
418 S.EmitIntValue(RuntimeMD::KeyKernelBegin, 1);
419 emitRuntimeMDStringValue(RuntimeMD::KeyKernelName, F.getName());
420
421 const DataLayout &DL = F.getParent()->getDataLayout();
422 for (auto &Arg : F.args()) {
423 unsigned I = Arg.getArgNo();
424 Type *T = Arg.getType();
425 auto TypeName = dyn_cast(F.getMetadata(
426 "kernel_arg_type")->getOperand(I))->getString();
427 auto BaseTypeName = cast(F.getMetadata(
428 "kernel_arg_base_type")->getOperand(I))->getString();
429 StringRef ArgName;
430 if (auto ArgNameMD = F.getMetadata("kernel_arg_name"))
431 ArgName = cast(ArgNameMD->getOperand(I))->getString();
432 auto TypeQual = cast(F.getMetadata(
433 "kernel_arg_type_qual")->getOperand(I))->getString();
434 auto AccQual = cast(F.getMetadata(
435 "kernel_arg_access_qual")->getOperand(I))->getString();
436 RuntimeMD::KernelArg::Kind Kind;
437 if (TypeQual.find("pipe") != StringRef::npos)
438 Kind = RuntimeMD::KernelArg::Pipe;
439 else Kind = StringSwitch(BaseTypeName)
440 .Case("sampler_t", RuntimeMD::KernelArg::Sampler)
441 .Case("queue_t", RuntimeMD::KernelArg::Queue)
442 .Cases("image1d_t", "image1d_array_t", "image1d_buffer_t",
443 "image2d_t" , "image2d_array_t", RuntimeMD::KernelArg::Image)
444 .Cases("image2d_depth_t", "image2d_array_depth_t",
445 "image2d_msaa_t", "image2d_array_msaa_t",
446 "image2d_msaa_depth_t", RuntimeMD::KernelArg::Image)
447 .Cases("image2d_array_msaa_depth_t", "image3d_t",
448 RuntimeMD::KernelArg::Image)
449 .Default(isa(T) ?
450 (T->getPointerAddressSpace() == AMDGPUAS::LOCAL_ADDRESS ?
451 RuntimeMD::KernelArg::DynamicSharedPointer :
452 RuntimeMD::KernelArg::GlobalBuffer) :
453 RuntimeMD::KernelArg::ByValue);
454 emitRuntimeMetadataForKernelArg(DL, T,
455 Kind, BaseTypeName, TypeName, ArgName, TypeQual, AccQual);
456 }
457
458 // Emit hidden kernel arguments for OpenCL kernels.
459 if (F.getParent()->getNamedMetadata("opencl.ocl.version")) {
460 auto Int64T = Type::getInt64Ty(F.getContext());
461 emitRuntimeMetadataForKernelArg(DL, Int64T,
462 RuntimeMD::KernelArg::HiddenGlobalOffsetX);
463 emitRuntimeMetadataForKernelArg(DL, Int64T,
464 RuntimeMD::KernelArg::HiddenGlobalOffsetY);
465 emitRuntimeMetadataForKernelArg(DL, Int64T,
466 RuntimeMD::KernelArg::HiddenGlobalOffsetZ);
467 if (F.getParent()->getNamedMetadata("llvm.printf.fmts")) {
468 auto Int8PtrT = Type::getInt8PtrTy(F.getContext(),
469 RuntimeMD::KernelArg::Global);
470 emitRuntimeMetadataForKernelArg(DL, Int8PtrT,
471 RuntimeMD::KernelArg::HiddenPrintfBuffer);
472 }
473 }
474
475 // Emit KeyReqdWorkGroupSize, KeyWorkGroupSizeHint, and KeyVecTypeHint.
476 if (auto RWGS = F.getMetadata("reqd_work_group_size")) {
477 emitRuntimeMDThreeIntValues(RuntimeMD::KeyReqdWorkGroupSize,
478 RWGS, 4);
479 }
480
481 if (auto WGSH = F.getMetadata("work_group_size_hint")) {
482 emitRuntimeMDThreeIntValues(RuntimeMD::KeyWorkGroupSizeHint,
483 WGSH, 4);
484 }
485
486 if (auto VTH = F.getMetadata("vec_type_hint")) {
487 auto TypeName = getOCLTypeName(cast(
488 VTH->getOperand(0))->getType(), mdconst::extract(
489 VTH->getOperand(1))->getZExtValue());
490 emitRuntimeMDStringValue(RuntimeMD::KeyVecTypeHint, TypeName);
491 }
492
493 // Emit KeyKernelEnd
494 S.EmitIntValue(RuntimeMD::KeyKernelEnd, 1);
495 }
496
497 void AMDGPUTargetStreamer::emitRuntimeMetadataAsNoteElement(Module &M) {
200 void AMDGPUTargetELFStreamer::emitRuntimeMetadata(Module &M) {
498201 auto &S = getStreamer();
499202 auto &Context = S.getContext();
500203
519222 S.EmitValue(DescSZ, 4); // descz
520223 S.EmitIntValue(PT_NOTE::NT_AMDGPU_HSA_RUNTIME_METADATA, 4); // type
521224 S.EmitBytes(StringRef(PT_NOTE::NoteName, NameSZ)); // name
522 S.EmitValueToAlignment(4); // padding 0
225 S.EmitValueToAlignment(4, 0, 1, 0); // padding 0
523226 S.EmitLabel(DescBegin);
524 emitRuntimeMetadata(M); // desc
227 S.EmitBytes(getRuntimeMDYAMLString(M)); // desc
525228 S.EmitLabel(DescEnd);
526 S.EmitValueToAlignment(4); // padding 0
229 S.EmitValueToAlignment(4, 0, 1, 0); // padding 0
527230 S.PopSection();
528231 }
529
530 void AMDGPUTargetStreamer::emitRuntimeMetadata(Module &M) {
531 emitStartOfRuntimeMetadata(M);
532 for (auto &F : M.functions())
533 emitRuntimeMetadata(F);
534 }
535
4242
4343 virtual void EmitAMDGPUHsaProgramScopeGlobal(StringRef GlobalName) = 0;
4444
45 /// Emit runtime metadata as a note element.
46 void emitRuntimeMetadataAsNoteElement(Module &M);
47
48 private:
49 void emitRuntimeMetadata(Module &M);
50 void emitStartOfRuntimeMetadata(const Module &M);
51
52 /// Emit runtime metadata for a kernel function.
53 void emitRuntimeMetadata(const Function &F);
54
55 // Emit runtime metadata for a kernel argument.
56 void emitRuntimeMetadataForKernelArg(const DataLayout &DL,
57 Type *T, AMDGPU::RuntimeMD::KernelArg::Kind Kind,
58 StringRef BaseTypeName = "", StringRef TypeName = "",
59 StringRef ArgName = "", StringRef TypeQual = "",
60 StringRef AccQual = "");
61
62 /// Emit a key and an integer value for runtime metadata.
63 void emitRuntimeMDIntValue(AMDGPU::RuntimeMD::Key K,
64 uint64_t V, unsigned Size);
65
66 /// Emit a key and a string value for runtime metadata.
67 void emitRuntimeMDStringValue(AMDGPU::RuntimeMD::Key K,
68 StringRef S);
69
70 /// Emit a key and three integer values for runtime metadata.
71 /// The three integer values are obtained from MDNode \p Node;
72 void emitRuntimeMDThreeIntValues(AMDGPU::RuntimeMD::Key K, MDNode *Node,
73 unsigned Size);
45 virtual void emitRuntimeMetadata(Module &M) = 0;
7446 };
7547
7648 class AMDGPUTargetAsmStreamer : public AMDGPUTargetStreamer {
9163 void EmitAMDGPUHsaModuleScopeGlobal(StringRef GlobalName) override;
9264
9365 void EmitAMDGPUHsaProgramScopeGlobal(StringRef GlobalName) override;
66
67 void emitRuntimeMetadata(Module &M) override {}
9468 };
9569
9670 class AMDGPUTargetELFStreamer : public AMDGPUTargetStreamer {
11589 void EmitAMDGPUHsaModuleScopeGlobal(StringRef GlobalName) override;
11690
11791 void EmitAMDGPUHsaProgramScopeGlobal(StringRef GlobalName) override;
92
93 void emitRuntimeMetadata(Module &M) override;
11894 };
11995
12096 }
55 AMDGPUMCCodeEmitter.cpp
66 AMDGPUMCTargetDesc.cpp
77 AMDGPUMCAsmInfo.cpp
8 AMDGPURuntimeMD.cpp
89 AMDGPUTargetStreamer.cpp
910 R600MCCodeEmitter.cpp
1011 SIMCCodeEmitter.cpp
None ; RUN: llc -mtriple=amdgcn--amdhsa < %s | FileCheck %s
0 ; RUN: llc -mtriple=amdgcn--amdhsa -filetype=obj -o - < %s | llvm-readobj -amdgpu-runtime-metadata | FileCheck %s
11 ; check llc does not crash for invalid opencl version metadata
22
3 ; CHECK: .section .note,#alloc
4 ; CHECK-NEXT: .long 4
5 ; CHECK-NEXT: .long {{.+}}
6 ; CHECK-NEXT: .long 7
7 ; CHECK-NEXT: .asciz "AMD"
3 ; CHECK: { amd.MDVersion: [ 2, 0 ] }
84
95 !opencl.ocl.version = !{}
None ; RUN: llc -mtriple=amdgcn--amdhsa < %s | FileCheck %s
0 ; RUN: llc -mtriple=amdgcn--amdhsa -filetype=obj -o - < %s | llvm-readobj -amdgpu-runtime-metadata | FileCheck %s
11 ; check llc does not crash for invalid opencl version metadata
22
3 ; CHECK: .section .note,#alloc
4 ; CHECK-NEXT: .long 4
5 ; CHECK-NEXT: .long {{.+}}
6 ; CHECK-NEXT: .long 7
7 ; CHECK-NEXT: .asciz "AMD"
3 ; CHECK: { amd.MDVersion: [ 2, 0 ] }
84
95 !opencl.ocl.version = !{!0}
106 !0 = !{}
None ; RUN: llc -mtriple=amdgcn--amdhsa < %s | FileCheck %s
0 ; RUN: llc -mtriple=amdgcn--amdhsa -filetype=obj -o - < %s | llvm-readobj -amdgpu-runtime-metadata | FileCheck %s
11 ; check llc does not crash for invalid opencl version metadata
22
3 ; CHECK: .section .note,#alloc
4 ; CHECK-NEXT: .long 4
5 ; CHECK-NEXT: .long {{.+}}
6 ; CHECK-NEXT: .long 7
7 ; CHECK-NEXT: .asciz "AMD"
3 ; CHECK: { amd.MDVersion: [ 2, 0 ] }
84
95 !opencl.ocl.version = !{!0}
106 !0 = !{i32 1}
None ; RUN: llc -mtriple=amdgcn--amdhsa < %s | FileCheck %s
0 ; RUN: llc -mtriple=amdgcn--amdhsa -filetype=obj -o - < %s | llvm-readobj -amdgpu-runtime-metadata | FileCheck %s
1 ; RUN: llc -mtriple=amdgcn--amdhsa -filetype=obj -amdgpu-dump-rtmd -amdgpu-check-rtmd-parser %s 2>&1 | FileCheck --check-prefix=CHECK --check-prefix=PARSER %s
12
23 %struct.A = type { i8, float }
34 %opencl.image1d_t = type opaque
89 %struct.B = type { i32 addrspace(1)*}
910 %opencl.clk_event_t = type opaque
1011
11 ; CHECK: .section .note,#alloc
12 ; CHECK-NEXT: .long 4
13 ; CHECK-NEXT: .long [[Ltmp1:.+]]-[[Ltmp0:.+]]
14 ; CHECK-NEXT: .long 7
15 ; CHECK-NEXT: .asciz "AMD"
16 ; CHECK-NEXT: .p2align 2
17 ; CHECK-NEXT: [[Ltmp0]]:
18 ; CHECK-NEXT: .byte 1
19 ; CHECK-NEXT: .short 256
20 ; CHECK-NEXT: .byte 2
21 ; CHECK-NEXT: .byte 0
22 ; CHECK-NEXT: .byte 3
23 ; CHECK-NEXT: .short 200
24 ; CHECK-NEXT: .byte 30
25 ; CHECK-NEXT: .long 10
26 ; CHECK-NEXT: .ascii "1:1:4:%d\\n"
27 ; CHECK-NEXT: .byte 30
28 ; CHECK-NEXT: .long 10
29 ; CHECK-NEXT: .ascii "2:1:8:%g\\n"
30
31 ; CHECK-NEXT: .byte 4
32 ; CHECK-NEXT: .byte 6
33 ; CHECK-NEXT: .long 9
34 ; CHECK-NEXT: .ascii "test_char"
35 ; CHECK-NEXT: .byte 7
36 ; CHECK-NEXT: .byte 9
37 ; CHECK-NEXT: .long 1
38 ; CHECK-NEXT: .byte 10
39 ; CHECK-NEXT: .long 1
40 ; CHECK-NEXT: .byte 11
41 ; CHECK-NEXT: .long 4
42 ; CHECK-NEXT: .ascii "char"
43 ; CHECK-NEXT: .byte 13
44 ; CHECK-NEXT: .byte 0
45 ; CHECK-NEXT: .byte 14
46 ; CHECK-NEXT: .short 1
47 ; CHECK-NEXT: .byte 16
48 ; CHECK-NEXT: .byte 0
49 ; CHECK-NEXT: .byte 8
50 ; CHECK-NEXT: .byte 7
51 ; CHECK-NEXT: .byte 9
52 ; CHECK-NEXT: .long 8
53 ; CHECK-NEXT: .byte 10
54 ; CHECK-NEXT: .long 8
55 ; CHECK-NEXT: .byte 13
56 ; CHECK-NEXT: .byte 7
57 ; CHECK-NEXT: .byte 14
58 ; CHECK-NEXT: .short 9
59 ; CHECK-NEXT: .byte 8
60 ; CHECK-NEXT: .byte 7
61 ; CHECK-NEXT: .byte 9
62 ; CHECK-NEXT: .long 8
63 ; CHECK-NEXT: .byte 10
64 ; CHECK-NEXT: .long 8
65 ; CHECK-NEXT: .byte 13
66 ; CHECK-NEXT: .byte 8
67 ; CHECK-NEXT: .byte 14
68 ; CHECK-NEXT: .short 9
69 ; CHECK-NEXT: .byte 8
70 ; CHECK-NEXT: .byte 7
71 ; CHECK-NEXT: .byte 9
72 ; CHECK-NEXT: .long 8
73 ; CHECK-NEXT: .byte 10
74 ; CHECK-NEXT: .long 8
75 ; CHECK-NEXT: .byte 13
76 ; CHECK-NEXT: .byte 9
77 ; CHECK-NEXT: .byte 14
78 ; CHECK-NEXT: .short 9
79 ; CHECK-NEXT: .byte 8
80 ; CHECK-NEXT: .byte 7
81 ; CHECK-NEXT: .byte 9
82 ; CHECK-NEXT: .long 8
83 ; CHECK-NEXT: .byte 10
84 ; CHECK-NEXT: .long 8
85 ; CHECK-NEXT: .byte 13
86 ; CHECK-NEXT: .byte 11
87 ; CHECK-NEXT: .byte 14
88 ; CHECK-NEXT: .short 1
89 ; CHECK-NEXT: .byte 15
90 ; CHECK-NEXT: .byte 1
91 ; CHECK-NEXT: .byte 8
92 ; CHECK-NEXT: .byte 5
93
12 ; CHECK: ---
13 ; CHECK-NEXT: { amd.MDVersion: [ 2, 0 ], amd.PrintfInfo: [ '1:1:4:%d\n', '2:1:8:%g\n' ], amd.Kernels:
14
15 ; CHECK-NEXT: - { amd.KernelName: test_char, amd.Language: OpenCL C, amd.LanguageVersion: [ 2, 0 ], amd.Args:
16 ; CHECK-NEXT: - { amd.ArgSize: 1, amd.ArgAlign: 1, amd.ArgKind: 0, amd.ArgValueType: 1, amd.ArgTypeName: char, amd.ArgAccQual: 0 }
17 ; CHECK-NEXT: - { amd.ArgSize: 8, amd.ArgAlign: 8, amd.ArgKind: 7, amd.ArgValueType: 9 }
18 ; CHECK-NEXT: - { amd.ArgSize: 8, amd.ArgAlign: 8, amd.ArgKind: 8, amd.ArgValueType: 9 }
19 ; CHECK-NEXT: - { amd.ArgSize: 8, amd.ArgAlign: 8, amd.ArgKind: 9, amd.ArgValueType: 9 }
20 ; CHECK-NEXT: - { amd.ArgSize: 8, amd.ArgAlign: 8, amd.ArgKind: 11, amd.ArgValueType: 1, amd.ArgAddrQual: 1 } }
9421 define amdgpu_kernel void @test_char(i8 %a) !kernel_arg_addr_space !1 !kernel_arg_access_qual !2 !kernel_arg_type !9 !kernel_arg_base_type !9 !kernel_arg_type_qual !4 {
9522 ret void
9623 }
9724
98 ; CHECK-NEXT: .byte 4
99 ; CHECK-NEXT: .byte 6
100 ; CHECK-NEXT: .long 12
101 ; CHECK-NEXT: .ascii "test_ushort2"
102 ; CHECK-NEXT: .byte 7
103 ; CHECK-NEXT: .byte 9
104 ; CHECK-NEXT: .long 4
105 ; CHECK-NEXT: .byte 10
106 ; CHECK-NEXT: .long 4
107 ; CHECK-NEXT: .byte 11
108 ; CHECK-NEXT: .long 7
109 ; CHECK-NEXT: .ascii "ushort2"
110 ; CHECK-NEXT: .byte 13
111 ; CHECK-NEXT: .byte 0
112 ; CHECK-NEXT: .byte 14
113 ; CHECK-NEXT: .short 4
114 ; CHECK-NEXT: .byte 16
115 ; CHECK-NEXT: .byte 0
116 ; CHECK-NEXT: .byte 8
117 ; CHECK-NEXT: .byte 7
118 ; CHECK-NEXT: .byte 9
119 ; CHECK-NEXT: .long 8
120 ; CHECK-NEXT: .byte 10
121 ; CHECK-NEXT: .long 8
122 ; CHECK-NEXT: .byte 13
123 ; CHECK-NEXT: .byte 7
124 ; CHECK-NEXT: .byte 14
125 ; CHECK-NEXT: .short 9
126 ; CHECK-NEXT: .byte 8
127 ; CHECK-NEXT: .byte 7
128 ; CHECK-NEXT: .byte 9
129 ; CHECK-NEXT: .long 8
130 ; CHECK-NEXT: .byte 10
131 ; CHECK-NEXT: .long 8
132 ; CHECK-NEXT: .byte 13
133 ; CHECK-NEXT: .byte 8
134 ; CHECK-NEXT: .byte 14
135 ; CHECK-NEXT: .short 9
136 ; CHECK-NEXT: .byte 8
137 ; CHECK-NEXT: .byte 7
138 ; CHECK-NEXT: .byte 9
139 ; CHECK-NEXT: .long 8
140 ; CHECK-NEXT: .byte 10
141 ; CHECK-NEXT: .long 8
142 ; CHECK-NEXT: .byte 13
143 ; CHECK-NEXT: .byte 9
144 ; CHECK-NEXT: .byte 14
145 ; CHECK-NEXT: .short 9
146 ; CHECK-NEXT: .byte 8
147 ; CHECK-NEXT: .byte 7
148 ; CHECK-NEXT: .byte 9
149 ; CHECK-NEXT: .long 8
150 ; CHECK-NEXT: .byte 10
151 ; CHECK-NEXT: .long 8
152 ; CHECK-NEXT: .byte 13
153 ; CHECK-NEXT: .byte 11
154 ; CHECK-NEXT: .byte 14
155 ; CHECK-NEXT: .short 1
156 ; CHECK-NEXT: .byte 15
157 ; CHECK-NEXT: .byte 1
158 ; CHECK-NEXT: .byte 8
159 ; CHECK-NEXT: .byte 5
160
25 ; CHECK-NEXT: - { amd.KernelName: test_ushort2, amd.Language: OpenCL C, amd.LanguageVersion: [ 2, 0 ], amd.Args:
26 ; CHECK-NEXT: - { amd.ArgSize: 4, amd.ArgAlign: 4, amd.ArgKind: 0, amd.ArgValueType: 4, amd.ArgTypeName: ushort2, amd.ArgAccQual: 0 }
27 ; CHECK-NEXT: - { amd.ArgSize: 8, amd.ArgAlign: 8, amd.ArgKind: 7, amd.ArgValueType: 9 }
28 ; CHECK-NEXT: - { amd.ArgSize: 8, amd.ArgAlign: 8, amd.ArgKind: 8, amd.ArgValueType: 9 }
29 ; CHECK-NEXT: - { amd.ArgSize: 8, amd.ArgAlign: 8, amd.ArgKind: 9, amd.ArgValueType: 9 }
30 ; CHECK-NEXT: - { amd.ArgSize: 8, amd.ArgAlign: 8, amd.ArgKind: 11, amd.ArgValueType: 1, amd.ArgAddrQual: 1 } }
16131 define amdgpu_kernel void @test_ushort2(<2 x i16> %a) !kernel_arg_addr_space !1 !kernel_arg_access_qual !2 !kernel_arg_type !10 !kernel_arg_base_type !10 !kernel_arg_type_qual !4 {
16232 ret void
16333 }
16434
165 ; CHECK-NEXT: .byte 4
166 ; CHECK-NEXT: .byte 6
167 ; CHECK-NEXT: .long 9
168 ; CHECK-NEXT: .ascii "test_int3"
169 ; CHECK-NEXT: .byte 7
170 ; CHECK-NEXT: .byte 9
171 ; CHECK-NEXT: .long 16
172 ; CHECK-NEXT: .byte 10
173 ; CHECK-NEXT: .long 16
174 ; CHECK-NEXT: .byte 11
175 ; CHECK-NEXT: .long 4
176 ; CHECK-NEXT: .ascii "int3"
177 ; CHECK-NEXT: .byte 13
178 ; CHECK-NEXT: .byte 0
179 ; CHECK-NEXT: .byte 14
180 ; CHECK-NEXT: .short 6
181 ; CHECK-NEXT: .byte 16
182 ; CHECK-NEXT: .byte 0
183 ; CHECK-NEXT: .byte 8
184 ; CHECK-NEXT: .byte 7
185 ; CHECK-NEXT: .byte 9
186 ; CHECK-NEXT: .long 8
187 ; CHECK-NEXT: .byte 10
188 ; CHECK-NEXT: .long 8
189 ; CHECK-NEXT: .byte 13
190 ; CHECK-NEXT: .byte 7
191 ; CHECK-NEXT: .byte 14
192 ; CHECK-NEXT: .short 9
193 ; CHECK-NEXT: .byte 8
194 ; CHECK-NEXT: .byte 7
195 ; CHECK-NEXT: .byte 9
196 ; CHECK-NEXT: .long 8
197 ; CHECK-NEXT: .byte 10
198 ; CHECK-NEXT: .long 8
199 ; CHECK-NEXT: .byte 13
200 ; CHECK-NEXT: .byte 8
201 ; CHECK-NEXT: .byte 14
202 ; CHECK-NEXT: .short 9
203 ; CHECK-NEXT: .byte 8
204 ; CHECK-NEXT: .byte 7
205 ; CHECK-NEXT: .byte 9
206 ; CHECK-NEXT: .long 8
207 ; CHECK-NEXT: .byte 10
208 ; CHECK-NEXT: .long 8
209 ; CHECK-NEXT: .byte 13
210 ; CHECK-NEXT: .byte 9
211 ; CHECK-NEXT: .byte 14
212 ; CHECK-NEXT: .short 9
213 ; CHECK-NEXT: .byte 8
214 ; CHECK-NEXT: .byte 7
215 ; CHECK-NEXT: .byte 9
216 ; CHECK-NEXT: .long 8
217 ; CHECK-NEXT: .byte 10
218 ; CHECK-NEXT: .long 8
219 ; CHECK-NEXT: .byte 13
220 ; CHECK-NEXT: .byte 11
221 ; CHECK-NEXT: .byte 14
222 ; CHECK-NEXT: .short 1
223 ; CHECK-NEXT: .byte 15
224 ; CHECK-NEXT: .byte 1
225 ; CHECK-NEXT: .byte 8
226 ; CHECK-NEXT: .byte 5
227
35 ; CHECK-NEXT: - { amd.KernelName: test_int3, amd.Language: OpenCL C, amd.LanguageVersion: [ 2, 0 ], amd.Args:
36 ; CHECK-NEXT: - { amd.ArgSize: 16, amd.ArgAlign: 16, amd.ArgKind: 0, amd.ArgValueType: 6, amd.ArgTypeName: int3, amd.ArgAccQual: 0 }
37 ; CHECK-NEXT: - { amd.ArgSize: 8, amd.ArgAlign: 8, amd.ArgKind: 7, amd.ArgValueType: 9 }
38 ; CHECK-NEXT: - { amd.ArgSize: 8, amd.ArgAlign: 8, amd.ArgKind: 8, amd.ArgValueType: 9 }
39 ; CHECK-NEXT: - { amd.ArgSize: 8, amd.ArgAlign: 8, amd.ArgKind: 9, amd.ArgValueType: 9 }
40 ; CHECK-NEXT: - { amd.ArgSize: 8, amd.ArgAlign: 8, amd.ArgKind: 11, amd.ArgValueType: 1, amd.ArgAddrQual: 1 } }
22841 define amdgpu_kernel void @test_int3(<3 x i32> %a) !kernel_arg_addr_space !1 !kernel_arg_access_qual !2 !kernel_arg_type !11 !kernel_arg_base_type !11 !kernel_arg_type_qual !4 {
22942 ret void
23043 }
23144
232 ; CHECK-NEXT: .byte 4
233 ; CHECK-NEXT: .byte 6
234 ; CHECK-NEXT: .long 11
235 ; CHECK-NEXT: .ascii "test_ulong4"
236 ; CHECK-NEXT: .byte 7
237 ; CHECK-NEXT: .byte 9
238 ; CHECK-NEXT: .long 32
239 ; CHECK-NEXT: .byte 10
240 ; CHECK-NEXT: .long 32
241 ; CHECK-NEXT: .byte 11
242 ; CHECK-NEXT: .long 6
243 ; CHECK-NEXT: .ascii "ulong4"
244 ; CHECK-NEXT: .byte 13
245 ; CHECK-NEXT: .byte 0
246 ; CHECK-NEXT: .byte 14
247 ; CHECK-NEXT: .short 10
248 ; CHECK-NEXT: .byte 16
249 ; CHECK-NEXT: .byte 0
250 ; CHECK-NEXT: .byte 8
251 ; CHECK-NEXT: .byte 7
252 ; CHECK-NEXT: .byte 9
253 ; CHECK-NEXT: .long 8
254 ; CHECK-NEXT: .byte 10
255 ; CHECK-NEXT: .long 8
256 ; CHECK-NEXT: .byte 13
257 ; CHECK-NEXT: .byte 7
258 ; CHECK-NEXT: .byte 14
259 ; CHECK-NEXT: .short 9
260 ; CHECK-NEXT: .byte 8
261 ; CHECK-NEXT: .byte 7
262 ; CHECK-NEXT: .byte 9
263 ; CHECK-NEXT: .long 8
264 ; CHECK-NEXT: .byte 10
265 ; CHECK-NEXT: .long 8
266 ; CHECK-NEXT: .byte 13
267 ; CHECK-NEXT: .byte 8
268 ; CHECK-NEXT: .byte 14
269 ; CHECK-NEXT: .short 9
270 ; CHECK-NEXT: .byte 8
271 ; CHECK-NEXT: .byte 7
272 ; CHECK-NEXT: .byte 9
273 ; CHECK-NEXT: .long 8
274 ; CHECK-NEXT: .byte 10
275 ; CHECK-NEXT: .long 8
276 ; CHECK-NEXT: .byte 13
277 ; CHECK-NEXT: .byte 9
278 ; CHECK-NEXT: .byte 14
279 ; CHECK-NEXT: .short 9
280 ; CHECK-NEXT: .byte 8
281 ; CHECK-NEXT: .byte 7
282 ; CHECK-NEXT: .byte 9
283 ; CHECK-NEXT: .long 8
284 ; CHECK-NEXT: .byte 10
285 ; CHECK-NEXT: .long 8
286 ; CHECK-NEXT: .byte 13
287 ; CHECK-NEXT: .byte 11
288 ; CHECK-NEXT: .byte 14
289 ; CHECK-NEXT: .short 1
290 ; CHECK-NEXT: .byte 15
291 ; CHECK-NEXT: .byte 1
292 ; CHECK-NEXT: .byte 8
293 ; CHECK-NEXT: .byte 5
294
45 ; CHECK-NEXT: - { amd.KernelName: test_ulong4, amd.Language: OpenCL C, amd.LanguageVersion: [ 2, 0 ], amd.Args:
46 ; CHECK-NEXT: - { amd.ArgSize: 32, amd.ArgAlign: 32, amd.ArgKind: 0, amd.ArgValueType: 10, amd.ArgTypeName: ulong4, amd.ArgAccQual: 0 }
47 ; CHECK-NEXT: - { amd.ArgSize: 8, amd.ArgAlign: 8, amd.ArgKind: 7, amd.ArgValueType: 9 }
48 ; CHECK-NEXT: - { amd.ArgSize: 8, amd.ArgAlign: 8, amd.ArgKind: 8, amd.ArgValueType: 9 }
49 ; CHECK-NEXT: - { amd.ArgSize: 8, amd.ArgAlign: 8, amd.ArgKind: 9, amd.ArgValueType: 9 }
50 ; CHECK-NEXT: - { amd.ArgSize: 8, amd.ArgAlign: 8, amd.ArgKind: 11, amd.ArgValueType: 1, amd.ArgAddrQual: 1 } }
29551 define amdgpu_kernel void @test_ulong4(<4 x i64> %a) !kernel_arg_addr_space !1 !kernel_arg_access_qual !2 !kernel_arg_type !12 !kernel_arg_base_type !12 !kernel_arg_type_qual !4 {
29652 ret void
29753 }
29854
299 ; CHECK-NEXT: .byte 4
300 ; CHECK-NEXT: .byte 6
301 ; CHECK-NEXT: .long 10
302 ; CHECK-NEXT: .ascii "test_half8"
303 ; CHECK-NEXT: .byte 7
304 ; CHECK-NEXT: .byte 9
305 ; CHECK-NEXT: .long 16
306 ; CHECK-NEXT: .byte 10
307 ; CHECK-NEXT: .long 16
308 ; CHECK-NEXT: .byte 11
309 ; CHECK-NEXT: .long 5
310 ; CHECK-NEXT: .ascii "half8"
311 ; CHECK-NEXT: .byte 13
312 ; CHECK-NEXT: .byte 0
313 ; CHECK-NEXT: .byte 14
314 ; CHECK-NEXT: .short 5
315 ; CHECK-NEXT: .byte 16
316 ; CHECK-NEXT: .byte 0
317 ; CHECK-NEXT: .byte 8
318 ; CHECK-NEXT: .byte 7
319 ; CHECK-NEXT: .byte 9
320 ; CHECK-NEXT: .long 8
321 ; CHECK-NEXT: .byte 10
322 ; CHECK-NEXT: .long 8
323 ; CHECK-NEXT: .byte 13
324 ; CHECK-NEXT: .byte 7
325 ; CHECK-NEXT: .byte 14
326 ; CHECK-NEXT: .short 9
327 ; CHECK-NEXT: .byte 8
328 ; CHECK-NEXT: .byte 7
329 ; CHECK-NEXT: .byte 9
330 ; CHECK-NEXT: .long 8
331 ; CHECK-NEXT: .byte 10
332 ; CHECK-NEXT: .long 8
333 ; CHECK-NEXT: .byte 13
334 ; CHECK-NEXT: .byte 8
335 ; CHECK-NEXT: .byte 14
336 ; CHECK-NEXT: .short 9
337 ; CHECK-NEXT: .byte 8
338 ; CHECK-NEXT: .byte 7
339 ; CHECK-NEXT: .byte 9
340 ; CHECK-NEXT: .long 8
341 ; CHECK-NEXT: .byte 10
342 ; CHECK-NEXT: .long 8
343 ; CHECK-NEXT: .byte 13
344 ; CHECK-NEXT: .byte 9
345 ; CHECK-NEXT: .byte 14
346 ; CHECK-NEXT: .short 9
347 ; CHECK-NEXT: .byte 8
348 ; CHECK-NEXT: .byte 7
349 ; CHECK-NEXT: .byte 9
350 ; CHECK-NEXT: .long 8
351 ; CHECK-NEXT: .byte 10
352 ; CHECK-NEXT: .long 8
353 ; CHECK-NEXT: .byte 13
354 ; CHECK-NEXT: .byte 11
355 ; CHECK-NEXT: .byte 14
356 ; CHECK-NEXT: .short 1
357 ; CHECK-NEXT: .byte 15
358 ; CHECK-NEXT: .byte 1
359 ; CHECK-NEXT: .byte 8
360 ; CHECK-NEXT: .byte 5
361
55 ; CHECK-NEXT: - { amd.KernelName: test_half8, amd.Language: OpenCL C, amd.LanguageVersion: [ 2, 0 ], amd.Args:
56 ; CHECK-NEXT: - { amd.ArgSize: 16, amd.ArgAlign: 16, amd.ArgKind: 0, amd.ArgValueType: 5, amd.ArgTypeName: half8, amd.ArgAccQual: 0 }
57 ; CHECK-NEXT: - { amd.ArgSize: 8, amd.ArgAlign: 8, amd.ArgKind: 7, amd.ArgValueType: 9 }
58 ; CHECK-NEXT: - { amd.ArgSize: 8, amd.ArgAlign: 8, amd.ArgKind: 8, amd.ArgValueType: 9 }
59 ; CHECK-NEXT: - { amd.ArgSize: 8, amd.ArgAlign: 8, amd.ArgKind: 9, amd.ArgValueType: 9 }
60 ; CHECK-NEXT: - { amd.ArgSize: 8, amd.ArgAlign: 8, amd.ArgKind: 11, amd.ArgValueType: 1, amd.ArgAddrQual: 1 } }
36261 define amdgpu_kernel void @test_half8(<8 x half> %a) !kernel_arg_addr_space !1 !kernel_arg_access_qual !2 !kernel_arg_type !13 !kernel_arg_base_type !13 !kernel_arg_type_qual !4 {
36362 ret void
36463 }
36564
366 ; CHECK-NEXT: .byte 4
367 ; CHECK-NEXT: .byte 6
368 ; CHECK-NEXT: .long 12
369 ; CHECK-NEXT: .ascii "test_float16"
370 ; CHECK-NEXT: .byte 7
371 ; CHECK-NEXT: .byte 9
372 ; CHECK-NEXT: .long 64
373 ; CHECK-NEXT: .byte 10
374 ; CHECK-NEXT: .long 64
375 ; CHECK-NEXT: .byte 11
376 ; CHECK-NEXT: .long 7
377 ; CHECK-NEXT: .ascii "float16"
378 ; CHECK-NEXT: .byte 13
379 ; CHECK-NEXT: .byte 0
380 ; CHECK-NEXT: .byte 14
381 ; CHECK-NEXT: .short 8
382 ; CHECK-NEXT: .byte 16
383 ; CHECK-NEXT: .byte 0
384 ; CHECK-NEXT: .byte 8
385 ; CHECK-NEXT: .byte 7
386 ; CHECK-NEXT: .byte 9
387 ; CHECK-NEXT: .long 8
388 ; CHECK-NEXT: .byte 10
389 ; CHECK-NEXT: .long 8
390 ; CHECK-NEXT: .byte 13
391 ; CHECK-NEXT: .byte 7
392 ; CHECK-NEXT: .byte 14
393 ; CHECK-NEXT: .short 9
394 ; CHECK-NEXT: .byte 8
395 ; CHECK-NEXT: .byte 7
396 ; CHECK-NEXT: .byte 9
397 ; CHECK-NEXT: .long 8
398 ; CHECK-NEXT: .byte 10
399 ; CHECK-NEXT: .long 8
400 ; CHECK-NEXT: .byte 13
401 ; CHECK-NEXT: .byte 8
402 ; CHECK-NEXT: .byte 14
403 ; CHECK-NEXT: .short 9
404 ; CHECK-NEXT: .byte 8
405 ; CHECK-NEXT: .byte 7
406 ; CHECK-NEXT: .byte 9
407 ; CHECK-NEXT: .long 8
408 ; CHECK-NEXT: .byte 10
409 ; CHECK-NEXT: .long 8
410 ; CHECK-NEXT: .byte 13
411 ; CHECK-NEXT: .byte 9
412 ; CHECK-NEXT: .byte 14
413 ; CHECK-NEXT: .short 9
414 ; CHECK-NEXT: .byte 8
415 ; CHECK-NEXT: .byte 7
416 ; CHECK-NEXT: .byte 9
417 ; CHECK-NEXT: .long 8
418 ; CHECK-NEXT: .byte 10
419 ; CHECK-NEXT: .long 8
420 ; CHECK-NEXT: .byte 13
421 ; CHECK-NEXT: .byte 11
422 ; CHECK-NEXT: .byte 14
423 ; CHECK-NEXT: .short 1
424 ; CHECK-NEXT: .byte 15
425 ; CHECK-NEXT: .byte 1
426 ; CHECK-NEXT: .byte 8
427 ; CHECK-NEXT: .byte 5
428
65 ; CHECK-NEXT: - { amd.KernelName: test_float16, amd.Language: OpenCL C, amd.LanguageVersion: [ 2, 0 ], amd.Args:
66 ; CHECK-NEXT: - { amd.ArgSize: 64, amd.ArgAlign: 64, amd.ArgKind: 0, amd.ArgValueType: 8, amd.ArgTypeName: float16, amd.ArgAccQual: 0 }
67 ; CHECK-NEXT: - { amd.ArgSize: 8, amd.ArgAlign: 8, amd.ArgKind: 7, amd.ArgValueType: 9 }
68 ; CHECK-NEXT: - { amd.ArgSize: 8, amd.ArgAlign: 8, amd.ArgKind: 8, amd.ArgValueType: 9 }
69 ; CHECK-NEXT: - { amd.ArgSize: 8, amd.ArgAlign: 8, amd.ArgKind: 9, amd.ArgValueType: 9 }
70 ; CHECK-NEXT: - { amd.ArgSize: 8, amd.ArgAlign: 8, amd.ArgKind: 11, amd.ArgValueType: 1, amd.ArgAddrQual: 1 } }
42971 define amdgpu_kernel void @test_float16(<16 x float> %a) !kernel_arg_addr_space !1 !kernel_arg_access_qual !2 !kernel_arg_type !14 !kernel_arg_base_type !14 !kernel_arg_type_qual !4 {
43072 ret void
43173 }
43274
433 ; CHECK-NEXT: .byte 4
434 ; CHECK-NEXT: .byte 6
435 ; CHECK-NEXT: .long 13
436 ; CHECK-NEXT: .ascii "test_double16"
437 ; CHECK-NEXT: .byte 7
438 ; CHECK-NEXT: .byte 9
439 ; CHECK-NEXT: .long 128
440 ; CHECK-NEXT: .byte 10
441 ; CHECK-NEXT: .long 128
442 ; CHECK-NEXT: .byte 11
443 ; CHECK-NEXT: .long 8
444 ; CHECK-NEXT: .ascii "double16"
445 ; CHECK-NEXT: .byte 13
446 ; CHECK-NEXT: .byte 0
447 ; CHECK-NEXT: .byte 14
448 ; CHECK-NEXT: .short 11
449 ; CHECK-NEXT: .byte 16
450 ; CHECK-NEXT: .byte 0
451 ; CHECK-NEXT: .byte 8
452 ; CHECK-NEXT: .byte 7
453 ; CHECK-NEXT: .byte 9
454 ; CHECK-NEXT: .long 8
455 ; CHECK-NEXT: .byte 10
456 ; CHECK-NEXT: .long 8
457 ; CHECK-NEXT: .byte 13
458 ; CHECK-NEXT: .byte 7
459 ; CHECK-NEXT: .byte 14
460 ; CHECK-NEXT: .short 9
461 ; CHECK-NEXT: .byte 8
462 ; CHECK-NEXT: .byte 7
463 ; CHECK-NEXT: .byte 9
464 ; CHECK-NEXT: .long 8
465 ; CHECK-NEXT: .byte 10
466 ; CHECK-NEXT: .long 8
467 ; CHECK-NEXT: .byte 13
468 ; CHECK-NEXT: .byte 8
469 ; CHECK-NEXT: .byte 14
470 ; CHECK-NEXT: .short 9
471 ; CHECK-NEXT: .byte 8
472 ; CHECK-NEXT: .byte 7
473 ; CHECK-NEXT: .byte 9
474 ; CHECK-NEXT: .long 8
475 ; CHECK-NEXT: .byte 10
476 ; CHECK-NEXT: .long 8
477 ; CHECK-NEXT: .byte 13
478 ; CHECK-NEXT: .byte 9
479 ; CHECK-NEXT: .byte 14
480 ; CHECK-NEXT: .short 9
481 ; CHECK-NEXT: .byte 8
482 ; CHECK-NEXT: .byte 7
483 ; CHECK-NEXT: .byte 9
484 ; CHECK-NEXT: .long 8
485 ; CHECK-NEXT: .byte 10
486 ; CHECK-NEXT: .long 8
487 ; CHECK-NEXT: .byte 13
488 ; CHECK-NEXT: .byte 11
489 ; CHECK-NEXT: .byte 14
490 ; CHECK-NEXT: .short 1
491 ; CHECK-NEXT: .byte 15
492 ; CHECK-NEXT: .byte 1
493 ; CHECK-NEXT: .byte 8
494 ; CHECK-NEXT: .byte 5
495
75 ; CHECK-NEXT: - { amd.KernelName: test_double16, amd.Language: OpenCL C, amd.LanguageVersion: [ 2, 0 ], amd.Args:
76 ; CHECK-NEXT: - { amd.ArgSize: 128, amd.ArgAlign: 128, amd.ArgKind: 0, amd.ArgValueType: 11, amd.ArgTypeName: double16, amd.ArgAccQual: 0 }
77 ; CHECK-NEXT: - { amd.ArgSize: 8, amd.ArgAlign: 8, amd.ArgKind: 7, amd.ArgValueType: 9 }
78 ; CHECK-NEXT: - { amd.ArgSize: 8, amd.ArgAlign: 8, amd.ArgKind: 8, amd.ArgValueType: 9 }
79 ; CHECK-NEXT: - { amd.ArgSize: 8, amd.ArgAlign: 8, amd.ArgKind: 9, amd.ArgValueType: 9 }
80 ; CHECK-NEXT: - { amd.ArgSize: 8, amd.ArgAlign: 8, amd.ArgKind: 11, amd.ArgValueType: 1, amd.ArgAddrQual: 1 } }
49681 define amdgpu_kernel void @test_double16(<16 x double> %a) !kernel_arg_addr_space !1 !kernel_arg_access_qual !2 !kernel_arg_type !15 !kernel_arg_base_type !15 !kernel_arg_type_qual !4 {
49782 ret void
49883 }
49984
500 ; CHECK-NEXT: .byte 4
501 ; CHECK-NEXT: .byte 6
502 ; CHECK-NEXT: .long 12
503 ; CHECK-NEXT: .ascii "test_pointer"
504 ; CHECK-NEXT: .byte 7
505 ; CHECK-NEXT: .byte 9
506 ; CHECK-NEXT: .long 8
507 ; CHECK-NEXT: .byte 10
508 ; CHECK-NEXT: .long 8
509 ; CHECK-NEXT: .byte 11
510 ; CHECK-NEXT: .long 5
511 ; CHECK-NEXT: .ascii "int *"
512 ; CHECK-NEXT: .byte 13
513 ; CHECK-NEXT: .byte 1
514 ; CHECK-NEXT: .byte 14
515 ; CHECK-NEXT: .short 6
516 ; CHECK-NEXT: .byte 16
517 ; CHECK-NEXT: .byte 0
518 ; CHECK-NEXT: .byte 15
519 ; CHECK-NEXT: .byte 1
520 ; CHECK-NEXT: .byte 8
521 ; CHECK-NEXT: .byte 7
522 ; CHECK-NEXT: .byte 9
523 ; CHECK-NEXT: .long 8
524 ; CHECK-NEXT: .byte 10
525 ; CHECK-NEXT: .long 8
526 ; CHECK-NEXT: .byte 13
527 ; CHECK-NEXT: .byte 7
528 ; CHECK-NEXT: .byte 14
529 ; CHECK-NEXT: .short 9
530 ; CHECK-NEXT: .byte 8
531 ; CHECK-NEXT: .byte 7
532 ; CHECK-NEXT: .byte 9
533 ; CHECK-NEXT: .long 8
534 ; CHECK-NEXT: .byte 10
535 ; CHECK-NEXT: .long 8
536 ; CHECK-NEXT: .byte 13
537 ; CHECK-NEXT: .byte 8
538 ; CHECK-NEXT: .byte 14
539 ; CHECK-NEXT: .short 9
540 ; CHECK-NEXT: .byte 8
541 ; CHECK-NEXT: .byte 7
542 ; CHECK-NEXT: .byte 9
543 ; CHECK-NEXT: .long 8
544 ; CHECK-NEXT: .byte 10
545 ; CHECK-NEXT: .long 8
546 ; CHECK-NEXT: .byte 13
547 ; CHECK-NEXT: .byte 9
548 ; CHECK-NEXT: .byte 14
549 ; CHECK-NEXT: .short 9
550 ; CHECK-NEXT: .byte 8
551 ; CHECK-NEXT: .byte 7
552 ; CHECK-NEXT: .byte 9
553 ; CHECK-NEXT: .long 8
554 ; CHECK-NEXT: .byte 10
555 ; CHECK-NEXT: .long 8
556 ; CHECK-NEXT: .byte 13
557 ; CHECK-NEXT: .byte 11
558 ; CHECK-NEXT: .byte 14
559 ; CHECK-NEXT: .short 1
560 ; CHECK-NEXT: .byte 15
561 ; CHECK-NEXT: .byte 1
562 ; CHECK-NEXT: .byte 8
563 ; CHECK-NEXT: .byte 5
564
85 ; CHECK-NEXT: - { amd.KernelName: test_pointer, amd.Language: OpenCL C, amd.LanguageVersion: [ 2, 0 ], amd.Args:
86 ; CHECK-NEXT: - { amd.ArgSize: 8, amd.ArgAlign: 8, amd.ArgKind: 1, amd.ArgValueType: 6, amd.ArgTypeName: 'int *', amd.ArgAddrQual: 1, amd.ArgAccQual: 0 }
87 ; CHECK-NEXT: - { amd.ArgSize: 8, amd.ArgAlign: 8, amd.ArgKind: 7, amd.ArgValueType: 9 }
88 ; CHECK-NEXT: - { amd.ArgSize: 8, amd.ArgAlign: 8, amd.ArgKind: 8, amd.ArgValueType: 9 }
89 ; CHECK-NEXT: - { amd.ArgSize: 8, amd.ArgAlign: 8, amd.ArgKind: 9, amd.ArgValueType: 9 }
90 ; CHECK-NEXT: - { amd.ArgSize: 8, amd.ArgAlign: 8, amd.ArgKind: 11, amd.ArgValueType: 1, amd.ArgAddrQual: 1 } }
56591 define amdgpu_kernel void @test_pointer(i32 addrspace(1)* %a) !kernel_arg_addr_space !1 !kernel_arg_access_qual !2 !kernel_arg_type !16 !kernel_arg_base_type !16 !kernel_arg_type_qual !4 {
56692 ret void
56793 }
56894
569 ; CHECK-NEXT: .byte 4
570 ; CHECK-NEXT: .byte 6
571 ; CHECK-NEXT: .long 10
572 ; CHECK-NEXT: .ascii "test_image"
573 ; CHECK-NEXT: .byte 7
574 ; CHECK-NEXT: .byte 9
575 ; CHECK-NEXT: .long 8
576 ; CHECK-NEXT: .byte 10
577 ; CHECK-NEXT: .long 8
578 ; CHECK-NEXT: .byte 11
579 ; CHECK-NEXT: .long 9
580 ; CHECK-NEXT: .ascii "image2d_t"
581 ; CHECK-NEXT: .byte 13
582 ; CHECK-NEXT: .byte 4
583 ; CHECK-NEXT: .byte 14
584 ; CHECK-NEXT: .short 0
585 ; CHECK-NEXT: .byte 16
586 ; CHECK-NEXT: .byte 0
587 ; CHECK-NEXT: .byte 15
588 ; CHECK-NEXT: .byte 1
589 ; CHECK-NEXT: .byte 8
590 ; CHECK-NEXT: .byte 7
591 ; CHECK-NEXT: .byte 9
592 ; CHECK-NEXT: .long 8
593 ; CHECK-NEXT: .byte 10
594 ; CHECK-NEXT: .long 8
595 ; CHECK-NEXT: .byte 13
596 ; CHECK-NEXT: .byte 7
597 ; CHECK-NEXT: .byte 14
598 ; CHECK-NEXT: .short 9
599 ; CHECK-NEXT: .byte 8
600 ; CHECK-NEXT: .byte 7
601 ; CHECK-NEXT: .byte 9
602 ; CHECK-NEXT: .long 8
603 ; CHECK-NEXT: .byte 10
604 ; CHECK-NEXT: .long 8
605 ; CHECK-NEXT: .byte 13
606 ; CHECK-NEXT: .byte 8
607 ; CHECK-NEXT: .byte 14
608 ; CHECK-NEXT: .short 9
609 ; CHECK-NEXT: .byte 8
610 ; CHECK-NEXT: .byte 7
611 ; CHECK-NEXT: .byte 9
612 ; CHECK-NEXT: .long 8
613 ; CHECK-NEXT: .byte 10
614 ; CHECK-NEXT: .long 8
615 ; CHECK-NEXT: .byte 13
616 ; CHECK-NEXT: .byte 9
617 ; CHECK-NEXT: .byte 14
618 ; CHECK-NEXT: .short 9
619 ; CHECK-NEXT: .byte 8
620 ; CHECK-NEXT: .byte 7
621 ; CHECK-NEXT: .byte 9
622 ; CHECK-NEXT: .long 8
623 ; CHECK-NEXT: .byte 10
624 ; CHECK-NEXT: .long 8
625 ; CHECK-NEXT: .byte 13
626 ; CHECK-NEXT: .byte 11
627 ; CHECK-NEXT: .byte 14
628 ; CHECK-NEXT: .short 1
629 ; CHECK-NEXT: .byte 15
630 ; CHECK-NEXT: .byte 1
631 ; CHECK-NEXT: .byte 8
632 ; CHECK-NEXT: .byte 5
633
95 ; CHECK-NEXT: - { amd.KernelName: test_image, amd.Language: OpenCL C, amd.LanguageVersion: [ 2, 0 ], amd.Args:
96 ; CHECK-NEXT: - { amd.ArgSize: 8, amd.ArgAlign: 8, amd.ArgKind: 4, amd.ArgValueType: 0, amd.ArgTypeName: image2d_t, amd.ArgAddrQual: 1, amd.ArgAccQual: 0 }
97 ; CHECK-NEXT: - { amd.ArgSize: 8, amd.ArgAlign: 8, amd.ArgKind: 7, amd.ArgValueType: 9 }
98 ; CHECK-NEXT: - { amd.ArgSize: 8, amd.ArgAlign: 8, amd.ArgKind: 8, amd.ArgValueType: 9 }
99 ; CHECK-NEXT: - { amd.ArgSize: 8, amd.ArgAlign: 8, amd.ArgKind: 9, amd.ArgValueType: 9 }
100 ; CHECK-NEXT: - { amd.ArgSize: 8, amd.ArgAlign: 8, amd.ArgKind: 11, amd.ArgValueType: 1, amd.ArgAddrQual: 1 } }
634101 define amdgpu_kernel void @test_image(%opencl.image2d_t addrspace(1)* %a) !kernel_arg_addr_space !1 !kernel_arg_access_qual !2 !kernel_arg_type !17 !kernel_arg_base_type !17 !kernel_arg_type_qual !4 {
635102 ret void
636103 }
637104
638 ; CHECK-NEXT: .byte 4
639 ; CHECK-NEXT: .byte 6
640 ; CHECK-NEXT: .long 12
641 ; CHECK-NEXT: .ascii "test_sampler"
642 ; CHECK-NEXT: .byte 7
643 ; CHECK-NEXT: .byte 9
644 ; CHECK-NEXT: .long 4
645 ; CHECK-NEXT: .byte 10
646 ; CHECK-NEXT: .long 4
647 ; CHECK-NEXT: .byte 11
648 ; CHECK-NEXT: .long 9
649 ; CHECK-NEXT: .ascii "sampler_t"
650 ; CHECK-NEXT: .byte 13
651 ; CHECK-NEXT: .byte 3
652 ; CHECK-NEXT: .byte 14
653 ; CHECK-NEXT: .short 6
654 ; CHECK-NEXT: .byte 16
655 ; CHECK-NEXT: .byte 0
656 ; CHECK-NEXT: .byte 8
657 ; CHECK-NEXT: .byte 7
658 ; CHECK-NEXT: .byte 9
659 ; CHECK-NEXT: .long 8
660 ; CHECK-NEXT: .byte 10
661 ; CHECK-NEXT: .long 8
662 ; CHECK-NEXT: .byte 13
663 ; CHECK-NEXT: .byte 7
664 ; CHECK-NEXT: .byte 14
665 ; CHECK-NEXT: .short 9
666 ; CHECK-NEXT: .byte 8
667 ; CHECK-NEXT: .byte 7
668 ; CHECK-NEXT: .byte 9
669 ; CHECK-NEXT: .long 8
670 ; CHECK-NEXT: .byte 10
671 ; CHECK-NEXT: .long 8
672 ; CHECK-NEXT: .byte 13
673 ; CHECK-NEXT: .byte 8
674 ; CHECK-NEXT: .byte 14
675 ; CHECK-NEXT: .short 9
676 ; CHECK-NEXT: .byte 8
677 ; CHECK-NEXT: .byte 7
678 ; CHECK-NEXT: .byte 9
679 ; CHECK-NEXT: .long 8
680 ; CHECK-NEXT: .byte 10
681 ; CHECK-NEXT: .long 8
682 ; CHECK-NEXT: .byte 13
683 ; CHECK-NEXT: .byte 9
684 ; CHECK-NEXT: .byte 14
685 ; CHECK-NEXT: .short 9
686 ; CHECK-NEXT: .byte 8
687 ; CHECK-NEXT: .byte 7
688 ; CHECK-NEXT: .byte 9
689 ; CHECK-NEXT: .long 8
690 ; CHECK-NEXT: .byte 10
691 ; CHECK-NEXT: .long 8
692 ; CHECK-NEXT: .byte 13
693 ; CHECK-NEXT: .byte 11
694 ; CHECK-NEXT: .byte 14
695 ; CHECK-NEXT: .short 1
696 ; CHECK-NEXT: .byte 15
697 ; CHECK-NEXT: .byte 1
698 ; CHECK-NEXT: .byte 8
699 ; CHECK-NEXT: .byte 5
700
105 ; CHECK-NEXT: - { amd.KernelName: test_sampler, amd.Language: OpenCL C, amd.LanguageVersion: [ 2, 0 ], amd.Args:
106 ; CHECK-NEXT: - { amd.ArgSize: 4, amd.ArgAlign: 4, amd.ArgKind: 3, amd.ArgValueType: 6, amd.ArgTypeName: sampler_t, amd.ArgAccQual: 0 }
107 ; CHECK-NEXT: - { amd.ArgSize: 8, amd.ArgAlign: 8, amd.ArgKind: 7, amd.ArgValueType: 9 }
108 ; CHECK-NEXT: - { amd.ArgSize: 8, amd.ArgAlign: 8, amd.ArgKind: 8, amd.ArgValueType: 9 }
109 ; CHECK-NEXT: - { amd.ArgSize: 8, amd.ArgAlign: 8, amd.ArgKind: 9, amd.ArgValueType: 9 }
110 ; CHECK-NEXT: - { amd.ArgSize: 8, amd.ArgAlign: 8, amd.ArgKind: 11, amd.ArgValueType: 1, amd.ArgAddrQual: 1 } }
701111 define amdgpu_kernel void @test_sampler(i32 %a) !kernel_arg_addr_space !1 !kernel_arg_access_qual !2 !kernel_arg_type !18 !kernel_arg_base_type !18 !kernel_arg_type_qual !4 {
702112 ret void
703113 }
704114
705 ; CHECK-NEXT: .byte 4
706 ; CHECK-NEXT: .byte 6
707 ; CHECK-NEXT: .long 10
708 ; CHECK-NEXT: .ascii "test_queue"
709 ; CHECK-NEXT: .byte 7
710 ; CHECK-NEXT: .byte 9
711 ; CHECK-NEXT: .long 8
712 ; CHECK-NEXT: .byte 10
713 ; CHECK-NEXT: .long 8
714 ; CHECK-NEXT: .byte 11
715 ; CHECK-NEXT: .long 7
716 ; CHECK-NEXT: .ascii "queue_t"
717 ; CHECK-NEXT: .byte 13
718 ; CHECK-NEXT: .byte 6
719 ; CHECK-NEXT: .byte 14
720 ; CHECK-NEXT: .short 0
721 ; CHECK-NEXT: .byte 16
722 ; CHECK-NEXT: .byte 0
723 ; CHECK-NEXT: .byte 15
724 ; CHECK-NEXT: .byte 1
725 ; CHECK-NEXT: .byte 8
726 ; CHECK-NEXT: .byte 7
727 ; CHECK-NEXT: .byte 9
728 ; CHECK-NEXT: .long 8
729 ; CHECK-NEXT: .byte 10
730 ; CHECK-NEXT: .long 8
731 ; CHECK-NEXT: .byte 13
732 ; CHECK-NEXT: .byte 7
733 ; CHECK-NEXT: .byte 14
734 ; CHECK-NEXT: .short 9
735 ; CHECK-NEXT: .byte 8
736 ; CHECK-NEXT: .byte 7
737 ; CHECK-NEXT: .byte 9
738 ; CHECK-NEXT: .long 8
739 ; CHECK-NEXT: .byte 10
740 ; CHECK-NEXT: .long 8
741 ; CHECK-NEXT: .byte 13
742 ; CHECK-NEXT: .byte 8
743 ; CHECK-NEXT: .byte 14
744 ; CHECK-NEXT: .short 9
745 ; CHECK-NEXT: .byte 8
746 ; CHECK-NEXT: .byte 7
747 ; CHECK-NEXT: .byte 9
748 ; CHECK-NEXT: .long 8
749 ; CHECK-NEXT: .byte 10
750 ; CHECK-NEXT: .long 8
751 ; CHECK-NEXT: .byte 13
752 ; CHECK-NEXT: .byte 9
753 ; CHECK-NEXT: .byte 14
754 ; CHECK-NEXT: .short 9
755 ; CHECK-NEXT: .byte 8
756 ; CHECK-NEXT: .byte 7
757 ; CHECK-NEXT: .byte 9
758 ; CHECK-NEXT: .long 8
759 ; CHECK-NEXT: .byte 10
760 ; CHECK-NEXT: .long 8
761 ; CHECK-NEXT: .byte 13
762 ; CHECK-NEXT: .byte 11
763 ; CHECK-NEXT: .byte 14
764 ; CHECK-NEXT: .short 1
765 ; CHECK-NEXT: .byte 15
766 ; CHECK-NEXT: .byte 1
767 ; CHECK-NEXT: .byte 8
768 ; CHECK-NEXT: .byte 5
769
115 ; CHECK-NEXT: - { amd.KernelName: test_queue, amd.Language: OpenCL C, amd.LanguageVersion: [ 2, 0 ], amd.Args:
116 ; CHECK-NEXT: - { amd.ArgSize: 8, amd.ArgAlign: 8, amd.ArgKind: 6, amd.ArgValueType: 0, amd.ArgTypeName: queue_t, amd.ArgAddrQual: 1, amd.ArgAccQual: 0 }
117 ; CHECK-NEXT: - { amd.ArgSize: 8, amd.ArgAlign: 8, amd.ArgKind: 7, amd.ArgValueType: 9 }
118 ; CHECK-NEXT: - { amd.ArgSize: 8, amd.ArgAlign: 8, amd.ArgKind: 8, amd.ArgValueType: 9 }
119 ; CHECK-NEXT: - { amd.ArgSize: 8, amd.ArgAlign: 8, amd.ArgKind: 9, amd.ArgValueType: 9 }
120 ; CHECK-NEXT: - { amd.ArgSize: 8, amd.ArgAlign: 8, amd.ArgKind: 11, amd.ArgValueType: 1, amd.ArgAddrQual: 1 } }
770121 define amdgpu_kernel void @test_queue(%opencl.queue_t addrspace(1)* %a) !kernel_arg_addr_space !1 !kernel_arg_access_qual !2 !kernel_arg_type !19 !kernel_arg_base_type !19 !kernel_arg_type_qual !4 {
771122 ret void
772123 }
773124
774 ; CHECK-NEXT: .byte 4
775 ; CHECK-NEXT: .byte 6
776 ; CHECK-NEXT: .long 11
777 ; CHECK-NEXT: .ascii "test_struct"
778 ; CHECK-NEXT: .byte 7
779 ; CHECK-NEXT: .byte 9
780 ; CHECK-NEXT: .long 4
781 ; CHECK-NEXT: .byte 10
782 ; CHECK-NEXT: .long 4
783 ; CHECK-NEXT: .byte 11
784 ; CHECK-NEXT: .long 8
785 ; CHECK-NEXT: .ascii "struct A"
786 ; CHECK-NEXT: .byte 13
787 ; CHECK-NEXT: .byte 1
788 ; CHECK-NEXT: .byte 14
789 ; CHECK-NEXT: .short 0
790 ; CHECK-NEXT: .byte 16
791 ; CHECK-NEXT: .byte 0
792 ; CHECK-NEXT: .byte 15
793 ; CHECK-NEXT: .byte 0
794 ; CHECK-NEXT: .byte 8
795 ; CHECK-NEXT: .byte 7
796 ; CHECK-NEXT: .byte 9
797 ; CHECK-NEXT: .long 8
798 ; CHECK-NEXT: .byte 10
799 ; CHECK-NEXT: .long 8
800 ; CHECK-NEXT: .byte 13
801 ; CHECK-NEXT: .byte 7
802 ; CHECK-NEXT: .byte 14
803 ; CHECK-NEXT: .short 9
804 ; CHECK-NEXT: .byte 8
805 ; CHECK-NEXT: .byte 7
806 ; CHECK-NEXT: .byte 9
807 ; CHECK-NEXT: .long 8
808 ; CHECK-NEXT: .byte 10
809 ; CHECK-NEXT: .long 8
810 ; CHECK-NEXT: .byte 13
811 ; CHECK-NEXT: .byte 8
812 ; CHECK-NEXT: .byte 14
813 ; CHECK-NEXT: .short 9
814 ; CHECK-NEXT: .byte 8
815 ; CHECK-NEXT: .byte 7
816 ; CHECK-NEXT: .byte 9
817 ; CHECK-NEXT: .long 8
818 ; CHECK-NEXT: .byte 10
819 ; CHECK-NEXT: .long 8
820 ; CHECK-NEXT: .byte 13
821 ; CHECK-NEXT: .byte 9
822 ; CHECK-NEXT: .byte 14
823 ; CHECK-NEXT: .short 9
824 ; CHECK-NEXT: .byte 8
825 ; CHECK-NEXT: .byte 7
826 ; CHECK-NEXT: .byte 9
827 ; CHECK-NEXT: .long 8
828 ; CHECK-NEXT: .byte 10
829 ; CHECK-NEXT: .long 8
830 ; CHECK-NEXT: .byte 13
831 ; CHECK-NEXT: .byte 11
832 ; CHECK-NEXT: .byte 14
833 ; CHECK-NEXT: .short 1
834 ; CHECK-NEXT: .byte 15
835 ; CHECK-NEXT: .byte 1
836 ; CHECK-NEXT: .byte 8
837 ; CHECK-NEXT: .byte 5
838
125 ; CHECK-NEXT: - { amd.KernelName: test_struct, amd.Language: OpenCL C, amd.LanguageVersion: [ 2, 0 ], amd.Args:
126 ; CHECK-NEXT: - { amd.ArgSize: 4, amd.ArgAlign: 4, amd.ArgKind: 1, amd.ArgValueType: 0, amd.ArgTypeName: struct A, amd.ArgAddrQual: 0, amd.ArgAccQual: 0 }
127 ; CHECK-NEXT: - { amd.ArgSize: 8, amd.ArgAlign: 8, amd.ArgKind: 7, amd.ArgValueType: 9 }
128 ; CHECK-NEXT: - { amd.ArgSize: 8, amd.ArgAlign: 8, amd.ArgKind: 8, amd.ArgValueType: 9 }
129 ; CHECK-NEXT: - { amd.ArgSize: 8, amd.ArgAlign: 8, amd.ArgKind: 9, amd.ArgValueType: 9 }
130 ; CHECK-NEXT: - { amd.ArgSize: 8, amd.ArgAlign: 8, amd.ArgKind: 11, amd.ArgValueType: 1, amd.ArgAddrQual: 1 } }
839131 define amdgpu_kernel void @test_struct(%struct.A* byval %a) !kernel_arg_addr_space !1 !kernel_arg_access_qual !2 !kernel_arg_type !20 !kernel_arg_base_type !20 !kernel_arg_type_qual !4 {
840132 ret void
841133 }
842134
843 ; CHECK-NEXT: .byte 4
844 ; CHECK-NEXT: .byte 6
845 ; CHECK-NEXT: .long 9
846 ; CHECK-NEXT: .ascii "test_i128"
847 ; CHECK-NEXT: .byte 7
848 ; CHECK-NEXT: .byte 9
849 ; CHECK-NEXT: .long 16
850 ; CHECK-NEXT: .byte 10
851 ; CHECK-NEXT: .long 8
852 ; CHECK-NEXT: .byte 11
853 ; CHECK-NEXT: .long 4
854 ; CHECK-NEXT: .ascii "i128"
855 ; CHECK-NEXT: .byte 13
856 ; CHECK-NEXT: .byte 0
857 ; CHECK-NEXT: .byte 14
858 ; CHECK-NEXT: .short 0
859 ; CHECK-NEXT: .byte 16
860 ; CHECK-NEXT: .byte 0
861 ; CHECK-NEXT: .byte 8
862 ; CHECK-NEXT: .byte 7
863 ; CHECK-NEXT: .byte 9
864 ; CHECK-NEXT: .long 8
865 ; CHECK-NEXT: .byte 10
866 ; CHECK-NEXT: .long 8
867 ; CHECK-NEXT: .byte 13
868 ; CHECK-NEXT: .byte 7
869 ; CHECK-NEXT: .byte 14
870 ; CHECK-NEXT: .short 9
871 ; CHECK-NEXT: .byte 8
872 ; CHECK-NEXT: .byte 7
873 ; CHECK-NEXT: .byte 9
874 ; CHECK-NEXT: .long 8
875 ; CHECK-NEXT: .byte 10
876 ; CHECK-NEXT: .long 8
877 ; CHECK-NEXT: .byte 13
878 ; CHECK-NEXT: .byte 8
879 ; CHECK-NEXT: .byte 14
880 ; CHECK-NEXT: .short 9
881 ; CHECK-NEXT: .byte 8
882 ; CHECK-NEXT: .byte 7
883 ; CHECK-NEXT: .byte 9
884 ; CHECK-NEXT: .long 8
885 ; CHECK-NEXT: .byte 10
886 ; CHECK-NEXT: .long 8
887 ; CHECK-NEXT: .byte 13
888 ; CHECK-NEXT: .byte 9
889 ; CHECK-NEXT: .byte 14
890 ; CHECK-NEXT: .short 9
891 ; CHECK-NEXT: .byte 8
892 ; CHECK-NEXT: .byte 7
893 ; CHECK-NEXT: .byte 9
894 ; CHECK-NEXT: .long 8
895 ; CHECK-NEXT: .byte 10
896 ; CHECK-NEXT: .long 8
897 ; CHECK-NEXT: .byte 13
898 ; CHECK-NEXT: .byte 11
899 ; CHECK-NEXT: .byte 14
900 ; CHECK-NEXT: .short 1
901 ; CHECK-NEXT: .byte 15
902 ; CHECK-NEXT: .byte 1
903 ; CHECK-NEXT: .byte 8
904 ; CHECK-NEXT: .byte 5
905
135 ; CHECK-NEXT: - { amd.KernelName: test_i128, amd.Language: OpenCL C, amd.LanguageVersion: [ 2, 0 ], amd.Args:
136 ; CHECK-NEXT: - { amd.ArgSize: 16, amd.ArgAlign: 8, amd.ArgKind: 0, amd.ArgValueType: 0, amd.ArgTypeName: i128, amd.ArgAccQual: 0 }
137 ; CHECK-NEXT: - { amd.ArgSize: 8, amd.ArgAlign: 8, amd.ArgKind: 7, amd.ArgValueType: 9 }
138 ; CHECK-NEXT: - { amd.ArgSize: 8, amd.ArgAlign: 8, amd.ArgKind: 8, amd.ArgValueType: 9 }
139 ; CHECK-NEXT: - { amd.ArgSize: 8, amd.ArgAlign: 8, amd.ArgKind: 9, amd.ArgValueType: 9 }
140 ; CHECK-NEXT: - { amd.ArgSize: 8, amd.ArgAlign: 8, amd.ArgKind: 11, amd.ArgValueType: 1, amd.ArgAddrQual: 1 } }
906141 define amdgpu_kernel void @test_i128(i128 %a) !kernel_arg_addr_space !1 !kernel_arg_access_qual !2 !kernel_arg_type !21 !kernel_arg_base_type !21 !kernel_arg_type_qual !4 {
907142 ret void
908143 }
909144
910 ; CHECK-NEXT: .byte 4
911 ; CHECK-NEXT: .byte 6
912 ; CHECK-NEXT: .long 14
913 ; CHECK-NEXT: .ascii "test_multi_arg"
914 ; CHECK-NEXT: .byte 7
915 ; CHECK-NEXT: .byte 9
916 ; CHECK-NEXT: .long 4
917 ; CHECK-NEXT: .byte 10
918 ; CHECK-NEXT: .long 4
919 ; CHECK-NEXT: .byte 11
920 ; CHECK-NEXT: .long 3
921 ; CHECK-NEXT: .ascii "int"
922 ; CHECK-NEXT: .byte 13
923 ; CHECK-NEXT: .byte 0
924 ; CHECK-NEXT: .byte 14
925 ; CHECK-NEXT: .short 6
926 ; CHECK-NEXT: .byte 16
927 ; CHECK-NEXT: .byte 0
928 ; CHECK-NEXT: .byte 8
929 ; CHECK-NEXT: .byte 7
930 ; CHECK-NEXT: .byte 9
931 ; CHECK-NEXT: .long 4
932 ; CHECK-NEXT: .byte 10
933 ; CHECK-NEXT: .long 4
934 ; CHECK-NEXT: .byte 11
935 ; CHECK-NEXT: .long 6
936 ; CHECK-NEXT: .ascii "short2"
937 ; CHECK-NEXT: .byte 13
938 ; CHECK-NEXT: .byte 0
939 ; CHECK-NEXT: .byte 14
940 ; CHECK-NEXT: .short 3
941 ; CHECK-NEXT: .byte 16
942 ; CHECK-NEXT: .byte 0
943 ; CHECK-NEXT: .byte 8
944 ; CHECK-NEXT: .byte 7
945 ; CHECK-NEXT: .byte 9
946 ; CHECK-NEXT: .long 4
947 ; CHECK-NEXT: .byte 10
948 ; CHECK-NEXT: .long 4
949 ; CHECK-NEXT: .byte 11
950 ; CHECK-NEXT: .long 5
951 ; CHECK-NEXT: .ascii "char3"
952 ; CHECK-NEXT: .byte 13
953 ; CHECK-NEXT: .byte 0
954 ; CHECK-NEXT: .byte 14
955 ; CHECK-NEXT: .short 1
956 ; CHECK-NEXT: .byte 16
957 ; CHECK-NEXT: .byte 0
958 ; CHECK-NEXT: .byte 8
959 ; CHECK-NEXT: .byte 7
960 ; CHECK-NEXT: .byte 9
961 ; CHECK-NEXT: .long 8
962 ; CHECK-NEXT: .byte 10
963 ; CHECK-NEXT: .long 8
964 ; CHECK-NEXT: .byte 13
965 ; CHECK-NEXT: .byte 7
966 ; CHECK-NEXT: .byte 14
967 ; CHECK-NEXT: .short 9
968 ; CHECK-NEXT: .byte 8
969 ; CHECK-NEXT: .byte 7
970 ; CHECK-NEXT: .byte 9
971 ; CHECK-NEXT: .long 8
972 ; CHECK-NEXT: .byte 10
973 ; CHECK-NEXT: .long 8
974 ; CHECK-NEXT: .byte 13
975 ; CHECK-NEXT: .byte 8
976 ; CHECK-NEXT: .byte 14
977 ; CHECK-NEXT: .short 9
978 ; CHECK-NEXT: .byte 8
979 ; CHECK-NEXT: .byte 7
980 ; CHECK-NEXT: .byte 9
981 ; CHECK-NEXT: .long 8
982 ; CHECK-NEXT: .byte 10
983 ; CHECK-NEXT: .long 8
984 ; CHECK-NEXT: .byte 13
985 ; CHECK-NEXT: .byte 9
986 ; CHECK-NEXT: .byte 14
987 ; CHECK-NEXT: .short 9
988 ; CHECK-NEXT: .byte 8
989 ; CHECK-NEXT: .byte 7
990 ; CHECK-NEXT: .byte 9
991 ; CHECK-NEXT: .long 8
992 ; CHECK-NEXT: .byte 10
993 ; CHECK-NEXT: .long 8
994 ; CHECK-NEXT: .byte 13
995 ; CHECK-NEXT: .byte 11
996 ; CHECK-NEXT: .byte 14
997 ; CHECK-NEXT: .short 1
998 ; CHECK-NEXT: .byte 15
999 ; CHECK-NEXT: .byte 1
1000 ; CHECK-NEXT: .byte 8
1001 ; CHECK-NEXT: .byte 5
1002
145 ; CHECK-NEXT: - { amd.KernelName: test_multi_arg, amd.Language: OpenCL C, amd.LanguageVersion: [ 2, 0 ], amd.Args:
146 ; CHECK-NEXT: - { amd.ArgSize: 4, amd.ArgAlign: 4, amd.ArgKind: 0, amd.ArgValueType: 6, amd.ArgTypeName: int, amd.ArgAccQual: 0 }
147 ; CHECK-NEXT: - { amd.ArgSize: 4, amd.ArgAlign: 4, amd.ArgKind: 0, amd.ArgValueType: 3, amd.ArgTypeName: short2, amd.ArgAccQual: 0 }
148 ; CHECK-NEXT: - { amd.ArgSize: 4, amd.ArgAlign: 4, amd.ArgKind: 0, amd.ArgValueType: 1, amd.ArgTypeName: char3, amd.ArgAccQual: 0 }
149 ; CHECK-NEXT: - { amd.ArgSize: 8, amd.ArgAlign: 8, amd.ArgKind: 7, amd.ArgValueType: 9 }
150 ; CHECK-NEXT: - { amd.ArgSize: 8, amd.ArgAlign: 8, amd.ArgKind: 8, amd.ArgValueType: 9 }
151 ; CHECK-NEXT: - { amd.ArgSize: 8, amd.ArgAlign: 8, amd.ArgKind: 9, amd.ArgValueType: 9 }
152 ; CHECK-NEXT: - { amd.ArgSize: 8, amd.ArgAlign: 8, amd.ArgKind: 11, amd.ArgValueType: 1, amd.ArgAddrQual: 1 } }
1003153 define amdgpu_kernel void @test_multi_arg(i32 %a, <2 x i16> %b, <3 x i8> %c) !kernel_arg_addr_space !22 !kernel_arg_access_qual !23 !kernel_arg_type !24 !kernel_arg_base_type !24 !kernel_arg_type_qual !25 {
1004154 ret void
1005155 }
1006156
1007 ; CHECK-NEXT: .byte 4
1008 ; CHECK-NEXT: .byte 6
1009 ; CHECK-NEXT: .long 15
1010 ; CHECK-NEXT: .ascii "test_addr_space"
1011 ; CHECK-NEXT: .byte 7
1012 ; CHECK-NEXT: .byte 9
1013 ; CHECK-NEXT: .long 8
1014 ; CHECK-NEXT: .byte 10
1015 ; CHECK-NEXT: .long 8
1016 ; CHECK-NEXT: .byte 11
1017 ; CHECK-NEXT: .long 5
1018 ; CHECK-NEXT: .ascii "int *"
1019 ; CHECK-NEXT: .byte 13
1020 ; CHECK-NEXT: .byte 1
1021 ; CHECK-NEXT: .byte 14
1022 ; CHECK-NEXT: .short 6
1023 ; CHECK-NEXT: .byte 16
1024 ; CHECK-NEXT: .byte 0
1025 ; CHECK-NEXT: .byte 15
1026 ; CHECK-NEXT: .byte 1
1027 ; CHECK-NEXT: .byte 8
1028 ; CHECK-NEXT: .byte 7
1029 ; CHECK-NEXT: .byte 9
1030 ; CHECK-NEXT: .long 8
1031 ; CHECK-NEXT: .byte 10
1032 ; CHECK-NEXT: .long 8
1033 ; CHECK-NEXT: .byte 11
1034 ; CHECK-NEXT: .long 5
1035 ; CHECK-NEXT: .ascii "int *"
1036 ; CHECK-NEXT: .byte 13
1037 ; CHECK-NEXT: .byte 1
1038 ; CHECK-NEXT: .byte 14
1039 ; CHECK-NEXT: .short 6
1040 ; CHECK-NEXT: .byte 16
1041 ; CHECK-NEXT: .byte 0
1042 ; CHECK-NEXT: .byte 15
1043 ; CHECK-NEXT: .byte 2
1044 ; CHECK-NEXT: .byte 8
1045 ; CHECK-NEXT: .byte 7
1046 ; CHECK-NEXT: .byte 9
1047 ; CHECK-NEXT: .long 4
1048 ; CHECK-NEXT: .byte 10
1049 ; CHECK-NEXT: .long 4
1050 ; CHECK-NEXT: .byte 32
1051 ; CHECK-NEXT: .long 4
1052 ; CHECK-NEXT: .byte 11
1053 ; CHECK-NEXT: .long 5
1054 ; CHECK-NEXT: .ascii "int *"
1055 ; CHECK-NEXT: .byte 13
1056 ; CHECK-NEXT: .byte 2
1057 ; CHECK-NEXT: .byte 14
1058 ; CHECK-NEXT: .short 6
1059 ; CHECK-NEXT: .byte 16
1060 ; CHECK-NEXT: .byte 0
1061 ; CHECK-NEXT: .byte 15
1062 ; CHECK-NEXT: .byte 3
1063 ; CHECK-NEXT: .byte 8
1064 ; CHECK-NEXT: .byte 7
1065 ; CHECK-NEXT: .byte 9
1066 ; CHECK-NEXT: .long 8
1067 ; CHECK-NEXT: .byte 10
1068 ; CHECK-NEXT: .long 8
1069 ; CHECK-NEXT: .byte 13
1070 ; CHECK-NEXT: .byte 7
1071 ; CHECK-NEXT: .byte 14
1072 ; CHECK-NEXT: .short 9
1073 ; CHECK-NEXT: .byte 8
1074 ; CHECK-NEXT: .byte 7
1075 ; CHECK-NEXT: .byte 9
1076 ; CHECK-NEXT: .long 8
1077 ; CHECK-NEXT: .byte 10
1078 ; CHECK-NEXT: .long 8
1079 ; CHECK-NEXT: .byte 13
1080 ; CHECK-NEXT: .byte 8
1081 ; CHECK-NEXT: .byte 14
1082 ; CHECK-NEXT: .short 9
1083 ; CHECK-NEXT: .byte 8
1084 ; CHECK-NEXT: .byte 7
1085 ; CHECK-NEXT: .byte 9
1086 ; CHECK-NEXT: .long 8
1087 ; CHECK-NEXT: .byte 10
1088 ; CHECK-NEXT: .long 8
1089 ; CHECK-NEXT: .byte 13
1090 ; CHECK-NEXT: .byte 9
1091 ; CHECK-NEXT: .byte 14
1092 ; CHECK-NEXT: .short 9
1093 ; CHECK-NEXT: .byte 8
1094 ; CHECK-NEXT: .byte 7
1095 ; CHECK-NEXT: .byte 9
1096 ; CHECK-NEXT: .long 8
1097 ; CHECK-NEXT: .byte 10
1098 ; CHECK-NEXT: .long 8
1099 ; CHECK-NEXT: .byte 13
1100 ; CHECK-NEXT: .byte 11
1101 ; CHECK-NEXT: .byte 14
1102 ; CHECK-NEXT: .short 1
1103 ; CHECK-NEXT: .byte 15
1104 ; CHECK-NEXT: .byte 1
1105 ; CHECK-NEXT: .byte 8
1106 ; CHECK-NEXT: .byte 5
1107
157 ; CHECK-NEXT: - { amd.KernelName: test_addr_space, amd.Language: OpenCL C, amd.LanguageVersion: [ 2, 0 ], amd.Args:
158 ; CHECK-NEXT: - { amd.ArgSize: 8, amd.ArgAlign: 8, amd.ArgKind: 1, amd.ArgValueType: 6, amd.ArgTypeName: 'int *', amd.ArgAddrQual: 1, amd.ArgAccQual: 0 }
159 ; CHECK-NEXT: - { amd.ArgSize: 8, amd.ArgAlign: 8, amd.ArgKind: 1, amd.ArgValueType: 6, amd.ArgTypeName: 'int *', amd.ArgAddrQual: 2, amd.ArgAccQual: 0 }
160 ; CHECK-NEXT: - { amd.ArgSize: 4, amd.ArgAlign: 4, amd.ArgPointeeAlign: 4, amd.ArgKind: 2, amd.ArgValueType: 6, amd.ArgTypeName: 'int *', amd.ArgAddrQual: 3, amd.ArgAccQual: 0 }
161 ; CHECK-NEXT: - { amd.ArgSize: 8, amd.ArgAlign: 8, amd.ArgKind: 7, amd.ArgValueType: 9 }
162 ; CHECK-NEXT: - { amd.ArgSize: 8, amd.ArgAlign: 8, amd.ArgKind: 8, amd.ArgValueType: 9 }
163 ; CHECK-NEXT: - { amd.ArgSize: 8, amd.ArgAlign: 8, amd.ArgKind: 9, amd.ArgValueType: 9 }
164 ; CHECK-NEXT: - { amd.ArgSize: 8, amd.ArgAlign: 8, amd.ArgKind: 11, amd.ArgValueType: 1, amd.ArgAddrQual: 1 } }
1108165 define amdgpu_kernel void @test_addr_space(i32 addrspace(1)* %g, i32 addrspace(2)* %c, i32 addrspace(3)* %l) !kernel_arg_addr_space !50 !kernel_arg_access_qual !23 !kernel_arg_type !51 !kernel_arg_base_type !51 !kernel_arg_type_qual !25 {
1109166 ret void
1110167 }
1111168
1112 ; CHECK-NEXT: .byte 4
1113 ; CHECK-NEXT: .byte 6
1114 ; CHECK-NEXT: .long 14
1115 ; CHECK-NEXT: .ascii "test_type_qual"
1116 ; CHECK-NEXT: .byte 7
1117 ; CHECK-NEXT: .byte 9
1118 ; CHECK-NEXT: .long 8
1119 ; CHECK-NEXT: .byte 10
1120 ; CHECK-NEXT: .long 8
1121 ; CHECK-NEXT: .byte 11
1122 ; CHECK-NEXT: .long 5
1123 ; CHECK-NEXT: .ascii "int *"
1124 ; CHECK-NEXT: .byte 19
1125 ; CHECK-NEXT: .byte 13
1126 ; CHECK-NEXT: .byte 1
1127 ; CHECK-NEXT: .byte 14
1128 ; CHECK-NEXT: .short 6
1129 ; CHECK-NEXT: .byte 16
1130 ; CHECK-NEXT: .byte 0
1131 ; CHECK-NEXT: .byte 15
1132 ; CHECK-NEXT: .byte 1
1133 ; CHECK-NEXT: .byte 8
1134 ; CHECK-NEXT: .byte 7
1135 ; CHECK-NEXT: .byte 9
1136 ; CHECK-NEXT: .long 8
1137 ; CHECK-NEXT: .byte 10
1138 ; CHECK-NEXT: .long 8
1139 ; CHECK-NEXT: .byte 11
1140 ; CHECK-NEXT: .long 5
1141 ; CHECK-NEXT: .ascii "int *"
1142 ; CHECK-NEXT: .byte 17
1143 ; CHECK-NEXT: .byte 18
1144 ; CHECK-NEXT: .byte 13
1145 ; CHECK-NEXT: .byte 1
1146 ; CHECK-NEXT: .byte 14
1147 ; CHECK-NEXT: .short 6
1148 ; CHECK-NEXT: .byte 16
1149 ; CHECK-NEXT: .byte 0
1150 ; CHECK-NEXT: .byte 15
1151 ; CHECK-NEXT: .byte 1
1152 ; CHECK-NEXT: .byte 8
1153 ; CHECK-NEXT: .byte 7
1154 ; CHECK-NEXT: .byte 9
1155 ; CHECK-NEXT: .long 8
1156 ; CHECK-NEXT: .byte 10
1157 ; CHECK-NEXT: .long 8
1158 ; CHECK-NEXT: .byte 11
1159 ; CHECK-NEXT: .long 5
1160 ; CHECK-NEXT: .ascii "int *"
1161 ; CHECK-NEXT: .byte 20
1162 ; CHECK-NEXT: .byte 13
1163 ; CHECK-NEXT: .byte 5
1164 ; CHECK-NEXT: .byte 14
1165 ; CHECK-NEXT: .short 0
1166 ; CHECK-NEXT: .byte 16
1167 ; CHECK-NEXT: .byte 0
1168 ; CHECK-NEXT: .byte 15
1169 ; CHECK-NEXT: .byte 1
1170 ; CHECK-NEXT: .byte 8
1171 ; CHECK-NEXT: .byte 7
1172 ; CHECK-NEXT: .byte 9
1173 ; CHECK-NEXT: .long 8
1174 ; CHECK-NEXT: .byte 10
1175 ; CHECK-NEXT: .long 8
1176 ; CHECK-NEXT: .byte 13
1177 ; CHECK-NEXT: .byte 7
1178 ; CHECK-NEXT: .byte 14
1179 ; CHECK-NEXT: .short 9
1180 ; CHECK-NEXT: .byte 8
1181 ; CHECK-NEXT: .byte 7
1182 ; CHECK-NEXT: .byte 9
1183 ; CHECK-NEXT: .long 8
1184 ; CHECK-NEXT: .byte 10
1185 ; CHECK-NEXT: .long 8
1186 ; CHECK-NEXT: .byte 13
1187 ; CHECK-NEXT: .byte 8
1188 ; CHECK-NEXT: .byte 14
1189 ; CHECK-NEXT: .short 9
1190 ; CHECK-NEXT: .byte 8
1191 ; CHECK-NEXT: .byte 7
1192 ; CHECK-NEXT: .byte 9
1193 ; CHECK-NEXT: .long 8
1194 ; CHECK-NEXT: .byte 10
1195 ; CHECK-NEXT: .long 8
1196 ; CHECK-NEXT: .byte 13
1197 ; CHECK-NEXT: .byte 9
1198 ; CHECK-NEXT: .byte 14
1199 ; CHECK-NEXT: .short 9
1200 ; CHECK-NEXT: .byte 8
1201 ; CHECK-NEXT: .byte 7
1202 ; CHECK-NEXT: .byte 9
1203 ; CHECK-NEXT: .long 8
1204 ; CHECK-NEXT: .byte 10
1205 ; CHECK-NEXT: .long 8
1206 ; CHECK-NEXT: .byte 13
1207 ; CHECK-NEXT: .byte 11
1208 ; CHECK-NEXT: .byte 14
1209 ; CHECK-NEXT: .short 1
1210 ; CHECK-NEXT: .byte 15
1211 ; CHECK-NEXT: .byte 1
1212 ; CHECK-NEXT: .byte 8
1213 ; CHECK-NEXT: .byte 5
1214
169 ; CHECK-NEXT: - { amd.KernelName: test_type_qual, amd.Language: OpenCL C, amd.LanguageVersion: [ 2, 0 ], amd.Args:
170 ; CHECK-NEXT: - { amd.ArgSize: 8, amd.ArgAlign: 8, amd.ArgKind: 1, amd.ArgValueType: 6, amd.ArgTypeName: 'int *', amd.ArgAddrQual: 1, amd.ArgAccQual: 0, amd.ArgIsVolatile: 1 }
171 ; CHECK-NEXT: - { amd.ArgSize: 8, amd.ArgAlign: 8, amd.ArgKind: 1, amd.ArgValueType: 6, amd.ArgTypeName: 'int *', amd.ArgAddrQual: 1, amd.ArgAccQual: 0, amd.ArgIsConst: 1, amd.ArgIsRestrict: 1 }
172 ; CHECK-NEXT: - { amd.ArgSize: 8, amd.ArgAlign: 8, amd.ArgKind: 5, amd.ArgValueType: 0, amd.ArgTypeName: 'int *', amd.ArgAddrQual: 1, amd.ArgAccQual: 0, amd.ArgIsPipe: 1 }
173 ; CHECK-NEXT: - { amd.ArgSize: 8, amd.ArgAlign: 8, amd.ArgKind: 7, amd.ArgValueType: 9 }
174 ; CHECK-NEXT: - { amd.ArgSize: 8, amd.ArgAlign: 8, amd.ArgKind: 8, amd.ArgValueType: 9 }
175 ; CHECK-NEXT: - { amd.ArgSize: 8, amd.ArgAlign: 8, amd.ArgKind: 9, amd.ArgValueType: 9 }
176 ; CHECK-NEXT: - { amd.ArgSize: 8, amd.ArgAlign: 8, amd.ArgKind: 11, amd.ArgValueType: 1, amd.ArgAddrQual: 1 } }
1215177 define amdgpu_kernel void @test_type_qual(i32 addrspace(1)* %a, i32 addrspace(1)* %b, %opencl.pipe_t addrspace(1)* %c) !kernel_arg_addr_space !22 !kernel_arg_access_qual !23 !kernel_arg_type !51 !kernel_arg_base_type !51 !kernel_arg_type_qual !70 {
1216178 ret void
1217179 }
1218180
1219 ; CHECK-NEXT: .byte 4
1220 ; CHECK-NEXT: .byte 6
1221 ; CHECK-NEXT: .long 16
1222 ; CHECK-NEXT: .ascii "test_access_qual"
1223 ; CHECK-NEXT: .byte 7
1224 ; CHECK-NEXT: .byte 9
1225 ; CHECK-NEXT: .long 8
1226 ; CHECK-NEXT: .byte 10
1227 ; CHECK-NEXT: .long 8
1228 ; CHECK-NEXT: .byte 11
1229 ; CHECK-NEXT: .long 9
1230 ; CHECK-NEXT: .ascii "image1d_t"
1231 ; CHECK-NEXT: .byte 13
1232 ; CHECK-NEXT: .byte 4
1233 ; CHECK-NEXT: .byte 14
1234 ; CHECK-NEXT: .short 0
1235 ; CHECK-NEXT: .byte 16
1236 ; CHECK-NEXT: .byte 1
1237 ; CHECK-NEXT: .byte 15
1238 ; CHECK-NEXT: .byte 1
1239 ; CHECK-NEXT: .byte 8
1240 ; CHECK-NEXT: .byte 7
1241 ; CHECK-NEXT: .byte 9
1242 ; CHECK-NEXT: .long 8
1243 ; CHECK-NEXT: .byte 10
1244 ; CHECK-NEXT: .long 8
1245 ; CHECK-NEXT: .byte 11
1246 ; CHECK-NEXT: .long 9
1247 ; CHECK-NEXT: .ascii "image2d_t"
1248 ; CHECK-NEXT: .byte 13
1249 ; CHECK-NEXT: .byte 4
1250 ; CHECK-NEXT: .byte 14
1251 ; CHECK-NEXT: .short 0
1252 ; CHECK-NEXT: .byte 16
1253 ; CHECK-NEXT: .byte 2
1254 ; CHECK-NEXT: .byte 15
1255 ; CHECK-NEXT: .byte 1
1256 ; CHECK-NEXT: .byte 8
1257 ; CHECK-NEXT: .byte 7
1258 ; CHECK-NEXT: .byte 9
1259 ; CHECK-NEXT: .long 8
1260 ; CHECK-NEXT: .byte 10
1261 ; CHECK-NEXT: .long 8
1262 ; CHECK-NEXT: .byte 11
1263 ; CHECK-NEXT: .long 9
1264 ; CHECK-NEXT: .ascii "image3d_t"
1265 ; CHECK-NEXT: .byte 13
1266 ; CHECK-NEXT: .byte 4
1267 ; CHECK-NEXT: .byte 14
1268 ; CHECK-NEXT: .short 0
1269 ; CHECK-NEXT: .byte 16
1270 ; CHECK-NEXT: .byte 3
1271 ; CHECK-NEXT: .byte 15
1272 ; CHECK-NEXT: .byte 1
1273 ; CHECK-NEXT: .byte 8
1274 ; CHECK-NEXT: .byte 7
1275 ; CHECK-NEXT: .byte 9
1276 ; CHECK-NEXT: .long 8
1277 ; CHECK-NEXT: .byte 10
1278 ; CHECK-NEXT: .long 8
1279 ; CHECK-NEXT: .byte 13
1280 ; CHECK-NEXT: .byte 7
1281 ; CHECK-NEXT: .byte 14
1282 ; CHECK-NEXT: .short 9
1283 ; CHECK-NEXT: .byte 8
1284 ; CHECK-NEXT: .byte 7
1285 ; CHECK-NEXT: .byte 9
1286 ; CHECK-NEXT: .long 8
1287 ; CHECK-NEXT: .byte 10
1288 ; CHECK-NEXT: .long 8
1289 ; CHECK-NEXT: .byte 13
1290 ; CHECK-NEXT: .byte 8
1291 ; CHECK-NEXT: .byte 14
1292 ; CHECK-NEXT: .short 9
1293 ; CHECK-NEXT: .byte 8
1294 ; CHECK-NEXT: .byte 7
1295 ; CHECK-NEXT: .byte 9
1296 ; CHECK-NEXT: .long 8
1297 ; CHECK-NEXT: .byte 10
1298 ; CHECK-NEXT: .long 8
1299 ; CHECK-NEXT: .byte 13
1300 ; CHECK-NEXT: .byte 9
1301 ; CHECK-NEXT: .byte 14
1302 ; CHECK-NEXT: .short 9
1303 ; CHECK-NEXT: .byte 8
1304 ; CHECK-NEXT: .byte 7
1305 ; CHECK-NEXT: .byte 9
1306 ; CHECK-NEXT: .long 8
1307 ; CHECK-NEXT: .byte 10
1308 ; CHECK-NEXT: .long 8
1309 ; CHECK-NEXT: .byte 13
1310 ; CHECK-NEXT: .byte 11
1311 ; CHECK-NEXT: .byte 14
1312 ; CHECK-NEXT: .short 1
1313 ; CHECK-NEXT: .byte 15
1314 ; CHECK-NEXT: .byte 1
1315 ; CHECK-NEXT: .byte 8
1316 ; CHECK-NEXT: .byte 5
1317
181 ; CHECK-NEXT: - { amd.KernelName: test_access_qual, amd.Language: OpenCL C, amd.LanguageVersion: [ 2, 0 ], amd.Args:
182 ; CHECK-NEXT: - { amd.ArgSize: 8, amd.ArgAlign: 8, amd.ArgKind: 4, amd.ArgValueType: 0, amd.ArgTypeName: image1d_t, amd.ArgAddrQual: 1, amd.ArgAccQual: 1 }
183 ; CHECK-NEXT: - { amd.ArgSize: 8, amd.ArgAlign: 8, amd.ArgKind: 4, amd.ArgValueType: 0, amd.ArgTypeName: image2d_t, amd.ArgAddrQual: 1, amd.ArgAccQual: 2 }
184 ; CHECK-NEXT: - { amd.ArgSize: 8, amd.ArgAlign: 8, amd.ArgKind: 4, amd.ArgValueType: 0, amd.ArgTypeName: image3d_t, amd.ArgAddrQual: 1, amd.ArgAccQual: 3 }
185 ; CHECK-NEXT: - { amd.ArgSize: 8, amd.ArgAlign: 8, amd.ArgKind: 7, amd.ArgValueType: 9 }
186 ; CHECK-NEXT: - { amd.ArgSize: 8, amd.ArgAlign: 8, amd.ArgKind: 8, amd.ArgValueType: 9 }
187 ; CHECK-NEXT: - { amd.ArgSize: 8, amd.ArgAlign: 8, amd.ArgKind: 9, amd.ArgValueType: 9 }
188 ; CHECK-NEXT: - { amd.ArgSize: 8, amd.ArgAlign: 8, amd.ArgKind: 11, amd.ArgValueType: 1, amd.ArgAddrQual: 1 } }
1318189 define amdgpu_kernel void @test_access_qual(%opencl.image1d_t addrspace(1)* %ro, %opencl.image2d_t addrspace(1)* %wo, %opencl.image3d_t addrspace(1)* %rw) !kernel_arg_addr_space !60 !kernel_arg_access_qual !61 !kernel_arg_type !62 !kernel_arg_base_type !62 !kernel_arg_type_qual !25 {
1319190 ret void
1320191 }
1321192
1322 ; CHECK-NEXT: .byte 4
1323 ; CHECK-NEXT: .byte 6
1324 ; CHECK-NEXT: .long 23
1325 ; CHECK-NEXT: .ascii "test_vec_type_hint_half"
1326 ; CHECK-NEXT: .byte 7
1327 ; CHECK-NEXT: .byte 9
1328 ; CHECK-NEXT: .long 4
1329 ; CHECK-NEXT: .byte 10
1330 ; CHECK-NEXT: .long 4
1331 ; CHECK-NEXT: .byte 11
1332 ; CHECK-NEXT: .long 3
1333 ; CHECK-NEXT: .ascii "int"
1334 ; CHECK-NEXT: .byte 13
1335 ; CHECK-NEXT: .byte 0
1336 ; CHECK-NEXT: .byte 14
1337 ; CHECK-NEXT: .short 6
1338 ; CHECK-NEXT: .byte 16
1339 ; CHECK-NEXT: .byte 0
1340 ; CHECK-NEXT: .byte 8
1341 ; CHECK-NEXT: .byte 7
1342 ; CHECK-NEXT: .byte 9
1343 ; CHECK-NEXT: .long 8
1344 ; CHECK-NEXT: .byte 10
1345 ; CHECK-NEXT: .long 8
1346 ; CHECK-NEXT: .byte 13
1347 ; CHECK-NEXT: .byte 7
1348 ; CHECK-NEXT: .byte 14
1349 ; CHECK-NEXT: .short 9
1350 ; CHECK-NEXT: .byte 8
1351 ; CHECK-NEXT: .byte 7
1352 ; CHECK-NEXT: .byte 9
1353 ; CHECK-NEXT: .long 8
1354 ; CHECK-NEXT: .byte 10
1355 ; CHECK-NEXT: .long 8
1356 ; CHECK-NEXT: .byte 13
1357 ; CHECK-NEXT: .byte 8
1358 ; CHECK-NEXT: .byte 14
1359 ; CHECK-NEXT: .short 9
1360 ; CHECK-NEXT: .byte 8
1361 ; CHECK-NEXT: .byte 7
1362 ; CHECK-NEXT: .byte 9
1363 ; CHECK-NEXT: .long 8
1364 ; CHECK-NEXT: .byte 10
1365 ; CHECK-NEXT: .long 8
1366 ; CHECK-NEXT: .byte 13
1367 ; CHECK-NEXT: .byte 9
1368 ; CHECK-NEXT: .byte 14
1369 ; CHECK-NEXT: .short 9
1370 ; CHECK-NEXT: .byte 8
1371 ; CHECK-NEXT: .byte 7
1372 ; CHECK-NEXT: .byte 9
1373 ; CHECK-NEXT: .long 8
1374 ; CHECK-NEXT: .byte 10
1375 ; CHECK-NEXT: .long 8
1376 ; CHECK-NEXT: .byte 13
1377 ; CHECK-NEXT: .byte 11
1378 ; CHECK-NEXT: .byte 14
1379 ; CHECK-NEXT: .short 1
1380 ; CHECK-NEXT: .byte 15
1381 ; CHECK-NEXT: .byte 1
1382 ; CHECK-NEXT: .byte 8
1383 ; CHECK-NEXT: .byte 23
1384 ; CHECK-NEXT: .long 4
1385 ; CHECK-NEXT: .ascii "half"
1386 ; CHECK-NEXT: .byte 5
1387
193 ; CHECK-NEXT: - { amd.KernelName: test_vec_type_hint_half, amd.Language: OpenCL C, amd.LanguageVersion: [ 2, 0 ], amd.VecTypeHint: half, amd.Args:
194 ; CHECK-NEXT: - { amd.ArgSize: 4, amd.ArgAlign: 4, amd.ArgKind: 0, amd.ArgValueType: 6, amd.ArgTypeName: int, amd.ArgAccQual: 0 }
195 ; CHECK-NEXT: - { amd.ArgSize: 8, amd.ArgAlign: 8, amd.ArgKind: 7, amd.ArgValueType: 9 }
196 ; CHECK-NEXT: - { amd.ArgSize: 8, amd.ArgAlign: 8, amd.ArgKind: 8, amd.ArgValueType: 9 }
197 ; CHECK-NEXT: - { amd.ArgSize: 8, amd.ArgAlign: 8, amd.ArgKind: 9, amd.ArgValueType: 9 }
198 ; CHECK-NEXT: - { amd.ArgSize: 8, amd.ArgAlign: 8, amd.ArgKind: 11, amd.ArgValueType: 1, amd.ArgAddrQual: 1 } }
1388199 define amdgpu_kernel void @test_vec_type_hint_half(i32 %a) !kernel_arg_addr_space !1 !kernel_arg_access_qual !2 !kernel_arg_type !3 !kernel_arg_base_type !3 !kernel_arg_type_qual !4 !vec_type_hint !26 {
1389200 ret void
1390201 }
1391202
1392 ; CHECK-NEXT: .byte 4
1393 ; CHECK-NEXT: .byte 6
1394 ; CHECK-NEXT: .long 24
1395 ; CHECK-NEXT: .ascii "test_vec_type_hint_float"
1396 ; CHECK-NEXT: .byte 7
1397 ; CHECK-NEXT: .byte 9
1398 ; CHECK-NEXT: .long 4
1399 ; CHECK-NEXT: .byte 10
1400 ; CHECK-NEXT: .long 4
1401 ; CHECK-NEXT: .byte 11
1402 ; CHECK-NEXT: .long 3
1403 ; CHECK-NEXT: .ascii "int"
1404 ; CHECK-NEXT: .byte 13
1405 ; CHECK-NEXT: .byte 0
1406 ; CHECK-NEXT: .byte 14
1407 ; CHECK-NEXT: .short 6
1408 ; CHECK-NEXT: .byte 16
1409 ; CHECK-NEXT: .byte 0
1410 ; CHECK-NEXT: .byte 8
1411 ; CHECK-NEXT: .byte 7
1412 ; CHECK-NEXT: .byte 9
1413 ; CHECK-NEXT: .long 8
1414 ; CHECK-NEXT: .byte 10
1415 ; CHECK-NEXT: .long 8
1416 ; CHECK-NEXT: .byte 13
1417 ; CHECK-NEXT: .byte 7
1418 ; CHECK-NEXT: .byte 14
1419 ; CHECK-NEXT: .short 9
1420 ; CHECK-NEXT: .byte 8
1421 ; CHECK-NEXT: .byte 7
1422 ; CHECK-NEXT: .byte 9
1423 ; CHECK-NEXT: .long 8
1424 ; CHECK-NEXT: .byte 10
1425 ; CHECK-NEXT: .long 8
1426 ; CHECK-NEXT: .byte 13
1427 ; CHECK-NEXT: .byte 8
1428 ; CHECK-NEXT: .byte 14
1429 ; CHECK-NEXT: .short 9
1430 ; CHECK-NEXT: .byte 8
1431 ; CHECK-NEXT: .byte 7
1432 ; CHECK-NEXT: .byte 9
1433 ; CHECK-NEXT: .long 8
1434 ; CHECK-NEXT: .byte 10
1435 ; CHECK-NEXT: .long 8
1436 ; CHECK-NEXT: .byte 13
1437 ; CHECK-NEXT: .byte 9
1438 ; CHECK-NEXT: .byte 14
1439 ; CHECK-NEXT: .short 9
1440 ; CHECK-NEXT: .byte 8
1441 ; CHECK-NEXT: .byte 7
1442 ; CHECK-NEXT: .byte 9
1443 ; CHECK-NEXT: .long 8
1444 ; CHECK-NEXT: .byte 10
1445 ; CHECK-NEXT: .long 8
1446 ; CHECK-NEXT: .byte 13
1447 ; CHECK-NEXT: .byte 11
1448 ; CHECK-NEXT: .byte 14
1449 ; CHECK-NEXT: .short 1
1450 ; CHECK-NEXT: .byte 15
1451 ; CHECK-NEXT: .byte 1
1452 ; CHECK-NEXT: .byte 8
1453 ; CHECK-NEXT: .byte 23
1454 ; CHECK-NEXT: .long 5
1455 ; CHECK-NEXT: .ascii "float"
1456 ; CHECK-NEXT: .byte 5
1457
203 ; CHECK-NEXT: - { amd.KernelName: test_vec_type_hint_float, amd.Language: OpenCL C, amd.LanguageVersion: [ 2, 0 ], amd.VecTypeHint: float, amd.Args:
204 ; CHECK-NEXT: - { amd.ArgSize: 4, amd.ArgAlign: 4, amd.ArgKind: 0, amd.ArgValueType: 6, amd.ArgTypeName: int, amd.ArgAccQual: 0 }
205 ; CHECK-NEXT: - { amd.ArgSize: 8, amd.ArgAlign: 8, amd.ArgKind: 7, amd.ArgValueType: 9 }
206 ; CHECK-NEXT: - { amd.ArgSize: 8, amd.ArgAlign: 8, amd.ArgKind: 8, amd.ArgValueType: 9 }
207 ; CHECK-NEXT: - { amd.ArgSize: 8, amd.ArgAlign: 8, amd.ArgKind: 9, amd.ArgValueType: 9 }
208 ; CHECK-NEXT: - { amd.ArgSize: 8, amd.ArgAlign: 8, amd.ArgKind: 11, amd.ArgValueType: 1, amd.ArgAddrQual: 1 } }
1458209 define amdgpu_kernel void @test_vec_type_hint_float(i32 %a) !kernel_arg_addr_space !1 !kernel_arg_access_qual !2 !kernel_arg_type !3 !kernel_arg_base_type !3 !kernel_arg_type_qual !4 !vec_type_hint !27 {
1459210 ret void
1460211 }
1461212
1462 ; CHECK-NEXT: .byte 4
1463 ; CHECK-NEXT: .byte 6
1464 ; CHECK-NEXT: .long 25
1465 ; CHECK-NEXT: .ascii "test_vec_type_hint_double"
1466 ; CHECK-NEXT: .byte 7
1467 ; CHECK-NEXT: .byte 9
1468 ; CHECK-NEXT: .long 4
1469 ; CHECK-NEXT: .byte 10
1470 ; CHECK-NEXT: .long 4
1471 ; CHECK-NEXT: .byte 11
1472 ; CHECK-NEXT: .long 3
1473 ; CHECK-NEXT: .ascii "int"
1474 ; CHECK-NEXT: .byte 13
1475 ; CHECK-NEXT: .byte 0
1476 ; CHECK-NEXT: .byte 14
1477 ; CHECK-NEXT: .short 6
1478 ; CHECK-NEXT: .byte 16
1479 ; CHECK-NEXT: .byte 0
1480 ; CHECK-NEXT: .byte 8
1481 ; CHECK-NEXT: .byte 7
1482 ; CHECK-NEXT: .byte 9
1483 ; CHECK-NEXT: .long 8
1484 ; CHECK-NEXT: .byte 10
1485 ; CHECK-NEXT: .long 8
1486 ; CHECK-NEXT: .byte 13
1487 ; CHECK-NEXT: .byte 7
1488 ; CHECK-NEXT: .byte 14
1489 ; CHECK-NEXT: .short 9
1490 ; CHECK-NEXT: .byte 8
1491 ; CHECK-NEXT: .byte 7
1492 ; CHECK-NEXT: .byte 9
1493 ; CHECK-NEXT: .long 8
1494 ; CHECK-NEXT: .byte 10
1495 ; CHECK-NEXT: .long 8
1496 ; CHECK-NEXT: .byte 13
1497 ; CHECK-NEXT: .byte 8
1498 ; CHECK-NEXT: .byte 14
1499 ; CHECK-NEXT: .short 9
1500 ; CHECK-NEXT: .byte 8
1501 ; CHECK-NEXT: .byte 7
1502 ; CHECK-NEXT: .byte 9
1503 ; CHECK-NEXT: .long 8
1504 ; CHECK-NEXT: .byte 10
1505 ; CHECK-NEXT: .long 8
1506 ; CHECK-NEXT: .byte 13
1507 ; CHECK-NEXT: .byte 9
1508 ; CHECK-NEXT: .byte 14
1509 ; CHECK-NEXT: .short 9
1510 ; CHECK-NEXT: .byte 8
1511 ; CHECK-NEXT: .byte 7
1512 ; CHECK-NEXT: .byte 9
1513 ; CHECK-NEXT: .long 8
1514 ; CHECK-NEXT: .byte 10
1515 ; CHECK-NEXT: .long 8
1516 ; CHECK-NEXT: .byte 13
1517 ; CHECK-NEXT: .byte 11
1518 ; CHECK-NEXT: .byte 14
1519 ; CHECK-NEXT: .short 1
1520 ; CHECK-NEXT: .byte 15
1521 ; CHECK-NEXT: .byte 1
1522 ; CHECK-NEXT: .byte 8
1523 ; CHECK-NEXT: .byte 23
1524 ; CHECK-NEXT: .long 6
1525 ; CHECK-NEXT: .ascii "double"
1526 ; CHECK-NEXT: .byte 5
1527
213 ; CHECK-NEXT: - { amd.KernelName: test_vec_type_hint_double, amd.Language: OpenCL C, amd.LanguageVersion: [ 2, 0 ], amd.VecTypeHint: double, amd.Args:
214 ; CHECK-NEXT: - { amd.ArgSize: 4, amd.ArgAlign: 4, amd.ArgKind: 0, amd.ArgValueType: 6, amd.ArgTypeName: int, amd.ArgAccQual: 0 }
215 ; CHECK-NEXT: - { amd.ArgSize: 8, amd.ArgAlign: 8, amd.ArgKind: 7, amd.ArgValueType: 9 }
216 ; CHECK-NEXT: - { amd.ArgSize: 8, amd.ArgAlign: 8, amd.ArgKind: 8, amd.ArgValueType: 9 }
217 ; CHECK-NEXT: - { amd.ArgSize: 8, amd.ArgAlign: 8, amd.ArgKind: 9, amd.ArgValueType: 9 }
218 ; CHECK-NEXT: - { amd.ArgSize: 8, amd.ArgAlign: 8, amd.ArgKind: 11, amd.ArgValueType: 1, amd.ArgAddrQual: 1 } }
1528219 define amdgpu_kernel void @test_vec_type_hint_double(i32 %a) !kernel_arg_addr_space !1 !kernel_arg_access_qual !2 !kernel_arg_type !3 !kernel_arg_base_type !3 !kernel_arg_type_qual !4 !vec_type_hint !28 {
1529220 ret void
1530221 }
1531222
1532 ; CHECK-NEXT: .byte 4
1533 ; CHECK-NEXT: .byte 6
1534 ; CHECK-NEXT: .long 23
1535 ; CHECK-NEXT: .ascii "test_vec_type_hint_char"
1536 ; CHECK-NEXT: .byte 7
1537 ; CHECK-NEXT: .byte 9
1538 ; CHECK-NEXT: .long 4
1539 ; CHECK-NEXT: .byte 10
1540 ; CHECK-NEXT: .long 4
1541 ; CHECK-NEXT: .byte 11
1542 ; CHECK-NEXT: .long 3
1543 ; CHECK-NEXT: .ascii "int"
1544 ; CHECK-NEXT: .byte 13
1545 ; CHECK-NEXT: .byte 0
1546 ; CHECK-NEXT: .byte 14
1547 ; CHECK-NEXT: .short 6
1548 ; CHECK-NEXT: .byte 16
1549 ; CHECK-NEXT: .byte 0
1550 ; CHECK-NEXT: .byte 8
1551 ; CHECK-NEXT: .byte 7
1552 ; CHECK-NEXT: .byte 9
1553 ; CHECK-NEXT: .long 8
1554 ; CHECK-NEXT: .byte 10
1555 ; CHECK-NEXT: .long 8
1556 ; CHECK-NEXT: .byte 13
1557 ; CHECK-NEXT: .byte 7
1558 ; CHECK-NEXT: .byte 14
1559 ; CHECK-NEXT: .short 9
1560 ; CHECK-NEXT: .byte 8
1561 ; CHECK-NEXT: .byte 7
1562 ; CHECK-NEXT: .byte 9
1563 ; CHECK-NEXT: .long 8
1564 ; CHECK-NEXT: .byte 10
1565 ; CHECK-NEXT: .long 8
1566 ; CHECK-NEXT: .byte 13
1567 ; CHECK-NEXT: .byte 8
1568 ; CHECK-NEXT: .byte 14
1569 ; CHECK-NEXT: .short 9
1570 ; CHECK-NEXT: .byte 8
1571 ; CHECK-NEXT: .byte 7
1572 ; CHECK-NEXT: .byte 9
1573 ; CHECK-NEXT: .long 8
1574 ; CHECK-NEXT: .byte 10
1575 ; CHECK-NEXT: .long 8
1576 ; CHECK-NEXT: .byte 13
1577 ; CHECK-NEXT: .byte 9
1578 ; CHECK-NEXT: .byte 14
1579 ; CHECK-NEXT: .short 9
1580 ; CHECK-NEXT: .byte 8
1581 ; CHECK-NEXT: .byte 7
1582 ; CHECK-NEXT: .byte 9
1583 ; CHECK-NEXT: .long 8
1584 ; CHECK-NEXT: .byte 10
1585 ; CHECK-NEXT: .long 8
1586 ; CHECK-NEXT: .byte 13
1587 ; CHECK-NEXT: .byte 11
1588 ; CHECK-NEXT: .byte 14
1589 ; CHECK-NEXT: .short 1
1590 ; CHECK-NEXT: .byte 15
1591 ; CHECK-NEXT: .byte 1
1592 ; CHECK-NEXT: .byte 8
1593 ; CHECK-NEXT: .byte 23
1594 ; CHECK-NEXT: .long 4
1595 ; CHECK-NEXT: .ascii "char"
1596 ; CHECK-NEXT: .byte 5
1597
223 ; CHECK-NEXT: - { amd.KernelName: test_vec_type_hint_char, amd.Language: OpenCL C, amd.LanguageVersion: [ 2, 0 ], amd.VecTypeHint: char, amd.Args:
224 ; CHECK-NEXT: - { amd.ArgSize: 4, amd.ArgAlign: 4, amd.ArgKind: 0, amd.ArgValueType: 6, amd.ArgTypeName: int, amd.ArgAccQual: 0 }
225 ; CHECK-NEXT: - { amd.ArgSize: 8, amd.ArgAlign: 8, amd.ArgKind: 7, amd.ArgValueType: 9 }
226 ; CHECK-NEXT: - { amd.ArgSize: 8, amd.ArgAlign: 8, amd.ArgKind: 8, amd.ArgValueType: 9 }
227 ; CHECK-NEXT: - { amd.ArgSize: 8, amd.ArgAlign: 8, amd.ArgKind: 9, amd.ArgValueType: 9 }
228 ; CHECK-NEXT: - { amd.ArgSize: 8, amd.ArgAlign: 8, amd.ArgKind: 11, amd.ArgValueType: 1, amd.ArgAddrQual: 1 } }
1598229 define amdgpu_kernel void @test_vec_type_hint_char(i32 %a) !kernel_arg_addr_space !1 !kernel_arg_access_qual !2 !kernel_arg_type !3 !kernel_arg_base_type !3 !kernel_arg_type_qual !4 !vec_type_hint !29 {
1599230 ret void
1600231 }
1601232
1602 ; CHECK-NEXT: .byte 4
1603 ; CHECK-NEXT: .byte 6
1604 ; CHECK-NEXT: .long 24
1605 ; CHECK-NEXT: .ascii "test_vec_type_hint_short"
1606 ; CHECK-NEXT: .byte 7
1607 ; CHECK-NEXT: .byte 9
1608 ; CHECK-NEXT: .long 4
1609 ; CHECK-NEXT: .byte 10
1610 ; CHECK-NEXT: .long 4
1611 ; CHECK-NEXT: .byte 11
1612 ; CHECK-NEXT: .long 3
1613 ; CHECK-NEXT: .ascii "int"
1614 ; CHECK-NEXT: .byte 13
1615 ; CHECK-NEXT: .byte 0
1616 ; CHECK-NEXT: .byte 14
1617 ; CHECK-NEXT: .short 6
1618 ; CHECK-NEXT: .byte 16
1619 ; CHECK-NEXT: .byte 0
1620 ; CHECK-NEXT: .byte 8
1621 ; CHECK-NEXT: .byte 7
1622 ; CHECK-NEXT: .byte 9
1623 ; CHECK-NEXT: .long 8
1624 ; CHECK-NEXT: .byte 10
1625 ; CHECK-NEXT: .long 8
1626 ; CHECK-NEXT: .byte 13
1627 ; CHECK-NEXT: .byte 7
1628 ; CHECK-NEXT: .byte 14
1629 ; CHECK-NEXT: .short 9
1630 ; CHECK-NEXT: .byte 8
1631 ; CHECK-NEXT: .byte 7
1632 ; CHECK-NEXT: .byte 9
1633 ; CHECK-NEXT: .long 8
1634 ; CHECK-NEXT: .byte 10
1635 ; CHECK-NEXT: .long 8
1636 ; CHECK-NEXT: .byte 13
1637 ; CHECK-NEXT: .byte 8
1638 ; CHECK-NEXT: .byte 14
1639 ; CHECK-NEXT: .short 9
1640 ; CHECK-NEXT: .byte 8
1641 ; CHECK-NEXT: .byte 7
1642 ; CHECK-NEXT: .byte 9
1643 ; CHECK-NEXT: .long 8
1644 ; CHECK-NEXT: .byte 10
1645 ; CHECK-NEXT: .long 8
1646 ; CHECK-NEXT: .byte 13
1647 ; CHECK-NEXT: .byte 9
1648 ; CHECK-NEXT: .byte 14
1649 ; CHECK-NEXT: .short 9
1650 ; CHECK-NEXT: .byte 8
1651 ; CHECK-NEXT: .byte 7
1652 ; CHECK-NEXT: .byte 9
1653 ; CHECK-NEXT: .long 8
1654 ; CHECK-NEXT: .byte 10
1655 ; CHECK-NEXT: .long 8
1656 ; CHECK-NEXT: .byte 13
1657 ; CHECK-NEXT: .byte 11
1658 ; CHECK-NEXT: .byte 14
1659 ; CHECK-NEXT: .short 1
1660 ; CHECK-NEXT: .byte 15
1661 ; CHECK-NEXT: .byte 1
1662 ; CHECK-NEXT: .byte 8
1663 ; CHECK-NEXT: .byte 23
1664 ; CHECK-NEXT: .long 5
1665 ; CHECK-NEXT: .ascii "short"
1666 ; CHECK-NEXT: .byte 5
1667
233 ; CHECK-NEXT: - { amd.KernelName: test_vec_type_hint_short, amd.Language: OpenCL C, amd.LanguageVersion: [ 2, 0 ], amd.VecTypeHint: short, amd.Args:
234 ; CHECK-NEXT: - { amd.ArgSize: 4, amd.ArgAlign: 4, amd.ArgKind: 0, amd.ArgValueType: 6, amd.ArgTypeName: int, amd.ArgAccQual: 0 }
235 ; CHECK-NEXT: - { amd.ArgSize: 8, amd.ArgAlign: 8, amd.ArgKind: 7, amd.ArgValueType: 9 }
236 ; CHECK-NEXT: - { amd.ArgSize: 8, amd.ArgAlign: 8, amd.ArgKind: 8, amd.ArgValueType: 9 }
237 ; CHECK-NEXT: - { amd.ArgSize: 8, amd.ArgAlign: 8, amd.ArgKind: 9, amd.ArgValueType: 9 }
238 ; CHECK-NEXT: - { amd.ArgSize: 8, amd.ArgAlign: 8, amd.ArgKind: 11, amd.ArgValueType: 1, amd.ArgAddrQual: 1 } }
1668239 define amdgpu_kernel void @test_vec_type_hint_short(i32 %a) !kernel_arg_addr_space !1 !kernel_arg_access_qual !2 !kernel_arg_type !3 !kernel_arg_base_type !3 !kernel_arg_type_qual !4 !vec_type_hint !30 {
1669240 ret void
1670241 }
1671242
1672 ; CHECK-NEXT: .byte 4
1673 ; CHECK-NEXT: .byte 6
1674 ; CHECK-NEXT: .long 23
1675 ; CHECK-NEXT: .ascii "test_vec_type_hint_long"
1676 ; CHECK-NEXT: .byte 7
1677 ; CHECK-NEXT: .byte 9
1678 ; CHECK-NEXT: .long 4
1679 ; CHECK-NEXT: .byte 10
1680 ; CHECK-NEXT: .long 4
1681 ; CHECK-NEXT: .byte 11
1682 ; CHECK-NEXT: .long 3
1683 ; CHECK-NEXT: .ascii "int"
1684 ; CHECK-NEXT: .byte 13
1685 ; CHECK-NEXT: .byte 0
1686 ; CHECK-NEXT: .byte 14
1687 ; CHECK-NEXT: .short 6
1688 ; CHECK-NEXT: .byte 16
1689 ; CHECK-NEXT: .byte 0
1690 ; CHECK-NEXT: .byte 8
1691 ; CHECK-NEXT: .byte 7
1692 ; CHECK-NEXT: .byte 9
1693 ; CHECK-NEXT: .long 8
1694 ; CHECK-NEXT: .byte 10
1695 ; CHECK-NEXT: .long 8
1696 ; CHECK-NEXT: .byte 13
1697 ; CHECK-NEXT: .byte 7
1698 ; CHECK-NEXT: .byte 14
1699 ; CHECK-NEXT: .short 9
1700 ; CHECK-NEXT: .byte 8
1701 ; CHECK-NEXT: .byte 7
1702 ; CHECK-NEXT: .byte 9
1703 ; CHECK-NEXT: .long 8
1704 ; CHECK-NEXT: .byte 10
1705 ; CHECK-NEXT: .long 8
1706 ; CHECK-NEXT: .byte 13
1707 ; CHECK-NEXT: .byte 8
1708 ; CHECK-NEXT: .byte 14
1709 ; CHECK-NEXT: .short 9
1710 ; CHECK-NEXT: .byte 8
1711 ; CHECK-NEXT: .byte 7
1712 ; CHECK-NEXT: .byte 9
1713 ; CHECK-NEXT: .long 8
1714 ; CHECK-NEXT: .byte 10
1715 ; CHECK-NEXT: .long 8
1716 ; CHECK-NEXT: .byte 13
1717 ; CHECK-NEXT: .byte 9
1718 ; CHECK-NEXT: .byte 14
1719 ; CHECK-NEXT: .short 9
1720 ; CHECK-NEXT: .byte 8
1721 ; CHECK-NEXT: .byte 7
1722 ; CHECK-NEXT: .byte 9
1723 ; CHECK-NEXT: .long 8
1724 ; CHECK-NEXT: .byte 10
1725 ; CHECK-NEXT: .long 8
1726 ; CHECK-NEXT: .byte 13
1727 ; CHECK-NEXT: .byte 11
1728 ; CHECK-NEXT: .byte 14
1729 ; CHECK-NEXT: .short 1
1730 ; CHECK-NEXT: .byte 15
1731 ; CHECK-NEXT: .byte 1
1732 ; CHECK-NEXT: .byte 8
1733 ; CHECK-NEXT: .byte 23
1734 ; CHECK-NEXT: .long 4
1735 ; CHECK-NEXT: .ascii "long"
1736 ; CHECK-NEXT: .byte 5
1737
243 ; CHECK-NEXT: - { amd.KernelName: test_vec_type_hint_long, amd.Language: OpenCL C, amd.LanguageVersion: [ 2, 0 ], amd.VecTypeHint: long, amd.Args:
244 ; CHECK-NEXT: - { amd.ArgSize: 4, amd.ArgAlign: 4, amd.ArgKind: 0, amd.ArgValueType: 6, amd.ArgTypeName: int, amd.ArgAccQual: 0 }
245 ; CHECK-NEXT: - { amd.ArgSize: 8, amd.ArgAlign: 8, amd.ArgKind: 7, amd.ArgValueType: 9 }
246 ; CHECK-NEXT: - { amd.ArgSize: 8, amd.ArgAlign: 8, amd.ArgKind: 8, amd.ArgValueType: 9 }
247 ; CHECK-NEXT: - { amd.ArgSize: 8, amd.ArgAlign: 8, amd.ArgKind: 9, amd.ArgValueType: 9 }
248 ; CHECK-NEXT: - { amd.ArgSize: 8, amd.ArgAlign: 8, amd.ArgKind: 11, amd.ArgValueType: 1, amd.ArgAddrQual: 1 } }
1738249 define amdgpu_kernel void @test_vec_type_hint_long(i32 %a) !kernel_arg_addr_space !1 !kernel_arg_access_qual !2 !kernel_arg_type !3 !kernel_arg_base_type !3 !kernel_arg_type_qual !4 !vec_type_hint !31 {
1739250 ret void
1740251 }
1741252
1742 ; CHECK-NEXT: .byte 4
1743 ; CHECK-NEXT: .byte 6
1744 ; CHECK-NEXT: .long 26
1745 ; CHECK-NEXT: .ascii "test_vec_type_hint_unknown"
1746 ; CHECK-NEXT: .byte 7
1747 ; CHECK-NEXT: .byte 9
1748 ; CHECK-NEXT: .long 4
1749 ; CHECK-NEXT: .byte 10
1750 ; CHECK-NEXT: .long 4
1751 ; CHECK-NEXT: .byte 11
1752 ; CHECK-NEXT: .long 3
1753 ; CHECK-NEXT: .ascii "int"
1754 ; CHECK-NEXT: .byte 13
1755 ; CHECK-NEXT: .byte 0
1756 ; CHECK-NEXT: .byte 14
1757 ; CHECK-NEXT: .short 6
1758 ; CHECK-NEXT: .byte 16
1759 ; CHECK-NEXT: .byte 0
1760 ; CHECK-NEXT: .byte 8
1761 ; CHECK-NEXT: .byte 7
1762 ; CHECK-NEXT: .byte 9
1763 ; CHECK-NEXT: .long 8
1764 ; CHECK-NEXT: .byte 10
1765 ; CHECK-NEXT: .long 8
1766 ; CHECK-NEXT: .byte 13
1767 ; CHECK-NEXT: .byte 7
1768 ; CHECK-NEXT: .byte 14
1769 ; CHECK-NEXT: .short 9
1770 ; CHECK-NEXT: .byte 8
1771 ; CHECK-NEXT: .byte 7
1772 ; CHECK-NEXT: .byte 9
1773 ; CHECK-NEXT: .long 8
1774 ; CHECK-NEXT: .byte 10
1775 ; CHECK-NEXT: .long 8
1776 ; CHECK-NEXT: .byte 13
1777 ; CHECK-NEXT: .byte 8
1778 ; CHECK-NEXT: .byte 14
1779 ; CHECK-NEXT: .short 9
1780 ; CHECK-NEXT: .byte 8
1781 ; CHECK-NEXT: .byte 7
1782 ; CHECK-NEXT: .byte 9
1783 ; CHECK-NEXT: .long 8
1784 ; CHECK-NEXT: .byte 10
1785 ; CHECK-NEXT: .long 8
1786 ; CHECK-NEXT: .byte 13
1787 ; CHECK-NEXT: .byte 9
1788 ; CHECK-NEXT: .byte 14
1789 ; CHECK-NEXT: .short 9
1790 ; CHECK-NEXT: .byte 8
1791 ; CHECK-NEXT: .byte 7
1792 ; CHECK-NEXT: .byte 9
1793 ; CHECK-NEXT: .long 8
1794 ; CHECK-NEXT: .byte 10
1795 ; CHECK-NEXT: .long 8
1796 ; CHECK-NEXT: .byte 13
1797 ; CHECK-NEXT: .byte 11
1798 ; CHECK-NEXT: .byte 14
1799 ; CHECK-NEXT: .short 1
1800 ; CHECK-NEXT: .byte 15
1801 ; CHECK-NEXT: .byte 1
1802 ; CHECK-NEXT: .byte 8
1803 ; CHECK-NEXT: .byte 23
1804 ; CHECK-NEXT: .long 7
1805 ; CHECK-NEXT: .ascii "unknown"
1806 ; CHECK-NEXT: .byte 5
1807
253 ; CHECK-NEXT: - { amd.KernelName: test_vec_type_hint_unknown, amd.Language: OpenCL C, amd.LanguageVersion: [ 2, 0 ], amd.VecTypeHint: unknown, amd.Args:
254 ; CHECK-NEXT: - { amd.ArgSize: 4, amd.ArgAlign: 4, amd.ArgKind: 0, amd.ArgValueType: 6, amd.ArgTypeName: int, amd.ArgAccQual: 0 }
255 ; CHECK-NEXT: - { amd.ArgSize: 8, amd.ArgAlign: 8, amd.ArgKind: 7, amd.ArgValueType: 9 }
256 ; CHECK-NEXT: - { amd.ArgSize: 8, amd.ArgAlign: 8, amd.ArgKind: 8, amd.ArgValueType: 9 }
257 ; CHECK-NEXT: - { amd.ArgSize: 8, amd.ArgAlign: 8, amd.ArgKind: 9, amd.ArgValueType: 9 }
258 ; CHECK-NEXT: - { amd.ArgSize: 8, amd.ArgAlign: 8, amd.ArgKind: 11, amd.ArgValueType: 1, amd.ArgAddrQual: 1 } }
1808259 define amdgpu_kernel void @test_vec_type_hint_unknown(i32 %a) !kernel_arg_addr_space !1 !kernel_arg_access_qual !2 !kernel_arg_type !3 !kernel_arg_base_type !3 !kernel_arg_type_qual !4 !vec_type_hint !32 {
1809260 ret void
1810261 }
1811262
1812 ; CHECK-NEXT: .byte 4
1813 ; CHECK-NEXT: .byte 6
1814 ; CHECK-NEXT: .long 27
1815 ; CHECK-NEXT: .ascii "test_reqd_wgs_vec_type_hint"
1816 ; CHECK-NEXT: .byte 7
1817 ; CHECK-NEXT: .byte 9
1818 ; CHECK-NEXT: .long 4
1819 ; CHECK-NEXT: .byte 10
1820 ; CHECK-NEXT: .long 4
1821 ; CHECK-NEXT: .byte 11
1822 ; CHECK-NEXT: .long 3
1823 ; CHECK-NEXT: .ascii "int"
1824 ; CHECK-NEXT: .byte 13
1825 ; CHECK-NEXT: .byte 0
1826 ; CHECK-NEXT: .byte 14
1827 ; CHECK-NEXT: .short 6
1828 ; CHECK-NEXT: .byte 16
1829 ; CHECK-NEXT: .byte 0
1830 ; CHECK-NEXT: .byte 8
1831 ; CHECK-NEXT: .byte 7
1832 ; CHECK-NEXT: .byte 9
1833 ; CHECK-NEXT: .long 8
1834 ; CHECK-NEXT: .byte 10
1835 ; CHECK-NEXT: .long 8
1836 ; CHECK-NEXT: .byte 13
1837 ; CHECK-NEXT: .byte 7
1838 ; CHECK-NEXT: .byte 14
1839 ; CHECK-NEXT: .short 9
1840 ; CHECK-NEXT: .byte 8
1841 ; CHECK-NEXT: .byte 7
1842 ; CHECK-NEXT: .byte 9
1843 ; CHECK-NEXT: .long 8
1844 ; CHECK-NEXT: .byte 10
1845 ; CHECK-NEXT: .long 8
1846 ; CHECK-NEXT: .byte 13
1847 ; CHECK-NEXT: .byte 8
1848 ; CHECK-NEXT: .byte 14
1849 ; CHECK-NEXT: .short 9
1850 ; CHECK-NEXT: .byte 8
1851 ; CHECK-NEXT: .byte 7
1852 ; CHECK-NEXT: .byte 9
1853 ; CHECK-NEXT: .long 8
1854 ; CHECK-NEXT: .byte 10
1855 ; CHECK-NEXT: .long 8
1856 ; CHECK-NEXT: .byte 13
1857 ; CHECK-NEXT: .byte 9
1858 ; CHECK-NEXT: .byte 14
1859 ; CHECK-NEXT: .short 9
1860 ; CHECK-NEXT: .byte 8
1861 ; CHECK-NEXT: .byte 7
1862 ; CHECK-NEXT: .byte 9
1863 ; CHECK-NEXT: .long 8
1864 ; CHECK-NEXT: .byte 10
1865 ; CHECK-NEXT: .long 8
1866 ; CHECK-NEXT: .byte 13
1867 ; CHECK-NEXT: .byte 11
1868 ; CHECK-NEXT: .byte 14
1869 ; CHECK-NEXT: .short 1
1870 ; CHECK-NEXT: .byte 15
1871 ; CHECK-NEXT: .byte 1
1872 ; CHECK-NEXT: .byte 8
1873 ; CHECK-NEXT: .byte 21
1874 ; CHECK-NEXT: .long 1
1875 ; CHECK-NEXT: .long 2
1876 ; CHECK-NEXT: .long 4
1877 ; CHECK-NEXT: .byte 23
1878 ; CHECK-NEXT: .long 3
1879 ; CHECK-NEXT: .ascii "int"
1880 ; CHECK-NEXT: .byte 5
1881
263 ; CHECK-NEXT: - { amd.KernelName: test_reqd_wgs_vec_type_hint, amd.Language: OpenCL C, amd.LanguageVersion: [ 2, 0 ], amd.ReqdWorkGroupSize: [ 1, 2, 4 ], amd.VecTypeHint: int, amd.Args:
264 ; CHECK-NEXT: - { amd.ArgSize: 4, amd.ArgAlign: 4, amd.ArgKind: 0, amd.ArgValueType: 6, amd.ArgTypeName: int, amd.ArgAccQual: 0 }
265 ; CHECK-NEXT: - { amd.ArgSize: 8, amd.ArgAlign: 8, amd.ArgKind: 7, amd.ArgValueType: 9 }
266 ; CHECK-NEXT: - { amd.ArgSize: 8, amd.ArgAlign: 8, amd.ArgKind: 8, amd.ArgValueType: 9 }
267 ; CHECK-NEXT: - { amd.ArgSize: 8, amd.ArgAlign: 8, amd.ArgKind: 9, amd.ArgValueType: 9 }
268 ; CHECK-NEXT: - { amd.ArgSize: 8, amd.ArgAlign: 8, amd.ArgKind: 11, amd.ArgValueType: 1, amd.ArgAddrQual: 1 } }
1882269 define amdgpu_kernel void @test_reqd_wgs_vec_type_hint(i32 %a) !kernel_arg_addr_space !1 !kernel_arg_access_qual !2 !kernel_arg_type !3 !kernel_arg_base_type !3 !kernel_arg_type_qual !4 !vec_type_hint !5 !reqd_work_group_size !6 {
1883270 ret void
1884271 }
1885272
1886 ; CHECK-NEXT: .byte 4
1887 ; CHECK-NEXT: .byte 6
1888 ; CHECK-NEXT: .long 27
1889 ; CHECK-NEXT: .ascii "test_wgs_hint_vec_type_hint"
1890 ; CHECK-NEXT: .byte 7
1891 ; CHECK-NEXT: .byte 9
1892 ; CHECK-NEXT: .long 4
1893 ; CHECK-NEXT: .byte 10
1894 ; CHECK-NEXT: .long 4
1895 ; CHECK-NEXT: .byte 11
1896 ; CHECK-NEXT: .long 3
1897 ; CHECK-NEXT: .ascii "int"
1898 ; CHECK-NEXT: .byte 13
1899 ; CHECK-NEXT: .byte 0
1900 ; CHECK-NEXT: .byte 14
1901 ; CHECK-NEXT: .short 6
1902 ; CHECK-NEXT: .byte 16
1903 ; CHECK-NEXT: .byte 0
1904 ; CHECK-NEXT: .byte 8
1905 ; CHECK-NEXT: .byte 7
1906 ; CHECK-NEXT: .byte 9
1907 ; CHECK-NEXT: .long 8
1908 ; CHECK-NEXT: .byte 10
1909 ; CHECK-NEXT: .long 8
1910 ; CHECK-NEXT: .byte 13
1911 ; CHECK-NEXT: .byte 7
1912 ; CHECK-NEXT: .byte 14
1913 ; CHECK-NEXT: .short 9
1914 ; CHECK-NEXT: .byte 8
1915 ; CHECK-NEXT: .byte 7
1916 ; CHECK-NEXT: .byte 9
1917 ; CHECK-NEXT: .long 8
1918 ; CHECK-NEXT: .byte 10
1919 ; CHECK-NEXT: .long 8
1920 ; CHECK-NEXT: .byte 13
1921 ; CHECK-NEXT: .byte 8
1922 ; CHECK-NEXT: .byte 14
1923 ; CHECK-NEXT: .short 9
1924 ; CHECK-NEXT: .byte 8
1925 ; CHECK-NEXT: .byte 7
1926 ; CHECK-NEXT: .byte 9
1927 ; CHECK-NEXT: .long 8
1928 ; CHECK-NEXT: .byte 10
1929 ; CHECK-NEXT: .long 8
1930 ; CHECK-NEXT: .byte 13
1931 ; CHECK-NEXT: .byte 9
1932 ; CHECK-NEXT: .byte 14
1933 ; CHECK-NEXT: .short 9
1934 ; CHECK-NEXT: .byte 8
1935 ; CHECK-NEXT: .byte 7
1936 ; CHECK-NEXT: .byte 9
1937 ; CHECK-NEXT: .long 8
1938 ; CHECK-NEXT: .byte 10
1939 ; CHECK-NEXT: .long 8
1940 ; CHECK-NEXT: .byte 13
1941 ; CHECK-NEXT: .byte 11
1942 ; CHECK-NEXT: .byte 14
1943 ; CHECK-NEXT: .short 1
1944 ; CHECK-NEXT: .byte 15
1945 ; CHECK-NEXT: .byte 1
1946 ; CHECK-NEXT: .byte 8
1947 ; CHECK-NEXT: .byte 22
1948 ; CHECK-NEXT: .long 8
1949 ; CHECK-NEXT: .long 16
1950 ; CHECK-NEXT: .long 32
1951 ; CHECK-NEXT: .byte 23
1952 ; CHECK-NEXT: .long 5
1953 ; CHECK-NEXT: .ascii "uint4"
1954 ; CHECK-NEXT: .byte 5
1955
273 ; CHECK-NEXT: - { amd.KernelName: test_wgs_hint_vec_type_hint, amd.Language: OpenCL C, amd.LanguageVersion: [ 2, 0 ], amd.WorkGroupSizeHint: [ 8, 16, 32 ], amd.VecTypeHint: uint4, amd.Args:
274 ; CHECK-NEXT: - { amd.ArgSize: 4, amd.ArgAlign: 4, amd.ArgKind: 0, amd.ArgValueType: 6, amd.ArgTypeName: int, amd.ArgAccQual: 0 }
275 ; CHECK-NEXT: - { amd.ArgSize: 8, amd.ArgAlign: 8, amd.ArgKind: 7, amd.ArgValueType: 9 }
276 ; CHECK-NEXT: - { amd.ArgSize: 8, amd.ArgAlign: 8, amd.ArgKind: 8, amd.ArgValueType: 9 }
277 ; CHECK-NEXT: - { amd.ArgSize: 8, amd.ArgAlign: 8, amd.ArgKind: 9, amd.ArgValueType: 9 }
278 ; CHECK-NEXT: - { amd.ArgSize: 8, amd.ArgAlign: 8, amd.ArgKind: 11, amd.ArgValueType: 1, amd.ArgAddrQual: 1 } }
1956279 define amdgpu_kernel void @test_wgs_hint_vec_type_hint(i32 %a) !kernel_arg_addr_space !1 !kernel_arg_access_qual !2 !kernel_arg_type !3 !kernel_arg_base_type !3 !kernel_arg_type_qual !4 !vec_type_hint !7 !work_group_size_hint !8 {
1957280 ret void
1958281 }
1959282
1960 ; CHECK-NEXT: .byte 4
1961 ; CHECK-NEXT: .byte 6
1962 ; CHECK-NEXT: .long 19
1963 ; CHECK-NEXT: .ascii "test_arg_ptr_to_ptr"
1964 ; CHECK-NEXT: .byte 7
1965 ; CHECK-NEXT: .byte 9
1966 ; CHECK-NEXT: .long 8
1967 ; CHECK-NEXT: .byte 10
1968 ; CHECK-NEXT: .long 8
1969 ; CHECK-NEXT: .byte 11
1970 ; CHECK-NEXT: .long 6
1971 ; CHECK-NEXT: .ascii "int **"
1972 ; CHECK-NEXT: .byte 13
1973 ; CHECK-NEXT: .byte 1
1974 ; CHECK-NEXT: .byte 14
1975 ; CHECK-NEXT: .short 6
1976 ; CHECK-NEXT: .byte 16
1977 ; CHECK-NEXT: .byte 0
1978 ; CHECK-NEXT: .byte 15
1979 ; CHECK-NEXT: .byte 1
1980 ; CHECK-NEXT: .byte 8
1981 ; CHECK-NEXT: .byte 7
1982 ; CHECK-NEXT: .byte 9
1983 ; CHECK-NEXT: .long 8
1984 ; CHECK-NEXT: .byte 10
1985 ; CHECK-NEXT: .long 8
1986 ; CHECK-NEXT: .byte 13
1987 ; CHECK-NEXT: .byte 7
1988 ; CHECK-NEXT: .byte 14
1989 ; CHECK-NEXT: .short 9
1990 ; CHECK-NEXT: .byte 8
1991 ; CHECK-NEXT: .byte 7
1992 ; CHECK-NEXT: .byte 9
1993 ; CHECK-NEXT: .long 8
1994 ; CHECK-NEXT: .byte 10
1995 ; CHECK-NEXT: .long 8
1996 ; CHECK-NEXT: .byte 13
1997 ; CHECK-NEXT: .byte 8
1998 ; CHECK-NEXT: .byte 14
1999 ; CHECK-NEXT: .short 9
2000 ; CHECK-NEXT: .byte 8
2001 ; CHECK-NEXT: .byte 7
2002 ; CHECK-NEXT: .byte 9
2003 ; CHECK-NEXT: .long 8
2004 ; CHECK-NEXT: .byte 10
2005 ; CHECK-NEXT: .long 8
2006 ; CHECK-NEXT: .byte 13
2007 ; CHECK-NEXT: .byte 9
2008 ; CHECK-NEXT: .byte 14
2009 ; CHECK-NEXT: .short 9
2010 ; CHECK-NEXT: .byte 8
2011 ; CHECK-NEXT: .byte 7
2012 ; CHECK-NEXT: .byte 9
2013 ; CHECK-NEXT: .long 8
2014 ; CHECK-NEXT: .byte 10
2015 ; CHECK-NEXT: .long 8
2016 ; CHECK-NEXT: .byte 13
2017 ; CHECK-NEXT: .byte 11
2018 ; CHECK-NEXT: .byte 14
2019 ; CHECK-NEXT: .short 1
2020 ; CHECK-NEXT: .byte 15
2021 ; CHECK-NEXT: .byte 1
2022 ; CHECK-NEXT: .byte 8
2023 ; CHECK-NEXT: .byte 5
2024
283 ; CHECK-NEXT: - { amd.KernelName: test_arg_ptr_to_ptr, amd.Language: OpenCL C, amd.LanguageVersion: [ 2, 0 ], amd.Args:
284 ; CHECK-NEXT: - { amd.ArgSize: 8, amd.ArgAlign: 8, amd.ArgKind: 1, amd.ArgValueType: 6, amd.ArgTypeName: 'int **', amd.ArgAddrQual: 1, amd.ArgAccQual: 0 }
285 ; CHECK-NEXT: - { amd.ArgSize: 8, amd.ArgAlign: 8, amd.ArgKind: 7, amd.ArgValueType: 9 }
286 ; CHECK-NEXT: - { amd.ArgSize: 8, amd.ArgAlign: 8, amd.ArgKind: 8, amd.ArgValueType: 9 }
287 ; CHECK-NEXT: - { amd.ArgSize: 8, amd.ArgAlign: 8, amd.ArgKind: 9, amd.ArgValueType: 9 }
288 ; CHECK-NEXT: - { amd.ArgSize: 8, amd.ArgAlign: 8, amd.ArgKind: 11, amd.ArgValueType: 1, amd.ArgAddrQual: 1 } }
2025289 define amdgpu_kernel void @test_arg_ptr_to_ptr(i32 * addrspace(1)* %a) !kernel_arg_addr_space !81 !kernel_arg_access_qual !2 !kernel_arg_type !80 !kernel_arg_base_type !80 !kernel_arg_type_qual !4 {
2026290 ret void
2027291 }
2028
2029 ; CHECK-NEXT: .byte 4
2030 ; CHECK-NEXT: .byte 6
2031 ; CHECK-NEXT: .long 28
2032 ; CHECK-NEXT: .ascii "test_arg_struct_contains_ptr"
2033 ; CHECK-NEXT: .byte 7
2034 ; CHECK-NEXT: .byte 9
2035 ; CHECK-NEXT: .long 4
2036 ; CHECK-NEXT: .byte 10
2037 ; CHECK-NEXT: .long 4
2038 ; CHECK-NEXT: .byte 11
2039 ; CHECK-NEXT: .long 8
2040 ; CHECK-NEXT: .ascii "struct B"
2041 ; CHECK-NEXT: .byte 13
2042 ; CHECK-NEXT: .byte 1
2043 ; CHECK-NEXT: .byte 14
2044 ; CHECK-NEXT: .short 0
2045 ; CHECK-NEXT: .byte 16
2046 ; CHECK-NEXT: .byte 0
2047 ; CHECK-NEXT: .byte 15
2048 ; CHECK-NEXT: .byte 0
2049 ; CHECK-NEXT: .byte 8
2050 ; CHECK-NEXT: .byte 7
2051 ; CHECK-NEXT: .byte 9
2052 ; CHECK-NEXT: .long 8
2053 ; CHECK-NEXT: .byte 10
2054 ; CHECK-NEXT: .long 8
2055 ; CHECK-NEXT: .byte 13
2056 ; CHECK-NEXT: .byte 7
2057 ; CHECK-NEXT: .byte 14
2058 ; CHECK-NEXT: .short 9
2059 ; CHECK-NEXT: .byte 8
2060 ; CHECK-NEXT: .byte 7
2061 ; CHECK-NEXT: .byte 9
2062 ; CHECK-NEXT: .long 8
2063 ; CHECK-NEXT: .byte 10
2064 ; CHECK-NEXT: .long 8
2065 ; CHECK-NEXT: .byte 13
2066 ; CHECK-NEXT: .byte 8
2067 ; CHECK-NEXT: .byte 14
2068 ; CHECK-NEXT: .short 9
2069 ; CHECK-NEXT: .byte 8
2070 ; CHECK-NEXT: .byte 7
2071 ; CHECK-NEXT: .byte 9
2072 ; CHECK-NEXT: .long 8
2073 ; CHECK-NEXT: .byte 10
2074 ; CHECK-NEXT: .long 8
2075 ; CHECK-NEXT: .byte 13
2076 ; CHECK-NEXT: .byte 9
2077 ; CHECK-NEXT: .byte 14
2078 ; CHECK-NEXT: .short 9
2079 ; CHECK-NEXT: .byte 8
2080 ; CHECK-NEXT: .byte 7
2081 ; CHECK-NEXT: .byte 9
2082 ; CHECK-NEXT: .long 8
2083 ; CHECK-NEXT: .byte 10
2084 ; CHECK-NEXT: .long 8
2085 ; CHECK-NEXT: .byte 13
2086 ; CHECK-NEXT: .byte 11
2087 ; CHECK-NEXT: .byte 14
2088 ; CHECK-NEXT: .short 1
2089 ; CHECK-NEXT: .byte 15
2090 ; CHECK-NEXT: .byte 1
2091 ; CHECK-NEXT: .byte 8
2092 ; CHECK-NEXT: .byte 5
2093
292 ; CHECK-NEXT: - { amd.KernelName: test_arg_struct_contains_ptr, amd.Language: OpenCL C, amd.LanguageVersion: [ 2, 0 ], amd.Args:
293 ; CHECK-NEXT: - { amd.ArgSize: 4, amd.ArgAlign: 4, amd.ArgKind: 1, amd.ArgValueType: 0, amd.ArgTypeName: struct B, amd.ArgAddrQual: 0, amd.ArgAccQual: 0 }
294 ; CHECK-NEXT: - { amd.ArgSize: 8, amd.ArgAlign: 8, amd.ArgKind: 7, amd.ArgValueType: 9 }
295 ; CHECK-NEXT: - { amd.ArgSize: 8, amd.ArgAlign: 8, amd.ArgKind: 8, amd.ArgValueType: 9 }
296 ; CHECK-NEXT: - { amd.ArgSize: 8, amd.ArgAlign: 8, amd.ArgKind: 9, amd.ArgValueType: 9 }
297 ; CHECK-NEXT: - { amd.ArgSize: 8, amd.ArgAlign: 8, amd.ArgKind: 11, amd.ArgValueType: 1, amd.ArgAddrQual: 1 } }
2094298 define amdgpu_kernel void @test_arg_struct_contains_ptr(%struct.B * byval %a) !kernel_arg_addr_space !1 !kernel_arg_access_qual !2 !kernel_arg_type !82 !kernel_arg_base_type !82 !kernel_arg_type_qual !4 {
2095299 ret void
2096300 }
2097301
2098 ; CHECK-NEXT: .byte 4
2099 ; CHECK-NEXT: .byte 6
2100 ; CHECK-NEXT: .long 22
2101 ; CHECK-NEXT: .ascii "test_arg_vector_of_ptr"
2102 ; CHECK-NEXT: .byte 7
2103 ; CHECK-NEXT: .byte 9
2104 ; CHECK-NEXT: .long 16
2105 ; CHECK-NEXT: .byte 10
2106 ; CHECK-NEXT: .long 16
2107 ; CHECK-NEXT: .byte 11
2108 ; CHECK-NEXT: .long 47
2109 ; CHECK-NEXT: .ascii "global int* __attribute__((ext_vector_type(2)))"
2110 ; CHECK-NEXT: .byte 13
2111 ; CHECK-NEXT: .byte 0
2112 ; CHECK-NEXT: .byte 14
2113 ; CHECK-NEXT: .short 6
2114 ; CHECK-NEXT: .byte 16
2115 ; CHECK-NEXT: .byte 0
2116 ; CHECK-NEXT: .byte 8
2117 ; CHECK-NEXT: .byte 7
2118 ; CHECK-NEXT: .byte 9
2119 ; CHECK-NEXT: .long 8
2120 ; CHECK-NEXT: .byte 10
2121 ; CHECK-NEXT: .long 8
2122 ; CHECK-NEXT: .byte 13
2123 ; CHECK-NEXT: .byte 7
2124 ; CHECK-NEXT: .byte 14
2125 ; CHECK-NEXT: .short 9
2126 ; CHECK-NEXT: .byte 8
2127 ; CHECK-NEXT: .byte 7
2128 ; CHECK-NEXT: .byte 9
2129 ; CHECK-NEXT: .long 8
2130 ; CHECK-NEXT: .byte 10
2131 ; CHECK-NEXT: .long 8
2132 ; CHECK-NEXT: .byte 13
2133 ; CHECK-NEXT: .byte 8
2134 ; CHECK-NEXT: .byte 14
2135 ; CHECK-NEXT: .short 9
2136 ; CHECK-NEXT: .byte 8
2137 ; CHECK-NEXT: .byte 7
2138 ; CHECK-NEXT: .byte 9
2139 ; CHECK-NEXT: .long 8
2140 ; CHECK-NEXT: .byte 10
2141 ; CHECK-NEXT: .long 8
2142 ; CHECK-NEXT: .byte 13
2143 ; CHECK-NEXT: .byte 9
2144 ; CHECK-NEXT: .byte 14
2145 ; CHECK-NEXT: .short 9
2146 ; CHECK-NEXT: .byte 8
2147 ; CHECK-NEXT: .byte 7
2148 ; CHECK-NEXT: .byte 9
2149 ; CHECK-NEXT: .long 8
2150 ; CHECK-NEXT: .byte 10
2151 ; CHECK-NEXT: .long 8
2152 ; CHECK-NEXT: .byte 13
2153 ; CHECK-NEXT: .byte 11
2154 ; CHECK-NEXT: .byte 14
2155 ; CHECK-NEXT: .short 1
2156 ; CHECK-NEXT: .byte 15
2157 ; CHECK-NEXT: .byte 1
2158 ; CHECK-NEXT: .byte 8
2159 ; CHECK-NEXT: .byte 5
2160
302 ; CHECK-NEXT: - { amd.KernelName: test_arg_vector_of_ptr, amd.Language: OpenCL C, amd.LanguageVersion: [ 2, 0 ], amd.Args:
303 ; CHECK-NEXT: - { amd.ArgSize: 16, amd.ArgAlign: 16, amd.ArgKind: 0, amd.ArgValueType: 6, amd.ArgTypeName: 'global int* __attribute__((ext_vector_type(2)))', amd.ArgAccQual: 0 }
304 ; CHECK-NEXT: - { amd.ArgSize: 8, amd.ArgAlign: 8, amd.ArgKind: 7, amd.ArgValueType: 9 }
305 ; CHECK-NEXT: - { amd.ArgSize: 8, amd.ArgAlign: 8, amd.ArgKind: 8, amd.ArgValueType: 9 }
306 ; CHECK-NEXT: - { amd.ArgSize: 8, amd.ArgAlign: 8, amd.ArgKind: 9, amd.ArgValueType: 9 }
307 ; CHECK-NEXT: - { amd.ArgSize: 8, amd.ArgAlign: 8, amd.ArgKind: 11, amd.ArgValueType: 1, amd.ArgAddrQual: 1 } }
2161308 define amdgpu_kernel void @test_arg_vector_of_ptr(<2 x i32 addrspace(1)*> %a) !kernel_arg_addr_space !1 !kernel_arg_access_qual !2 !kernel_arg_type !83 !kernel_arg_base_type !83 !kernel_arg_type_qual !4 {
2162309 ret void
2163310 }
2164311
2165 ; CHECK-NEXT: .byte 4
2166 ; CHECK-NEXT: .byte 6
2167 ; CHECK-NEXT: .long 29
2168 ; CHECK-NEXT: .ascii "test_arg_unknown_builtin_type"
2169 ; CHECK-NEXT: .byte 7
2170 ; CHECK-NEXT: .byte 9
2171 ; CHECK-NEXT: .long 8
2172 ; CHECK-NEXT: .byte 10
2173 ; CHECK-NEXT: .long 8
2174 ; CHECK-NEXT: .byte 11
2175 ; CHECK-NEXT: .long 11
2176 ; CHECK-NEXT: .ascii "clk_event_t"
2177 ; CHECK-NEXT: .byte 13
2178 ; CHECK-NEXT: .byte 1
2179 ; CHECK-NEXT: .byte 14
2180 ; CHECK-NEXT: .short 0
2181 ; CHECK-NEXT: .byte 16
2182 ; CHECK-NEXT: .byte 0
2183 ; CHECK-NEXT: .byte 15
2184 ; CHECK-NEXT: .byte 1
2185 ; CHECK-NEXT: .byte 8
2186 ; CHECK-NEXT: .byte 7
2187 ; CHECK-NEXT: .byte 9
2188 ; CHECK-NEXT: .long 8
2189 ; CHECK-NEXT: .byte 10
2190 ; CHECK-NEXT: .long 8
2191 ; CHECK-NEXT: .byte 13
2192 ; CHECK-NEXT: .byte 7
2193 ; CHECK-NEXT: .byte 14
2194 ; CHECK-NEXT: .short 9
2195 ; CHECK-NEXT: .byte 8
2196 ; CHECK-NEXT: .byte 7
2197 ; CHECK-NEXT: .byte 9
2198 ; CHECK-NEXT: .long 8
2199 ; CHECK-NEXT: .byte 10
2200 ; CHECK-NEXT: .long 8
2201 ; CHECK-NEXT: .byte 13
2202 ; CHECK-NEXT: .byte 8
2203 ; CHECK-NEXT: .byte 14
2204 ; CHECK-NEXT: .short 9
2205 ; CHECK-NEXT: .byte 8
2206 ; CHECK-NEXT: .byte 7
2207 ; CHECK-NEXT: .byte 9
2208 ; CHECK-NEXT: .long 8
2209 ; CHECK-NEXT: .byte 10
2210 ; CHECK-NEXT: .long 8
2211 ; CHECK-NEXT: .byte 13
2212 ; CHECK-NEXT: .byte 9
2213 ; CHECK-NEXT: .byte 14
2214 ; CHECK-NEXT: .short 9
2215 ; CHECK-NEXT: .byte 8
2216 ; CHECK-NEXT: .byte 7
2217 ; CHECK-NEXT: .byte 9
2218 ; CHECK-NEXT: .long 8
2219 ; CHECK-NEXT: .byte 10
2220 ; CHECK-NEXT: .long 8
2221 ; CHECK-NEXT: .byte 13
2222 ; CHECK-NEXT: .byte 11
2223 ; CHECK-NEXT: .byte 14
2224 ; CHECK-NEXT: .short 1
2225 ; CHECK-NEXT: .byte 15
2226 ; CHECK-NEXT: .byte 1
2227 ; CHECK-NEXT: .byte 8
2228 ; CHECK-NEXT: .byte 5
2229
2230
312
313 ; CHECK-NEXT: - { amd.KernelName: test_arg_unknown_builtin_type, amd.Language: OpenCL C, amd.LanguageVersion: [ 2, 0 ], amd.Args:
314 ; CHECK-NEXT: - { amd.ArgSize: 8, amd.ArgAlign: 8, amd.ArgKind: 1, amd.ArgValueType: 0, amd.ArgTypeName: clk_event_t, amd.ArgAddrQual: 1, amd.ArgAccQual: 0 }
315 ; CHECK-NEXT: - { amd.ArgSize: 8, amd.ArgAlign: 8, amd.ArgKind: 7, amd.ArgValueType: 9 }
316 ; CHECK-NEXT: - { amd.ArgSize: 8, amd.ArgAlign: 8, amd.ArgKind: 8, amd.ArgValueType: 9 }
317 ; CHECK-NEXT: - { amd.ArgSize: 8, amd.ArgAlign: 8, amd.ArgKind: 9, amd.ArgValueType: 9 }
318 ; CHECK-NEXT: - { amd.ArgSize: 8, amd.ArgAlign: 8, amd.ArgKind: 11, amd.ArgValueType: 1, amd.ArgAddrQual: 1 } }
2231319 define amdgpu_kernel void @test_arg_unknown_builtin_type(%opencl.clk_event_t addrspace(1)* %a) !kernel_arg_addr_space !81 !kernel_arg_access_qual !2 !kernel_arg_type !84 !kernel_arg_base_type !84 !kernel_arg_type_qual !4 {
2232320 ret void
2233321 }
2234322
2235 ; CHECK-NEXT: .byte 4
2236 ; CHECK-NEXT: .byte 6
2237 ; CHECK-NEXT: .long 18
2238 ; CHECK-NEXT: .ascii "test_pointee_align"
2239 ; CHECK-NEXT: .byte 7
2240 ; CHECK-NEXT: .byte 9
2241 ; CHECK-NEXT: .long 8
2242 ; CHECK-NEXT: .byte 10
2243 ; CHECK-NEXT: .long 8
2244 ; CHECK-NEXT: .byte 11
2245 ; CHECK-NEXT: .long 6
2246 ; CHECK-NEXT: .ascii "long *"
2247 ; CHECK-NEXT: .byte 13
2248 ; CHECK-NEXT: .byte 1
2249 ; CHECK-NEXT: .byte 14
2250 ; CHECK-NEXT: .short 9
2251 ; CHECK-NEXT: .byte 16
2252 ; CHECK-NEXT: .byte 0
2253 ; CHECK-NEXT: .byte 15
2254 ; CHECK-NEXT: .byte 1
2255 ; CHECK-NEXT: .byte 8
2256 ; CHECK-NEXT: .byte 7
2257 ; CHECK-NEXT: .byte 9
2258 ; CHECK-NEXT: .long 4
2259 ; CHECK-NEXT: .byte 10
2260 ; CHECK-NEXT: .long 4
2261 ; CHECK-NEXT: .byte 32
2262 ; CHECK-NEXT: .long 1
2263 ; CHECK-NEXT: .byte 11
2264 ; CHECK-NEXT: .long 6
2265 ; CHECK-NEXT: .ascii "char *"
2266 ; CHECK-NEXT: .byte 13
2267 ; CHECK-NEXT: .byte 2
2268 ; CHECK-NEXT: .byte 14
2269 ; CHECK-NEXT: .short 1
2270 ; CHECK-NEXT: .byte 16
2271 ; CHECK-NEXT: .byte 0
2272 ; CHECK-NEXT: .byte 15
2273 ; CHECK-NEXT: .byte 3
2274 ; CHECK-NEXT: .byte 8
2275 ; CHECK-NEXT: .byte 7
2276 ; CHECK-NEXT: .byte 9
2277 ; CHECK-NEXT: .long 4
2278 ; CHECK-NEXT: .byte 10
2279 ; CHECK-NEXT: .long 4
2280 ; CHECK-NEXT: .byte 32
2281 ; CHECK-NEXT: .long 2
2282 ; CHECK-NEXT: .byte 11
2283 ; CHECK-NEXT: .long 7
2284 ; CHECK-NEXT: .ascii "char2 *"
2285 ; CHECK-NEXT: .byte 13
2286 ; CHECK-NEXT: .byte 2
2287 ; CHECK-NEXT: .byte 14
2288 ; CHECK-NEXT: .short 1
2289 ; CHECK-NEXT: .byte 16
2290 ; CHECK-NEXT: .byte 0
2291 ; CHECK-NEXT: .byte 15
2292 ; CHECK-NEXT: .byte 3
2293 ; CHECK-NEXT: .byte 8
2294 ; CHECK-NEXT: .byte 7
2295 ; CHECK-NEXT: .byte 9
2296 ; CHECK-NEXT: .long 4
2297 ; CHECK-NEXT: .byte 10
2298 ; CHECK-NEXT: .long 4
2299 ; CHECK-NEXT: .byte 32
2300 ; CHECK-NEXT: .long 4
2301 ; CHECK-NEXT: .byte 11
2302 ; CHECK-NEXT: .long 7
2303 ; CHECK-NEXT: .ascii "char3 *"
2304 ; CHECK-NEXT: .byte 13
2305 ; CHECK-NEXT: .byte 2
2306 ; CHECK-NEXT: .byte 14
2307 ; CHECK-NEXT: .short 1
2308 ; CHECK-NEXT: .byte 16
2309 ; CHECK-NEXT: .byte 0
2310 ; CHECK-NEXT: .byte 15
2311 ; CHECK-NEXT: .byte 3
2312 ; CHECK-NEXT: .byte 8
2313 ; CHECK-NEXT: .byte 7
2314 ; CHECK-NEXT: .byte 9
2315 ; CHECK-NEXT: .long 4
2316 ; CHECK-NEXT: .byte 10
2317 ; CHECK-NEXT: .long 4
2318 ; CHECK-NEXT: .byte 32
2319 ; CHECK-NEXT: .long 4
2320 ; CHECK-NEXT: .byte 11
2321 ; CHECK-NEXT: .long