Bug Summary

File:build/llvm-toolchain-snapshot-16~++20221003111214+1fa2019828ca/build-llvm/tools/clang/stage2-bins/tools/mlir/include/mlir/Dialect/SPIRV/IR/SPIRVAttributes.cpp.inc
Warning:line 2002, column 5
Value stored to '_firstPrinted' is never read

Annotated Source Code

Press '?' to see keyboard shortcuts

clang -cc1 -cc1 -triple x86_64-pc-linux-gnu -analyze -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name SPIRVAttributes.cpp -analyzer-checker=core -analyzer-checker=apiModeling -analyzer-checker=unix -analyzer-checker=deadcode -analyzer-checker=cplusplus -analyzer-checker=security.insecureAPI.UncheckedReturn -analyzer-checker=security.insecureAPI.getpw -analyzer-checker=security.insecureAPI.gets -analyzer-checker=security.insecureAPI.mktemp -analyzer-checker=security.insecureAPI.mkstemp -analyzer-checker=security.insecureAPI.vfork -analyzer-checker=nullability.NullPassedToNonnull -analyzer-checker=nullability.NullReturnedFromNonnull -analyzer-output plist -w -setup-static-analyzer -analyzer-config-compatibility-mode=true -mrelocation-model pic -pic-level 2 -mframe-pointer=none -fmath-errno -ffp-contract=on -fno-rounding-math -mconstructor-aliases -funwind-tables=2 -target-cpu x86-64 -tune-cpu generic -debugger-tuning=gdb -ffunction-sections -fdata-sections -fcoverage-compilation-dir=/build/llvm-toolchain-snapshot-16~++20221003111214+1fa2019828ca/build-llvm/tools/clang/stage2-bins -resource-dir /usr/lib/llvm-16/lib/clang/16.0.0 -D MLIR_CUDA_CONVERSIONS_ENABLED=1 -D MLIR_ROCM_CONVERSIONS_ENABLED=1 -D _DEBUG -D _GNU_SOURCE -D __STDC_CONSTANT_MACROS -D __STDC_FORMAT_MACROS -D __STDC_LIMIT_MACROS -I tools/mlir/lib/Dialect/SPIRV/IR -I /build/llvm-toolchain-snapshot-16~++20221003111214+1fa2019828ca/mlir/lib/Dialect/SPIRV/IR -I include -I /build/llvm-toolchain-snapshot-16~++20221003111214+1fa2019828ca/llvm/include -I /build/llvm-toolchain-snapshot-16~++20221003111214+1fa2019828ca/mlir/include -I tools/mlir/include -D _FORTIFY_SOURCE=2 -D NDEBUG -U NDEBUG -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10 -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/10/../../../../include/x86_64-linux-gnu/c++/10 -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/backward -internal-isystem /usr/lib/llvm-16/lib/clang/16.0.0/include -internal-isystem /usr/local/include -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/10/../../../../x86_64-linux-gnu/include -internal-externc-isystem /usr/include/x86_64-linux-gnu -internal-externc-isystem /include -internal-externc-isystem /usr/include -fmacro-prefix-map=/build/llvm-toolchain-snapshot-16~++20221003111214+1fa2019828ca/build-llvm/tools/clang/stage2-bins=build-llvm/tools/clang/stage2-bins -fmacro-prefix-map=/build/llvm-toolchain-snapshot-16~++20221003111214+1fa2019828ca/= -fcoverage-prefix-map=/build/llvm-toolchain-snapshot-16~++20221003111214+1fa2019828ca/build-llvm/tools/clang/stage2-bins=build-llvm/tools/clang/stage2-bins -fcoverage-prefix-map=/build/llvm-toolchain-snapshot-16~++20221003111214+1fa2019828ca/= -O2 -Wno-unused-command-line-argument -Wno-unused-parameter -Wwrite-strings -Wno-missing-field-initializers -Wno-long-long -Wno-maybe-uninitialized -Wno-class-memaccess -Wno-redundant-move -Wno-pessimizing-move -Wno-noexcept-type -Wno-comment -Wno-misleading-indentation -std=c++17 -fdeprecated-macro -fdebug-compilation-dir=/build/llvm-toolchain-snapshot-16~++20221003111214+1fa2019828ca/build-llvm/tools/clang/stage2-bins -fdebug-prefix-map=/build/llvm-toolchain-snapshot-16~++20221003111214+1fa2019828ca/build-llvm/tools/clang/stage2-bins=build-llvm/tools/clang/stage2-bins -fdebug-prefix-map=/build/llvm-toolchain-snapshot-16~++20221003111214+1fa2019828ca/= -ferror-limit 19 -fvisibility-inlines-hidden -stack-protector 2 -fgnuc-version=4.2.1 -fcolor-diagnostics -vectorize-loops -vectorize-slp -analyzer-output=html -analyzer-config stable-report-filename=true -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o /tmp/scan-build-2022-10-03-140002-15933-1 -x c++ /build/llvm-toolchain-snapshot-16~++20221003111214+1fa2019828ca/mlir/lib/Dialect/SPIRV/IR/SPIRVAttributes.cpp
1/*===- TableGen'erated file -------------------------------------*- C++ -*-===*\
2|* *|
3|* AttrDef Definitions *|
4|* *|
5|* Automatically generated file, do not edit! *|
6|* *|
7\*===----------------------------------------------------------------------===*/
8
9#ifdef GET_ATTRDEF_LIST
10#undef GET_ATTRDEF_LIST
11
12::mlir::spirv::AddressingModelAttr,
13::mlir::spirv::ImageArrayedInfoAttr,
14::mlir::spirv::BuiltInAttr,
15::mlir::spirv::CapabilityAttr,
16::mlir::spirv::CooperativeMatrixPropertiesNVAttr,
17::mlir::spirv::DecorationAttr,
18::mlir::spirv::ImageDepthInfoAttr,
19::mlir::spirv::DeviceTypeAttr,
20::mlir::spirv::DimAttr,
21::mlir::spirv::EntryPointABIAttr,
22::mlir::spirv::ExecutionModeAttr,
23::mlir::spirv::ExecutionModelAttr,
24::mlir::spirv::ExtensionAttr,
25::mlir::spirv::FunctionControlAttr,
26::mlir::spirv::GroupOperationAttr,
27::mlir::spirv::ImageFormatAttr,
28::mlir::spirv::ImageOperandsAttr,
29::mlir::spirv::JointMatrixPropertiesINTELAttr,
30::mlir::spirv::LinkageTypeAttr,
31::mlir::spirv::LoopControlAttr,
32::mlir::spirv::MatrixLayoutAttr,
33::mlir::spirv::MemoryAccessAttr,
34::mlir::spirv::MemoryModelAttr,
35::mlir::spirv::MemorySemanticsAttr,
36::mlir::spirv::OpcodeAttr,
37::mlir::spirv::ResourceLimitsAttr,
38::mlir::spirv::ImageSamplerUseInfoAttr,
39::mlir::spirv::ImageSamplingInfoAttr,
40::mlir::spirv::ScopeAttr,
41::mlir::spirv::SelectionControlAttr,
42::mlir::spirv::StorageClassAttr,
43::mlir::spirv::VendorAttr,
44::mlir::spirv::VersionAttr
45
46#endif // GET_ATTRDEF_LIST
47
48#ifdef GET_ATTRDEF_CLASSES
49#undef GET_ATTRDEF_CLASSES
50
51static ::mlir::OptionalParseResult generatedAttributeParser(::mlir::AsmParser &parser, ::llvm::StringRef *mnemonic, ::mlir::Type type, ::mlir::Attribute &value) {
52 return ::mlir::AsmParser::KeywordSwitch<::mlir::OptionalParseResult>(parser)
53 .Case(::mlir::spirv::AddressingModelAttr::getMnemonic(), [&](llvm::StringRef, llvm::SMLoc) {
54 value = ::mlir::spirv::AddressingModelAttr::parse(parser, type);
55 return ::mlir::success(!!value);
56 })
57 .Case(::mlir::spirv::ImageArrayedInfoAttr::getMnemonic(), [&](llvm::StringRef, llvm::SMLoc) {
58 value = ::mlir::spirv::ImageArrayedInfoAttr::parse(parser, type);
59 return ::mlir::success(!!value);
60 })
61 .Case(::mlir::spirv::BuiltInAttr::getMnemonic(), [&](llvm::StringRef, llvm::SMLoc) {
62 value = ::mlir::spirv::BuiltInAttr::parse(parser, type);
63 return ::mlir::success(!!value);
64 })
65 .Case(::mlir::spirv::CapabilityAttr::getMnemonic(), [&](llvm::StringRef, llvm::SMLoc) {
66 value = ::mlir::spirv::CapabilityAttr::parse(parser, type);
67 return ::mlir::success(!!value);
68 })
69 .Case(::mlir::spirv::CooperativeMatrixPropertiesNVAttr::getMnemonic(), [&](llvm::StringRef, llvm::SMLoc) {
70 value = ::mlir::spirv::CooperativeMatrixPropertiesNVAttr::parse(parser, type);
71 return ::mlir::success(!!value);
72 })
73 .Case(::mlir::spirv::DecorationAttr::getMnemonic(), [&](llvm::StringRef, llvm::SMLoc) {
74 value = ::mlir::spirv::DecorationAttr::parse(parser, type);
75 return ::mlir::success(!!value);
76 })
77 .Case(::mlir::spirv::ImageDepthInfoAttr::getMnemonic(), [&](llvm::StringRef, llvm::SMLoc) {
78 value = ::mlir::spirv::ImageDepthInfoAttr::parse(parser, type);
79 return ::mlir::success(!!value);
80 })
81 .Case(::mlir::spirv::DeviceTypeAttr::getMnemonic(), [&](llvm::StringRef, llvm::SMLoc) {
82 value = ::mlir::spirv::DeviceTypeAttr::parse(parser, type);
83 return ::mlir::success(!!value);
84 })
85 .Case(::mlir::spirv::DimAttr::getMnemonic(), [&](llvm::StringRef, llvm::SMLoc) {
86 value = ::mlir::spirv::DimAttr::parse(parser, type);
87 return ::mlir::success(!!value);
88 })
89 .Case(::mlir::spirv::EntryPointABIAttr::getMnemonic(), [&](llvm::StringRef, llvm::SMLoc) {
90 value = ::mlir::spirv::EntryPointABIAttr::parse(parser, type);
91 return ::mlir::success(!!value);
92 })
93 .Case(::mlir::spirv::ExecutionModeAttr::getMnemonic(), [&](llvm::StringRef, llvm::SMLoc) {
94 value = ::mlir::spirv::ExecutionModeAttr::parse(parser, type);
95 return ::mlir::success(!!value);
96 })
97 .Case(::mlir::spirv::ExecutionModelAttr::getMnemonic(), [&](llvm::StringRef, llvm::SMLoc) {
98 value = ::mlir::spirv::ExecutionModelAttr::parse(parser, type);
99 return ::mlir::success(!!value);
100 })
101 .Case(::mlir::spirv::ExtensionAttr::getMnemonic(), [&](llvm::StringRef, llvm::SMLoc) {
102 value = ::mlir::spirv::ExtensionAttr::parse(parser, type);
103 return ::mlir::success(!!value);
104 })
105 .Case(::mlir::spirv::FunctionControlAttr::getMnemonic(), [&](llvm::StringRef, llvm::SMLoc) {
106 value = ::mlir::spirv::FunctionControlAttr::parse(parser, type);
107 return ::mlir::success(!!value);
108 })
109 .Case(::mlir::spirv::GroupOperationAttr::getMnemonic(), [&](llvm::StringRef, llvm::SMLoc) {
110 value = ::mlir::spirv::GroupOperationAttr::parse(parser, type);
111 return ::mlir::success(!!value);
112 })
113 .Case(::mlir::spirv::ImageFormatAttr::getMnemonic(), [&](llvm::StringRef, llvm::SMLoc) {
114 value = ::mlir::spirv::ImageFormatAttr::parse(parser, type);
115 return ::mlir::success(!!value);
116 })
117 .Case(::mlir::spirv::ImageOperandsAttr::getMnemonic(), [&](llvm::StringRef, llvm::SMLoc) {
118 value = ::mlir::spirv::ImageOperandsAttr::parse(parser, type);
119 return ::mlir::success(!!value);
120 })
121 .Case(::mlir::spirv::JointMatrixPropertiesINTELAttr::getMnemonic(), [&](llvm::StringRef, llvm::SMLoc) {
122 value = ::mlir::spirv::JointMatrixPropertiesINTELAttr::parse(parser, type);
123 return ::mlir::success(!!value);
124 })
125 .Case(::mlir::spirv::LinkageTypeAttr::getMnemonic(), [&](llvm::StringRef, llvm::SMLoc) {
126 value = ::mlir::spirv::LinkageTypeAttr::parse(parser, type);
127 return ::mlir::success(!!value);
128 })
129 .Case(::mlir::spirv::LoopControlAttr::getMnemonic(), [&](llvm::StringRef, llvm::SMLoc) {
130 value = ::mlir::spirv::LoopControlAttr::parse(parser, type);
131 return ::mlir::success(!!value);
132 })
133 .Case(::mlir::spirv::MatrixLayoutAttr::getMnemonic(), [&](llvm::StringRef, llvm::SMLoc) {
134 value = ::mlir::spirv::MatrixLayoutAttr::parse(parser, type);
135 return ::mlir::success(!!value);
136 })
137 .Case(::mlir::spirv::MemoryAccessAttr::getMnemonic(), [&](llvm::StringRef, llvm::SMLoc) {
138 value = ::mlir::spirv::MemoryAccessAttr::parse(parser, type);
139 return ::mlir::success(!!value);
140 })
141 .Case(::mlir::spirv::MemoryModelAttr::getMnemonic(), [&](llvm::StringRef, llvm::SMLoc) {
142 value = ::mlir::spirv::MemoryModelAttr::parse(parser, type);
143 return ::mlir::success(!!value);
144 })
145 .Case(::mlir::spirv::MemorySemanticsAttr::getMnemonic(), [&](llvm::StringRef, llvm::SMLoc) {
146 value = ::mlir::spirv::MemorySemanticsAttr::parse(parser, type);
147 return ::mlir::success(!!value);
148 })
149 .Case(::mlir::spirv::OpcodeAttr::getMnemonic(), [&](llvm::StringRef, llvm::SMLoc) {
150 value = ::mlir::spirv::OpcodeAttr::parse(parser, type);
151 return ::mlir::success(!!value);
152 })
153 .Case(::mlir::spirv::ResourceLimitsAttr::getMnemonic(), [&](llvm::StringRef, llvm::SMLoc) {
154 value = ::mlir::spirv::ResourceLimitsAttr::parse(parser, type);
155 return ::mlir::success(!!value);
156 })
157 .Case(::mlir::spirv::ImageSamplerUseInfoAttr::getMnemonic(), [&](llvm::StringRef, llvm::SMLoc) {
158 value = ::mlir::spirv::ImageSamplerUseInfoAttr::parse(parser, type);
159 return ::mlir::success(!!value);
160 })
161 .Case(::mlir::spirv::ImageSamplingInfoAttr::getMnemonic(), [&](llvm::StringRef, llvm::SMLoc) {
162 value = ::mlir::spirv::ImageSamplingInfoAttr::parse(parser, type);
163 return ::mlir::success(!!value);
164 })
165 .Case(::mlir::spirv::ScopeAttr::getMnemonic(), [&](llvm::StringRef, llvm::SMLoc) {
166 value = ::mlir::spirv::ScopeAttr::parse(parser, type);
167 return ::mlir::success(!!value);
168 })
169 .Case(::mlir::spirv::SelectionControlAttr::getMnemonic(), [&](llvm::StringRef, llvm::SMLoc) {
170 value = ::mlir::spirv::SelectionControlAttr::parse(parser, type);
171 return ::mlir::success(!!value);
172 })
173 .Case(::mlir::spirv::StorageClassAttr::getMnemonic(), [&](llvm::StringRef, llvm::SMLoc) {
174 value = ::mlir::spirv::StorageClassAttr::parse(parser, type);
175 return ::mlir::success(!!value);
176 })
177 .Case(::mlir::spirv::VendorAttr::getMnemonic(), [&](llvm::StringRef, llvm::SMLoc) {
178 value = ::mlir::spirv::VendorAttr::parse(parser, type);
179 return ::mlir::success(!!value);
180 })
181 .Case(::mlir::spirv::VersionAttr::getMnemonic(), [&](llvm::StringRef, llvm::SMLoc) {
182 value = ::mlir::spirv::VersionAttr::parse(parser, type);
183 return ::mlir::success(!!value);
184 })
185 .Default([&](llvm::StringRef keyword, llvm::SMLoc) {
186 *mnemonic = keyword;
187 return llvm::None;
188 });
189}
190
191static ::mlir::LogicalResult generatedAttributePrinter(::mlir::Attribute def, ::mlir::AsmPrinter &printer) {
192 return ::llvm::TypeSwitch<::mlir::Attribute, ::mlir::LogicalResult>(def) .Case<::mlir::spirv::AddressingModelAttr>([&](auto t) {
193 printer << ::mlir::spirv::AddressingModelAttr::getMnemonic();
194t.print(printer);
195 return ::mlir::success();
196 })
197 .Case<::mlir::spirv::ImageArrayedInfoAttr>([&](auto t) {
198 printer << ::mlir::spirv::ImageArrayedInfoAttr::getMnemonic();
199t.print(printer);
200 return ::mlir::success();
201 })
202 .Case<::mlir::spirv::BuiltInAttr>([&](auto t) {
203 printer << ::mlir::spirv::BuiltInAttr::getMnemonic();
204t.print(printer);
205 return ::mlir::success();
206 })
207 .Case<::mlir::spirv::CapabilityAttr>([&](auto t) {
208 printer << ::mlir::spirv::CapabilityAttr::getMnemonic();
209t.print(printer);
210 return ::mlir::success();
211 })
212 .Case<::mlir::spirv::CooperativeMatrixPropertiesNVAttr>([&](auto t) {
213 printer << ::mlir::spirv::CooperativeMatrixPropertiesNVAttr::getMnemonic();
214t.print(printer);
215 return ::mlir::success();
216 })
217 .Case<::mlir::spirv::DecorationAttr>([&](auto t) {
218 printer << ::mlir::spirv::DecorationAttr::getMnemonic();
219t.print(printer);
220 return ::mlir::success();
221 })
222 .Case<::mlir::spirv::ImageDepthInfoAttr>([&](auto t) {
223 printer << ::mlir::spirv::ImageDepthInfoAttr::getMnemonic();
224t.print(printer);
225 return ::mlir::success();
226 })
227 .Case<::mlir::spirv::DeviceTypeAttr>([&](auto t) {
228 printer << ::mlir::spirv::DeviceTypeAttr::getMnemonic();
229t.print(printer);
230 return ::mlir::success();
231 })
232 .Case<::mlir::spirv::DimAttr>([&](auto t) {
233 printer << ::mlir::spirv::DimAttr::getMnemonic();
234t.print(printer);
235 return ::mlir::success();
236 })
237 .Case<::mlir::spirv::EntryPointABIAttr>([&](auto t) {
238 printer << ::mlir::spirv::EntryPointABIAttr::getMnemonic();
239t.print(printer);
240 return ::mlir::success();
241 })
242 .Case<::mlir::spirv::ExecutionModeAttr>([&](auto t) {
243 printer << ::mlir::spirv::ExecutionModeAttr::getMnemonic();
244t.print(printer);
245 return ::mlir::success();
246 })
247 .Case<::mlir::spirv::ExecutionModelAttr>([&](auto t) {
248 printer << ::mlir::spirv::ExecutionModelAttr::getMnemonic();
249t.print(printer);
250 return ::mlir::success();
251 })
252 .Case<::mlir::spirv::ExtensionAttr>([&](auto t) {
253 printer << ::mlir::spirv::ExtensionAttr::getMnemonic();
254t.print(printer);
255 return ::mlir::success();
256 })
257 .Case<::mlir::spirv::FunctionControlAttr>([&](auto t) {
258 printer << ::mlir::spirv::FunctionControlAttr::getMnemonic();
259t.print(printer);
260 return ::mlir::success();
261 })
262 .Case<::mlir::spirv::GroupOperationAttr>([&](auto t) {
263 printer << ::mlir::spirv::GroupOperationAttr::getMnemonic();
264t.print(printer);
265 return ::mlir::success();
266 })
267 .Case<::mlir::spirv::ImageFormatAttr>([&](auto t) {
268 printer << ::mlir::spirv::ImageFormatAttr::getMnemonic();
269t.print(printer);
270 return ::mlir::success();
271 })
272 .Case<::mlir::spirv::ImageOperandsAttr>([&](auto t) {
273 printer << ::mlir::spirv::ImageOperandsAttr::getMnemonic();
274t.print(printer);
275 return ::mlir::success();
276 })
277 .Case<::mlir::spirv::JointMatrixPropertiesINTELAttr>([&](auto t) {
278 printer << ::mlir::spirv::JointMatrixPropertiesINTELAttr::getMnemonic();
279t.print(printer);
280 return ::mlir::success();
281 })
282 .Case<::mlir::spirv::LinkageTypeAttr>([&](auto t) {
283 printer << ::mlir::spirv::LinkageTypeAttr::getMnemonic();
284t.print(printer);
285 return ::mlir::success();
286 })
287 .Case<::mlir::spirv::LoopControlAttr>([&](auto t) {
288 printer << ::mlir::spirv::LoopControlAttr::getMnemonic();
289t.print(printer);
290 return ::mlir::success();
291 })
292 .Case<::mlir::spirv::MatrixLayoutAttr>([&](auto t) {
293 printer << ::mlir::spirv::MatrixLayoutAttr::getMnemonic();
294t.print(printer);
295 return ::mlir::success();
296 })
297 .Case<::mlir::spirv::MemoryAccessAttr>([&](auto t) {
298 printer << ::mlir::spirv::MemoryAccessAttr::getMnemonic();
299t.print(printer);
300 return ::mlir::success();
301 })
302 .Case<::mlir::spirv::MemoryModelAttr>([&](auto t) {
303 printer << ::mlir::spirv::MemoryModelAttr::getMnemonic();
304t.print(printer);
305 return ::mlir::success();
306 })
307 .Case<::mlir::spirv::MemorySemanticsAttr>([&](auto t) {
308 printer << ::mlir::spirv::MemorySemanticsAttr::getMnemonic();
309t.print(printer);
310 return ::mlir::success();
311 })
312 .Case<::mlir::spirv::OpcodeAttr>([&](auto t) {
313 printer << ::mlir::spirv::OpcodeAttr::getMnemonic();
314t.print(printer);
315 return ::mlir::success();
316 })
317 .Case<::mlir::spirv::ResourceLimitsAttr>([&](auto t) {
318 printer << ::mlir::spirv::ResourceLimitsAttr::getMnemonic();
319t.print(printer);
320 return ::mlir::success();
321 })
322 .Case<::mlir::spirv::ImageSamplerUseInfoAttr>([&](auto t) {
323 printer << ::mlir::spirv::ImageSamplerUseInfoAttr::getMnemonic();
324t.print(printer);
325 return ::mlir::success();
326 })
327 .Case<::mlir::spirv::ImageSamplingInfoAttr>([&](auto t) {
328 printer << ::mlir::spirv::ImageSamplingInfoAttr::getMnemonic();
329t.print(printer);
330 return ::mlir::success();
331 })
332 .Case<::mlir::spirv::ScopeAttr>([&](auto t) {
333 printer << ::mlir::spirv::ScopeAttr::getMnemonic();
334t.print(printer);
335 return ::mlir::success();
336 })
337 .Case<::mlir::spirv::SelectionControlAttr>([&](auto t) {
338 printer << ::mlir::spirv::SelectionControlAttr::getMnemonic();
339t.print(printer);
340 return ::mlir::success();
341 })
342 .Case<::mlir::spirv::StorageClassAttr>([&](auto t) {
343 printer << ::mlir::spirv::StorageClassAttr::getMnemonic();
344t.print(printer);
345 return ::mlir::success();
346 })
347 .Case<::mlir::spirv::VendorAttr>([&](auto t) {
348 printer << ::mlir::spirv::VendorAttr::getMnemonic();
349t.print(printer);
350 return ::mlir::success();
351 })
352 .Case<::mlir::spirv::VersionAttr>([&](auto t) {
353 printer << ::mlir::spirv::VersionAttr::getMnemonic();
354t.print(printer);
355 return ::mlir::success();
356 })
357 .Default([](auto) { return ::mlir::failure(); });
358}
359
360namespace mlir {
361namespace spirv {
362namespace detail {
363struct AddressingModelAttrStorage : public ::mlir::AttributeStorage {
364 using KeyTy = std::tuple<::mlir::spirv::AddressingModel>;
365 AddressingModelAttrStorage(::mlir::spirv::AddressingModel value) : value(value) {}
366
367 bool operator==(const KeyTy &tblgenKey) const {
368 return (value == std::get<0>(tblgenKey));
369 }
370
371 static ::llvm::hash_code hashKey(const KeyTy &tblgenKey) {
372 return ::llvm::hash_combine(std::get<0>(tblgenKey));
373 }
374
375 static AddressingModelAttrStorage *construct(::mlir::AttributeStorageAllocator &allocator, const KeyTy &tblgenKey) {
376 auto value = std::get<0>(tblgenKey);
377 return new (allocator.allocate<AddressingModelAttrStorage>()) AddressingModelAttrStorage(value);
378 }
379
380 ::mlir::spirv::AddressingModel value;
381};
382} // namespace detail
383AddressingModelAttr AddressingModelAttr::get(::mlir::MLIRContext *context, ::mlir::spirv::AddressingModel value) {
384 return Base::get(context, value);
385}
386
387::mlir::Attribute AddressingModelAttr::parse(::mlir::AsmParser &odsParser, ::mlir::Type odsType) {
388 ::mlir::Builder odsBuilder(odsParser.getContext());
389 ::llvm::SMLoc odsLoc = odsParser.getCurrentLocation();
390 (void) odsLoc;
391 ::mlir::FailureOr<::mlir::spirv::AddressingModel> _result_value;
392 // Parse literal '<'
393 if (odsParser.parseLess()) return {};
394
395 // Parse variable 'value'
396 _result_value = [&]() -> ::mlir::FailureOr<::mlir::spirv::AddressingModel> {
397 auto loc = odsParser.getCurrentLocation();
398 ::llvm::StringRef enumKeyword;
399 if (::mlir::failed(odsParser.parseKeyword(&enumKeyword)))
400 return ::mlir::failure();
401 auto maybeEnum = ::mlir::spirv::symbolizeAddressingModel(enumKeyword);
402 if (maybeEnum)
403 return *maybeEnum;
404 return {(::mlir::LogicalResult)(odsParser.emitError(loc) << "expected " << "::mlir::spirv::AddressingModel" << " to be one of: " << "Logical" << ", " << "Physical32" << ", " << "Physical64" << ", " << "PhysicalStorageBuffer64")};
405 }();
406 if (::mlir::failed(_result_value)) {
407 odsParser.emitError(odsParser.getCurrentLocation(), "failed to parse SPIRV_AddressingModelAttr parameter 'value' which is to be a `::mlir::spirv::AddressingModel`");
408 return {};
409 }
410 // Parse literal '>'
411 if (odsParser.parseGreater()) return {};
412 assert(::mlir::succeeded(_result_value))(static_cast <bool> (::mlir::succeeded(_result_value)) ?
void (0) : __assert_fail ("::mlir::succeeded(_result_value)"
, "tools/mlir/include/mlir/Dialect/SPIRV/IR/SPIRVAttributes.cpp.inc"
, 412, __extension__ __PRETTY_FUNCTION__))
;
413 return AddressingModelAttr::get(odsParser.getContext(),
414 ::mlir::spirv::AddressingModel((*_result_value)));
415}
416
417void AddressingModelAttr::print(::mlir::AsmPrinter &odsPrinter) const {
418 ::mlir::Builder odsBuilder(getContext());
419 odsPrinter << "<";
420 odsPrinter << stringifyAddressingModel(getValue());
421 odsPrinter << ">";
422}
423
424::mlir::spirv::AddressingModel AddressingModelAttr::getValue() const {
425 return getImpl()->value;
426}
427
428} // namespace spirv
429} // namespace mlir
430MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::spirv::AddressingModelAttr)namespace mlir { namespace detail { SelfOwningTypeID TypeIDResolver
< ::mlir::spirv::AddressingModelAttr>::id = {}; } }
431namespace mlir {
432namespace spirv {
433namespace detail {
434struct ImageArrayedInfoAttrStorage : public ::mlir::AttributeStorage {
435 using KeyTy = std::tuple<::mlir::spirv::ImageArrayedInfo>;
436 ImageArrayedInfoAttrStorage(::mlir::spirv::ImageArrayedInfo value) : value(value) {}
437
438 bool operator==(const KeyTy &tblgenKey) const {
439 return (value == std::get<0>(tblgenKey));
440 }
441
442 static ::llvm::hash_code hashKey(const KeyTy &tblgenKey) {
443 return ::llvm::hash_combine(std::get<0>(tblgenKey));
444 }
445
446 static ImageArrayedInfoAttrStorage *construct(::mlir::AttributeStorageAllocator &allocator, const KeyTy &tblgenKey) {
447 auto value = std::get<0>(tblgenKey);
448 return new (allocator.allocate<ImageArrayedInfoAttrStorage>()) ImageArrayedInfoAttrStorage(value);
449 }
450
451 ::mlir::spirv::ImageArrayedInfo value;
452};
453} // namespace detail
454ImageArrayedInfoAttr ImageArrayedInfoAttr::get(::mlir::MLIRContext *context, ::mlir::spirv::ImageArrayedInfo value) {
455 return Base::get(context, value);
456}
457
458::mlir::Attribute ImageArrayedInfoAttr::parse(::mlir::AsmParser &odsParser, ::mlir::Type odsType) {
459 ::mlir::Builder odsBuilder(odsParser.getContext());
460 ::llvm::SMLoc odsLoc = odsParser.getCurrentLocation();
461 (void) odsLoc;
462 ::mlir::FailureOr<::mlir::spirv::ImageArrayedInfo> _result_value;
463 // Parse literal '<'
464 if (odsParser.parseLess()) return {};
465
466 // Parse variable 'value'
467 _result_value = [&]() -> ::mlir::FailureOr<::mlir::spirv::ImageArrayedInfo> {
468 auto loc = odsParser.getCurrentLocation();
469 ::llvm::StringRef enumKeyword;
470 if (::mlir::failed(odsParser.parseKeyword(&enumKeyword)))
471 return ::mlir::failure();
472 auto maybeEnum = ::mlir::spirv::symbolizeImageArrayedInfo(enumKeyword);
473 if (maybeEnum)
474 return *maybeEnum;
475 return {(::mlir::LogicalResult)(odsParser.emitError(loc) << "expected " << "::mlir::spirv::ImageArrayedInfo" << " to be one of: " << "NonArrayed" << ", " << "Arrayed")};
476 }();
477 if (::mlir::failed(_result_value)) {
478 odsParser.emitError(odsParser.getCurrentLocation(), "failed to parse SPIRV_ArrayedAttr parameter 'value' which is to be a `::mlir::spirv::ImageArrayedInfo`");
479 return {};
480 }
481 // Parse literal '>'
482 if (odsParser.parseGreater()) return {};
483 assert(::mlir::succeeded(_result_value))(static_cast <bool> (::mlir::succeeded(_result_value)) ?
void (0) : __assert_fail ("::mlir::succeeded(_result_value)"
, "tools/mlir/include/mlir/Dialect/SPIRV/IR/SPIRVAttributes.cpp.inc"
, 483, __extension__ __PRETTY_FUNCTION__))
;
484 return ImageArrayedInfoAttr::get(odsParser.getContext(),
485 ::mlir::spirv::ImageArrayedInfo((*_result_value)));
486}
487
488void ImageArrayedInfoAttr::print(::mlir::AsmPrinter &odsPrinter) const {
489 ::mlir::Builder odsBuilder(getContext());
490 odsPrinter << "<";
491 odsPrinter << stringifyImageArrayedInfo(getValue());
492 odsPrinter << ">";
493}
494
495::mlir::spirv::ImageArrayedInfo ImageArrayedInfoAttr::getValue() const {
496 return getImpl()->value;
497}
498
499} // namespace spirv
500} // namespace mlir
501MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::spirv::ImageArrayedInfoAttr)namespace mlir { namespace detail { SelfOwningTypeID TypeIDResolver
< ::mlir::spirv::ImageArrayedInfoAttr>::id = {}; } }
502namespace mlir {
503namespace spirv {
504namespace detail {
505struct BuiltInAttrStorage : public ::mlir::AttributeStorage {
506 using KeyTy = std::tuple<::mlir::spirv::BuiltIn>;
507 BuiltInAttrStorage(::mlir::spirv::BuiltIn value) : value(value) {}
508
509 bool operator==(const KeyTy &tblgenKey) const {
510 return (value == std::get<0>(tblgenKey));
511 }
512
513 static ::llvm::hash_code hashKey(const KeyTy &tblgenKey) {
514 return ::llvm::hash_combine(std::get<0>(tblgenKey));
515 }
516
517 static BuiltInAttrStorage *construct(::mlir::AttributeStorageAllocator &allocator, const KeyTy &tblgenKey) {
518 auto value = std::get<0>(tblgenKey);
519 return new (allocator.allocate<BuiltInAttrStorage>()) BuiltInAttrStorage(value);
520 }
521
522 ::mlir::spirv::BuiltIn value;
523};
524} // namespace detail
525BuiltInAttr BuiltInAttr::get(::mlir::MLIRContext *context, ::mlir::spirv::BuiltIn value) {
526 return Base::get(context, value);
527}
528
529::mlir::Attribute BuiltInAttr::parse(::mlir::AsmParser &odsParser, ::mlir::Type odsType) {
530 ::mlir::Builder odsBuilder(odsParser.getContext());
531 ::llvm::SMLoc odsLoc = odsParser.getCurrentLocation();
532 (void) odsLoc;
533 ::mlir::FailureOr<::mlir::spirv::BuiltIn> _result_value;
534 // Parse literal '<'
535 if (odsParser.parseLess()) return {};
536
537 // Parse variable 'value'
538 _result_value = [&]() -> ::mlir::FailureOr<::mlir::spirv::BuiltIn> {
539 auto loc = odsParser.getCurrentLocation();
540 ::llvm::StringRef enumKeyword;
541 if (::mlir::failed(odsParser.parseKeyword(&enumKeyword)))
542 return ::mlir::failure();
543 auto maybeEnum = ::mlir::spirv::symbolizeBuiltIn(enumKeyword);
544 if (maybeEnum)
545 return *maybeEnum;
546 return {(::mlir::LogicalResult)(odsParser.emitError(loc) << "expected " << "::mlir::spirv::BuiltIn" << " to be one of: " << "Position" << ", " << "PointSize" << ", " << "ClipDistance" << ", " << "CullDistance" << ", " << "VertexId" << ", " << "InstanceId" << ", " << "PrimitiveId" << ", " << "InvocationId" << ", " << "Layer" << ", " << "ViewportIndex" << ", " << "TessLevelOuter" << ", " << "TessLevelInner" << ", " << "TessCoord" << ", " << "PatchVertices" << ", " << "FragCoord" << ", " << "PointCoord" << ", " << "FrontFacing" << ", " << "SampleId" << ", " << "SamplePosition" << ", " << "SampleMask" << ", " << "FragDepth" << ", " << "HelperInvocation" << ", " << "NumWorkgroups" << ", " << "WorkgroupSize" << ", " << "WorkgroupId" << ", " << "LocalInvocationId" << ", " << "GlobalInvocationId" << ", " << "LocalInvocationIndex" << ", " << "WorkDim" << ", " << "GlobalSize" << ", " << "EnqueuedWorkgroupSize" << ", " << "GlobalOffset" << ", " << "GlobalLinearId" << ", " << "SubgroupSize" << ", " << "SubgroupMaxSize" << ", " << "NumSubgroups" << ", " << "NumEnqueuedSubgroups" << ", " << "SubgroupId" << ", " << "SubgroupLocalInvocationId" << ", " << "VertexIndex" << ", " << "InstanceIndex" << ", " << "SubgroupEqMask" << ", " << "SubgroupGeMask" << ", " << "SubgroupGtMask" << ", " << "SubgroupLeMask" << ", " << "SubgroupLtMask" << ", " << "BaseVertex" << ", " << "BaseInstance" << ", " << "DrawIndex" << ", " << "PrimitiveShadingRateKHR" << ", " << "DeviceIndex" << ", " << "ViewIndex" << ", " << "ShadingRateKHR" << ", " << "BaryCoordNoPerspAMD" << ", " << "BaryCoordNoPerspCentroidAMD" << ", " << "BaryCoordNoPerspSampleAMD" << ", " << "BaryCoordSmoothAMD" << ", " << "BaryCoordSmoothCentroidAMD" << ", " << "BaryCoordSmoothSampleAMD" << ", " << "BaryCoordPullModelAMD" << ", " << "FragStencilRefEXT" << ", " << "ViewportMaskNV" << ", " << "SecondaryPositionNV" << ", " << "SecondaryViewportMaskNV" << ", " << "PositionPerViewNV" << ", " << "ViewportMaskPerViewNV" << ", " << "FullyCoveredEXT" << ", " << "TaskCountNV" << ", " << "PrimitiveCountNV" << ", " << "PrimitiveIndicesNV" << ", " << "ClipDistancePerViewNV" << ", " << "CullDistancePerViewNV" << ", " << "LayerPerViewNV" << ", " << "MeshViewCountNV" << ", " << "MeshViewIndicesNV" << ", " << "BaryCoordKHR" << ", " << "BaryCoordNoPerspKHR" << ", " << "FragSizeEXT" << ", " << "FragInvocationCountEXT" << ", " << "LaunchIdKHR" << ", " << "LaunchSizeKHR" << ", " << "WorldRayOriginKHR" << ", " << "WorldRayDirectionKHR" << ", " << "ObjectRayOriginKHR" << ", " << "ObjectRayDirectionKHR" << ", " << "RayTminKHR" << ", " << "RayTmaxKHR" << ", " << "InstanceCustomIndexKHR" << ", " << "ObjectToWorldKHR" << ", " << "WorldToObjectKHR" << ", " << "HitTNV" << ", " << "HitKindKHR" << ", " << "CurrentRayTimeNV" << ", " << "IncomingRayFlagsKHR" << ", " << "RayGeometryIndexKHR" << ", " << "WarpsPerSMNV" << ", " << "SMCountNV" << ", " << "WarpIDNV" << ", " << "SMIDNV" << ", " << "CullMaskKHR")};
547 }();
548 if (::mlir::failed(_result_value)) {
549 odsParser.emitError(odsParser.getCurrentLocation(), "failed to parse SPIRV_BuiltInAttr parameter 'value' which is to be a `::mlir::spirv::BuiltIn`");
550 return {};
551 }
552 // Parse literal '>'
553 if (odsParser.parseGreater()) return {};
554 assert(::mlir::succeeded(_result_value))(static_cast <bool> (::mlir::succeeded(_result_value)) ?
void (0) : __assert_fail ("::mlir::succeeded(_result_value)"
, "tools/mlir/include/mlir/Dialect/SPIRV/IR/SPIRVAttributes.cpp.inc"
, 554, __extension__ __PRETTY_FUNCTION__))
;
555 return BuiltInAttr::get(odsParser.getContext(),
556 ::mlir::spirv::BuiltIn((*_result_value)));
557}
558
559void BuiltInAttr::print(::mlir::AsmPrinter &odsPrinter) const {
560 ::mlir::Builder odsBuilder(getContext());
561 odsPrinter << "<";
562 odsPrinter << stringifyBuiltIn(getValue());
563 odsPrinter << ">";
564}
565
566::mlir::spirv::BuiltIn BuiltInAttr::getValue() const {
567 return getImpl()->value;
568}
569
570} // namespace spirv
571} // namespace mlir
572MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::spirv::BuiltInAttr)namespace mlir { namespace detail { SelfOwningTypeID TypeIDResolver
< ::mlir::spirv::BuiltInAttr>::id = {}; } }
573namespace mlir {
574namespace spirv {
575namespace detail {
576struct CapabilityAttrStorage : public ::mlir::AttributeStorage {
577 using KeyTy = std::tuple<::mlir::spirv::Capability>;
578 CapabilityAttrStorage(::mlir::spirv::Capability value) : value(value) {}
579
580 bool operator==(const KeyTy &tblgenKey) const {
581 return (value == std::get<0>(tblgenKey));
582 }
583
584 static ::llvm::hash_code hashKey(const KeyTy &tblgenKey) {
585 return ::llvm::hash_combine(std::get<0>(tblgenKey));
586 }
587
588 static CapabilityAttrStorage *construct(::mlir::AttributeStorageAllocator &allocator, const KeyTy &tblgenKey) {
589 auto value = std::get<0>(tblgenKey);
590 return new (allocator.allocate<CapabilityAttrStorage>()) CapabilityAttrStorage(value);
591 }
592
593 ::mlir::spirv::Capability value;
594};
595} // namespace detail
596CapabilityAttr CapabilityAttr::get(::mlir::MLIRContext *context, ::mlir::spirv::Capability value) {
597 return Base::get(context, value);
598}
599
600::mlir::Attribute CapabilityAttr::parse(::mlir::AsmParser &odsParser, ::mlir::Type odsType) {
601 ::mlir::Builder odsBuilder(odsParser.getContext());
602 ::llvm::SMLoc odsLoc = odsParser.getCurrentLocation();
603 (void) odsLoc;
604 ::mlir::FailureOr<::mlir::spirv::Capability> _result_value;
605 // Parse literal '<'
606 if (odsParser.parseLess()) return {};
607
608 // Parse variable 'value'
609 _result_value = [&]() -> ::mlir::FailureOr<::mlir::spirv::Capability> {
610 auto loc = odsParser.getCurrentLocation();
611 ::llvm::StringRef enumKeyword;
612 if (::mlir::failed(odsParser.parseKeyword(&enumKeyword)))
613 return ::mlir::failure();
614 auto maybeEnum = ::mlir::spirv::symbolizeCapability(enumKeyword);
615 if (maybeEnum)
616 return *maybeEnum;
617 return {(::mlir::LogicalResult)(odsParser.emitError(loc) << "expected " << "::mlir::spirv::Capability" << " to be one of: " << "Matrix" << ", " << "Addresses" << ", " << "Linkage" << ", " << "Kernel" << ", " << "Float16" << ", " << "Float64" << ", " << "Int64" << ", " << "Groups" << ", " << "Int16" << ", " << "Int8" << ", " << "Sampled1D" << ", " << "SampledBuffer" << ", " << "GroupNonUniform" << ", " << "ShaderLayer" << ", " << "ShaderViewportIndex" << ", " << "UniformDecoration" << ", " << "SubgroupBallotKHR" << ", " << "SubgroupVoteKHR" << ", " << "StorageBuffer16BitAccess" << ", " << "StoragePushConstant16" << ", " << "StorageInputOutput16" << ", " << "DeviceGroup" << ", " << "AtomicStorageOps" << ", " << "SampleMaskPostDepthCoverage" << ", " << "StorageBuffer8BitAccess" << ", " << "StoragePushConstant8" << ", " << "DenormPreserve" << ", " << "DenormFlushToZero" << ", " << "SignedZeroInfNanPreserve" << ", " << "RoundingModeRTE" << ", " << "RoundingModeRTZ" << ", " << "ImageFootprintNV" << ", " << "FragmentBarycentricKHR" << ", " << "ComputeDerivativeGroupQuadsNV" << ", " << "GroupNonUniformPartitionedNV" << ", " << "VulkanMemoryModel" << ", " << "VulkanMemoryModelDeviceScope" << ", " << "ComputeDerivativeGroupLinearNV" << ", " << "BindlessTextureNV" << ", " << "SubgroupShuffleINTEL" << ", " << "SubgroupBufferBlockIOINTEL" << ", " << "SubgroupImageBlockIOINTEL" << ", " << "SubgroupImageMediaBlockIOINTEL" << ", " << "RoundToInfinityINTEL" << ", " << "FloatingPointModeINTEL" << ", " << "FunctionPointersINTEL" << ", " << "IndirectReferencesINTEL" << ", " << "AsmINTEL" << ", " << "AtomicFloat32MinMaxEXT" << ", " << "AtomicFloat64MinMaxEXT" << ", " << "AtomicFloat16MinMaxEXT" << ", " << "VectorAnyINTEL" << ", " << "ExpectAssumeKHR" << ", " << "SubgroupAvcMotionEstimationINTEL" << ", " << "SubgroupAvcMotionEstimationIntraINTEL" << ", " << "SubgroupAvcMotionEstimationChromaINTEL" << ", " << "VariableLengthArrayINTEL" << ", " << "FunctionFloatControlINTEL" << ", " << "FPGAMemoryAttributesINTEL" << ", " << "ArbitraryPrecisionIntegersINTEL" << ", " << "ArbitraryPrecisionFloatingPointINTEL" << ", " << "UnstructuredLoopControlsINTEL" << ", " << "FPGALoopControlsINTEL" << ", " << "KernelAttributesINTEL" << ", " << "FPGAKernelAttributesINTEL" << ", " << "FPGAMemoryAccessesINTEL" << ", " << "FPGAClusterAttributesINTEL" << ", " << "LoopFuseINTEL" << ", " << "MemoryAccessAliasingINTEL" << ", " << "FPGABufferLocationINTEL" << ", " << "ArbitraryPrecisionFixedPointINTEL" << ", " << "USMStorageClassesINTEL" << ", " << "IOPipesINTEL" << ", " << "BlockingPipesINTEL" << ", " << "FPGARegINTEL" << ", " << "DotProductInputAll" << ", " << "DotProductInput4x8BitPacked" << ", " << "DotProduct" << ", " << "RayCullMaskKHR" << ", " << "BitInstructions" << ", " << "AtomicFloat32AddEXT" << ", " << "AtomicFloat64AddEXT" << ", " << "LongConstantCompositeINTEL" << ", " << "OptNoneINTEL" << ", " << "AtomicFloat16AddEXT" << ", " << "DebugInfoModuleINTEL" << ", " << "SplitBarrierINTEL" << ", " << "GroupUniformArithmeticKHR" << ", " << "Shader" << ", " << "Vector16" << ", " << "Float16Buffer" << ", " << "Int64Atomics" << ", " << "ImageBasic" << ", " << "Pipes" << ", " << "DeviceEnqueue" << ", " << "LiteralSampler" << ", " << "GenericPointer" << ", " << "Image1D" << ", " << "ImageBuffer" << ", " << "NamedBarrier" << ", " << "GroupNonUniformVote" << ", " << "GroupNonUniformArithmetic" << ", " << "GroupNonUniformBallot" << ", " << "GroupNonUniformShuffle" << ", " << "GroupNonUniformShuffleRelative" << ", " << "GroupNonUniformClustered" << ", " << "GroupNonUniformQuad" << ", " << "StorageUniform16" << ", " << "UniformAndStorageBuffer8BitAccess" << ", " << "UniformTexelBufferArrayDynamicIndexing" << ", " << "VectorComputeINTEL" << ", " << "FPFastMathModeINTEL" << ", " << "DotProductInput4x8Bit" << ", " << "GroupNonUniformRotateKHR" << ", " << "Geometry" << ", " << "Tessellation" << ", " << "ImageReadWrite" << ", " << "ImageMipmap" << ", " << "AtomicStorage" << ", " << "ImageGatherExtended" << ", " << "StorageImageMultisample" << ", " << "UniformBufferArrayDynamicIndexing" << ", " << "SampledImageArrayDynamicIndexing" << ", " << "StorageBufferArrayDynamicIndexing" << ", " << "StorageImageArrayDynamicIndexing" << ", " << "ClipDistance" << ", " << "CullDistance" << ", " << "SampleRateShading" << ", " << "SampledRect" << ", " << "InputAttachment" << ", " << "SparseResidency" << ", " << "MinLod" << ", " << "SampledCubeArray" << ", " << "ImageMSArray" << ", " << "StorageImageExtendedFormats" << ", " << "ImageQuery" << ", " << "DerivativeControl" << ", " << "InterpolationFunction" << ", " << "TransformFeedback" << ", " << "StorageImageReadWithoutFormat" << ", " << "StorageImageWriteWithoutFormat" << ", " << "SubgroupDispatch" << ", " << "PipeStorage" << ", " << "FragmentShadingRateKHR" << ", " << "DrawParameters" << ", " << "WorkgroupMemoryExplicitLayoutKHR" << ", " << "WorkgroupMemoryExplicitLayout16BitAccessKHR" << ", " << "MultiView" << ", " << "VariablePointersStorageBuffer" << ", " << "RayQueryProvisionalKHR" << ", " << "RayQueryKHR" << ", " << "RayTracingKHR" << ", " << "Float16ImageAMD" << ", " << "ImageGatherBiasLodAMD" << ", " << "FragmentMaskAMD" << ", " << "StencilExportEXT" << ", " << "ImageReadWriteLodAMD" << ", " << "Int64ImageEXT" << ", " << "ShaderClockKHR" << ", " << "FragmentFullyCoveredEXT" << ", " << "MeshShadingNV" << ", " << "FragmentDensityEXT" << ", " << "ShaderNonUniform" << ", " << "RuntimeDescriptorArray" << ", " << "StorageTexelBufferArrayDynamicIndexing" << ", " << "RayTracingNV" << ", " << "RayTracingMotionBlurNV" << ", " << "PhysicalStorageBufferAddresses" << ", " << "RayTracingProvisionalKHR" << ", " << "CooperativeMatrixNV" << ", " << "FragmentShaderSampleInterlockEXT" << ", " << "FragmentShaderShadingRateInterlockEXT" << ", " << "ShaderSMBuiltinsNV" << ", " << "FragmentShaderPixelInterlockEXT" << ", " << "DemoteToHelperInvocation" << ", " << "IntegerFunctions2INTEL" << ", " << "TessellationPointSize" << ", " << "GeometryPointSize" << ", " << "ImageCubeArray" << ", " << "ImageRect" << ", " << "GeometryStreams" << ", " << "MultiViewport" << ", " << "WorkgroupMemoryExplicitLayout8BitAccessKHR" << ", " << "VariablePointers" << ", " << "RayTraversalPrimitiveCullingKHR" << ", " << "SampleMaskOverrideCoverageNV" << ", " << "GeometryShaderPassthroughNV" << ", " << "PerViewAttributesNV" << ", " << "InputAttachmentArrayDynamicIndexing" << ", " << "UniformBufferArrayNonUniformIndexing" << ", " << "SampledImageArrayNonUniformIndexing" << ", " << "StorageBufferArrayNonUniformIndexing" << ", " << "StorageImageArrayNonUniformIndexing" << ", " << "InputAttachmentArrayNonUniformIndexing" << ", " << "UniformTexelBufferArrayNonUniformIndexing" << ", " << "StorageTexelBufferArrayNonUniformIndexing" << ", " << "ShaderViewportIndexLayerEXT" << ", " << "ShaderViewportMaskNV" << ", " << "ShaderStereoViewNV" << ", " << "JointMatrixINTEL")};
618 }();
619 if (::mlir::failed(_result_value)) {
620 odsParser.emitError(odsParser.getCurrentLocation(), "failed to parse SPIRV_CapabilityAttr parameter 'value' which is to be a `::mlir::spirv::Capability`");
621 return {};
622 }
623 // Parse literal '>'
624 if (odsParser.parseGreater()) return {};
625 assert(::mlir::succeeded(_result_value))(static_cast <bool> (::mlir::succeeded(_result_value)) ?
void (0) : __assert_fail ("::mlir::succeeded(_result_value)"
, "tools/mlir/include/mlir/Dialect/SPIRV/IR/SPIRVAttributes.cpp.inc"
, 625, __extension__ __PRETTY_FUNCTION__))
;
626 return CapabilityAttr::get(odsParser.getContext(),
627 ::mlir::spirv::Capability((*_result_value)));
628}
629
630void CapabilityAttr::print(::mlir::AsmPrinter &odsPrinter) const {
631 ::mlir::Builder odsBuilder(getContext());
632 odsPrinter << "<";
633 odsPrinter << stringifyCapability(getValue());
634 odsPrinter << ">";
635}
636
637::mlir::spirv::Capability CapabilityAttr::getValue() const {
638 return getImpl()->value;
639}
640
641} // namespace spirv
642} // namespace mlir
643MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::spirv::CapabilityAttr)namespace mlir { namespace detail { SelfOwningTypeID TypeIDResolver
< ::mlir::spirv::CapabilityAttr>::id = {}; } }
644namespace mlir {
645namespace spirv {
646namespace detail {
647struct CooperativeMatrixPropertiesNVAttrStorage : public ::mlir::AttributeStorage {
648 using KeyTy = std::tuple<int, int, int, mlir::Type, mlir::Type, mlir::Type, mlir::Type, mlir::spirv::ScopeAttr>;
649 CooperativeMatrixPropertiesNVAttrStorage(int m_size, int n_size, int k_size, mlir::Type a_type, mlir::Type b_type, mlir::Type c_type, mlir::Type result_type, mlir::spirv::ScopeAttr scope) : m_size(m_size), n_size(n_size), k_size(k_size), a_type(a_type), b_type(b_type), c_type(c_type), result_type(result_type), scope(scope) {}
650
651 bool operator==(const KeyTy &tblgenKey) const {
652 return (m_size == std::get<0>(tblgenKey)) && (n_size == std::get<1>(tblgenKey)) && (k_size == std::get<2>(tblgenKey)) && (a_type == std::get<3>(tblgenKey)) && (b_type == std::get<4>(tblgenKey)) && (c_type == std::get<5>(tblgenKey)) && (result_type == std::get<6>(tblgenKey)) && (scope == std::get<7>(tblgenKey));
653 }
654
655 static ::llvm::hash_code hashKey(const KeyTy &tblgenKey) {
656 return ::llvm::hash_combine(std::get<0>(tblgenKey), std::get<1>(tblgenKey), std::get<2>(tblgenKey), std::get<3>(tblgenKey), std::get<4>(tblgenKey), std::get<5>(tblgenKey), std::get<6>(tblgenKey), std::get<7>(tblgenKey));
657 }
658
659 static CooperativeMatrixPropertiesNVAttrStorage *construct(::mlir::AttributeStorageAllocator &allocator, const KeyTy &tblgenKey) {
660 auto m_size = std::get<0>(tblgenKey);
661 auto n_size = std::get<1>(tblgenKey);
662 auto k_size = std::get<2>(tblgenKey);
663 auto a_type = std::get<3>(tblgenKey);
664 auto b_type = std::get<4>(tblgenKey);
665 auto c_type = std::get<5>(tblgenKey);
666 auto result_type = std::get<6>(tblgenKey);
667 auto scope = std::get<7>(tblgenKey);
668 return new (allocator.allocate<CooperativeMatrixPropertiesNVAttrStorage>()) CooperativeMatrixPropertiesNVAttrStorage(m_size, n_size, k_size, a_type, b_type, c_type, result_type, scope);
669 }
670
671 int m_size;
672 int n_size;
673 int k_size;
674 mlir::Type a_type;
675 mlir::Type b_type;
676 mlir::Type c_type;
677 mlir::Type result_type;
678 mlir::spirv::ScopeAttr scope;
679};
680} // namespace detail
681CooperativeMatrixPropertiesNVAttr CooperativeMatrixPropertiesNVAttr::get(::mlir::MLIRContext *context, int m_size, int n_size, int k_size, mlir::Type a_type, mlir::Type b_type, mlir::Type c_type, mlir::Type result_type, mlir::spirv::ScopeAttr scope) {
682 return Base::get(context, m_size, n_size, k_size, a_type, b_type, c_type, result_type, scope);
683}
684
685::mlir::Attribute CooperativeMatrixPropertiesNVAttr::parse(::mlir::AsmParser &odsParser, ::mlir::Type odsType) {
686 ::mlir::Builder odsBuilder(odsParser.getContext());
687 ::llvm::SMLoc odsLoc = odsParser.getCurrentLocation();
688 (void) odsLoc;
689 ::mlir::FailureOr<int> _result_m_size;
690 ::mlir::FailureOr<int> _result_n_size;
691 ::mlir::FailureOr<int> _result_k_size;
692 ::mlir::FailureOr<mlir::Type> _result_a_type;
693 ::mlir::FailureOr<mlir::Type> _result_b_type;
694 ::mlir::FailureOr<mlir::Type> _result_c_type;
695 ::mlir::FailureOr<mlir::Type> _result_result_type;
696 ::mlir::FailureOr<mlir::spirv::ScopeAttr> _result_scope;
697 // Parse literal '<'
698 if (odsParser.parseLess()) return {};
699 // Parse parameter struct
700 bool _seen_m_size = false;
701 bool _seen_n_size = false;
702 bool _seen_k_size = false;
703 bool _seen_a_type = false;
704 bool _seen_b_type = false;
705 bool _seen_c_type = false;
706 bool _seen_result_type = false;
707 bool _seen_scope = false;
708 {
709 const auto _loop_body = [&](::llvm::StringRef _paramKey) -> bool {
710 // Parse literal '='
711 if (odsParser.parseEqual()) return {};
712 if (!_seen_m_size && _paramKey == "m_size") {
713 _seen_m_size = true;
714
715 // Parse variable 'm_size'
716 _result_m_size = ::mlir::FieldParser<int>::parse(odsParser);
717 if (::mlir::failed(_result_m_size)) {
718 odsParser.emitError(odsParser.getCurrentLocation(), "failed to parse SPIRV_CooperativeMatrixPropertiesNVAttr parameter 'm_size' which is to be a `int`");
719 return {};
720 }
721 } else if (!_seen_n_size && _paramKey == "n_size") {
722 _seen_n_size = true;
723
724 // Parse variable 'n_size'
725 _result_n_size = ::mlir::FieldParser<int>::parse(odsParser);
726 if (::mlir::failed(_result_n_size)) {
727 odsParser.emitError(odsParser.getCurrentLocation(), "failed to parse SPIRV_CooperativeMatrixPropertiesNVAttr parameter 'n_size' which is to be a `int`");
728 return {};
729 }
730 } else if (!_seen_k_size && _paramKey == "k_size") {
731 _seen_k_size = true;
732
733 // Parse variable 'k_size'
734 _result_k_size = ::mlir::FieldParser<int>::parse(odsParser);
735 if (::mlir::failed(_result_k_size)) {
736 odsParser.emitError(odsParser.getCurrentLocation(), "failed to parse SPIRV_CooperativeMatrixPropertiesNVAttr parameter 'k_size' which is to be a `int`");
737 return {};
738 }
739 } else if (!_seen_a_type && _paramKey == "a_type") {
740 _seen_a_type = true;
741
742 // Parse variable 'a_type'
743 _result_a_type = ::mlir::FieldParser<mlir::Type>::parse(odsParser);
744 if (::mlir::failed(_result_a_type)) {
745 odsParser.emitError(odsParser.getCurrentLocation(), "failed to parse SPIRV_CooperativeMatrixPropertiesNVAttr parameter 'a_type' which is to be a `mlir::Type`");
746 return {};
747 }
748 } else if (!_seen_b_type && _paramKey == "b_type") {
749 _seen_b_type = true;
750
751 // Parse variable 'b_type'
752 _result_b_type = ::mlir::FieldParser<mlir::Type>::parse(odsParser);
753 if (::mlir::failed(_result_b_type)) {
754 odsParser.emitError(odsParser.getCurrentLocation(), "failed to parse SPIRV_CooperativeMatrixPropertiesNVAttr parameter 'b_type' which is to be a `mlir::Type`");
755 return {};
756 }
757 } else if (!_seen_c_type && _paramKey == "c_type") {
758 _seen_c_type = true;
759
760 // Parse variable 'c_type'
761 _result_c_type = ::mlir::FieldParser<mlir::Type>::parse(odsParser);
762 if (::mlir::failed(_result_c_type)) {
763 odsParser.emitError(odsParser.getCurrentLocation(), "failed to parse SPIRV_CooperativeMatrixPropertiesNVAttr parameter 'c_type' which is to be a `mlir::Type`");
764 return {};
765 }
766 } else if (!_seen_result_type && _paramKey == "result_type") {
767 _seen_result_type = true;
768
769 // Parse variable 'result_type'
770 _result_result_type = ::mlir::FieldParser<mlir::Type>::parse(odsParser);
771 if (::mlir::failed(_result_result_type)) {
772 odsParser.emitError(odsParser.getCurrentLocation(), "failed to parse SPIRV_CooperativeMatrixPropertiesNVAttr parameter 'result_type' which is to be a `mlir::Type`");
773 return {};
774 }
775 } else if (!_seen_scope && _paramKey == "scope") {
776 _seen_scope = true;
777
778 // Parse variable 'scope'
779 _result_scope = ::mlir::FieldParser<mlir::spirv::ScopeAttr>::parse(odsParser);
780 if (::mlir::failed(_result_scope)) {
781 odsParser.emitError(odsParser.getCurrentLocation(), "failed to parse SPIRV_CooperativeMatrixPropertiesNVAttr parameter 'scope' which is to be a `mlir::spirv::ScopeAttr`");
782 return {};
783 }
784 } else {
785 odsParser.emitError(odsParser.getCurrentLocation(), "duplicate or unknown struct parameter name: ") << _paramKey;
786 return {};
787 }
788 return true;
789 };
790 for (unsigned odsStructIndex = 0; odsStructIndex < 8; ++odsStructIndex) {
791 ::llvm::StringRef _paramKey;
792 if (odsParser.parseKeyword(&_paramKey)) {
793 odsParser.emitError(odsParser.getCurrentLocation(),
794 "expected a parameter name in struct");
795 return {};
796 }
797 if (!_loop_body(_paramKey)) return {};
798 if ((odsStructIndex != 8 - 1) && odsParser.parseComma())
799 return {};
800 }
801 }
802 // Parse literal '>'
803 if (odsParser.parseGreater()) return {};
804 assert(::mlir::succeeded(_result_m_size))(static_cast <bool> (::mlir::succeeded(_result_m_size))
? void (0) : __assert_fail ("::mlir::succeeded(_result_m_size)"
, "tools/mlir/include/mlir/Dialect/SPIRV/IR/SPIRVAttributes.cpp.inc"
, 804, __extension__ __PRETTY_FUNCTION__))
;
805 assert(::mlir::succeeded(_result_n_size))(static_cast <bool> (::mlir::succeeded(_result_n_size))
? void (0) : __assert_fail ("::mlir::succeeded(_result_n_size)"
, "tools/mlir/include/mlir/Dialect/SPIRV/IR/SPIRVAttributes.cpp.inc"
, 805, __extension__ __PRETTY_FUNCTION__))
;
806 assert(::mlir::succeeded(_result_k_size))(static_cast <bool> (::mlir::succeeded(_result_k_size))
? void (0) : __assert_fail ("::mlir::succeeded(_result_k_size)"
, "tools/mlir/include/mlir/Dialect/SPIRV/IR/SPIRVAttributes.cpp.inc"
, 806, __extension__ __PRETTY_FUNCTION__))
;
807 assert(::mlir::succeeded(_result_a_type))(static_cast <bool> (::mlir::succeeded(_result_a_type))
? void (0) : __assert_fail ("::mlir::succeeded(_result_a_type)"
, "tools/mlir/include/mlir/Dialect/SPIRV/IR/SPIRVAttributes.cpp.inc"
, 807, __extension__ __PRETTY_FUNCTION__))
;
808 assert(::mlir::succeeded(_result_b_type))(static_cast <bool> (::mlir::succeeded(_result_b_type))
? void (0) : __assert_fail ("::mlir::succeeded(_result_b_type)"
, "tools/mlir/include/mlir/Dialect/SPIRV/IR/SPIRVAttributes.cpp.inc"
, 808, __extension__ __PRETTY_FUNCTION__))
;
809 assert(::mlir::succeeded(_result_c_type))(static_cast <bool> (::mlir::succeeded(_result_c_type))
? void (0) : __assert_fail ("::mlir::succeeded(_result_c_type)"
, "tools/mlir/include/mlir/Dialect/SPIRV/IR/SPIRVAttributes.cpp.inc"
, 809, __extension__ __PRETTY_FUNCTION__))
;
810 assert(::mlir::succeeded(_result_result_type))(static_cast <bool> (::mlir::succeeded(_result_result_type
)) ? void (0) : __assert_fail ("::mlir::succeeded(_result_result_type)"
, "tools/mlir/include/mlir/Dialect/SPIRV/IR/SPIRVAttributes.cpp.inc"
, 810, __extension__ __PRETTY_FUNCTION__))
;
811 assert(::mlir::succeeded(_result_scope))(static_cast <bool> (::mlir::succeeded(_result_scope)) ?
void (0) : __assert_fail ("::mlir::succeeded(_result_scope)"
, "tools/mlir/include/mlir/Dialect/SPIRV/IR/SPIRVAttributes.cpp.inc"
, 811, __extension__ __PRETTY_FUNCTION__))
;
812 return CooperativeMatrixPropertiesNVAttr::get(odsParser.getContext(),
813 int((*_result_m_size)),
814 int((*_result_n_size)),
815 int((*_result_k_size)),
816 mlir::Type((*_result_a_type)),
817 mlir::Type((*_result_b_type)),
818 mlir::Type((*_result_c_type)),
819 mlir::Type((*_result_result_type)),
820 mlir::spirv::ScopeAttr((*_result_scope)));
821}
822
823void CooperativeMatrixPropertiesNVAttr::print(::mlir::AsmPrinter &odsPrinter) const {
824 ::mlir::Builder odsBuilder(getContext());
825 odsPrinter << "<";
826 {
827 bool _firstPrinted = true;
828 if (!_firstPrinted) odsPrinter << ", ";
829 _firstPrinted = false;
830 odsPrinter << "m_size = ";
831 odsPrinter.printStrippedAttrOrType(getMSize());
832 if (!_firstPrinted) odsPrinter << ", ";
833 _firstPrinted = false;
834 odsPrinter << "n_size = ";
835 odsPrinter.printStrippedAttrOrType(getNSize());
836 if (!_firstPrinted) odsPrinter << ", ";
837 _firstPrinted = false;
838 odsPrinter << "k_size = ";
839 odsPrinter.printStrippedAttrOrType(getKSize());
840 if (!_firstPrinted) odsPrinter << ", ";
841 _firstPrinted = false;
842 odsPrinter << "a_type = ";
843 odsPrinter.printStrippedAttrOrType(getAType());
844 if (!_firstPrinted) odsPrinter << ", ";
845 _firstPrinted = false;
846 odsPrinter << "b_type = ";
847 odsPrinter.printStrippedAttrOrType(getBType());
848 if (!_firstPrinted) odsPrinter << ", ";
849 _firstPrinted = false;
850 odsPrinter << "c_type = ";
851 odsPrinter.printStrippedAttrOrType(getCType());
852 if (!_firstPrinted) odsPrinter << ", ";
853 _firstPrinted = false;
854 odsPrinter << "result_type = ";
855 odsPrinter.printStrippedAttrOrType(getResultType());
856 if (!_firstPrinted) odsPrinter << ", ";
857 _firstPrinted = false;
858 odsPrinter << "scope = ";
859 odsPrinter.printStrippedAttrOrType(getScope());
860 }
861 odsPrinter << ">";
862}
863
864int CooperativeMatrixPropertiesNVAttr::getMSize() const {
865 return getImpl()->m_size;
866}
867
868int CooperativeMatrixPropertiesNVAttr::getNSize() const {
869 return getImpl()->n_size;
870}
871
872int CooperativeMatrixPropertiesNVAttr::getKSize() const {
873 return getImpl()->k_size;
874}
875
876mlir::Type CooperativeMatrixPropertiesNVAttr::getAType() const {
877 return getImpl()->a_type;
878}
879
880mlir::Type CooperativeMatrixPropertiesNVAttr::getBType() const {
881 return getImpl()->b_type;
882}
883
884mlir::Type CooperativeMatrixPropertiesNVAttr::getCType() const {
885 return getImpl()->c_type;
886}
887
888mlir::Type CooperativeMatrixPropertiesNVAttr::getResultType() const {
889 return getImpl()->result_type;
890}
891
892mlir::spirv::ScopeAttr CooperativeMatrixPropertiesNVAttr::getScope() const {
893 return getImpl()->scope;
894}
895
896} // namespace spirv
897} // namespace mlir
898MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::spirv::CooperativeMatrixPropertiesNVAttr)namespace mlir { namespace detail { SelfOwningTypeID TypeIDResolver
< ::mlir::spirv::CooperativeMatrixPropertiesNVAttr>::id
= {}; } }
899namespace mlir {
900namespace spirv {
901namespace detail {
902struct DecorationAttrStorage : public ::mlir::AttributeStorage {
903 using KeyTy = std::tuple<::mlir::spirv::Decoration>;
904 DecorationAttrStorage(::mlir::spirv::Decoration value) : value(value) {}
905
906 bool operator==(const KeyTy &tblgenKey) const {
907 return (value == std::get<0>(tblgenKey));
908 }
909
910 static ::llvm::hash_code hashKey(const KeyTy &tblgenKey) {
911 return ::llvm::hash_combine(std::get<0>(tblgenKey));
912 }
913
914 static DecorationAttrStorage *construct(::mlir::AttributeStorageAllocator &allocator, const KeyTy &tblgenKey) {
915 auto value = std::get<0>(tblgenKey);
916 return new (allocator.allocate<DecorationAttrStorage>()) DecorationAttrStorage(value);
917 }
918
919 ::mlir::spirv::Decoration value;
920};
921} // namespace detail
922DecorationAttr DecorationAttr::get(::mlir::MLIRContext *context, ::mlir::spirv::Decoration value) {
923 return Base::get(context, value);
924}
925
926::mlir::Attribute DecorationAttr::parse(::mlir::AsmParser &odsParser, ::mlir::Type odsType) {
927 ::mlir::Builder odsBuilder(odsParser.getContext());
928 ::llvm::SMLoc odsLoc = odsParser.getCurrentLocation();
929 (void) odsLoc;
930 ::mlir::FailureOr<::mlir::spirv::Decoration> _result_value;
931 // Parse literal '<'
932 if (odsParser.parseLess()) return {};
933
934 // Parse variable 'value'
935 _result_value = [&]() -> ::mlir::FailureOr<::mlir::spirv::Decoration> {
936 auto loc = odsParser.getCurrentLocation();
937 ::llvm::StringRef enumKeyword;
938 if (::mlir::failed(odsParser.parseKeyword(&enumKeyword)))
939 return ::mlir::failure();
940 auto maybeEnum = ::mlir::spirv::symbolizeDecoration(enumKeyword);
941 if (maybeEnum)
942 return *maybeEnum;
943 return {(::mlir::LogicalResult)(odsParser.emitError(loc) << "expected " << "::mlir::spirv::Decoration" << " to be one of: " << "RelaxedPrecision" << ", " << "SpecId" << ", " << "Block" << ", " << "BufferBlock" << ", " << "RowMajor" << ", " << "ColMajor" << ", " << "ArrayStride" << ", " << "MatrixStride" << ", " << "GLSLShared" << ", " << "GLSLPacked" << ", " << "CPacked" << ", " << "BuiltIn" << ", " << "NoPerspective" << ", " << "Flat" << ", " << "Patch" << ", " << "Centroid" << ", " << "Sample" << ", " << "Invariant" << ", " << "Restrict" << ", " << "Aliased" << ", " << "Volatile" << ", " << "Constant" << ", " << "Coherent" << ", " << "NonWritable" << ", " << "NonReadable" << ", " << "Uniform" << ", " << "UniformId" << ", " << "SaturatedConversion" << ", " << "Stream" << ", " << "Location" << ", " << "Component" << ", " << "Index" << ", " << "Binding" << ", " << "DescriptorSet" << ", " << "Offset" << ", " << "XfbBuffer" << ", " << "XfbStride" << ", " << "FuncParamAttr" << ", " << "FPRoundingMode" << ", " << "FPFastMathMode" << ", " << "LinkageAttributes" << ", " << "NoContraction" << ", " << "InputAttachmentIndex" << ", " << "Alignment" << ", " << "MaxByteOffset" << ", " << "AlignmentId" << ", " << "MaxByteOffsetId" << ", " << "NoSignedWrap" << ", " << "NoUnsignedWrap" << ", " << "ExplicitInterpAMD" << ", " << "OverrideCoverageNV" << ", " << "PassthroughNV" << ", " << "ViewportRelativeNV" << ", " << "SecondaryViewportRelativeNV" << ", " << "PerPrimitiveNV" << ", " << "PerViewNV" << ", " << "PerTaskNV" << ", " << "PerVertexKHR" << ", " << "NonUniform" << ", " << "RestrictPointer" << ", " << "AliasedPointer" << ", " << "BindlessSamplerNV" << ", " << "BindlessImageNV" << ", " << "BoundSamplerNV" << ", " << "BoundImageNV" << ", " << "SIMTCallINTEL" << ", " << "ReferencedIndirectlyINTEL" << ", " << "ClobberINTEL" << ", " << "SideEffectsINTEL" << ", " << "VectorComputeVariableINTEL" << ", " << "FuncParamIOKindINTEL" << ", " << "VectorComputeFunctionINTEL" << ", " << "StackCallINTEL" << ", " << "GlobalVariableOffsetINTEL" << ", " << "CounterBuffer" << ", " << "UserSemantic" << ", " << "UserTypeGOOGLE" << ", " << "FunctionRoundingModeINTEL" << ", " << "FunctionDenormModeINTEL" << ", " << "RegisterINTEL" << ", " << "MemoryINTEL" << ", " << "NumbanksINTEL" << ", " << "BankwidthINTEL" << ", " << "MaxPrivateCopiesINTEL" << ", " << "SinglepumpINTEL" << ", " << "DoublepumpINTEL" << ", " << "MaxReplicatesINTEL" << ", " << "SimpleDualPortINTEL" << ", " << "MergeINTEL" << ", " << "BankBitsINTEL" << ", " << "ForcePow2DepthINTEL" << ", " << "BurstCoalesceINTEL" << ", " << "CacheSizeINTEL" << ", " << "DontStaticallyCoalesceINTEL" << ", " << "PrefetchINTEL" << ", " << "StallEnableINTEL" << ", " << "FuseLoopsInFunctionINTEL" << ", " << "AliasScopeINTEL" << ", " << "NoAliasINTEL" << ", " << "BufferLocationINTEL" << ", " << "IOPipeStorageINTEL" << ", " << "FunctionFloatingPointModeINTEL" << ", " << "SingleElementVectorINTEL" << ", " << "VectorComputeCallableFunctionINTEL" << ", " << "MediaBlockIOINTEL")};
944 }();
945 if (::mlir::failed(_result_value)) {
946 odsParser.emitError(odsParser.getCurrentLocation(), "failed to parse SPIRV_DecorationAttr parameter 'value' which is to be a `::mlir::spirv::Decoration`");
947 return {};
948 }
949 // Parse literal '>'
950 if (odsParser.parseGreater()) return {};
951 assert(::mlir::succeeded(_result_value))(static_cast <bool> (::mlir::succeeded(_result_value)) ?
void (0) : __assert_fail ("::mlir::succeeded(_result_value)"
, "tools/mlir/include/mlir/Dialect/SPIRV/IR/SPIRVAttributes.cpp.inc"
, 951, __extension__ __PRETTY_FUNCTION__))
;
952 return DecorationAttr::get(odsParser.getContext(),
953 ::mlir::spirv::Decoration((*_result_value)));
954}
955
956void DecorationAttr::print(::mlir::AsmPrinter &odsPrinter) const {
957 ::mlir::Builder odsBuilder(getContext());
958 odsPrinter << "<";
959 odsPrinter << stringifyDecoration(getValue());
960 odsPrinter << ">";
961}
962
963::mlir::spirv::Decoration DecorationAttr::getValue() const {
964 return getImpl()->value;
965}
966
967} // namespace spirv
968} // namespace mlir
969MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::spirv::DecorationAttr)namespace mlir { namespace detail { SelfOwningTypeID TypeIDResolver
< ::mlir::spirv::DecorationAttr>::id = {}; } }
970namespace mlir {
971namespace spirv {
972namespace detail {
973struct ImageDepthInfoAttrStorage : public ::mlir::AttributeStorage {
974 using KeyTy = std::tuple<::mlir::spirv::ImageDepthInfo>;
975 ImageDepthInfoAttrStorage(::mlir::spirv::ImageDepthInfo value) : value(value) {}
976
977 bool operator==(const KeyTy &tblgenKey) const {
978 return (value == std::get<0>(tblgenKey));
979 }
980
981 static ::llvm::hash_code hashKey(const KeyTy &tblgenKey) {
982 return ::llvm::hash_combine(std::get<0>(tblgenKey));
983 }
984
985 static ImageDepthInfoAttrStorage *construct(::mlir::AttributeStorageAllocator &allocator, const KeyTy &tblgenKey) {
986 auto value = std::get<0>(tblgenKey);
987 return new (allocator.allocate<ImageDepthInfoAttrStorage>()) ImageDepthInfoAttrStorage(value);
988 }
989
990 ::mlir::spirv::ImageDepthInfo value;
991};
992} // namespace detail
993ImageDepthInfoAttr ImageDepthInfoAttr::get(::mlir::MLIRContext *context, ::mlir::spirv::ImageDepthInfo value) {
994 return Base::get(context, value);
995}
996
997::mlir::Attribute ImageDepthInfoAttr::parse(::mlir::AsmParser &odsParser, ::mlir::Type odsType) {
998 ::mlir::Builder odsBuilder(odsParser.getContext());
999 ::llvm::SMLoc odsLoc = odsParser.getCurrentLocation();
1000 (void) odsLoc;
1001 ::mlir::FailureOr<::mlir::spirv::ImageDepthInfo> _result_value;
1002 // Parse literal '<'
1003 if (odsParser.parseLess()) return {};
1004
1005 // Parse variable 'value'
1006 _result_value = [&]() -> ::mlir::FailureOr<::mlir::spirv::ImageDepthInfo> {
1007 auto loc = odsParser.getCurrentLocation();
1008 ::llvm::StringRef enumKeyword;
1009 if (::mlir::failed(odsParser.parseKeyword(&enumKeyword)))
1010 return ::mlir::failure();
1011 auto maybeEnum = ::mlir::spirv::symbolizeImageDepthInfo(enumKeyword);
1012 if (maybeEnum)
1013 return *maybeEnum;
1014 return {(::mlir::LogicalResult)(odsParser.emitError(loc) << "expected " << "::mlir::spirv::ImageDepthInfo" << " to be one of: " << "NoDepth" << ", " << "IsDepth" << ", " << "DepthUnknown")};
1015 }();
1016 if (::mlir::failed(_result_value)) {
1017 odsParser.emitError(odsParser.getCurrentLocation(), "failed to parse SPIRV_DepthAttr parameter 'value' which is to be a `::mlir::spirv::ImageDepthInfo`");
1018 return {};
1019 }
1020 // Parse literal '>'
1021 if (odsParser.parseGreater()) return {};
1022 assert(::mlir::succeeded(_result_value))(static_cast <bool> (::mlir::succeeded(_result_value)) ?
void (0) : __assert_fail ("::mlir::succeeded(_result_value)"
, "tools/mlir/include/mlir/Dialect/SPIRV/IR/SPIRVAttributes.cpp.inc"
, 1022, __extension__ __PRETTY_FUNCTION__))
;
1023 return ImageDepthInfoAttr::get(odsParser.getContext(),
1024 ::mlir::spirv::ImageDepthInfo((*_result_value)));
1025}
1026
1027void ImageDepthInfoAttr::print(::mlir::AsmPrinter &odsPrinter) const {
1028 ::mlir::Builder odsBuilder(getContext());
1029 odsPrinter << "<";
1030 odsPrinter << stringifyImageDepthInfo(getValue());
1031 odsPrinter << ">";
1032}
1033
1034::mlir::spirv::ImageDepthInfo ImageDepthInfoAttr::getValue() const {
1035 return getImpl()->value;
1036}
1037
1038} // namespace spirv
1039} // namespace mlir
1040MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::spirv::ImageDepthInfoAttr)namespace mlir { namespace detail { SelfOwningTypeID TypeIDResolver
< ::mlir::spirv::ImageDepthInfoAttr>::id = {}; } }
1041namespace mlir {
1042namespace spirv {
1043namespace detail {
1044struct DeviceTypeAttrStorage : public ::mlir::AttributeStorage {
1045 using KeyTy = std::tuple<::mlir::spirv::DeviceType>;
1046 DeviceTypeAttrStorage(::mlir::spirv::DeviceType value) : value(value) {}
1047
1048 bool operator==(const KeyTy &tblgenKey) const {
1049 return (value == std::get<0>(tblgenKey));
1050 }
1051
1052 static ::llvm::hash_code hashKey(const KeyTy &tblgenKey) {
1053 return ::llvm::hash_combine(std::get<0>(tblgenKey));
1054 }
1055
1056 static DeviceTypeAttrStorage *construct(::mlir::AttributeStorageAllocator &allocator, const KeyTy &tblgenKey) {
1057 auto value = std::get<0>(tblgenKey);
1058 return new (allocator.allocate<DeviceTypeAttrStorage>()) DeviceTypeAttrStorage(value);
1059 }
1060
1061 ::mlir::spirv::DeviceType value;
1062};
1063} // namespace detail
1064DeviceTypeAttr DeviceTypeAttr::get(::mlir::MLIRContext *context, ::mlir::spirv::DeviceType value) {
1065 return Base::get(context, value);
1066}
1067
1068::mlir::Attribute DeviceTypeAttr::parse(::mlir::AsmParser &odsParser, ::mlir::Type odsType) {
1069 ::mlir::Builder odsBuilder(odsParser.getContext());
1070 ::llvm::SMLoc odsLoc = odsParser.getCurrentLocation();
1071 (void) odsLoc;
1072 ::mlir::FailureOr<::mlir::spirv::DeviceType> _result_value;
1073 // Parse literal '<'
1074 if (odsParser.parseLess()) return {};
1075
1076 // Parse variable 'value'
1077 _result_value = [&]() -> ::mlir::FailureOr<::mlir::spirv::DeviceType> {
1078 auto loc = odsParser.getCurrentLocation();
1079 ::llvm::StringRef enumKeyword;
1080 if (::mlir::failed(odsParser.parseKeyword(&enumKeyword)))
1081 return ::mlir::failure();
1082 auto maybeEnum = ::mlir::spirv::symbolizeDeviceType(enumKeyword);
1083 if (maybeEnum)
1084 return *maybeEnum;
1085 return {(::mlir::LogicalResult)(odsParser.emitError(loc) << "expected " << "::mlir::spirv::DeviceType" << " to be one of: " << "Other" << ", " << "IntegratedGPU" << ", " << "DiscreteGPU" << ", " << "CPU" << ", " << "Unknown")};
1086 }();
1087 if (::mlir::failed(_result_value)) {
1088 odsParser.emitError(odsParser.getCurrentLocation(), "failed to parse SPIRV_DeviceTypeAttr parameter 'value' which is to be a `::mlir::spirv::DeviceType`");
1089 return {};
1090 }
1091 // Parse literal '>'
1092 if (odsParser.parseGreater()) return {};
1093 assert(::mlir::succeeded(_result_value))(static_cast <bool> (::mlir::succeeded(_result_value)) ?
void (0) : __assert_fail ("::mlir::succeeded(_result_value)"
, "tools/mlir/include/mlir/Dialect/SPIRV/IR/SPIRVAttributes.cpp.inc"
, 1093, __extension__ __PRETTY_FUNCTION__))
;
1094 return DeviceTypeAttr::get(odsParser.getContext(),
1095 ::mlir::spirv::DeviceType((*_result_value)));
1096}
1097
1098void DeviceTypeAttr::print(::mlir::AsmPrinter &odsPrinter) const {
1099 ::mlir::Builder odsBuilder(getContext());
1100 odsPrinter << "<";
1101 odsPrinter << stringifyDeviceType(getValue());
1102 odsPrinter << ">";
1103}
1104
1105::mlir::spirv::DeviceType DeviceTypeAttr::getValue() const {
1106 return getImpl()->value;
1107}
1108
1109} // namespace spirv
1110} // namespace mlir
1111MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::spirv::DeviceTypeAttr)namespace mlir { namespace detail { SelfOwningTypeID TypeIDResolver
< ::mlir::spirv::DeviceTypeAttr>::id = {}; } }
1112namespace mlir {
1113namespace spirv {
1114namespace detail {
1115struct DimAttrStorage : public ::mlir::AttributeStorage {
1116 using KeyTy = std::tuple<::mlir::spirv::Dim>;
1117 DimAttrStorage(::mlir::spirv::Dim value) : value(value) {}
1118
1119 bool operator==(const KeyTy &tblgenKey) const {
1120 return (value == std::get<0>(tblgenKey));
1121 }
1122
1123 static ::llvm::hash_code hashKey(const KeyTy &tblgenKey) {
1124 return ::llvm::hash_combine(std::get<0>(tblgenKey));
1125 }
1126
1127 static DimAttrStorage *construct(::mlir::AttributeStorageAllocator &allocator, const KeyTy &tblgenKey) {
1128 auto value = std::get<0>(tblgenKey);
1129 return new (allocator.allocate<DimAttrStorage>()) DimAttrStorage(value);
1130 }
1131
1132 ::mlir::spirv::Dim value;
1133};
1134} // namespace detail
1135DimAttr DimAttr::get(::mlir::MLIRContext *context, ::mlir::spirv::Dim value) {
1136 return Base::get(context, value);
1137}
1138
1139::mlir::Attribute DimAttr::parse(::mlir::AsmParser &odsParser, ::mlir::Type odsType) {
1140 ::mlir::Builder odsBuilder(odsParser.getContext());
1141 ::llvm::SMLoc odsLoc = odsParser.getCurrentLocation();
1142 (void) odsLoc;
1143 ::mlir::FailureOr<::mlir::spirv::Dim> _result_value;
1144 // Parse literal '<'
1145 if (odsParser.parseLess()) return {};
1146
1147 // Parse variable 'value'
1148 _result_value = [&]() -> ::mlir::FailureOr<::mlir::spirv::Dim> {
1149 auto loc = odsParser.getCurrentLocation();
1150 ::llvm::StringRef enumKeyword;
1151 if (::mlir::failed(odsParser.parseKeyword(&enumKeyword)))
1152 return ::mlir::failure();
1153 auto maybeEnum = ::mlir::spirv::symbolizeDim(enumKeyword);
1154 if (maybeEnum)
1155 return *maybeEnum;
1156 return {(::mlir::LogicalResult)(odsParser.emitError(loc) << "expected " << "::mlir::spirv::Dim" << " to be one of: " << "Dim1D" << ", " << "Dim2D" << ", " << "Dim3D" << ", " << "Cube" << ", " << "Rect" << ", " << "Buffer" << ", " << "SubpassData")};
1157 }();
1158 if (::mlir::failed(_result_value)) {
1159 odsParser.emitError(odsParser.getCurrentLocation(), "failed to parse SPIRV_DimAttr parameter 'value' which is to be a `::mlir::spirv::Dim`");
1160 return {};
1161 }
1162 // Parse literal '>'
1163 if (odsParser.parseGreater()) return {};
1164 assert(::mlir::succeeded(_result_value))(static_cast <bool> (::mlir::succeeded(_result_value)) ?
void (0) : __assert_fail ("::mlir::succeeded(_result_value)"
, "tools/mlir/include/mlir/Dialect/SPIRV/IR/SPIRVAttributes.cpp.inc"
, 1164, __extension__ __PRETTY_FUNCTION__))
;
1165 return DimAttr::get(odsParser.getContext(),
1166 ::mlir::spirv::Dim((*_result_value)));
1167}
1168
1169void DimAttr::print(::mlir::AsmPrinter &odsPrinter) const {
1170 ::mlir::Builder odsBuilder(getContext());
1171 odsPrinter << "<";
1172 odsPrinter << stringifyDim(getValue());
1173 odsPrinter << ">";
1174}
1175
1176::mlir::spirv::Dim DimAttr::getValue() const {
1177 return getImpl()->value;
1178}
1179
1180} // namespace spirv
1181} // namespace mlir
1182MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::spirv::DimAttr)namespace mlir { namespace detail { SelfOwningTypeID TypeIDResolver
< ::mlir::spirv::DimAttr>::id = {}; } }
1183namespace mlir {
1184namespace spirv {
1185namespace detail {
1186struct EntryPointABIAttrStorage : public ::mlir::AttributeStorage {
1187 using KeyTy = std::tuple<DenseIntElementsAttr>;
1188 EntryPointABIAttrStorage(DenseIntElementsAttr local_size) : local_size(local_size) {}
1189
1190 bool operator==(const KeyTy &tblgenKey) const {
1191 return (local_size == std::get<0>(tblgenKey));
1192 }
1193
1194 static ::llvm::hash_code hashKey(const KeyTy &tblgenKey) {
1195 return ::llvm::hash_combine(std::get<0>(tblgenKey));
1196 }
1197
1198 static EntryPointABIAttrStorage *construct(::mlir::AttributeStorageAllocator &allocator, const KeyTy &tblgenKey) {
1199 auto local_size = std::get<0>(tblgenKey);
1200 return new (allocator.allocate<EntryPointABIAttrStorage>()) EntryPointABIAttrStorage(local_size);
1201 }
1202
1203 DenseIntElementsAttr local_size;
1204};
1205} // namespace detail
1206EntryPointABIAttr EntryPointABIAttr::get(::mlir::MLIRContext *context, DenseIntElementsAttr local_size) {
1207 return Base::get(context, local_size);
1208}
1209
1210::mlir::Attribute EntryPointABIAttr::parse(::mlir::AsmParser &odsParser, ::mlir::Type odsType) {
1211 ::mlir::Builder odsBuilder(odsParser.getContext());
1212 ::llvm::SMLoc odsLoc = odsParser.getCurrentLocation();
1213 (void) odsLoc;
1214 ::mlir::FailureOr<DenseIntElementsAttr> _result_local_size;
1215 // Parse literal '<'
1216 if (odsParser.parseLess()) return {};
1217 // Parse parameter struct
1218 bool _seen_local_size = false;
1219 {
1220 const auto _loop_body = [&](::llvm::StringRef _paramKey) -> bool {
1221 // Parse literal '='
1222 if (odsParser.parseEqual()) return {};
1223 if (!_seen_local_size && _paramKey == "local_size") {
1224 _seen_local_size = true;
1225
1226 // Parse variable 'local_size'
1227 _result_local_size = ::mlir::FieldParser<DenseIntElementsAttr>::parse(odsParser);
1228 if (::mlir::failed(_result_local_size)) {
1229 odsParser.emitError(odsParser.getCurrentLocation(), "failed to parse SPIRV_EntryPointABIAttr parameter 'local_size' which is to be a `DenseIntElementsAttr`");
1230 return {};
1231 }
1232 } else {
1233 odsParser.emitError(odsParser.getCurrentLocation(), "duplicate or unknown struct parameter name: ") << _paramKey;
1234 return {};
1235 }
1236 return true;
1237 };
1238 ::llvm::StringRef _paramKey;
1239 if (!odsParser.parseOptionalKeyword(&_paramKey)) {
1240 if (!_loop_body(_paramKey)) return {};
1241 while (!odsParser.parseOptionalComma()) {
1242 ::llvm::StringRef _paramKey;
1243 if (odsParser.parseKeyword(&_paramKey)) {
1244 odsParser.emitError(odsParser.getCurrentLocation(),
1245 "expected a parameter name in struct");
1246 return {};
1247 }
1248 if (!_loop_body(_paramKey)) return {};
1249 }
1250 }
1251 }
1252 // Parse literal '>'
1253 if (odsParser.parseGreater()) return {};
1254 return EntryPointABIAttr::get(odsParser.getContext(),
1255 DenseIntElementsAttr((_result_local_size.value_or(DenseIntElementsAttr()))));
1256}
1257
1258void EntryPointABIAttr::print(::mlir::AsmPrinter &odsPrinter) const {
1259 ::mlir::Builder odsBuilder(getContext());
1260 odsPrinter << "<";
1261 {
1262 bool _firstPrinted = true;
1263 if (!(getLocalSize() == DenseIntElementsAttr())) {
1264 if (!_firstPrinted) odsPrinter << ", ";
1265 _firstPrinted = false;
1266 odsPrinter << "local_size = ";
1267 if (!(getLocalSize() == DenseIntElementsAttr())) {
1268 odsPrinter.printStrippedAttrOrType(getLocalSize());
1269 }
1270 }
1271 }
1272 odsPrinter << ">";
1273}
1274
1275DenseIntElementsAttr EntryPointABIAttr::getLocalSize() const {
1276 return getImpl()->local_size;
1277}
1278
1279} // namespace spirv
1280} // namespace mlir
1281MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::spirv::EntryPointABIAttr)namespace mlir { namespace detail { SelfOwningTypeID TypeIDResolver
< ::mlir::spirv::EntryPointABIAttr>::id = {}; } }
1282namespace mlir {
1283namespace spirv {
1284namespace detail {
1285struct ExecutionModeAttrStorage : public ::mlir::AttributeStorage {
1286 using KeyTy = std::tuple<::mlir::spirv::ExecutionMode>;
1287 ExecutionModeAttrStorage(::mlir::spirv::ExecutionMode value) : value(value) {}
1288
1289 bool operator==(const KeyTy &tblgenKey) const {
1290 return (value == std::get<0>(tblgenKey));
1291 }
1292
1293 static ::llvm::hash_code hashKey(const KeyTy &tblgenKey) {
1294 return ::llvm::hash_combine(std::get<0>(tblgenKey));
1295 }
1296
1297 static ExecutionModeAttrStorage *construct(::mlir::AttributeStorageAllocator &allocator, const KeyTy &tblgenKey) {
1298 auto value = std::get<0>(tblgenKey);
1299 return new (allocator.allocate<ExecutionModeAttrStorage>()) ExecutionModeAttrStorage(value);
1300 }
1301
1302 ::mlir::spirv::ExecutionMode value;
1303};
1304} // namespace detail
1305ExecutionModeAttr ExecutionModeAttr::get(::mlir::MLIRContext *context, ::mlir::spirv::ExecutionMode value) {
1306 return Base::get(context, value);
1307}
1308
1309::mlir::Attribute ExecutionModeAttr::parse(::mlir::AsmParser &odsParser, ::mlir::Type odsType) {
1310 ::mlir::Builder odsBuilder(odsParser.getContext());
1311 ::llvm::SMLoc odsLoc = odsParser.getCurrentLocation();
1312 (void) odsLoc;
1313 ::mlir::FailureOr<::mlir::spirv::ExecutionMode> _result_value;
1314 // Parse literal '<'
1315 if (odsParser.parseLess()) return {};
1316
1317 // Parse variable 'value'
1318 _result_value = [&]() -> ::mlir::FailureOr<::mlir::spirv::ExecutionMode> {
1319 auto loc = odsParser.getCurrentLocation();
1320 ::llvm::StringRef enumKeyword;
1321 if (::mlir::failed(odsParser.parseKeyword(&enumKeyword)))
1322 return ::mlir::failure();
1323 auto maybeEnum = ::mlir::spirv::symbolizeExecutionMode(enumKeyword);
1324 if (maybeEnum)
1325 return *maybeEnum;
1326 return {(::mlir::LogicalResult)(odsParser.emitError(loc) << "expected " << "::mlir::spirv::ExecutionMode" << " to be one of: " << "Invocations" << ", " << "SpacingEqual" << ", " << "SpacingFractionalEven" << ", " << "SpacingFractionalOdd" << ", " << "VertexOrderCw" << ", " << "VertexOrderCcw" << ", " << "PixelCenterInteger" << ", " << "OriginUpperLeft" << ", " << "OriginLowerLeft" << ", " << "EarlyFragmentTests" << ", " << "PointMode" << ", " << "Xfb" << ", " << "DepthReplacing" << ", " << "DepthGreater" << ", " << "DepthLess" << ", " << "DepthUnchanged" << ", " << "LocalSize" << ", " << "LocalSizeHint" << ", " << "InputPoints" << ", " << "InputLines" << ", " << "InputLinesAdjacency" << ", " << "Triangles" << ", " << "InputTrianglesAdjacency" << ", " << "Quads" << ", " << "Isolines" << ", " << "OutputVertices" << ", " << "OutputPoints" << ", " << "OutputLineStrip" << ", " << "OutputTriangleStrip" << ", " << "VecTypeHint" << ", " << "ContractionOff" << ", " << "Initializer" << ", " << "Finalizer" << ", " << "SubgroupSize" << ", " << "SubgroupsPerWorkgroup" << ", " << "SubgroupsPerWorkgroupId" << ", " << "LocalSizeId" << ", " << "LocalSizeHintId" << ", " << "SubgroupUniformControlFlowKHR" << ", " << "PostDepthCoverage" << ", " << "DenormPreserve" << ", " << "DenormFlushToZero" << ", " << "SignedZeroInfNanPreserve" << ", " << "RoundingModeRTE" << ", " << "RoundingModeRTZ" << ", " << "EarlyAndLateFragmentTestsAMD" << ", " << "StencilRefReplacingEXT" << ", " << "StencilRefUnchangedFrontAMD" << ", " << "StencilRefGreaterFrontAMD" << ", " << "StencilRefLessFrontAMD" << ", " << "StencilRefUnchangedBackAMD" << ", " << "StencilRefGreaterBackAMD" << ", " << "StencilRefLessBackAMD" << ", " << "OutputLinesNV" << ", " << "OutputPrimitivesNV" << ", " << "DerivativeGroupQuadsNV" << ", " << "DerivativeGroupLinearNV" << ", " << "OutputTrianglesNV" << ", " << "PixelInterlockOrderedEXT" << ", " << "PixelInterlockUnorderedEXT" << ", " << "SampleInterlockOrderedEXT" << ", " << "SampleInterlockUnorderedEXT" << ", " << "ShadingRateInterlockOrderedEXT" << ", " << "ShadingRateInterlockUnorderedEXT" << ", " << "SharedLocalMemorySizeINTEL" << ", " << "RoundingModeRTPINTEL" << ", " << "RoundingModeRTNINTEL" << ", " << "FloatingPointModeALTINTEL" << ", " << "FloatingPointModeIEEEINTEL" << ", " << "MaxWorkgroupSizeINTEL" << ", " << "MaxWorkDimINTEL" << ", " << "NoGlobalOffsetINTEL" << ", " << "NumSIMDWorkitemsINTEL" << ", " << "SchedulerTargetFmaxMhzINTEL" << ", " << "NamedBarrierCountINTEL")};
1327 }();
1328 if (::mlir::failed(_result_value)) {
1329 odsParser.emitError(odsParser.getCurrentLocation(), "failed to parse SPIRV_ExecutionModeAttr parameter 'value' which is to be a `::mlir::spirv::ExecutionMode`");
1330 return {};
1331 }
1332 // Parse literal '>'
1333 if (odsParser.parseGreater()) return {};
1334 assert(::mlir::succeeded(_result_value))(static_cast <bool> (::mlir::succeeded(_result_value)) ?
void (0) : __assert_fail ("::mlir::succeeded(_result_value)"
, "tools/mlir/include/mlir/Dialect/SPIRV/IR/SPIRVAttributes.cpp.inc"
, 1334, __extension__ __PRETTY_FUNCTION__))
;
1335 return ExecutionModeAttr::get(odsParser.getContext(),
1336 ::mlir::spirv::ExecutionMode((*_result_value)));
1337}
1338
1339void ExecutionModeAttr::print(::mlir::AsmPrinter &odsPrinter) const {
1340 ::mlir::Builder odsBuilder(getContext());
1341 odsPrinter << "<";
1342 odsPrinter << stringifyExecutionMode(getValue());
1343 odsPrinter << ">";
1344}
1345
1346::mlir::spirv::ExecutionMode ExecutionModeAttr::getValue() const {
1347 return getImpl()->value;
1348}
1349
1350} // namespace spirv
1351} // namespace mlir
1352MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::spirv::ExecutionModeAttr)namespace mlir { namespace detail { SelfOwningTypeID TypeIDResolver
< ::mlir::spirv::ExecutionModeAttr>::id = {}; } }
1353namespace mlir {
1354namespace spirv {
1355namespace detail {
1356struct ExecutionModelAttrStorage : public ::mlir::AttributeStorage {
1357 using KeyTy = std::tuple<::mlir::spirv::ExecutionModel>;
1358 ExecutionModelAttrStorage(::mlir::spirv::ExecutionModel value) : value(value) {}
1359
1360 bool operator==(const KeyTy &tblgenKey) const {
1361 return (value == std::get<0>(tblgenKey));
1362 }
1363
1364 static ::llvm::hash_code hashKey(const KeyTy &tblgenKey) {
1365 return ::llvm::hash_combine(std::get<0>(tblgenKey));
1366 }
1367
1368 static ExecutionModelAttrStorage *construct(::mlir::AttributeStorageAllocator &allocator, const KeyTy &tblgenKey) {
1369 auto value = std::get<0>(tblgenKey);
1370 return new (allocator.allocate<ExecutionModelAttrStorage>()) ExecutionModelAttrStorage(value);
1371 }
1372
1373 ::mlir::spirv::ExecutionModel value;
1374};
1375} // namespace detail
1376ExecutionModelAttr ExecutionModelAttr::get(::mlir::MLIRContext *context, ::mlir::spirv::ExecutionModel value) {
1377 return Base::get(context, value);
1378}
1379
1380::mlir::Attribute ExecutionModelAttr::parse(::mlir::AsmParser &odsParser, ::mlir::Type odsType) {
1381 ::mlir::Builder odsBuilder(odsParser.getContext());
1382 ::llvm::SMLoc odsLoc = odsParser.getCurrentLocation();
1383 (void) odsLoc;
1384 ::mlir::FailureOr<::mlir::spirv::ExecutionModel> _result_value;
1385 // Parse literal '<'
1386 if (odsParser.parseLess()) return {};
1387
1388 // Parse variable 'value'
1389 _result_value = [&]() -> ::mlir::FailureOr<::mlir::spirv::ExecutionModel> {
1390 auto loc = odsParser.getCurrentLocation();
1391 ::llvm::StringRef enumKeyword;
1392 if (::mlir::failed(odsParser.parseKeyword(&enumKeyword)))
1393 return ::mlir::failure();
1394 auto maybeEnum = ::mlir::spirv::symbolizeExecutionModel(enumKeyword);
1395 if (maybeEnum)
1396 return *maybeEnum;
1397 return {(::mlir::LogicalResult)(odsParser.emitError(loc) << "expected " << "::mlir::spirv::ExecutionModel" << " to be one of: " << "Vertex" << ", " << "TessellationControl" << ", " << "TessellationEvaluation" << ", " << "Geometry" << ", " << "Fragment" << ", " << "GLCompute" << ", " << "Kernel" << ", " << "TaskNV" << ", " << "MeshNV" << ", " << "RayGenerationKHR" << ", " << "IntersectionKHR" << ", " << "AnyHitKHR" << ", " << "ClosestHitKHR" << ", " << "MissKHR" << ", " << "CallableKHR")};
1398 }();
1399 if (::mlir::failed(_result_value)) {
1400 odsParser.emitError(odsParser.getCurrentLocation(), "failed to parse SPIRV_ExecutionModelAttr parameter 'value' which is to be a `::mlir::spirv::ExecutionModel`");
1401 return {};
1402 }
1403 // Parse literal '>'
1404 if (odsParser.parseGreater()) return {};
1405 assert(::mlir::succeeded(_result_value))(static_cast <bool> (::mlir::succeeded(_result_value)) ?
void (0) : __assert_fail ("::mlir::succeeded(_result_value)"
, "tools/mlir/include/mlir/Dialect/SPIRV/IR/SPIRVAttributes.cpp.inc"
, 1405, __extension__ __PRETTY_FUNCTION__))
;
1406 return ExecutionModelAttr::get(odsParser.getContext(),
1407 ::mlir::spirv::ExecutionModel((*_result_value)));
1408}
1409
1410void ExecutionModelAttr::print(::mlir::AsmPrinter &odsPrinter) const {
1411 ::mlir::Builder odsBuilder(getContext());
1412 odsPrinter << "<";
1413 odsPrinter << stringifyExecutionModel(getValue());
1414 odsPrinter << ">";
1415}
1416
1417::mlir::spirv::ExecutionModel ExecutionModelAttr::getValue() const {
1418 return getImpl()->value;
1419}
1420
1421} // namespace spirv
1422} // namespace mlir
1423MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::spirv::ExecutionModelAttr)namespace mlir { namespace detail { SelfOwningTypeID TypeIDResolver
< ::mlir::spirv::ExecutionModelAttr>::id = {}; } }
1424namespace mlir {
1425namespace spirv {
1426namespace detail {
1427struct ExtensionAttrStorage : public ::mlir::AttributeStorage {
1428 using KeyTy = std::tuple<::mlir::spirv::Extension>;
1429 ExtensionAttrStorage(::mlir::spirv::Extension value) : value(value) {}
1430
1431 bool operator==(const KeyTy &tblgenKey) const {
1432 return (value == std::get<0>(tblgenKey));
1433 }
1434
1435 static ::llvm::hash_code hashKey(const KeyTy &tblgenKey) {
1436 return ::llvm::hash_combine(std::get<0>(tblgenKey));
1437 }
1438
1439 static ExtensionAttrStorage *construct(::mlir::AttributeStorageAllocator &allocator, const KeyTy &tblgenKey) {
1440 auto value = std::get<0>(tblgenKey);
1441 return new (allocator.allocate<ExtensionAttrStorage>()) ExtensionAttrStorage(value);
1442 }
1443
1444 ::mlir::spirv::Extension value;
1445};
1446} // namespace detail
1447ExtensionAttr ExtensionAttr::get(::mlir::MLIRContext *context, ::mlir::spirv::Extension value) {
1448 return Base::get(context, value);
1449}
1450
1451::mlir::Attribute ExtensionAttr::parse(::mlir::AsmParser &odsParser, ::mlir::Type odsType) {
1452 ::mlir::Builder odsBuilder(odsParser.getContext());
1453 ::llvm::SMLoc odsLoc = odsParser.getCurrentLocation();
1454 (void) odsLoc;
1455 ::mlir::FailureOr<::mlir::spirv::Extension> _result_value;
1456 // Parse literal '<'
1457 if (odsParser.parseLess()) return {};
1458
1459 // Parse variable 'value'
1460 _result_value = [&]() -> ::mlir::FailureOr<::mlir::spirv::Extension> {
1461 auto loc = odsParser.getCurrentLocation();
1462 ::llvm::StringRef enumKeyword;
1463 if (::mlir::failed(odsParser.parseKeyword(&enumKeyword)))
1464 return ::mlir::failure();
1465 auto maybeEnum = ::mlir::spirv::symbolizeExtension(enumKeyword);
1466 if (maybeEnum)
1467 return *maybeEnum;
1468 return {(::mlir::LogicalResult)(odsParser.emitError(loc) << "expected " << "::mlir::spirv::Extension" << " to be one of: " << "SPV_KHR_16bit_storage" << ", " << "SPV_KHR_8bit_storage" << ", " << "SPV_KHR_device_group" << ", " << "SPV_KHR_float_controls" << ", " << "SPV_KHR_physical_storage_buffer" << ", " << "SPV_KHR_multiview" << ", " << "SPV_KHR_no_integer_wrap_decoration" << ", " << "SPV_KHR_post_depth_coverage" << ", " << "SPV_KHR_shader_atomic_counter_ops" << ", " << "SPV_KHR_shader_ballot" << ", " << "SPV_KHR_shader_clock" << ", " << "SPV_KHR_shader_draw_parameters" << ", " << "SPV_KHR_storage_buffer_storage_class" << ", " << "SPV_KHR_subgroup_vote" << ", " << "SPV_KHR_variable_pointers" << ", " << "SPV_KHR_vulkan_memory_model" << ", " << "SPV_KHR_expect_assume" << ", " << "SPV_KHR_integer_dot_product" << ", " << "SPV_KHR_bit_instructions" << ", " << "SPV_KHR_fragment_shading_rate" << ", " << "SPV_KHR_workgroup_memory_explicit_layout" << ", " << "SPV_KHR_ray_query" << ", " << "SPV_KHR_ray_tracing" << ", " << "SPV_KHR_subgroup_uniform_control_flow" << ", " << "SPV_KHR_linkonce_odr" << ", " << "SPV_KHR_fragment_shader_barycentric" << ", " << "SPV_KHR_ray_cull_mask" << ", " << "SPV_KHR_uniform_group_instructions" << ", " << "SPV_KHR_subgroup_rotate" << ", " << "SPV_EXT_demote_to_helper_invocation" << ", " << "SPV_EXT_descriptor_indexing" << ", " << "SPV_EXT_fragment_fully_covered" << ", " << "SPV_EXT_fragment_invocation_density" << ", " << "SPV_EXT_fragment_shader_interlock" << ", " << "SPV_EXT_physical_storage_buffer" << ", " << "SPV_EXT_shader_stencil_export" << ", " << "SPV_EXT_shader_viewport_index_layer" << ", " << "SPV_EXT_shader_atomic_float_add" << ", " << "SPV_EXT_shader_atomic_float_min_max" << ", " << "SPV_EXT_shader_image_int64" << ", " << "SPV_EXT_shader_atomic_float16_add" << ", " << "SPV_AMD_gpu_shader_half_float_fetch" << ", " << "SPV_AMD_shader_ballot" << ", " << "SPV_AMD_shader_explicit_vertex_parameter" << ", " << "SPV_AMD_shader_fragment_mask" << ", " << "SPV_AMD_shader_image_load_store_lod" << ", " << "SPV_AMD_texture_gather_bias_lod" << ", " << "SPV_AMD_shader_early_and_late_fragment_tests" << ", " << "SPV_GOOGLE_decorate_string" << ", " << "SPV_GOOGLE_hlsl_functionality1" << ", " << "SPV_GOOGLE_user_type" << ", " << "SPV_INTEL_device_side_avc_motion_estimation" << ", " << "SPV_INTEL_media_block_io" << ", " << "SPV_INTEL_shader_integer_functions2" << ", " << "SPV_INTEL_subgroups" << ", " << "SPV_INTEL_vector_compute" << ", " << "SPV_INTEL_float_controls2" << ", " << "SPV_INTEL_function_pointers" << ", " << "SPV_INTEL_inline_assembly" << ", " << "SPV_INTEL_variable_length_array" << ", " << "SPV_INTEL_fpga_memory_attributes" << ", " << "SPV_INTEL_unstructured_loop_controls" << ", " << "SPV_INTEL_fpga_loop_controls" << ", " << "SPV_INTEL_arbitrary_precision_integers" << ", " << "SPV_INTEL_arbitrary_precision_floating_point" << ", " << "SPV_INTEL_kernel_attributes" << ", " << "SPV_INTEL_fpga_memory_accesses" << ", " << "SPV_INTEL_fpga_cluster_attributes" << ", " << "SPV_INTEL_loop_fuse" << ", " << "SPV_INTEL_fpga_buffer_location" << ", " << "SPV_INTEL_arbitrary_precision_fixed_point" << ", " << "SPV_INTEL_usm_storage_classes" << ", " << "SPV_INTEL_io_pipes" << ", " << "SPV_INTEL_blocking_pipes" << ", " << "SPV_INTEL_fpga_reg" << ", " << "SPV_INTEL_long_constant_composite" << ", " << "SPV_INTEL_optnone" << ", " << "SPV_INTEL_debug_module" << ", " << "SPV_INTEL_fp_fast_math_mode" << ", " << "SPV_INTEL_memory_access_aliasing" << ", " << "SPV_INTEL_split_barrier" << ", " << "SPV_INTEL_joint_matrix" << ", " << "SPV_NV_compute_shader_derivatives" << ", " << "SPV_NV_cooperative_matrix" << ", " << "SPV_NV_fragment_shader_barycentric" << ", " << "SPV_NV_geometry_shader_passthrough" << ", " << "SPV_NV_mesh_shader" << ", " << "SPV_NV_ray_tracing" << ", " << "SPV_NV_sample_mask_override_coverage" << ", " << "SPV_NV_shader_image_footprint" << ", " << "SPV_NV_shader_sm_builtins" << ", " << "SPV_NV_shader_subgroup_partitioned" << ", " << "SPV_NV_shading_rate" << ", " << "SPV_NV_stereo_view_rendering" << ", " << "SPV_NV_viewport_array2" << ", " << "SPV_NV_bindless_texture" << ", " << "SPV_NV_ray_tracing_motion_blur" << ", " << "SPV_NVX_multiview_per_view_attributes")};
1469 }();
1470 if (::mlir::failed(_result_value)) {
1471 odsParser.emitError(odsParser.getCurrentLocation(), "failed to parse SPIRV_ExtensionAttr parameter 'value' which is to be a `::mlir::spirv::Extension`");
1472 return {};
1473 }
1474 // Parse literal '>'
1475 if (odsParser.parseGreater()) return {};
1476 assert(::mlir::succeeded(_result_value))(static_cast <bool> (::mlir::succeeded(_result_value)) ?
void (0) : __assert_fail ("::mlir::succeeded(_result_value)"
, "tools/mlir/include/mlir/Dialect/SPIRV/IR/SPIRVAttributes.cpp.inc"
, 1476, __extension__ __PRETTY_FUNCTION__))
;
1477 return ExtensionAttr::get(odsParser.getContext(),
1478 ::mlir::spirv::Extension((*_result_value)));
1479}
1480
1481void ExtensionAttr::print(::mlir::AsmPrinter &odsPrinter) const {
1482 ::mlir::Builder odsBuilder(getContext());
1483 odsPrinter << "<";
1484 odsPrinter << stringifyExtension(getValue());
1485 odsPrinter << ">";
1486}
1487
1488::mlir::spirv::Extension ExtensionAttr::getValue() const {
1489 return getImpl()->value;
1490}
1491
1492} // namespace spirv
1493} // namespace mlir
1494MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::spirv::ExtensionAttr)namespace mlir { namespace detail { SelfOwningTypeID TypeIDResolver
< ::mlir::spirv::ExtensionAttr>::id = {}; } }
1495namespace mlir {
1496namespace spirv {
1497namespace detail {
1498struct FunctionControlAttrStorage : public ::mlir::AttributeStorage {
1499 using KeyTy = std::tuple<::mlir::spirv::FunctionControl>;
1500 FunctionControlAttrStorage(::mlir::spirv::FunctionControl value) : value(value) {}
1501
1502 bool operator==(const KeyTy &tblgenKey) const {
1503 return (value == std::get<0>(tblgenKey));
1504 }
1505
1506 static ::llvm::hash_code hashKey(const KeyTy &tblgenKey) {
1507 return ::llvm::hash_combine(std::get<0>(tblgenKey));
1508 }
1509
1510 static FunctionControlAttrStorage *construct(::mlir::AttributeStorageAllocator &allocator, const KeyTy &tblgenKey) {
1511 auto value = std::get<0>(tblgenKey);
1512 return new (allocator.allocate<FunctionControlAttrStorage>()) FunctionControlAttrStorage(value);
1513 }
1514
1515 ::mlir::spirv::FunctionControl value;
1516};
1517} // namespace detail
1518FunctionControlAttr FunctionControlAttr::get(::mlir::MLIRContext *context, ::mlir::spirv::FunctionControl value) {
1519 return Base::get(context, value);
1520}
1521
1522::mlir::Attribute FunctionControlAttr::parse(::mlir::AsmParser &odsParser, ::mlir::Type odsType) {
1523 ::mlir::Builder odsBuilder(odsParser.getContext());
1524 ::llvm::SMLoc odsLoc = odsParser.getCurrentLocation();
1525 (void) odsLoc;
1526 ::mlir::FailureOr<::mlir::spirv::FunctionControl> _result_value;
1527 // Parse literal '<'
1528 if (odsParser.parseLess()) return {};
1529
1530 // Parse variable 'value'
1531 _result_value = [&]() -> ::mlir::FailureOr<::mlir::spirv::FunctionControl> {
1532 ::mlir::spirv::FunctionControl flags = {};
1533 auto loc = odsParser.getCurrentLocation();
1534 ::llvm::StringRef enumKeyword;
1535 do {
1536 if (::mlir::failed(odsParser.parseKeyword(&enumKeyword)))
1537 return ::mlir::failure();
1538 auto maybeEnum = ::mlir::spirv::symbolizeFunctionControl(enumKeyword);
1539 if (!maybeEnum) {
1540 return {(::mlir::LogicalResult)(odsParser.emitError(loc) << "expected " << "::mlir::spirv::FunctionControl" << " to be one of: " << "None" << ", " << "Inline" << ", " << "DontInline" << ", " << "Pure" << ", " << "Const" << ", " << "OptNoneINTEL")};
1541 }
1542 flags = flags | *maybeEnum;
1543 } while(::mlir::succeeded(odsParser.parseOptionalVerticalBar()));
1544 return flags;
1545 }();
1546 if (::mlir::failed(_result_value)) {
1547 odsParser.emitError(odsParser.getCurrentLocation(), "failed to parse SPIRV_FunctionControlAttr parameter 'value' which is to be a `::mlir::spirv::FunctionControl`");
1548 return {};
1549 }
1550 // Parse literal '>'
1551 if (odsParser.parseGreater()) return {};
1552 assert(::mlir::succeeded(_result_value))(static_cast <bool> (::mlir::succeeded(_result_value)) ?
void (0) : __assert_fail ("::mlir::succeeded(_result_value)"
, "tools/mlir/include/mlir/Dialect/SPIRV/IR/SPIRVAttributes.cpp.inc"
, 1552, __extension__ __PRETTY_FUNCTION__))
;
1553 return FunctionControlAttr::get(odsParser.getContext(),
1554 ::mlir::spirv::FunctionControl((*_result_value)));
1555}
1556
1557void FunctionControlAttr::print(::mlir::AsmPrinter &odsPrinter) const {
1558 ::mlir::Builder odsBuilder(getContext());
1559 odsPrinter << "<";
1560 odsPrinter << stringifyFunctionControl(getValue());
1561 odsPrinter << ">";
1562}
1563
1564::mlir::spirv::FunctionControl FunctionControlAttr::getValue() const {
1565 return getImpl()->value;
1566}
1567
1568} // namespace spirv
1569} // namespace mlir
1570MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::spirv::FunctionControlAttr)namespace mlir { namespace detail { SelfOwningTypeID TypeIDResolver
< ::mlir::spirv::FunctionControlAttr>::id = {}; } }
1571namespace mlir {
1572namespace spirv {
1573namespace detail {
1574struct GroupOperationAttrStorage : public ::mlir::AttributeStorage {
1575 using KeyTy = std::tuple<::mlir::spirv::GroupOperation>;
1576 GroupOperationAttrStorage(::mlir::spirv::GroupOperation value) : value(value) {}
1577
1578 bool operator==(const KeyTy &tblgenKey) const {
1579 return (value == std::get<0>(tblgenKey));
1580 }
1581
1582 static ::llvm::hash_code hashKey(const KeyTy &tblgenKey) {
1583 return ::llvm::hash_combine(std::get<0>(tblgenKey));
1584 }
1585
1586 static GroupOperationAttrStorage *construct(::mlir::AttributeStorageAllocator &allocator, const KeyTy &tblgenKey) {
1587 auto value = std::get<0>(tblgenKey);
1588 return new (allocator.allocate<GroupOperationAttrStorage>()) GroupOperationAttrStorage(value);
1589 }
1590
1591 ::mlir::spirv::GroupOperation value;
1592};
1593} // namespace detail
1594GroupOperationAttr GroupOperationAttr::get(::mlir::MLIRContext *context, ::mlir::spirv::GroupOperation value) {
1595 return Base::get(context, value);
1596}
1597
1598::mlir::Attribute GroupOperationAttr::parse(::mlir::AsmParser &odsParser, ::mlir::Type odsType) {
1599 ::mlir::Builder odsBuilder(odsParser.getContext());
1600 ::llvm::SMLoc odsLoc = odsParser.getCurrentLocation();
1601 (void) odsLoc;
1602 ::mlir::FailureOr<::mlir::spirv::GroupOperation> _result_value;
1603 // Parse literal '<'
1604 if (odsParser.parseLess()) return {};
1605
1606 // Parse variable 'value'
1607 _result_value = [&]() -> ::mlir::FailureOr<::mlir::spirv::GroupOperation> {
1608 auto loc = odsParser.getCurrentLocation();
1609 ::llvm::StringRef enumKeyword;
1610 if (::mlir::failed(odsParser.parseKeyword(&enumKeyword)))
1611 return ::mlir::failure();
1612 auto maybeEnum = ::mlir::spirv::symbolizeGroupOperation(enumKeyword);
1613 if (maybeEnum)
1614 return *maybeEnum;
1615 return {(::mlir::LogicalResult)(odsParser.emitError(loc) << "expected " << "::mlir::spirv::GroupOperation" << " to be one of: " << "Reduce" << ", " << "InclusiveScan" << ", " << "ExclusiveScan" << ", " << "ClusteredReduce" << ", " << "PartitionedReduceNV" << ", " << "PartitionedInclusiveScanNV" << ", " << "PartitionedExclusiveScanNV")};
1616 }();
1617 if (::mlir::failed(_result_value)) {
1618 odsParser.emitError(odsParser.getCurrentLocation(), "failed to parse SPIRV_GroupOperationAttr parameter 'value' which is to be a `::mlir::spirv::GroupOperation`");
1619 return {};
1620 }
1621 // Parse literal '>'
1622 if (odsParser.parseGreater()) return {};
1623 assert(::mlir::succeeded(_result_value))(static_cast <bool> (::mlir::succeeded(_result_value)) ?
void (0) : __assert_fail ("::mlir::succeeded(_result_value)"
, "tools/mlir/include/mlir/Dialect/SPIRV/IR/SPIRVAttributes.cpp.inc"
, 1623, __extension__ __PRETTY_FUNCTION__))
;
1624 return GroupOperationAttr::get(odsParser.getContext(),
1625 ::mlir::spirv::GroupOperation((*_result_value)));
1626}
1627
1628void GroupOperationAttr::print(::mlir::AsmPrinter &odsPrinter) const {
1629 ::mlir::Builder odsBuilder(getContext());
1630 odsPrinter << "<";
1631 odsPrinter << stringifyGroupOperation(getValue());
1632 odsPrinter << ">";
1633}
1634
1635::mlir::spirv::GroupOperation GroupOperationAttr::getValue() const {
1636 return getImpl()->value;
1637}
1638
1639} // namespace spirv
1640} // namespace mlir
1641MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::spirv::GroupOperationAttr)namespace mlir { namespace detail { SelfOwningTypeID TypeIDResolver
< ::mlir::spirv::GroupOperationAttr>::id = {}; } }
1642namespace mlir {
1643namespace spirv {
1644namespace detail {
1645struct ImageFormatAttrStorage : public ::mlir::AttributeStorage {
1646 using KeyTy = std::tuple<::mlir::spirv::ImageFormat>;
1647 ImageFormatAttrStorage(::mlir::spirv::ImageFormat value) : value(value) {}
1648
1649 bool operator==(const KeyTy &tblgenKey) const {
1650 return (value == std::get<0>(tblgenKey));
1651 }
1652
1653 static ::llvm::hash_code hashKey(const KeyTy &tblgenKey) {
1654 return ::llvm::hash_combine(std::get<0>(tblgenKey));
1655 }
1656
1657 static ImageFormatAttrStorage *construct(::mlir::AttributeStorageAllocator &allocator, const KeyTy &tblgenKey) {
1658 auto value = std::get<0>(tblgenKey);
1659 return new (allocator.allocate<ImageFormatAttrStorage>()) ImageFormatAttrStorage(value);
1660 }
1661
1662 ::mlir::spirv::ImageFormat value;
1663};
1664} // namespace detail
1665ImageFormatAttr ImageFormatAttr::get(::mlir::MLIRContext *context, ::mlir::spirv::ImageFormat value) {
1666 return Base::get(context, value);
1667}
1668
1669::mlir::Attribute ImageFormatAttr::parse(::mlir::AsmParser &odsParser, ::mlir::Type odsType) {
1670 ::mlir::Builder odsBuilder(odsParser.getContext());
1671 ::llvm::SMLoc odsLoc = odsParser.getCurrentLocation();
1672 (void) odsLoc;
1673 ::mlir::FailureOr<::mlir::spirv::ImageFormat> _result_value;
1674 // Parse literal '<'
1675 if (odsParser.parseLess()) return {};
1676
1677 // Parse variable 'value'
1678 _result_value = [&]() -> ::mlir::FailureOr<::mlir::spirv::ImageFormat> {
1679 auto loc = odsParser.getCurrentLocation();
1680 ::llvm::StringRef enumKeyword;
1681 if (::mlir::failed(odsParser.parseKeyword(&enumKeyword)))
1682 return ::mlir::failure();
1683 auto maybeEnum = ::mlir::spirv::symbolizeImageFormat(enumKeyword);
1684 if (maybeEnum)
1685 return *maybeEnum;
1686 return {(::mlir::LogicalResult)(odsParser.emitError(loc) << "expected " << "::mlir::spirv::ImageFormat" << " to be one of: " << "Unknown" << ", " << "Rgba32f" << ", " << "Rgba16f" << ", " << "R32f" << ", " << "Rgba8" << ", " << "Rgba8Snorm" << ", " << "Rg32f" << ", " << "Rg16f" << ", " << "R11fG11fB10f" << ", " << "R16f" << ", " << "Rgba16" << ", " << "Rgb10A2" << ", " << "Rg16" << ", " << "Rg8" << ", " << "R16" << ", " << "R8" << ", " << "Rgba16Snorm" << ", " << "Rg16Snorm" << ", " << "Rg8Snorm" << ", " << "R16Snorm" << ", " << "R8Snorm" << ", " << "Rgba32i" << ", " << "Rgba16i" << ", " << "Rgba8i" << ", " << "R32i" << ", " << "Rg32i" << ", " << "Rg16i" << ", " << "Rg8i" << ", " << "R16i" << ", " << "R8i" << ", " << "Rgba32ui" << ", " << "Rgba16ui" << ", " << "Rgba8ui" << ", " << "R32ui" << ", " << "Rgb10a2ui" << ", " << "Rg32ui" << ", " << "Rg16ui" << ", " << "Rg8ui" << ", " << "R16ui" << ", " << "R8ui" << ", " << "R64ui" << ", " << "R64i")};
1687 }();
1688 if (::mlir::failed(_result_value)) {
1689 odsParser.emitError(odsParser.getCurrentLocation(), "failed to parse SPIRV_ImageFormatAttr parameter 'value' which is to be a `::mlir::spirv::ImageFormat`");
1690 return {};
1691 }
1692 // Parse literal '>'
1693 if (odsParser.parseGreater()) return {};
1694 assert(::mlir::succeeded(_result_value))(static_cast <bool> (::mlir::succeeded(_result_value)) ?
void (0) : __assert_fail ("::mlir::succeeded(_result_value)"
, "tools/mlir/include/mlir/Dialect/SPIRV/IR/SPIRVAttributes.cpp.inc"
, 1694, __extension__ __PRETTY_FUNCTION__))
;
1695 return ImageFormatAttr::get(odsParser.getContext(),
1696 ::mlir::spirv::ImageFormat((*_result_value)));
1697}
1698
1699void ImageFormatAttr::print(::mlir::AsmPrinter &odsPrinter) const {
1700 ::mlir::Builder odsBuilder(getContext());
1701 odsPrinter << "<";
1702 odsPrinter << stringifyImageFormat(getValue());
1703 odsPrinter << ">";
1704}
1705
1706::mlir::spirv::ImageFormat ImageFormatAttr::getValue() const {
1707 return getImpl()->value;
1708}
1709
1710} // namespace spirv
1711} // namespace mlir
1712MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::spirv::ImageFormatAttr)namespace mlir { namespace detail { SelfOwningTypeID TypeIDResolver
< ::mlir::spirv::ImageFormatAttr>::id = {}; } }
1713namespace mlir {
1714namespace spirv {
1715namespace detail {
1716struct ImageOperandsAttrStorage : public ::mlir::AttributeStorage {
1717 using KeyTy = std::tuple<::mlir::spirv::ImageOperands>;
1718 ImageOperandsAttrStorage(::mlir::spirv::ImageOperands value) : value(value) {}
1719
1720 bool operator==(const KeyTy &tblgenKey) const {
1721 return (value == std::get<0>(tblgenKey));
1722 }
1723
1724 static ::llvm::hash_code hashKey(const KeyTy &tblgenKey) {
1725 return ::llvm::hash_combine(std::get<0>(tblgenKey));
1726 }
1727
1728 static ImageOperandsAttrStorage *construct(::mlir::AttributeStorageAllocator &allocator, const KeyTy &tblgenKey) {
1729 auto value = std::get<0>(tblgenKey);
1730 return new (allocator.allocate<ImageOperandsAttrStorage>()) ImageOperandsAttrStorage(value);
1731 }
1732
1733 ::mlir::spirv::ImageOperands value;
1734};
1735} // namespace detail
1736ImageOperandsAttr ImageOperandsAttr::get(::mlir::MLIRContext *context, ::mlir::spirv::ImageOperands value) {
1737 return Base::get(context, value);
1738}
1739
1740::mlir::Attribute ImageOperandsAttr::parse(::mlir::AsmParser &odsParser, ::mlir::Type odsType) {
1741 ::mlir::Builder odsBuilder(odsParser.getContext());
1742 ::llvm::SMLoc odsLoc = odsParser.getCurrentLocation();
1743 (void) odsLoc;
1744 ::mlir::FailureOr<::mlir::spirv::ImageOperands> _result_value;
1745 // Parse literal '<'
1746 if (odsParser.parseLess()) return {};
1747
1748 // Parse variable 'value'
1749 _result_value = [&]() -> ::mlir::FailureOr<::mlir::spirv::ImageOperands> {
1750 ::mlir::spirv::ImageOperands flags = {};
1751 auto loc = odsParser.getCurrentLocation();
1752 ::llvm::StringRef enumKeyword;
1753 do {
1754 if (::mlir::failed(odsParser.parseKeyword(&enumKeyword)))
1755 return ::mlir::failure();
1756 auto maybeEnum = ::mlir::spirv::symbolizeImageOperands(enumKeyword);
1757 if (!maybeEnum) {
1758 return {(::mlir::LogicalResult)(odsParser.emitError(loc) << "expected " << "::mlir::spirv::ImageOperands" << " to be one of: " << "None" << ", " << "Bias" << ", " << "Lod" << ", " << "Grad" << ", " << "ConstOffset" << ", " << "Offset" << ", " << "ConstOffsets" << ", " << "Sample" << ", " << "MinLod" << ", " << "MakeTexelAvailable" << ", " << "MakeTexelVisible" << ", " << "NonPrivateTexel" << ", " << "VolatileTexel" << ", " << "SignExtend" << ", " << "Offsets" << ", " << "ZeroExtend" << ", " << "Nontemporal")};
1759 }
1760 flags = flags | *maybeEnum;
1761 } while(::mlir::succeeded(odsParser.parseOptionalVerticalBar()));
1762 return flags;
1763 }();
1764 if (::mlir::failed(_result_value)) {
1765 odsParser.emitError(odsParser.getCurrentLocation(), "failed to parse SPIRV_ImageOperandsAttr parameter 'value' which is to be a `::mlir::spirv::ImageOperands`");
1766 return {};
1767 }
1768 // Parse literal '>'
1769 if (odsParser.parseGreater()) return {};
1770 assert(::mlir::succeeded(_result_value))(static_cast <bool> (::mlir::succeeded(_result_value)) ?
void (0) : __assert_fail ("::mlir::succeeded(_result_value)"
, "tools/mlir/include/mlir/Dialect/SPIRV/IR/SPIRVAttributes.cpp.inc"
, 1770, __extension__ __PRETTY_FUNCTION__))
;
1771 return ImageOperandsAttr::get(odsParser.getContext(),
1772 ::mlir::spirv::ImageOperands((*_result_value)));
1773}
1774
1775void ImageOperandsAttr::print(::mlir::AsmPrinter &odsPrinter) const {
1776 ::mlir::Builder odsBuilder(getContext());
1777 odsPrinter << "<";
1778 odsPrinter << stringifyImageOperands(getValue());
1779 odsPrinter << ">";
1780}
1781
1782::mlir::spirv::ImageOperands ImageOperandsAttr::getValue() const {
1783 return getImpl()->value;
1784}
1785
1786} // namespace spirv
1787} // namespace mlir
1788MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::spirv::ImageOperandsAttr)namespace mlir { namespace detail { SelfOwningTypeID TypeIDResolver
< ::mlir::spirv::ImageOperandsAttr>::id = {}; } }
1789namespace mlir {
1790namespace spirv {
1791namespace detail {
1792struct JointMatrixPropertiesINTELAttrStorage : public ::mlir::AttributeStorage {
1793 using KeyTy = std::tuple<int, int, int, mlir::Type, mlir::Type, mlir::Type, mlir::Type, mlir::spirv::ScopeAttr>;
1794 JointMatrixPropertiesINTELAttrStorage(int m_size, int n_size, int k_size, mlir::Type a_type, mlir::Type b_type, mlir::Type c_type, mlir::Type result_type, mlir::spirv::ScopeAttr scope) : m_size(m_size), n_size(n_size), k_size(k_size), a_type(a_type), b_type(b_type), c_type(c_type), result_type(result_type), scope(scope) {}
1795
1796 bool operator==(const KeyTy &tblgenKey) const {
1797 return (m_size == std::get<0>(tblgenKey)) && (n_size == std::get<1>(tblgenKey)) && (k_size == std::get<2>(tblgenKey)) && (a_type == std::get<3>(tblgenKey)) && (b_type == std::get<4>(tblgenKey)) && (c_type == std::get<5>(tblgenKey)) && (result_type == std::get<6>(tblgenKey)) && (scope == std::get<7>(tblgenKey));
1798 }
1799
1800 static ::llvm::hash_code hashKey(const KeyTy &tblgenKey) {
1801 return ::llvm::hash_combine(std::get<0>(tblgenKey), std::get<1>(tblgenKey), std::get<2>(tblgenKey), std::get<3>(tblgenKey), std::get<4>(tblgenKey), std::get<5>(tblgenKey), std::get<6>(tblgenKey), std::get<7>(tblgenKey));
1802 }
1803
1804 static JointMatrixPropertiesINTELAttrStorage *construct(::mlir::AttributeStorageAllocator &allocator, const KeyTy &tblgenKey) {
1805 auto m_size = std::get<0>(tblgenKey);
1806 auto n_size = std::get<1>(tblgenKey);
1807 auto k_size = std::get<2>(tblgenKey);
1808 auto a_type = std::get<3>(tblgenKey);
1809 auto b_type = std::get<4>(tblgenKey);
1810 auto c_type = std::get<5>(tblgenKey);
1811 auto result_type = std::get<6>(tblgenKey);
1812 auto scope = std::get<7>(tblgenKey);
1813 return new (allocator.allocate<JointMatrixPropertiesINTELAttrStorage>()) JointMatrixPropertiesINTELAttrStorage(m_size, n_size, k_size, a_type, b_type, c_type, result_type, scope);
1814 }
1815
1816 int m_size;
1817 int n_size;
1818 int k_size;
1819 mlir::Type a_type;
1820 mlir::Type b_type;
1821 mlir::Type c_type;
1822 mlir::Type result_type;
1823 mlir::spirv::ScopeAttr scope;
1824};
1825} // namespace detail
1826JointMatrixPropertiesINTELAttr JointMatrixPropertiesINTELAttr::get(::mlir::MLIRContext *context, int m_size, int n_size, int k_size, mlir::Type a_type, mlir::Type b_type, mlir::Type c_type, mlir::Type result_type, mlir::spirv::ScopeAttr scope) {
1827 return Base::get(context, m_size, n_size, k_size, a_type, b_type, c_type, result_type, scope);
1828}
1829
1830::mlir::Attribute JointMatrixPropertiesINTELAttr::parse(::mlir::AsmParser &odsParser, ::mlir::Type odsType) {
1831 ::mlir::Builder odsBuilder(odsParser.getContext());
1832 ::llvm::SMLoc odsLoc = odsParser.getCurrentLocation();
1833 (void) odsLoc;
1834 ::mlir::FailureOr<int> _result_m_size;
1835 ::mlir::FailureOr<int> _result_n_size;
1836 ::mlir::FailureOr<int> _result_k_size;
1837 ::mlir::FailureOr<mlir::Type> _result_a_type;
1838 ::mlir::FailureOr<mlir::Type> _result_b_type;
1839 ::mlir::FailureOr<mlir::Type> _result_c_type;
1840 ::mlir::FailureOr<mlir::Type> _result_result_type;
1841 ::mlir::FailureOr<mlir::spirv::ScopeAttr> _result_scope;
1842 // Parse literal '<'
1843 if (odsParser.parseLess()) return {};
1844 // Parse parameter struct
1845 bool _seen_m_size = false;
1846 bool _seen_n_size = false;
1847 bool _seen_k_size = false;
1848 bool _seen_a_type = false;
1849 bool _seen_b_type = false;
1850 bool _seen_c_type = false;
1851 bool _seen_result_type = false;
1852 bool _seen_scope = false;
1853 {
1854 const auto _loop_body = [&](::llvm::StringRef _paramKey) -> bool {
1855 // Parse literal '='
1856 if (odsParser.parseEqual()) return {};
1857 if (!_seen_m_size && _paramKey == "m_size") {
1858 _seen_m_size = true;
1859
1860 // Parse variable 'm_size'
1861 _result_m_size = ::mlir::FieldParser<int>::parse(odsParser);
1862 if (::mlir::failed(_result_m_size)) {
1863 odsParser.emitError(odsParser.getCurrentLocation(), "failed to parse SPIRV_JointMatrixPropertiesINTELAttr parameter 'm_size' which is to be a `int`");
1864 return {};
1865 }
1866 } else if (!_seen_n_size && _paramKey == "n_size") {
1867 _seen_n_size = true;
1868
1869 // Parse variable 'n_size'
1870 _result_n_size = ::mlir::FieldParser<int>::parse(odsParser);
1871 if (::mlir::failed(_result_n_size)) {
1872 odsParser.emitError(odsParser.getCurrentLocation(), "failed to parse SPIRV_JointMatrixPropertiesINTELAttr parameter 'n_size' which is to be a `int`");
1873 return {};
1874 }
1875 } else if (!_seen_k_size && _paramKey == "k_size") {
1876 _seen_k_size = true;
1877
1878 // Parse variable 'k_size'
1879 _result_k_size = ::mlir::FieldParser<int>::parse(odsParser);
1880 if (::mlir::failed(_result_k_size)) {
1881 odsParser.emitError(odsParser.getCurrentLocation(), "failed to parse SPIRV_JointMatrixPropertiesINTELAttr parameter 'k_size' which is to be a `int`");
1882 return {};
1883 }
1884 } else if (!_seen_a_type && _paramKey == "a_type") {
1885 _seen_a_type = true;
1886
1887 // Parse variable 'a_type'
1888 _result_a_type = ::mlir::FieldParser<mlir::Type>::parse(odsParser);
1889 if (::mlir::failed(_result_a_type)) {
1890 odsParser.emitError(odsParser.getCurrentLocation(), "failed to parse SPIRV_JointMatrixPropertiesINTELAttr parameter 'a_type' which is to be a `mlir::Type`");
1891 return {};
1892 }
1893 } else if (!_seen_b_type && _paramKey == "b_type") {
1894 _seen_b_type = true;
1895
1896 // Parse variable 'b_type'
1897 _result_b_type = ::mlir::FieldParser<mlir::Type>::parse(odsParser);
1898 if (::mlir::failed(_result_b_type)) {
1899 odsParser.emitError(odsParser.getCurrentLocation(), "failed to parse SPIRV_JointMatrixPropertiesINTELAttr parameter 'b_type' which is to be a `mlir::Type`");
1900 return {};
1901 }
1902 } else if (!_seen_c_type && _paramKey == "c_type") {
1903 _seen_c_type = true;
1904
1905 // Parse variable 'c_type'
1906 _result_c_type = ::mlir::FieldParser<mlir::Type>::parse(odsParser);
1907 if (::mlir::failed(_result_c_type)) {
1908 odsParser.emitError(odsParser.getCurrentLocation(), "failed to parse SPIRV_JointMatrixPropertiesINTELAttr parameter 'c_type' which is to be a `mlir::Type`");
1909 return {};
1910 }
1911 } else if (!_seen_result_type && _paramKey == "result_type") {
1912 _seen_result_type = true;
1913
1914 // Parse variable 'result_type'
1915 _result_result_type = ::mlir::FieldParser<mlir::Type>::parse(odsParser);
1916 if (::mlir::failed(_result_result_type)) {
1917 odsParser.emitError(odsParser.getCurrentLocation(), "failed to parse SPIRV_JointMatrixPropertiesINTELAttr parameter 'result_type' which is to be a `mlir::Type`");
1918 return {};
1919 }
1920 } else if (!_seen_scope && _paramKey == "scope") {
1921 _seen_scope = true;
1922
1923 // Parse variable 'scope'
1924 _result_scope = ::mlir::FieldParser<mlir::spirv::ScopeAttr>::parse(odsParser);
1925 if (::mlir::failed(_result_scope)) {
1926 odsParser.emitError(odsParser.getCurrentLocation(), "failed to parse SPIRV_JointMatrixPropertiesINTELAttr parameter 'scope' which is to be a `mlir::spirv::ScopeAttr`");
1927 return {};
1928 }
1929 } else {
1930 odsParser.emitError(odsParser.getCurrentLocation(), "duplicate or unknown struct parameter name: ") << _paramKey;
1931 return {};
1932 }
1933 return true;
1934 };
1935 for (unsigned odsStructIndex = 0; odsStructIndex < 8; ++odsStructIndex) {
1936 ::llvm::StringRef _paramKey;
1937 if (odsParser.parseKeyword(&_paramKey)) {
1938 odsParser.emitError(odsParser.getCurrentLocation(),
1939 "expected a parameter name in struct");
1940 return {};
1941 }
1942 if (!_loop_body(_paramKey)) return {};
1943 if ((odsStructIndex != 8 - 1) && odsParser.parseComma())
1944 return {};
1945 }
1946 }
1947 // Parse literal '>'
1948 if (odsParser.parseGreater()) return {};
1949 assert(::mlir::succeeded(_result_m_size))(static_cast <bool> (::mlir::succeeded(_result_m_size))
? void (0) : __assert_fail ("::mlir::succeeded(_result_m_size)"
, "tools/mlir/include/mlir/Dialect/SPIRV/IR/SPIRVAttributes.cpp.inc"
, 1949, __extension__ __PRETTY_FUNCTION__))
;
1950 assert(::mlir::succeeded(_result_n_size))(static_cast <bool> (::mlir::succeeded(_result_n_size))
? void (0) : __assert_fail ("::mlir::succeeded(_result_n_size)"
, "tools/mlir/include/mlir/Dialect/SPIRV/IR/SPIRVAttributes.cpp.inc"
, 1950, __extension__ __PRETTY_FUNCTION__))
;
1951 assert(::mlir::succeeded(_result_k_size))(static_cast <bool> (::mlir::succeeded(_result_k_size))
? void (0) : __assert_fail ("::mlir::succeeded(_result_k_size)"
, "tools/mlir/include/mlir/Dialect/SPIRV/IR/SPIRVAttributes.cpp.inc"
, 1951, __extension__ __PRETTY_FUNCTION__))
;
1952 assert(::mlir::succeeded(_result_a_type))(static_cast <bool> (::mlir::succeeded(_result_a_type))
? void (0) : __assert_fail ("::mlir::succeeded(_result_a_type)"
, "tools/mlir/include/mlir/Dialect/SPIRV/IR/SPIRVAttributes.cpp.inc"
, 1952, __extension__ __PRETTY_FUNCTION__))
;
1953 assert(::mlir::succeeded(_result_b_type))(static_cast <bool> (::mlir::succeeded(_result_b_type))
? void (0) : __assert_fail ("::mlir::succeeded(_result_b_type)"
, "tools/mlir/include/mlir/Dialect/SPIRV/IR/SPIRVAttributes.cpp.inc"
, 1953, __extension__ __PRETTY_FUNCTION__))
;
1954 assert(::mlir::succeeded(_result_c_type))(static_cast <bool> (::mlir::succeeded(_result_c_type))
? void (0) : __assert_fail ("::mlir::succeeded(_result_c_type)"
, "tools/mlir/include/mlir/Dialect/SPIRV/IR/SPIRVAttributes.cpp.inc"
, 1954, __extension__ __PRETTY_FUNCTION__))
;
1955 assert(::mlir::succeeded(_result_result_type))(static_cast <bool> (::mlir::succeeded(_result_result_type
)) ? void (0) : __assert_fail ("::mlir::succeeded(_result_result_type)"
, "tools/mlir/include/mlir/Dialect/SPIRV/IR/SPIRVAttributes.cpp.inc"
, 1955, __extension__ __PRETTY_FUNCTION__))
;
1956 assert(::mlir::succeeded(_result_scope))(static_cast <bool> (::mlir::succeeded(_result_scope)) ?
void (0) : __assert_fail ("::mlir::succeeded(_result_scope)"
, "tools/mlir/include/mlir/Dialect/SPIRV/IR/SPIRVAttributes.cpp.inc"
, 1956, __extension__ __PRETTY_FUNCTION__))
;
1957 return JointMatrixPropertiesINTELAttr::get(odsParser.getContext(),
1958 int((*_result_m_size)),
1959 int((*_result_n_size)),
1960 int((*_result_k_size)),
1961 mlir::Type((*_result_a_type)),
1962 mlir::Type((*_result_b_type)),
1963 mlir::Type((*_result_c_type)),
1964 mlir::Type((*_result_result_type)),
1965 mlir::spirv::ScopeAttr((*_result_scope)));
1966}
1967
1968void JointMatrixPropertiesINTELAttr::print(::mlir::AsmPrinter &odsPrinter) const {
1969 ::mlir::Builder odsBuilder(getContext());
1970 odsPrinter << "<";
1971 {
1972 bool _firstPrinted = true;
1973 if (!_firstPrinted) odsPrinter << ", ";
1974 _firstPrinted = false;
1975 odsPrinter << "m_size = ";
1976 odsPrinter.printStrippedAttrOrType(getMSize());
1977 if (!_firstPrinted) odsPrinter << ", ";
1978 _firstPrinted = false;
1979 odsPrinter << "n_size = ";
1980 odsPrinter.printStrippedAttrOrType(getNSize());
1981 if (!_firstPrinted) odsPrinter << ", ";
1982 _firstPrinted = false;
1983 odsPrinter << "k_size = ";
1984 odsPrinter.printStrippedAttrOrType(getKSize());
1985 if (!_firstPrinted) odsPrinter << ", ";
1986 _firstPrinted = false;
1987 odsPrinter << "a_type = ";
1988 odsPrinter.printStrippedAttrOrType(getAType());
1989 if (!_firstPrinted) odsPrinter << ", ";
1990 _firstPrinted = false;
1991 odsPrinter << "b_type = ";
1992 odsPrinter.printStrippedAttrOrType(getBType());
1993 if (!_firstPrinted) odsPrinter << ", ";
1994 _firstPrinted = false;
1995 odsPrinter << "c_type = ";
1996 odsPrinter.printStrippedAttrOrType(getCType());
1997 if (!_firstPrinted) odsPrinter << ", ";
1998 _firstPrinted = false;
1999 odsPrinter << "result_type = ";
2000 odsPrinter.printStrippedAttrOrType(getResultType());
2001 if (!_firstPrinted) odsPrinter << ", ";
2002 _firstPrinted = false;
Value stored to '_firstPrinted' is never read
2003 odsPrinter << "scope = ";
2004 odsPrinter.printStrippedAttrOrType(getScope());
2005 }
2006 odsPrinter << ">";
2007}
2008
2009int JointMatrixPropertiesINTELAttr::getMSize() const {
2010 return getImpl()->m_size;
2011}
2012
2013int JointMatrixPropertiesINTELAttr::getNSize() const {
2014 return getImpl()->n_size;
2015}
2016
2017int JointMatrixPropertiesINTELAttr::getKSize() const {
2018 return getImpl()->k_size;
2019}
2020
2021mlir::Type JointMatrixPropertiesINTELAttr::getAType() const {
2022 return getImpl()->a_type;
2023}
2024
2025mlir::Type JointMatrixPropertiesINTELAttr::getBType() const {
2026 return getImpl()->b_type;
2027}
2028
2029mlir::Type JointMatrixPropertiesINTELAttr::getCType() const {
2030 return getImpl()->c_type;
2031}
2032
2033mlir::Type JointMatrixPropertiesINTELAttr::getResultType() const {
2034 return getImpl()->result_type;
2035}
2036
2037mlir::spirv::ScopeAttr JointMatrixPropertiesINTELAttr::getScope() const {
2038 return getImpl()->scope;
2039}
2040
2041} // namespace spirv
2042} // namespace mlir
2043MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::spirv::JointMatrixPropertiesINTELAttr)namespace mlir { namespace detail { SelfOwningTypeID TypeIDResolver
< ::mlir::spirv::JointMatrixPropertiesINTELAttr>::id = {
}; } }
2044namespace mlir {
2045namespace spirv {
2046namespace detail {
2047struct LinkageTypeAttrStorage : public ::mlir::AttributeStorage {
2048 using KeyTy = std::tuple<::mlir::spirv::LinkageType>;
2049 LinkageTypeAttrStorage(::mlir::spirv::LinkageType value) : value(value) {}
2050
2051 bool operator==(const KeyTy &tblgenKey) const {
2052 return (value == std::get<0>(tblgenKey));
2053 }
2054
2055 static ::llvm::hash_code hashKey(const KeyTy &tblgenKey) {
2056 return ::llvm::hash_combine(std::get<0>(tblgenKey));
2057 }
2058
2059 static LinkageTypeAttrStorage *construct(::mlir::AttributeStorageAllocator &allocator, const KeyTy &tblgenKey) {
2060 auto value = std::get<0>(tblgenKey);
2061 return new (allocator.allocate<LinkageTypeAttrStorage>()) LinkageTypeAttrStorage(value);
2062 }
2063
2064 ::mlir::spirv::LinkageType value;
2065};
2066} // namespace detail
2067LinkageTypeAttr LinkageTypeAttr::get(::mlir::MLIRContext *context, ::mlir::spirv::LinkageType value) {
2068 return Base::get(context, value);
2069}
2070
2071::mlir::Attribute LinkageTypeAttr::parse(::mlir::AsmParser &odsParser, ::mlir::Type odsType) {
2072 ::mlir::Builder odsBuilder(odsParser.getContext());
2073 ::llvm::SMLoc odsLoc = odsParser.getCurrentLocation();
2074 (void) odsLoc;
2075 ::mlir::FailureOr<::mlir::spirv::LinkageType> _result_value;
2076 // Parse literal '<'
2077 if (odsParser.parseLess()) return {};
2078
2079 // Parse variable 'value'
2080 _result_value = [&]() -> ::mlir::FailureOr<::mlir::spirv::LinkageType> {
2081 auto loc = odsParser.getCurrentLocation();
2082 ::llvm::StringRef enumKeyword;
2083 if (::mlir::failed(odsParser.parseKeyword(&enumKeyword)))
2084 return ::mlir::failure();
2085 auto maybeEnum = ::mlir::spirv::symbolizeLinkageType(enumKeyword);
2086 if (maybeEnum)
2087 return *maybeEnum;
2088 return {(::mlir::LogicalResult)(odsParser.emitError(loc) << "expected " << "::mlir::spirv::LinkageType" << " to be one of: " << "Export" << ", " << "Import" << ", " << "LinkOnceODR")};
2089 }();
2090 if (::mlir::failed(_result_value)) {
2091 odsParser.emitError(odsParser.getCurrentLocation(), "failed to parse SPIRV_LinkageTypeAttr parameter 'value' which is to be a `::mlir::spirv::LinkageType`");
2092 return {};
2093 }
2094 // Parse literal '>'
2095 if (odsParser.parseGreater()) return {};
2096 assert(::mlir::succeeded(_result_value))(static_cast <bool> (::mlir::succeeded(_result_value)) ?
void (0) : __assert_fail ("::mlir::succeeded(_result_value)"
, "tools/mlir/include/mlir/Dialect/SPIRV/IR/SPIRVAttributes.cpp.inc"
, 2096, __extension__ __PRETTY_FUNCTION__))
;
2097 return LinkageTypeAttr::get(odsParser.getContext(),
2098 ::mlir::spirv::LinkageType((*_result_value)));
2099}
2100
2101void LinkageTypeAttr::print(::mlir::AsmPrinter &odsPrinter) const {
2102 ::mlir::Builder odsBuilder(getContext());
2103 odsPrinter << "<";
2104 odsPrinter << stringifyLinkageType(getValue());
2105 odsPrinter << ">";
2106}
2107
2108::mlir::spirv::LinkageType LinkageTypeAttr::getValue() const {
2109 return getImpl()->value;
2110}
2111
2112} // namespace spirv
2113} // namespace mlir
2114MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::spirv::LinkageTypeAttr)namespace mlir { namespace detail { SelfOwningTypeID TypeIDResolver
< ::mlir::spirv::LinkageTypeAttr>::id = {}; } }
2115namespace mlir {
2116namespace spirv {
2117namespace detail {
2118struct LoopControlAttrStorage : public ::mlir::AttributeStorage {
2119 using KeyTy = std::tuple<::mlir::spirv::LoopControl>;
2120 LoopControlAttrStorage(::mlir::spirv::LoopControl value) : value(value) {}
2121
2122 bool operator==(const KeyTy &tblgenKey) const {
2123 return (value == std::get<0>(tblgenKey));
2124 }
2125
2126 static ::llvm::hash_code hashKey(const KeyTy &tblgenKey) {
2127 return ::llvm::hash_combine(std::get<0>(tblgenKey));
2128 }
2129
2130 static LoopControlAttrStorage *construct(::mlir::AttributeStorageAllocator &allocator, const KeyTy &tblgenKey) {
2131 auto value = std::get<0>(tblgenKey);
2132 return new (allocator.allocate<LoopControlAttrStorage>()) LoopControlAttrStorage(value);
2133 }
2134
2135 ::mlir::spirv::LoopControl value;
2136};
2137} // namespace detail
2138LoopControlAttr LoopControlAttr::get(::mlir::MLIRContext *context, ::mlir::spirv::LoopControl value) {
2139 return Base::get(context, value);
2140}
2141
2142::mlir::Attribute LoopControlAttr::parse(::mlir::AsmParser &odsParser, ::mlir::Type odsType) {
2143 ::mlir::Builder odsBuilder(odsParser.getContext());
2144 ::llvm::SMLoc odsLoc = odsParser.getCurrentLocation();
2145 (void) odsLoc;
2146 ::mlir::FailureOr<::mlir::spirv::LoopControl> _result_value;
2147 // Parse literal '<'
2148 if (odsParser.parseLess()) return {};
2149
2150 // Parse variable 'value'
2151 _result_value = [&]() -> ::mlir::FailureOr<::mlir::spirv::LoopControl> {
2152 ::mlir::spirv::LoopControl flags = {};
2153 auto loc = odsParser.getCurrentLocation();
2154 ::llvm::StringRef enumKeyword;
2155 do {
2156 if (::mlir::failed(odsParser.parseKeyword(&enumKeyword)))
2157 return ::mlir::failure();
2158 auto maybeEnum = ::mlir::spirv::symbolizeLoopControl(enumKeyword);
2159 if (!maybeEnum) {
2160 return {(::mlir::LogicalResult)(odsParser.emitError(loc) << "expected " << "::mlir::spirv::LoopControl" << " to be one of: " << "None" << ", " << "Unroll" << ", " << "DontUnroll" << ", " << "DependencyInfinite" << ", " << "DependencyLength" << ", " << "MinIterations" << ", " << "MaxIterations" << ", " << "IterationMultiple" << ", " << "PeelCount" << ", " << "PartialCount" << ", " << "InitiationIntervalINTEL" << ", " << "LoopCoalesceINTEL" << ", " << "MaxConcurrencyINTEL" << ", " << "MaxInterleavingINTEL" << ", " << "DependencyArrayINTEL" << ", " << "SpeculatedIterationsINTEL" << ", " << "PipelineEnableINTEL" << ", " << "NoFusionINTEL")};
2161 }
2162 flags = flags | *maybeEnum;
2163 } while(::mlir::succeeded(odsParser.parseOptionalVerticalBar()));
2164 return flags;
2165 }();
2166 if (::mlir::failed(_result_value)) {
2167 odsParser.emitError(odsParser.getCurrentLocation(), "failed to parse SPIRV_LoopControlAttr parameter 'value' which is to be a `::mlir::spirv::LoopControl`");
2168 return {};
2169 }
2170 // Parse literal '>'
2171 if (odsParser.parseGreater()) return {};
2172 assert(::mlir::succeeded(_result_value))(static_cast <bool> (::mlir::succeeded(_result_value)) ?
void (0) : __assert_fail ("::mlir::succeeded(_result_value)"
, "tools/mlir/include/mlir/Dialect/SPIRV/IR/SPIRVAttributes.cpp.inc"
, 2172, __extension__ __PRETTY_FUNCTION__))
;
2173 return LoopControlAttr::get(odsParser.getContext(),
2174 ::mlir::spirv::LoopControl((*_result_value)));
2175}
2176
2177void LoopControlAttr::print(::mlir::AsmPrinter &odsPrinter) const {
2178 ::mlir::Builder odsBuilder(getContext());
2179 odsPrinter << "<";
2180 odsPrinter << stringifyLoopControl(getValue());
2181 odsPrinter << ">";
2182}
2183
2184::mlir::spirv::LoopControl LoopControlAttr::getValue() const {
2185 return getImpl()->value;
2186}
2187
2188} // namespace spirv
2189} // namespace mlir
2190MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::spirv::LoopControlAttr)namespace mlir { namespace detail { SelfOwningTypeID TypeIDResolver
< ::mlir::spirv::LoopControlAttr>::id = {}; } }
2191namespace mlir {
2192namespace spirv {
2193namespace detail {
2194struct MatrixLayoutAttrStorage : public ::mlir::AttributeStorage {
2195 using KeyTy = std::tuple<::mlir::spirv::MatrixLayout>;
2196 MatrixLayoutAttrStorage(::mlir::spirv::MatrixLayout value) : value(value) {}
2197
2198 bool operator==(const KeyTy &tblgenKey) const {
2199 return (value == std::get<0>(tblgenKey));
2200 }
2201
2202 static ::llvm::hash_code hashKey(const KeyTy &tblgenKey) {
2203 return ::llvm::hash_combine(std::get<0>(tblgenKey));
2204 }
2205
2206 static MatrixLayoutAttrStorage *construct(::mlir::AttributeStorageAllocator &allocator, const KeyTy &tblgenKey) {
2207 auto value = std::get<0>(tblgenKey);
2208 return new (allocator.allocate<MatrixLayoutAttrStorage>()) MatrixLayoutAttrStorage(value);
2209 }
2210
2211 ::mlir::spirv::MatrixLayout value;
2212};
2213} // namespace detail
2214MatrixLayoutAttr MatrixLayoutAttr::get(::mlir::MLIRContext *context, ::mlir::spirv::MatrixLayout value) {
2215 return Base::get(context, value);
2216}
2217
2218::mlir::Attribute MatrixLayoutAttr::parse(::mlir::AsmParser &odsParser, ::mlir::Type odsType) {
2219 ::mlir::Builder odsBuilder(odsParser.getContext());
2220 ::llvm::SMLoc odsLoc = odsParser.getCurrentLocation();
2221 (void) odsLoc;
2222 ::mlir::FailureOr<::mlir::spirv::MatrixLayout> _result_value;
2223 // Parse literal '<'
2224 if (odsParser.parseLess()) return {};
2225
2226 // Parse variable 'value'
2227 _result_value = [&]() -> ::mlir::FailureOr<::mlir::spirv::MatrixLayout> {
2228 auto loc = odsParser.getCurrentLocation();
2229 ::llvm::StringRef enumKeyword;
2230 if (::mlir::failed(odsParser.parseKeyword(&enumKeyword)))
2231 return ::mlir::failure();
2232 auto maybeEnum = ::mlir::spirv::symbolizeMatrixLayout(enumKeyword);
2233 if (maybeEnum)
2234 return *maybeEnum;
2235 return {(::mlir::LogicalResult)(odsParser.emitError(loc) << "expected " << "::mlir::spirv::MatrixLayout" << " to be one of: " << "ColumnMajor" << ", " << "RowMajor" << ", " << "PackedA" << ", " << "PackedB")};
2236 }();
2237 if (::mlir::failed(_result_value)) {
2238 odsParser.emitError(odsParser.getCurrentLocation(), "failed to parse SPIRV_MatrixLayoutAttr parameter 'value' which is to be a `::mlir::spirv::MatrixLayout`");
2239 return {};
2240 }
2241 // Parse literal '>'
2242 if (odsParser.parseGreater()) return {};
2243 assert(::mlir::succeeded(_result_value))(static_cast <bool> (::mlir::succeeded(_result_value)) ?
void (0) : __assert_fail ("::mlir::succeeded(_result_value)"
, "tools/mlir/include/mlir/Dialect/SPIRV/IR/SPIRVAttributes.cpp.inc"
, 2243, __extension__ __PRETTY_FUNCTION__))
;
2244 return MatrixLayoutAttr::get(odsParser.getContext(),
2245 ::mlir::spirv::MatrixLayout((*_result_value)));
2246}
2247
2248void MatrixLayoutAttr::print(::mlir::AsmPrinter &odsPrinter) const {
2249 ::mlir::Builder odsBuilder(getContext());
2250 odsPrinter << "<";
2251 odsPrinter << stringifyMatrixLayout(getValue());
2252 odsPrinter << ">";
2253}
2254
2255::mlir::spirv::MatrixLayout MatrixLayoutAttr::getValue() const {
2256 return getImpl()->value;
2257}
2258
2259} // namespace spirv
2260} // namespace mlir
2261MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::spirv::MatrixLayoutAttr)namespace mlir { namespace detail { SelfOwningTypeID TypeIDResolver
< ::mlir::spirv::MatrixLayoutAttr>::id = {}; } }
2262namespace mlir {
2263namespace spirv {
2264namespace detail {
2265struct MemoryAccessAttrStorage : public ::mlir::AttributeStorage {
2266 using KeyTy = std::tuple<::mlir::spirv::MemoryAccess>;
2267 MemoryAccessAttrStorage(::mlir::spirv::MemoryAccess value) : value(value) {}
2268
2269 bool operator==(const KeyTy &tblgenKey) const {
2270 return (value == std::get<0>(tblgenKey));
2271 }
2272
2273 static ::llvm::hash_code hashKey(const KeyTy &tblgenKey) {
2274 return ::llvm::hash_combine(std::get<0>(tblgenKey));
2275 }
2276
2277 static MemoryAccessAttrStorage *construct(::mlir::AttributeStorageAllocator &allocator, const KeyTy &tblgenKey) {
2278 auto value = std::get<0>(tblgenKey);
2279 return new (allocator.allocate<MemoryAccessAttrStorage>()) MemoryAccessAttrStorage(value);
2280 }
2281
2282 ::mlir::spirv::MemoryAccess value;
2283};
2284} // namespace detail
2285MemoryAccessAttr MemoryAccessAttr::get(::mlir::MLIRContext *context, ::mlir::spirv::MemoryAccess value) {
2286 return Base::get(context, value);
2287}
2288
2289::mlir::Attribute MemoryAccessAttr::parse(::mlir::AsmParser &odsParser, ::mlir::Type odsType) {
2290 ::mlir::Builder odsBuilder(odsParser.getContext());
2291 ::llvm::SMLoc odsLoc = odsParser.getCurrentLocation();
2292 (void) odsLoc;
2293 ::mlir::FailureOr<::mlir::spirv::MemoryAccess> _result_value;
2294 // Parse literal '<'
2295 if (odsParser.parseLess()) return {};
2296
2297 // Parse variable 'value'
2298 _result_value = [&]() -> ::mlir::FailureOr<::mlir::spirv::MemoryAccess> {
2299 ::mlir::spirv::MemoryAccess flags = {};
2300 auto loc = odsParser.getCurrentLocation();
2301 ::llvm::StringRef enumKeyword;
2302 do {
2303 if (::mlir::failed(odsParser.parseKeyword(&enumKeyword)))
2304 return ::mlir::failure();
2305 auto maybeEnum = ::mlir::spirv::symbolizeMemoryAccess(enumKeyword);
2306 if (!maybeEnum) {
2307 return {(::mlir::LogicalResult)(odsParser.emitError(loc) << "expected " << "::mlir::spirv::MemoryAccess" << " to be one of: " << "None" << ", " << "Volatile" << ", " << "Aligned" << ", " << "Nontemporal" << ", " << "MakePointerAvailable" << ", " << "MakePointerVisible" << ", " << "NonPrivatePointer" << ", " << "AliasScopeINTELMask" << ", " << "NoAliasINTELMask")};
2308 }
2309 flags = flags | *maybeEnum;
2310 } while(::mlir::succeeded(odsParser.parseOptionalVerticalBar()));
2311 return flags;
2312 }();
2313 if (::mlir::failed(_result_value)) {
2314 odsParser.emitError(odsParser.getCurrentLocation(), "failed to parse SPIRV_MemoryAccessAttr parameter 'value' which is to be a `::mlir::spirv::MemoryAccess`");
2315 return {};
2316 }
2317 // Parse literal '>'
2318 if (odsParser.parseGreater()) return {};
2319 assert(::mlir::succeeded(_result_value))(static_cast <bool> (::mlir::succeeded(_result_value)) ?
void (0) : __assert_fail ("::mlir::succeeded(_result_value)"
, "tools/mlir/include/mlir/Dialect/SPIRV/IR/SPIRVAttributes.cpp.inc"
, 2319, __extension__ __PRETTY_FUNCTION__))
;
2320 return MemoryAccessAttr::get(odsParser.getContext(),
2321 ::mlir::spirv::MemoryAccess((*_result_value)));
2322}
2323
2324void MemoryAccessAttr::print(::mlir::AsmPrinter &odsPrinter) const {
2325 ::mlir::Builder odsBuilder(getContext());
2326 odsPrinter << "<";
2327 odsPrinter << stringifyMemoryAccess(getValue());
2328 odsPrinter << ">";
2329}
2330
2331::mlir::spirv::MemoryAccess MemoryAccessAttr::getValue() const {
2332 return getImpl()->value;
2333}
2334
2335} // namespace spirv
2336} // namespace mlir
2337MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::spirv::MemoryAccessAttr)namespace mlir { namespace detail { SelfOwningTypeID TypeIDResolver
< ::mlir::spirv::MemoryAccessAttr>::id = {}; } }
2338namespace mlir {
2339namespace spirv {
2340namespace detail {
2341struct MemoryModelAttrStorage : public ::mlir::AttributeStorage {
2342 using KeyTy = std::tuple<::mlir::spirv::MemoryModel>;
2343 MemoryModelAttrStorage(::mlir::spirv::MemoryModel value) : value(value) {}
2344
2345 bool operator==(const KeyTy &tblgenKey) const {
2346 return (value == std::get<0>(tblgenKey));
2347 }
2348
2349 static ::llvm::hash_code hashKey(const KeyTy &tblgenKey) {
2350 return ::llvm::hash_combine(std::get<0>(tblgenKey));
2351 }
2352
2353 static MemoryModelAttrStorage *construct(::mlir::AttributeStorageAllocator &allocator, const KeyTy &tblgenKey) {
2354 auto value = std::get<0>(tblgenKey);
2355 return new (allocator.allocate<MemoryModelAttrStorage>()) MemoryModelAttrStorage(value);
2356 }
2357
2358 ::mlir::spirv::MemoryModel value;
2359};
2360} // namespace detail
2361MemoryModelAttr MemoryModelAttr::get(::mlir::MLIRContext *context, ::mlir::spirv::MemoryModel value) {
2362 return Base::get(context, value);
2363}
2364
2365::mlir::Attribute MemoryModelAttr::parse(::mlir::AsmParser &odsParser, ::mlir::Type odsType) {
2366 ::mlir::Builder odsBuilder(odsParser.getContext());
2367 ::llvm::SMLoc odsLoc = odsParser.getCurrentLocation();
2368 (void) odsLoc;
2369 ::mlir::FailureOr<::mlir::spirv::MemoryModel> _result_value;
2370 // Parse literal '<'
2371 if (odsParser.parseLess()) return {};
2372
2373 // Parse variable 'value'
2374 _result_value = [&]() -> ::mlir::FailureOr<::mlir::spirv::MemoryModel> {
2375 auto loc = odsParser.getCurrentLocation();
2376 ::llvm::StringRef enumKeyword;
2377 if (::mlir::failed(odsParser.parseKeyword(&enumKeyword)))
2378 return ::mlir::failure();
2379 auto maybeEnum = ::mlir::spirv::symbolizeMemoryModel(enumKeyword);
2380 if (maybeEnum)
2381 return *maybeEnum;
2382 return {(::mlir::LogicalResult)(odsParser.emitError(loc) << "expected " << "::mlir::spirv::MemoryModel" << " to be one of: " << "Simple" << ", " << "GLSL450" << ", " << "OpenCL" << ", " << "Vulkan")};
2383 }();
2384 if (::mlir::failed(_result_value)) {
2385 odsParser.emitError(odsParser.getCurrentLocation(), "failed to parse SPIRV_MemoryModelAttr parameter 'value' which is to be a `::mlir::spirv::MemoryModel`");
2386 return {};
2387 }
2388 // Parse literal '>'
2389 if (odsParser.parseGreater()) return {};
2390 assert(::mlir::succeeded(_result_value))(static_cast <bool> (::mlir::succeeded(_result_value)) ?
void (0) : __assert_fail ("::mlir::succeeded(_result_value)"
, "tools/mlir/include/mlir/Dialect/SPIRV/IR/SPIRVAttributes.cpp.inc"
, 2390, __extension__ __PRETTY_FUNCTION__))
;
2391 return MemoryModelAttr::get(odsParser.getContext(),
2392 ::mlir::spirv::MemoryModel((*_result_value)));
2393}
2394
2395void MemoryModelAttr::print(::mlir::AsmPrinter &odsPrinter) const {
2396 ::mlir::Builder odsBuilder(getContext());
2397 odsPrinter << "<";
2398 odsPrinter << stringifyMemoryModel(getValue());
2399 odsPrinter << ">";
2400}
2401
2402::mlir::spirv::MemoryModel MemoryModelAttr::getValue() const {
2403 return getImpl()->value;
2404}
2405
2406} // namespace spirv
2407} // namespace mlir
2408MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::spirv::MemoryModelAttr)namespace mlir { namespace detail { SelfOwningTypeID TypeIDResolver
< ::mlir::spirv::MemoryModelAttr>::id = {}; } }
2409namespace mlir {
2410namespace spirv {
2411namespace detail {
2412struct MemorySemanticsAttrStorage : public ::mlir::AttributeStorage {
2413 using KeyTy = std::tuple<::mlir::spirv::MemorySemantics>;
2414 MemorySemanticsAttrStorage(::mlir::spirv::MemorySemantics value) : value(value) {}
2415
2416 bool operator==(const KeyTy &tblgenKey) const {
2417 return (value == std::get<0>(tblgenKey));
2418 }
2419
2420 static ::llvm::hash_code hashKey(const KeyTy &tblgenKey) {
2421 return ::llvm::hash_combine(std::get<0>(tblgenKey));
2422 }
2423
2424 static MemorySemanticsAttrStorage *construct(::mlir::AttributeStorageAllocator &allocator, const KeyTy &tblgenKey) {
2425 auto value = std::get<0>(tblgenKey);
2426 return new (allocator.allocate<MemorySemanticsAttrStorage>()) MemorySemanticsAttrStorage(value);
2427 }
2428
2429 ::mlir::spirv::MemorySemantics value;
2430};
2431} // namespace detail
2432MemorySemanticsAttr MemorySemanticsAttr::get(::mlir::MLIRContext *context, ::mlir::spirv::MemorySemantics value) {
2433 return Base::get(context, value);
2434}
2435
2436::mlir::Attribute MemorySemanticsAttr::parse(::mlir::AsmParser &odsParser, ::mlir::Type odsType) {
2437 ::mlir::Builder odsBuilder(odsParser.getContext());
2438 ::llvm::SMLoc odsLoc = odsParser.getCurrentLocation();
2439 (void) odsLoc;
2440 ::mlir::FailureOr<::mlir::spirv::MemorySemantics> _result_value;
2441 // Parse literal '<'
2442 if (odsParser.parseLess()) return {};
2443
2444 // Parse variable 'value'
2445 _result_value = [&]() -> ::mlir::FailureOr<::mlir::spirv::MemorySemantics> {
2446 ::mlir::spirv::MemorySemantics flags = {};
2447 auto loc = odsParser.getCurrentLocation();
2448 ::llvm::StringRef enumKeyword;
2449 do {
2450 if (::mlir::failed(odsParser.parseKeyword(&enumKeyword)))
2451 return ::mlir::failure();
2452 auto maybeEnum = ::mlir::spirv::symbolizeMemorySemantics(enumKeyword);
2453 if (!maybeEnum) {
2454 return {(::mlir::LogicalResult)(odsParser.emitError(loc) << "expected " << "::mlir::spirv::MemorySemantics" << " to be one of: " << "None" << ", " << "Acquire" << ", " << "Release" << ", " << "AcquireRelease" << ", " << "SequentiallyConsistent" << ", " << "UniformMemory" << ", " << "SubgroupMemory" << ", " << "WorkgroupMemory" << ", " << "CrossWorkgroupMemory" << ", " << "AtomicCounterMemory" << ", " << "ImageMemory" << ", " << "OutputMemory" << ", " << "MakeAvailable" << ", " << "MakeVisible" << ", " << "Volatile")};
2455 }
2456 flags = flags | *maybeEnum;
2457 } while(::mlir::succeeded(odsParser.parseOptionalVerticalBar()));
2458 return flags;
2459 }();
2460 if (::mlir::failed(_result_value)) {
2461 odsParser.emitError(odsParser.getCurrentLocation(), "failed to parse SPIRV_MemorySemanticsAttr parameter 'value' which is to be a `::mlir::spirv::MemorySemantics`");
2462 return {};
2463 }
2464 // Parse literal '>'
2465 if (odsParser.parseGreater()) return {};
2466 assert(::mlir::succeeded(_result_value))(static_cast <bool> (::mlir::succeeded(_result_value)) ?
void (0) : __assert_fail ("::mlir::succeeded(_result_value)"
, "tools/mlir/include/mlir/Dialect/SPIRV/IR/SPIRVAttributes.cpp.inc"
, 2466, __extension__ __PRETTY_FUNCTION__))
;
2467 return MemorySemanticsAttr::get(odsParser.getContext(),
2468 ::mlir::spirv::MemorySemantics((*_result_value)));
2469}
2470
2471void MemorySemanticsAttr::print(::mlir::AsmPrinter &odsPrinter) const {
2472 ::mlir::Builder odsBuilder(getContext());
2473 odsPrinter << "<";
2474 odsPrinter << stringifyMemorySemantics(getValue());
2475 odsPrinter << ">";
2476}
2477
2478::mlir::spirv::MemorySemantics MemorySemanticsAttr::getValue() const {
2479 return getImpl()->value;
2480}
2481
2482} // namespace spirv
2483} // namespace mlir
2484MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::spirv::MemorySemanticsAttr)namespace mlir { namespace detail { SelfOwningTypeID TypeIDResolver
< ::mlir::spirv::MemorySemanticsAttr>::id = {}; } }
2485namespace mlir {
2486namespace spirv {
2487namespace detail {
2488struct OpcodeAttrStorage : public ::mlir::AttributeStorage {
2489 using KeyTy = std::tuple<::mlir::spirv::Opcode>;
2490 OpcodeAttrStorage(::mlir::spirv::Opcode value) : value(value) {}
2491
2492 bool operator==(const KeyTy &tblgenKey) const {
2493 return (value == std::get<0>(tblgenKey));
2494 }
2495
2496 static ::llvm::hash_code hashKey(const KeyTy &tblgenKey) {
2497 return ::llvm::hash_combine(std::get<0>(tblgenKey));
2498 }
2499
2500 static OpcodeAttrStorage *construct(::mlir::AttributeStorageAllocator &allocator, const KeyTy &tblgenKey) {
2501 auto value = std::get<0>(tblgenKey);
2502 return new (allocator.allocate<OpcodeAttrStorage>()) OpcodeAttrStorage(value);
2503 }
2504
2505 ::mlir::spirv::Opcode value;
2506};
2507} // namespace detail
2508OpcodeAttr OpcodeAttr::get(::mlir::MLIRContext *context, ::mlir::spirv::Opcode value) {
2509 return Base::get(context, value);
2510}
2511
2512::mlir::Attribute OpcodeAttr::parse(::mlir::AsmParser &odsParser, ::mlir::Type odsType) {
2513 ::mlir::Builder odsBuilder(odsParser.getContext());
2514 ::llvm::SMLoc odsLoc = odsParser.getCurrentLocation();
2515 (void) odsLoc;
2516 ::mlir::FailureOr<::mlir::spirv::Opcode> _result_value;
2517 // Parse literal '<'
2518 if (odsParser.parseLess()) return {};
2519
2520 // Parse variable 'value'
2521 _result_value = [&]() -> ::mlir::FailureOr<::mlir::spirv::Opcode> {
2522 auto loc = odsParser.getCurrentLocation();
2523 ::llvm::StringRef enumKeyword;
2524 if (::mlir::failed(odsParser.parseKeyword(&enumKeyword)))
2525 return ::mlir::failure();
2526 auto maybeEnum = ::mlir::spirv::symbolizeOpcode(enumKeyword);
2527 if (maybeEnum)
2528 return *maybeEnum;
2529 return {(::mlir::LogicalResult)(odsParser.emitError(loc) << "expected " << "::mlir::spirv::Opcode" << " to be one of: " << "OpNop" << ", " << "OpUndef" << ", " << "OpSourceContinued" << ", " << "OpSource" << ", " << "OpSourceExtension" << ", " << "OpName" << ", " << "OpMemberName" << ", " << "OpString" << ", " << "OpLine" << ", " << "OpExtension" << ", " << "OpExtInstImport" << ", " << "OpExtInst" << ", " << "OpMemoryModel" << ", " << "OpEntryPoint" << ", " << "OpExecutionMode" << ", " << "OpCapability" << ", " << "OpTypeVoid" << ", " << "OpTypeBool" << ", " << "OpTypeInt" << ", " << "OpTypeFloat" << ", " << "OpTypeVector" << ", " << "OpTypeMatrix" << ", " << "OpTypeImage" << ", " << "OpTypeSampledImage" << ", " << "OpTypeArray" << ", " << "OpTypeRuntimeArray" << ", " << "OpTypeStruct" << ", " << "OpTypePointer" << ", " << "OpTypeFunction" << ", " << "OpTypeForwardPointer" << ", " << "OpConstantTrue" << ", " << "OpConstantFalse" << ", " << "OpConstant" << ", " << "OpConstantComposite" << ", " << "OpConstantNull" << ", " << "OpSpecConstantTrue" << ", " << "OpSpecConstantFalse" << ", " << "OpSpecConstant" << ", " << "OpSpecConstantComposite" << ", " << "OpSpecConstantOp" << ", " << "OpFunction" << ", " << "OpFunctionParameter" << ", " << "OpFunctionEnd" << ", " << "OpFunctionCall" << ", " << "OpVariable" << ", " << "OpLoad" << ", " << "OpStore" << ", " << "OpCopyMemory" << ", " << "OpAccessChain" << ", " << "OpPtrAccessChain" << ", " << "OpInBoundsPtrAccessChain" << ", " << "OpDecorate" << ", " << "OpMemberDecorate" << ", " << "OpVectorExtractDynamic" << ", " << "OpVectorInsertDynamic" << ", " << "OpVectorShuffle" << ", " << "OpCompositeConstruct" << ", " << "OpCompositeExtract" << ", " << "OpCompositeInsert" << ", " << "OpTranspose" << ", " << "OpImageDrefGather" << ", " << "OpImage" << ", " << "OpImageQuerySize" << ", " << "OpConvertFToU" << ", " << "OpConvertFToS" << ", " << "OpConvertSToF" << ", " << "OpConvertUToF" << ", " << "OpUConvert" << ", " << "OpSConvert" << ", " << "OpFConvert" << ", " << "OpPtrCastToGeneric" << ", " << "OpGenericCastToPtr" << ", " << "OpGenericCastToPtrExplicit" << ", " << "OpBitcast" << ", " << "OpSNegate" << ", " << "OpFNegate" << ", " << "OpIAdd" << ", " << "OpFAdd" << ", " << "OpISub" << ", " << "OpFSub" << ", " << "OpIMul" << ", " << "OpFMul" << ", " << "OpUDiv" << ", " << "OpSDiv" << ", " << "OpFDiv" << ", " << "OpUMod" << ", " << "OpSRem" << ", " << "OpSMod" << ", " << "OpFRem" << ", " << "OpFMod" << ", " << "OpVectorTimesScalar" << ", " << "OpMatrixTimesScalar" << ", " << "OpMatrixTimesMatrix" << ", " << "OpIAddCarry" << ", " << "OpISubBorrow" << ", " << "OpIsNan" << ", " << "OpIsInf" << ", " << "OpOrdered" << ", " << "OpUnordered" << ", " << "OpLogicalEqual" << ", " << "OpLogicalNotEqual" << ", " << "OpLogicalOr" << ", " << "OpLogicalAnd" << ", " << "OpLogicalNot" << ", " << "OpSelect" << ", " << "OpIEqual" << ", " << "OpINotEqual" << ", " << "OpUGreaterThan" << ", " << "OpSGreaterThan" << ", " << "OpUGreaterThanEqual" << ", " << "OpSGreaterThanEqual" << ", " << "OpULessThan" << ", " << "OpSLessThan" << ", " << "OpULessThanEqual" << ", " << "OpSLessThanEqual" << ", " << "OpFOrdEqual" << ", " << "OpFUnordEqual" << ", " << "OpFOrdNotEqual" << ", " << "OpFUnordNotEqual" << ", " << "OpFOrdLessThan" << ", " << "OpFUnordLessThan" << ", " << "OpFOrdGreaterThan" << ", " << "OpFUnordGreaterThan" << ", " << "OpFOrdLessThanEqual" << ", " << "OpFUnordLessThanEqual" << ", " << "OpFOrdGreaterThanEqual" << ", " << "OpFUnordGreaterThanEqual" << ", " << "OpShiftRightLogical" << ", " << "OpShiftRightArithmetic" << ", " << "OpShiftLeftLogical" << ", " << "OpBitwiseOr" << ", " << "OpBitwiseXor" << ", " << "OpBitwiseAnd" << ", " << "OpNot" << ", " << "OpBitFieldInsert" << ", " << "OpBitFieldSExtract" << ", " << "OpBitFieldUExtract" << ", " << "OpBitReverse" << ", " << "OpBitCount" << ", " << "OpControlBarrier" << ", " << "OpMemoryBarrier" << ", " << "OpAtomicExchange" << ", " << "OpAtomicCompareExchange" << ", " << "OpAtomicCompareExchangeWeak" << ", " << "OpAtomicIIncrement" << ", " << "OpAtomicIDecrement" << ", " << "OpAtomicIAdd" << ", " << "OpAtomicISub" << ", " << "OpAtomicSMin" << ", " << "OpAtomicUMin" << ", " << "OpAtomicSMax" << ", " << "OpAtomicUMax" << ", " << "OpAtomicAnd" << ", " << "OpAtomicOr" << ", " << "OpAtomicXor" << ", " << "OpPhi" << ", " << "OpLoopMerge" << ", " << "OpSelectionMerge" << ", " << "OpLabel" << ", " << "OpBranch" << ", " << "OpBranchConditional" << ", " << "OpReturn" << ", " << "OpReturnValue" << ", " << "OpUnreachable" << ", " << "OpGroupBroadcast" << ", " << "OpNoLine" << ", " << "OpModuleProcessed" << ", " << "OpGroupNonUniformElect" << ", " << "OpGroupNonUniformBroadcast" << ", " << "OpGroupNonUniformBallot" << ", " << "OpGroupNonUniformShuffle" << ", " << "OpGroupNonUniformShuffleXor" << ", " << "OpGroupNonUniformShuffleUp" << ", " << "OpGroupNonUniformShuffleDown" << ", " << "OpGroupNonUniformIAdd" << ", " << "OpGroupNonUniformFAdd" << ", " << "OpGroupNonUniformIMul" << ", " << "OpGroupNonUniformFMul" << ", " << "OpGroupNonUniformSMin" << ", " << "OpGroupNonUniformUMin" << ", " << "OpGroupNonUniformFMin" << ", " << "OpGroupNonUniformSMax" << ", " << "OpGroupNonUniformUMax" << ", " << "OpGroupNonUniformFMax" << ", " << "OpSubgroupBallotKHR" << ", " << "OpTypeCooperativeMatrixNV" << ", " << "OpCooperativeMatrixLoadNV" << ", " << "OpCooperativeMatrixStoreNV" << ", " << "OpCooperativeMatrixMulAddNV" << ", " << "OpCooperativeMatrixLengthNV" << ", " << "OpSubgroupBlockReadINTEL" << ", " << "OpSubgroupBlockWriteINTEL" << ", " << "OpAssumeTrueKHR" << ", " << "OpAtomicFAddEXT" << ", " << "OpTypeJointMatrixINTEL" << ", " << "OpJointMatrixLoadINTEL" << ", " << "OpJointMatrixStoreINTEL" << ", " << "OpJointMatrixMadINTEL" << ", " << "OpJointMatrixWorkItemLengthINTEL")};
2530 }();
2531 if (::mlir::failed(_result_value)) {
2532 odsParser.emitError(odsParser.getCurrentLocation(), "failed to parse SPIRV_OpcodeAttr parameter 'value' which is to be a `::mlir::spirv::Opcode`");
2533 return {};
2534 }
2535 // Parse literal '>'
2536 if (odsParser.parseGreater()) return {};
2537 assert(::mlir::succeeded(_result_value))(static_cast <bool> (::mlir::succeeded(_result_value)) ?
void (0) : __assert_fail ("::mlir::succeeded(_result_value)"
, "tools/mlir/include/mlir/Dialect/SPIRV/IR/SPIRVAttributes.cpp.inc"
, 2537, __extension__ __PRETTY_FUNCTION__))
;
2538 return OpcodeAttr::get(odsParser.getContext(),
2539 ::mlir::spirv::Opcode((*_result_value)));
2540}
2541
2542void OpcodeAttr::print(::mlir::AsmPrinter &odsPrinter) const {
2543 ::mlir::Builder odsBuilder(getContext());
2544 odsPrinter << "<";
2545 odsPrinter << stringifyOpcode(getValue());
2546 odsPrinter << ">";
2547}
2548
2549::mlir::spirv::Opcode OpcodeAttr::getValue() const {
2550 return getImpl()->value;
2551}
2552
2553} // namespace spirv
2554} // namespace mlir
2555MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::spirv::OpcodeAttr)namespace mlir { namespace detail { SelfOwningTypeID TypeIDResolver
< ::mlir::spirv::OpcodeAttr>::id = {}; } }
2556namespace mlir {
2557namespace spirv {
2558namespace detail {
2559struct ResourceLimitsAttrStorage : public ::mlir::AttributeStorage {
2560 using KeyTy = std::tuple<int, int, ArrayAttr, int, ArrayAttr>;
2561 ResourceLimitsAttrStorage(int max_compute_shared_memory_size, int max_compute_workgroup_invocations, ArrayAttr max_compute_workgroup_size, int subgroup_size, ArrayAttr cooperative_matrix_properties_nv) : max_compute_shared_memory_size(max_compute_shared_memory_size), max_compute_workgroup_invocations(max_compute_workgroup_invocations), max_compute_workgroup_size(max_compute_workgroup_size), subgroup_size(subgroup_size), cooperative_matrix_properties_nv(cooperative_matrix_properties_nv) {}
2562
2563 bool operator==(const KeyTy &tblgenKey) const {
2564 return (max_compute_shared_memory_size == std::get<0>(tblgenKey)) && (max_compute_workgroup_invocations == std::get<1>(tblgenKey)) && (max_compute_workgroup_size == std::get<2>(tblgenKey)) && (subgroup_size == std::get<3>(tblgenKey)) && (cooperative_matrix_properties_nv == std::get<4>(tblgenKey));
2565 }
2566
2567 static ::llvm::hash_code hashKey(const KeyTy &tblgenKey) {
2568 return ::llvm::hash_combine(std::get<0>(tblgenKey), std::get<1>(tblgenKey), std::get<2>(tblgenKey), std::get<3>(tblgenKey), std::get<4>(tblgenKey));
2569 }
2570
2571 static ResourceLimitsAttrStorage *construct(::mlir::AttributeStorageAllocator &allocator, const KeyTy &tblgenKey) {
2572 auto max_compute_shared_memory_size = std::get<0>(tblgenKey);
2573 auto max_compute_workgroup_invocations = std::get<1>(tblgenKey);
2574 auto max_compute_workgroup_size = std::get<2>(tblgenKey);
2575 auto subgroup_size = std::get<3>(tblgenKey);
2576 auto cooperative_matrix_properties_nv = std::get<4>(tblgenKey);
2577 return new (allocator.allocate<ResourceLimitsAttrStorage>()) ResourceLimitsAttrStorage(max_compute_shared_memory_size, max_compute_workgroup_invocations, max_compute_workgroup_size, subgroup_size, cooperative_matrix_properties_nv);
2578 }
2579
2580 int max_compute_shared_memory_size;
2581 int max_compute_workgroup_invocations;
2582 ArrayAttr max_compute_workgroup_size;
2583 int subgroup_size;
2584 ArrayAttr cooperative_matrix_properties_nv;
2585};
2586} // namespace detail
2587ResourceLimitsAttr ResourceLimitsAttr::get(::mlir::MLIRContext *context, int max_compute_shared_memory_size, int max_compute_workgroup_invocations, ArrayAttr max_compute_workgroup_size, int subgroup_size, ArrayAttr cooperative_matrix_properties_nv) {
2588 return Base::get(context, max_compute_shared_memory_size, max_compute_workgroup_invocations, max_compute_workgroup_size, subgroup_size, cooperative_matrix_properties_nv);
2589}
2590
2591::mlir::Attribute ResourceLimitsAttr::parse(::mlir::AsmParser &odsParser, ::mlir::Type odsType) {
2592 ::mlir::Builder odsBuilder(odsParser.getContext());
2593 ::llvm::SMLoc odsLoc = odsParser.getCurrentLocation();
2594 (void) odsLoc;
2595 ::mlir::FailureOr<int> _result_max_compute_shared_memory_size;
2596 ::mlir::FailureOr<int> _result_max_compute_workgroup_invocations;
2597 ::mlir::FailureOr<ArrayAttr> _result_max_compute_workgroup_size;
2598 ::mlir::FailureOr<int> _result_subgroup_size;
2599 ::mlir::FailureOr<ArrayAttr> _result_cooperative_matrix_properties_nv;
2600 // Parse literal '<'
2601 if (odsParser.parseLess()) return {};
2602 // Parse parameter struct
2603 bool _seen_max_compute_shared_memory_size = false;
2604 bool _seen_max_compute_workgroup_invocations = false;
2605 bool _seen_max_compute_workgroup_size = false;
2606 bool _seen_subgroup_size = false;
2607 bool _seen_cooperative_matrix_properties_nv = false;
2608 {
2609 const auto _loop_body = [&](::llvm::StringRef _paramKey) -> bool {
2610 // Parse literal '='
2611 if (odsParser.parseEqual()) return {};
2612 if (!_seen_max_compute_shared_memory_size && _paramKey == "max_compute_shared_memory_size") {
2613 _seen_max_compute_shared_memory_size = true;
2614
2615 // Parse variable 'max_compute_shared_memory_size'
2616 _result_max_compute_shared_memory_size = ::mlir::FieldParser<int>::parse(odsParser);
2617 if (::mlir::failed(_result_max_compute_shared_memory_size)) {
2618 odsParser.emitError(odsParser.getCurrentLocation(), "failed to parse SPIRV_ResourceLimitsAttr parameter 'max_compute_shared_memory_size' which is to be a `int`");
2619 return {};
2620 }
2621 } else if (!_seen_max_compute_workgroup_invocations && _paramKey == "max_compute_workgroup_invocations") {
2622 _seen_max_compute_workgroup_invocations = true;
2623
2624 // Parse variable 'max_compute_workgroup_invocations'
2625 _result_max_compute_workgroup_invocations = ::mlir::FieldParser<int>::parse(odsParser);
2626 if (::mlir::failed(_result_max_compute_workgroup_invocations)) {
2627 odsParser.emitError(odsParser.getCurrentLocation(), "failed to parse SPIRV_ResourceLimitsAttr parameter 'max_compute_workgroup_invocations' which is to be a `int`");
2628 return {};
2629 }
2630 } else if (!_seen_max_compute_workgroup_size && _paramKey == "max_compute_workgroup_size") {
2631 _seen_max_compute_workgroup_size = true;
2632
2633 // Parse variable 'max_compute_workgroup_size'
2634 _result_max_compute_workgroup_size = ::mlir::FieldParser<ArrayAttr>::parse(odsParser);
2635 if (::mlir::failed(_result_max_compute_workgroup_size)) {
2636 odsParser.emitError(odsParser.getCurrentLocation(), "failed to parse SPIRV_ResourceLimitsAttr parameter 'max_compute_workgroup_size' which is to be a `ArrayAttr`");
2637 return {};
2638 }
2639 } else if (!_seen_subgroup_size && _paramKey == "subgroup_size") {
2640 _seen_subgroup_size = true;
2641
2642 // Parse variable 'subgroup_size'
2643 _result_subgroup_size = ::mlir::FieldParser<int>::parse(odsParser);
2644 if (::mlir::failed(_result_subgroup_size)) {
2645 odsParser.emitError(odsParser.getCurrentLocation(), "failed to parse SPIRV_ResourceLimitsAttr parameter 'subgroup_size' which is to be a `int`");
2646 return {};
2647 }
2648 } else if (!_seen_cooperative_matrix_properties_nv && _paramKey == "cooperative_matrix_properties_nv") {
2649 _seen_cooperative_matrix_properties_nv = true;
2650
2651 // Parse variable 'cooperative_matrix_properties_nv'
2652 _result_cooperative_matrix_properties_nv = ::mlir::FieldParser<ArrayAttr>::parse(odsParser);
2653 if (::mlir::failed(_result_cooperative_matrix_properties_nv)) {
2654 odsParser.emitError(odsParser.getCurrentLocation(), "failed to parse SPIRV_ResourceLimitsAttr parameter 'cooperative_matrix_properties_nv' which is to be a `ArrayAttr`");
2655 return {};
2656 }
2657 } else {
2658 odsParser.emitError(odsParser.getCurrentLocation(), "duplicate or unknown struct parameter name: ") << _paramKey;
2659 return {};
2660 }
2661 return true;
2662 };
2663 ::llvm::StringRef _paramKey;
2664 if (!odsParser.parseOptionalKeyword(&_paramKey)) {
2665 if (!_loop_body(_paramKey)) return {};
2666 while (!odsParser.parseOptionalComma()) {
2667 ::llvm::StringRef _paramKey;
2668 if (odsParser.parseKeyword(&_paramKey)) {
2669 odsParser.emitError(odsParser.getCurrentLocation(),
2670 "expected a parameter name in struct");
2671 return {};
2672 }
2673 if (!_loop_body(_paramKey)) return {};
2674 }
2675 }
2676 }
2677 // Parse literal '>'
2678 if (odsParser.parseGreater()) return {};
2679 return ResourceLimitsAttr::get(odsParser.getContext(),
2680 int((_result_max_compute_shared_memory_size.value_or(16384))),
2681 int((_result_max_compute_workgroup_invocations.value_or(128))),
2682 ArrayAttr((_result_max_compute_workgroup_size.value_or(odsBuilder.getI32ArrayAttr({128, 128, 64})))),
2683 int((_result_subgroup_size.value_or(32))),
2684 ArrayAttr((_result_cooperative_matrix_properties_nv.value_or(nullptr))));
2685}
2686
2687void ResourceLimitsAttr::print(::mlir::AsmPrinter &odsPrinter) const {
2688 ::mlir::Builder odsBuilder(getContext());
2689 odsPrinter << "<";
2690 {
2691 bool _firstPrinted = true;
2692 if (!(getMaxComputeSharedMemorySize() == 16384)) {
2693 if (!_firstPrinted) odsPrinter << ", ";
2694 _firstPrinted = false;
2695 odsPrinter << "max_compute_shared_memory_size = ";
2696 if (!(getMaxComputeSharedMemorySize() == 16384)) {
2697 odsPrinter.printStrippedAttrOrType(getMaxComputeSharedMemorySize());
2698 }
2699 }
2700 if (!(getMaxComputeWorkgroupInvocations() == 128)) {
2701 if (!_firstPrinted) odsPrinter << ", ";
2702 _firstPrinted = false;
2703 odsPrinter << "max_compute_workgroup_invocations = ";
2704 if (!(getMaxComputeWorkgroupInvocations() == 128)) {
2705 odsPrinter.printStrippedAttrOrType(getMaxComputeWorkgroupInvocations());
2706 }
2707 }
2708 if (!(getMaxComputeWorkgroupSize() == odsBuilder.getI32ArrayAttr({128, 128, 64}))) {
2709 if (!_firstPrinted) odsPrinter << ", ";
2710 _firstPrinted = false;
2711 odsPrinter << "max_compute_workgroup_size = ";
2712 if (!(getMaxComputeWorkgroupSize() == odsBuilder.getI32ArrayAttr({128, 128, 64}))) {
2713 odsPrinter.printStrippedAttrOrType(getMaxComputeWorkgroupSize());
2714 }
2715 }
2716 if (!(getSubgroupSize() == 32)) {
2717 if (!_firstPrinted) odsPrinter << ", ";
2718 _firstPrinted = false;
2719 odsPrinter << "subgroup_size = ";
2720 if (!(getSubgroupSize() == 32)) {
2721 odsPrinter.printStrippedAttrOrType(getSubgroupSize());
2722 }
2723 }
2724 if (!(getCooperativeMatrixPropertiesNv() == nullptr)) {
2725 if (!_firstPrinted) odsPrinter << ", ";
2726 _firstPrinted = false;
2727 odsPrinter << "cooperative_matrix_properties_nv = ";
2728 if (!(getCooperativeMatrixPropertiesNv() == nullptr)) {
2729 odsPrinter.printStrippedAttrOrType(getCooperativeMatrixPropertiesNv());
2730 }
2731 }
2732 }
2733 odsPrinter << ">";
2734}
2735
2736int ResourceLimitsAttr::getMaxComputeSharedMemorySize() const {
2737 return getImpl()->max_compute_shared_memory_size;
2738}
2739
2740int ResourceLimitsAttr::getMaxComputeWorkgroupInvocations() const {
2741 return getImpl()->max_compute_workgroup_invocations;
2742}
2743
2744ArrayAttr ResourceLimitsAttr::getMaxComputeWorkgroupSize() const {
2745 return getImpl()->max_compute_workgroup_size;
2746}
2747
2748int ResourceLimitsAttr::getSubgroupSize() const {
2749 return getImpl()->subgroup_size;
2750}
2751
2752ArrayAttr ResourceLimitsAttr::getCooperativeMatrixPropertiesNv() const {
2753 return getImpl()->cooperative_matrix_properties_nv;
2754}
2755
2756} // namespace spirv
2757} // namespace mlir
2758MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::spirv::ResourceLimitsAttr)namespace mlir { namespace detail { SelfOwningTypeID TypeIDResolver
< ::mlir::spirv::ResourceLimitsAttr>::id = {}; } }
2759namespace mlir {
2760namespace spirv {
2761namespace detail {
2762struct ImageSamplerUseInfoAttrStorage : public ::mlir::AttributeStorage {
2763 using KeyTy = std::tuple<::mlir::spirv::ImageSamplerUseInfo>;
2764 ImageSamplerUseInfoAttrStorage(::mlir::spirv::ImageSamplerUseInfo value) : value(value) {}
2765
2766 bool operator==(const KeyTy &tblgenKey) const {
2767 return (value == std::get<0>(tblgenKey));
2768 }
2769
2770 static ::llvm::hash_code hashKey(const KeyTy &tblgenKey) {
2771 return ::llvm::hash_combine(std::get<0>(tblgenKey));
2772 }
2773
2774 static ImageSamplerUseInfoAttrStorage *construct(::mlir::AttributeStorageAllocator &allocator, const KeyTy &tblgenKey) {
2775 auto value = std::get<0>(tblgenKey);
2776 return new (allocator.allocate<ImageSamplerUseInfoAttrStorage>()) ImageSamplerUseInfoAttrStorage(value);
2777 }
2778
2779 ::mlir::spirv::ImageSamplerUseInfo value;
2780};
2781} // namespace detail
2782ImageSamplerUseInfoAttr ImageSamplerUseInfoAttr::get(::mlir::MLIRContext *context, ::mlir::spirv::ImageSamplerUseInfo value) {
2783 return Base::get(context, value);
2784}
2785
2786::mlir::Attribute ImageSamplerUseInfoAttr::parse(::mlir::AsmParser &odsParser, ::mlir::Type odsType) {
2787 ::mlir::Builder odsBuilder(odsParser.getContext());
2788 ::llvm::SMLoc odsLoc = odsParser.getCurrentLocation();
2789 (void) odsLoc;
2790 ::mlir::FailureOr<::mlir::spirv::ImageSamplerUseInfo> _result_value;
2791 // Parse literal '<'
2792 if (odsParser.parseLess()) return {};
2793
2794 // Parse variable 'value'
2795 _result_value = [&]() -> ::mlir::FailureOr<::mlir::spirv::ImageSamplerUseInfo> {
2796 auto loc = odsParser.getCurrentLocation();
2797 ::llvm::StringRef enumKeyword;
2798 if (::mlir::failed(odsParser.parseKeyword(&enumKeyword)))
2799 return ::mlir::failure();
2800 auto maybeEnum = ::mlir::spirv::symbolizeImageSamplerUseInfo(enumKeyword);
2801 if (maybeEnum)
2802 return *maybeEnum;
2803 return {(::mlir::LogicalResult)(odsParser.emitError(loc) << "expected " << "::mlir::spirv::ImageSamplerUseInfo" << " to be one of: " << "SamplerUnknown" << ", " << "NeedSampler" << ", " << "NoSampler")};
2804 }();
2805 if (::mlir::failed(_result_value)) {
2806 odsParser.emitError(odsParser.getCurrentLocation(), "failed to parse SPIRV_SamplerUseAttr parameter 'value' which is to be a `::mlir::spirv::ImageSamplerUseInfo`");
2807 return {};
2808 }
2809 // Parse literal '>'
2810 if (odsParser.parseGreater()) return {};
2811 assert(::mlir::succeeded(_result_value))(static_cast <bool> (::mlir::succeeded(_result_value)) ?
void (0) : __assert_fail ("::mlir::succeeded(_result_value)"
, "tools/mlir/include/mlir/Dialect/SPIRV/IR/SPIRVAttributes.cpp.inc"
, 2811, __extension__ __PRETTY_FUNCTION__))
;
2812 return ImageSamplerUseInfoAttr::get(odsParser.getContext(),
2813 ::mlir::spirv::ImageSamplerUseInfo((*_result_value)));
2814}
2815
2816void ImageSamplerUseInfoAttr::print(::mlir::AsmPrinter &odsPrinter) const {
2817 ::mlir::Builder odsBuilder(getContext());
2818 odsPrinter << "<";
2819 odsPrinter << stringifyImageSamplerUseInfo(getValue());
2820 odsPrinter << ">";
2821}
2822
2823::mlir::spirv::ImageSamplerUseInfo ImageSamplerUseInfoAttr::getValue() const {
2824 return getImpl()->value;
2825}
2826
2827} // namespace spirv
2828} // namespace mlir
2829MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::spirv::ImageSamplerUseInfoAttr)namespace mlir { namespace detail { SelfOwningTypeID TypeIDResolver
< ::mlir::spirv::ImageSamplerUseInfoAttr>::id = {}; } }
2830namespace mlir {
2831namespace spirv {
2832namespace detail {
2833struct ImageSamplingInfoAttrStorage : public ::mlir::AttributeStorage {
2834 using KeyTy = std::tuple<::mlir::spirv::ImageSamplingInfo>;
2835 ImageSamplingInfoAttrStorage(::mlir::spirv::ImageSamplingInfo value) : value(value) {}
2836
2837 bool operator==(const KeyTy &tblgenKey) const {
2838 return (value == std::get<0>(tblgenKey));
2839 }
2840
2841 static ::llvm::hash_code hashKey(const KeyTy &tblgenKey) {
2842 return ::llvm::hash_combine(std::get<0>(tblgenKey));
2843 }
2844
2845 static ImageSamplingInfoAttrStorage *construct(::mlir::AttributeStorageAllocator &allocator, const KeyTy &tblgenKey) {
2846 auto value = std::get<0>(tblgenKey);
2847 return new (allocator.allocate<ImageSamplingInfoAttrStorage>()) ImageSamplingInfoAttrStorage(value);
2848 }
2849
2850 ::mlir::spirv::ImageSamplingInfo value;
2851};
2852} // namespace detail
2853ImageSamplingInfoAttr ImageSamplingInfoAttr::get(::mlir::MLIRContext *context, ::mlir::spirv::ImageSamplingInfo value) {
2854 return Base::get(context, value);
2855}
2856
2857::mlir::Attribute ImageSamplingInfoAttr::parse(::mlir::AsmParser &odsParser, ::mlir::Type odsType) {
2858 ::mlir::Builder odsBuilder(odsParser.getContext());
2859 ::llvm::SMLoc odsLoc = odsParser.getCurrentLocation();
2860 (void) odsLoc;
2861 ::mlir::FailureOr<::mlir::spirv::ImageSamplingInfo> _result_value;
2862 // Parse literal '<'
2863 if (odsParser.parseLess()) return {};
2864
2865 // Parse variable 'value'
2866 _result_value = [&]() -> ::mlir::FailureOr<::mlir::spirv::ImageSamplingInfo> {
2867 auto loc = odsParser.getCurrentLocation();
2868 ::llvm::StringRef enumKeyword;
2869 if (::mlir::failed(odsParser.parseKeyword(&enumKeyword)))
2870 return ::mlir::failure();
2871 auto maybeEnum = ::mlir::spirv::symbolizeImageSamplingInfo(enumKeyword);
2872 if (maybeEnum)
2873 return *maybeEnum;
2874 return {(::mlir::LogicalResult)(odsParser.emitError(loc) << "expected " << "::mlir::spirv::ImageSamplingInfo" << " to be one of: " << "SingleSampled" << ", " << "MultiSampled")};
2875 }();
2876 if (::mlir::failed(_result_value)) {
2877 odsParser.emitError(odsParser.getCurrentLocation(), "failed to parse SPIRV_SamplingAttr parameter 'value' which is to be a `::mlir::spirv::ImageSamplingInfo`");
2878 return {};
2879 }
2880 // Parse literal '>'
2881 if (odsParser.parseGreater()) return {};
2882 assert(::mlir::succeeded(_result_value))(static_cast <bool> (::mlir::succeeded(_result_value)) ?
void (0) : __assert_fail ("::mlir::succeeded(_result_value)"
, "tools/mlir/include/mlir/Dialect/SPIRV/IR/SPIRVAttributes.cpp.inc"
, 2882, __extension__ __PRETTY_FUNCTION__))
;
2883 return ImageSamplingInfoAttr::get(odsParser.getContext(),
2884 ::mlir::spirv::ImageSamplingInfo((*_result_value)));
2885}
2886
2887void ImageSamplingInfoAttr::print(::mlir::AsmPrinter &odsPrinter) const {
2888 ::mlir::Builder odsBuilder(getContext());
2889 odsPrinter << "<";
2890 odsPrinter << stringifyImageSamplingInfo(getValue());
2891 odsPrinter << ">";
2892}
2893
2894::mlir::spirv::ImageSamplingInfo ImageSamplingInfoAttr::getValue() const {
2895 return getImpl()->value;
2896}
2897
2898} // namespace spirv
2899} // namespace mlir
2900MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::spirv::ImageSamplingInfoAttr)namespace mlir { namespace detail { SelfOwningTypeID TypeIDResolver
< ::mlir::spirv::ImageSamplingInfoAttr>::id = {}; } }
2901namespace mlir {
2902namespace spirv {
2903namespace detail {
2904struct ScopeAttrStorage : public ::mlir::AttributeStorage {
2905 using KeyTy = std::tuple<::mlir::spirv::Scope>;
2906 ScopeAttrStorage(::mlir::spirv::Scope value) : value(value) {}
2907
2908 bool operator==(const KeyTy &tblgenKey) const {
2909 return (value == std::get<0>(tblgenKey));
2910 }
2911
2912 static ::llvm::hash_code hashKey(const KeyTy &tblgenKey) {
2913 return ::llvm::hash_combine(std::get<0>(tblgenKey));
2914 }
2915
2916 static ScopeAttrStorage *construct(::mlir::AttributeStorageAllocator &allocator, const KeyTy &tblgenKey) {
2917 auto value = std::get<0>(tblgenKey);
2918 return new (allocator.allocate<ScopeAttrStorage>()) ScopeAttrStorage(value);
2919 }
2920
2921 ::mlir::spirv::Scope value;
2922};
2923} // namespace detail
2924ScopeAttr ScopeAttr::get(::mlir::MLIRContext *context, ::mlir::spirv::Scope value) {
2925 return Base::get(context, value);
2926}
2927
2928::mlir::Attribute ScopeAttr::parse(::mlir::AsmParser &odsParser, ::mlir::Type odsType) {
2929 ::mlir::Builder odsBuilder(odsParser.getContext());
2930 ::llvm::SMLoc odsLoc = odsParser.getCurrentLocation();
2931 (void) odsLoc;
2932 ::mlir::FailureOr<::mlir::spirv::Scope> _result_value;
2933 // Parse literal '<'
2934 if (odsParser.parseLess()) return {};
2935
2936 // Parse variable 'value'
2937 _result_value = [&]() -> ::mlir::FailureOr<::mlir::spirv::Scope> {
2938 auto loc = odsParser.getCurrentLocation();
2939 ::llvm::StringRef enumKeyword;
2940 if (::mlir::failed(odsParser.parseKeyword(&enumKeyword)))
2941 return ::mlir::failure();
2942 auto maybeEnum = ::mlir::spirv::symbolizeScope(enumKeyword);
2943 if (maybeEnum)
2944 return *maybeEnum;
2945 return {(::mlir::LogicalResult)(odsParser.emitError(loc) << "expected " << "::mlir::spirv::Scope" << " to be one of: " << "CrossDevice" << ", " << "Device" << ", " << "Workgroup" << ", " << "Subgroup" << ", " << "Invocation" << ", " << "QueueFamily" << ", " << "ShaderCallKHR")};
2946 }();
2947 if (::mlir::failed(_result_value)) {
2948 odsParser.emitError(odsParser.getCurrentLocation(), "failed to parse SPIRV_ScopeAttr parameter 'value' which is to be a `::mlir::spirv::Scope`");
2949 return {};
2950 }
2951 // Parse literal '>'
2952 if (odsParser.parseGreater()) return {};
2953 assert(::mlir::succeeded(_result_value))(static_cast <bool> (::mlir::succeeded(_result_value)) ?
void (0) : __assert_fail ("::mlir::succeeded(_result_value)"
, "tools/mlir/include/mlir/Dialect/SPIRV/IR/SPIRVAttributes.cpp.inc"
, 2953, __extension__ __PRETTY_FUNCTION__))
;
2954 return ScopeAttr::get(odsParser.getContext(),
2955 ::mlir::spirv::Scope((*_result_value)));
2956}
2957
2958void ScopeAttr::print(::mlir::AsmPrinter &odsPrinter) const {
2959 ::mlir::Builder odsBuilder(getContext());
2960 odsPrinter << "<";
2961 odsPrinter << stringifyScope(getValue());
2962 odsPrinter << ">";
2963}
2964
2965::mlir::spirv::Scope ScopeAttr::getValue() const {
2966 return getImpl()->value;
2967}
2968
2969} // namespace spirv
2970} // namespace mlir
2971MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::spirv::ScopeAttr)namespace mlir { namespace detail { SelfOwningTypeID TypeIDResolver
< ::mlir::spirv::ScopeAttr>::id = {}; } }
2972namespace mlir {
2973namespace spirv {
2974namespace detail {
2975struct SelectionControlAttrStorage : public ::mlir::AttributeStorage {
2976 using KeyTy = std::tuple<::mlir::spirv::SelectionControl>;
2977 SelectionControlAttrStorage(::mlir::spirv::SelectionControl value) : value(value) {}
2978
2979 bool operator==(const KeyTy &tblgenKey) const {
2980 return (value == std::get<0>(tblgenKey));
2981 }
2982
2983 static ::llvm::hash_code hashKey(const KeyTy &tblgenKey) {
2984 return ::llvm::hash_combine(std::get<0>(tblgenKey));
2985 }
2986
2987 static SelectionControlAttrStorage *construct(::mlir::AttributeStorageAllocator &allocator, const KeyTy &tblgenKey) {
2988 auto value = std::get<0>(tblgenKey);
2989 return new (allocator.allocate<SelectionControlAttrStorage>()) SelectionControlAttrStorage(value);
2990 }
2991
2992 ::mlir::spirv::SelectionControl value;
2993};
2994} // namespace detail
2995SelectionControlAttr SelectionControlAttr::get(::mlir::MLIRContext *context, ::mlir::spirv::SelectionControl value) {
2996 return Base::get(context, value);
2997}
2998
2999::mlir::Attribute SelectionControlAttr::parse(::mlir::AsmParser &odsParser, ::mlir::Type odsType) {
3000 ::mlir::Builder odsBuilder(odsParser.getContext());
3001 ::llvm::SMLoc odsLoc = odsParser.getCurrentLocation();
3002 (void) odsLoc;
3003 ::mlir::FailureOr<::mlir::spirv::SelectionControl> _result_value;
3004 // Parse literal '<'
3005 if (odsParser.parseLess()) return {};
3006
3007 // Parse variable 'value'
3008 _result_value = [&]() -> ::mlir::FailureOr<::mlir::spirv::SelectionControl> {
3009 ::mlir::spirv::SelectionControl flags = {};
3010 auto loc = odsParser.getCurrentLocation();
3011 ::llvm::StringRef enumKeyword;
3012 do {
3013 if (::mlir::failed(odsParser.parseKeyword(&enumKeyword)))
3014 return ::mlir::failure();
3015 auto maybeEnum = ::mlir::spirv::symbolizeSelectionControl(enumKeyword);
3016 if (!maybeEnum) {
3017 return {(::mlir::LogicalResult)(odsParser.emitError(loc) << "expected " << "::mlir::spirv::SelectionControl" << " to be one of: " << "None" << ", " << "Flatten" << ", " << "DontFlatten")};
3018 }
3019 flags = flags | *maybeEnum;
3020 } while(::mlir::succeeded(odsParser.parseOptionalVerticalBar()));
3021 return flags;
3022 }();
3023 if (::mlir::failed(_result_value)) {
3024 odsParser.emitError(odsParser.getCurrentLocation(), "failed to parse SPIRV_SelectionControlAttr parameter 'value' which is to be a `::mlir::spirv::SelectionControl`");
3025 return {};
3026 }
3027 // Parse literal '>'
3028 if (odsParser.parseGreater()) return {};
3029 assert(::mlir::succeeded(_result_value))(static_cast <bool> (::mlir::succeeded(_result_value)) ?
void (0) : __assert_fail ("::mlir::succeeded(_result_value)"
, "tools/mlir/include/mlir/Dialect/SPIRV/IR/SPIRVAttributes.cpp.inc"
, 3029, __extension__ __PRETTY_FUNCTION__))
;
3030 return SelectionControlAttr::get(odsParser.getContext(),
3031 ::mlir::spirv::SelectionControl((*_result_value)));
3032}
3033
3034void SelectionControlAttr::print(::mlir::AsmPrinter &odsPrinter) const {
3035 ::mlir::Builder odsBuilder(getContext());
3036 odsPrinter << "<";
3037 odsPrinter << stringifySelectionControl(getValue());
3038 odsPrinter << ">";
3039}
3040
3041::mlir::spirv::SelectionControl SelectionControlAttr::getValue() const {
3042 return getImpl()->value;
3043}
3044
3045} // namespace spirv
3046} // namespace mlir
3047MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::spirv::SelectionControlAttr)namespace mlir { namespace detail { SelfOwningTypeID TypeIDResolver
< ::mlir::spirv::SelectionControlAttr>::id = {}; } }
3048namespace mlir {
3049namespace spirv {
3050namespace detail {
3051struct StorageClassAttrStorage : public ::mlir::AttributeStorage {
3052 using KeyTy = std::tuple<::mlir::spirv::StorageClass>;
3053 StorageClassAttrStorage(::mlir::spirv::StorageClass value) : value(value) {}
3054
3055 bool operator==(const KeyTy &tblgenKey) const {
3056 return (value == std::get<0>(tblgenKey));
3057 }
3058
3059 static ::llvm::hash_code hashKey(const KeyTy &tblgenKey) {
3060 return ::llvm::hash_combine(std::get<0>(tblgenKey));
3061 }
3062
3063 static StorageClassAttrStorage *construct(::mlir::AttributeStorageAllocator &allocator, const KeyTy &tblgenKey) {
3064 auto value = std::get<0>(tblgenKey);
3065 return new (allocator.allocate<StorageClassAttrStorage>()) StorageClassAttrStorage(value);
3066 }
3067
3068 ::mlir::spirv::StorageClass value;
3069};
3070} // namespace detail
3071StorageClassAttr StorageClassAttr::get(::mlir::MLIRContext *context, ::mlir::spirv::StorageClass value) {
3072 return Base::get(context, value);
3073}
3074
3075::mlir::Attribute StorageClassAttr::parse(::mlir::AsmParser &odsParser, ::mlir::Type odsType) {
3076 ::mlir::Builder odsBuilder(odsParser.getContext());
3077 ::llvm::SMLoc odsLoc = odsParser.getCurrentLocation();
3078 (void) odsLoc;
3079 ::mlir::FailureOr<::mlir::spirv::StorageClass> _result_value;
3080 // Parse literal '<'
3081 if (odsParser.parseLess()) return {};
3082
3083 // Parse variable 'value'
3084 _result_value = [&]() -> ::mlir::FailureOr<::mlir::spirv::StorageClass> {
3085 auto loc = odsParser.getCurrentLocation();
3086 ::llvm::StringRef enumKeyword;
3087 if (::mlir::failed(odsParser.parseKeyword(&enumKeyword)))
3088 return ::mlir::failure();
3089 auto maybeEnum = ::mlir::spirv::symbolizeStorageClass(enumKeyword);
3090 if (maybeEnum)
3091 return *maybeEnum;
3092 return {(::mlir::LogicalResult)(odsParser.emitError(loc) << "expected " << "::mlir::spirv::StorageClass" << " to be one of: " << "UniformConstant" << ", " << "Input" << ", " << "Uniform" << ", " << "Output" << ", " << "Workgroup" << ", " << "CrossWorkgroup" << ", " << "Private" << ", " << "Function" << ", " << "Generic" << ", " << "PushConstant" << ", " << "AtomicCounter" << ", " << "Image" << ", " << "StorageBuffer" << ", " << "CallableDataKHR" << ", " << "IncomingCallableDataKHR" << ", " << "RayPayloadKHR" << ", " << "HitAttributeKHR" << ", " << "IncomingRayPayloadKHR" << ", " << "ShaderRecordBufferKHR" << ", " << "PhysicalStorageBuffer" << ", " << "CodeSectionINTEL" << ", " << "DeviceOnlyINTEL" << ", " << "HostOnlyINTEL")};
3093 }();
3094 if (::mlir::failed(_result_value)) {
3095 odsParser.emitError(odsParser.getCurrentLocation(), "failed to parse SPIRV_StorageClassAttr parameter 'value' which is to be a `::mlir::spirv::StorageClass`");
3096 return {};
3097 }
3098 // Parse literal '>'
3099 if (odsParser.parseGreater()) return {};
3100 assert(::mlir::succeeded(_result_value))(static_cast <bool> (::mlir::succeeded(_result_value)) ?
void (0) : __assert_fail ("::mlir::succeeded(_result_value)"
, "tools/mlir/include/mlir/Dialect/SPIRV/IR/SPIRVAttributes.cpp.inc"
, 3100, __extension__ __PRETTY_FUNCTION__))
;
3101 return StorageClassAttr::get(odsParser.getContext(),
3102 ::mlir::spirv::StorageClass((*_result_value)));
3103}
3104
3105void StorageClassAttr::print(::mlir::AsmPrinter &odsPrinter) const {
3106 ::mlir::Builder odsBuilder(getContext());
3107 odsPrinter << "<";
3108 odsPrinter << stringifyStorageClass(getValue());
3109 odsPrinter << ">";
3110}
3111
3112::mlir::spirv::StorageClass StorageClassAttr::getValue() const {
3113 return getImpl()->value;
3114}
3115
3116} // namespace spirv
3117} // namespace mlir
3118MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::spirv::StorageClassAttr)namespace mlir { namespace detail { SelfOwningTypeID TypeIDResolver
< ::mlir::spirv::StorageClassAttr>::id = {}; } }
3119namespace mlir {
3120namespace spirv {
3121namespace detail {
3122struct VendorAttrStorage : public ::mlir::AttributeStorage {
3123 using KeyTy = std::tuple<::mlir::spirv::Vendor>;
3124 VendorAttrStorage(::mlir::spirv::Vendor value) : value(value) {}
3125
3126 bool operator==(const KeyTy &tblgenKey) const {
3127 return (value == std::get<0>(tblgenKey));
3128 }
3129
3130 static ::llvm::hash_code hashKey(const KeyTy &tblgenKey) {
3131 return ::llvm::hash_combine(std::get<0>(tblgenKey));
3132 }
3133
3134 static VendorAttrStorage *construct(::mlir::AttributeStorageAllocator &allocator, const KeyTy &tblgenKey) {
3135 auto value = std::get<0>(tblgenKey);
3136 return new (allocator.allocate<VendorAttrStorage>()) VendorAttrStorage(value);
3137 }
3138
3139 ::mlir::spirv::Vendor value;
3140};
3141} // namespace detail
3142VendorAttr VendorAttr::get(::mlir::MLIRContext *context, ::mlir::spirv::Vendor value) {
3143 return Base::get(context, value);
3144}
3145
3146::mlir::Attribute VendorAttr::parse(::mlir::AsmParser &odsParser, ::mlir::Type odsType) {
3147 ::mlir::Builder odsBuilder(odsParser.getContext());
3148 ::llvm::SMLoc odsLoc = odsParser.getCurrentLocation();
3149 (void) odsLoc;
3150 ::mlir::FailureOr<::mlir::spirv::Vendor> _result_value;
3151 // Parse literal '<'
3152 if (odsParser.parseLess()) return {};
3153
3154 // Parse variable 'value'
3155 _result_value = [&]() -> ::mlir::FailureOr<::mlir::spirv::Vendor> {
3156 auto loc = odsParser.getCurrentLocation();
3157 ::llvm::StringRef enumKeyword;
3158 if (::mlir::failed(odsParser.parseKeyword(&enumKeyword)))
3159 return ::mlir::failure();
3160 auto maybeEnum = ::mlir::spirv::symbolizeVendor(enumKeyword);
3161 if (maybeEnum)
3162 return *maybeEnum;
3163 return {(::mlir::LogicalResult)(odsParser.emitError(loc) << "expected " << "::mlir::spirv::Vendor" << " to be one of: " << "AMD" << ", " << "Apple" << ", " << "ARM" << ", " << "Imagination" << ", " << "Intel" << ", " << "NVIDIA" << ", " << "Qualcomm" << ", " << "SwiftShader" << ", " << "Unknown")};
3164 }();
3165 if (::mlir::failed(_result_value)) {
3166 odsParser.emitError(odsParser.getCurrentLocation(), "failed to parse SPIRV_VendorAttr parameter 'value' which is to be a `::mlir::spirv::Vendor`");
3167 return {};
3168 }
3169 // Parse literal '>'
3170 if (odsParser.parseGreater()) return {};
3171 assert(::mlir::succeeded(_result_value))(static_cast <bool> (::mlir::succeeded(_result_value)) ?
void (0) : __assert_fail ("::mlir::succeeded(_result_value)"
, "tools/mlir/include/mlir/Dialect/SPIRV/IR/SPIRVAttributes.cpp.inc"
, 3171, __extension__ __PRETTY_FUNCTION__))
;
3172 return VendorAttr::get(odsParser.getContext(),
3173 ::mlir::spirv::Vendor((*_result_value)));
3174}
3175
3176void VendorAttr::print(::mlir::AsmPrinter &odsPrinter) const {
3177 ::mlir::Builder odsBuilder(getContext());
3178 odsPrinter << "<";
3179 odsPrinter << stringifyVendor(getValue());
3180 odsPrinter << ">";
3181}
3182
3183::mlir::spirv::Vendor VendorAttr::getValue() const {
3184 return getImpl()->value;
3185}
3186
3187} // namespace spirv
3188} // namespace mlir
3189MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::spirv::VendorAttr)namespace mlir { namespace detail { SelfOwningTypeID TypeIDResolver
< ::mlir::spirv::VendorAttr>::id = {}; } }
3190namespace mlir {
3191namespace spirv {
3192namespace detail {
3193struct VersionAttrStorage : public ::mlir::AttributeStorage {
3194 using KeyTy = std::tuple<::mlir::spirv::Version>;
3195 VersionAttrStorage(::mlir::spirv::Version value) : value(value) {}
3196
3197 bool operator==(const KeyTy &tblgenKey) const {
3198 return (value == std::get<0>(tblgenKey));
3199 }
3200
3201 static ::llvm::hash_code hashKey(const KeyTy &tblgenKey) {
3202 return ::llvm::hash_combine(std::get<0>(tblgenKey));
3203 }
3204
3205 static VersionAttrStorage *construct(::mlir::AttributeStorageAllocator &allocator, const KeyTy &tblgenKey) {
3206 auto value = std::get<0>(tblgenKey);
3207 return new (allocator.allocate<VersionAttrStorage>()) VersionAttrStorage(value);
3208 }
3209
3210 ::mlir::spirv::Version value;
3211};
3212} // namespace detail
3213VersionAttr VersionAttr::get(::mlir::MLIRContext *context, ::mlir::spirv::Version value) {
3214 return Base::get(context, value);
3215}
3216
3217::mlir::Attribute VersionAttr::parse(::mlir::AsmParser &odsParser, ::mlir::Type odsType) {
3218 ::mlir::Builder odsBuilder(odsParser.getContext());
3219 ::llvm::SMLoc odsLoc = odsParser.getCurrentLocation();
3220 (void) odsLoc;
3221 ::mlir::FailureOr<::mlir::spirv::Version> _result_value;
3222 // Parse literal '<'
3223 if (odsParser.parseLess()) return {};
3224
3225 // Parse variable 'value'
3226 _result_value = [&]() -> ::mlir::FailureOr<::mlir::spirv::Version> {
3227 auto loc = odsParser.getCurrentLocation();
3228 ::llvm::StringRef enumKeyword;
3229 if (::mlir::failed(odsParser.parseKeyword(&enumKeyword)))
3230 return ::mlir::failure();
3231 auto maybeEnum = ::mlir::spirv::symbolizeVersion(enumKeyword);
3232 if (maybeEnum)
3233 return *maybeEnum;
3234 return {(::mlir::LogicalResult)(odsParser.emitError(loc) << "expected " << "::mlir::spirv::Version" << " to be one of: " << "v1.0" << ", " << "v1.1" << ", " << "v1.2" << ", " << "v1.3" << ", " << "v1.4" << ", " << "v1.5" << ", " << "v1.6")};
3235 }();
3236 if (::mlir::failed(_result_value)) {
3237 odsParser.emitError(odsParser.getCurrentLocation(), "failed to parse SPIRV_VersionAttr parameter 'value' which is to be a `::mlir::spirv::Version`");
3238 return {};
3239 }
3240 // Parse literal '>'
3241 if (odsParser.parseGreater()) return {};
3242 assert(::mlir::succeeded(_result_value))(static_cast <bool> (::mlir::succeeded(_result_value)) ?
void (0) : __assert_fail ("::mlir::succeeded(_result_value)"
, "tools/mlir/include/mlir/Dialect/SPIRV/IR/SPIRVAttributes.cpp.inc"
, 3242, __extension__ __PRETTY_FUNCTION__))
;
3243 return VersionAttr::get(odsParser.getContext(),
3244 ::mlir::spirv::Version((*_result_value)));
3245}
3246
3247void VersionAttr::print(::mlir::AsmPrinter &odsPrinter) const {
3248 ::mlir::Builder odsBuilder(getContext());
3249 odsPrinter << "<";
3250 odsPrinter << stringifyVersion(getValue());
3251 odsPrinter << ">";
3252}
3253
3254::mlir::spirv::Version VersionAttr::getValue() const {
3255 return getImpl()->value;
3256}
3257
3258} // namespace spirv
3259} // namespace mlir
3260MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::spirv::VersionAttr)namespace mlir { namespace detail { SelfOwningTypeID TypeIDResolver
< ::mlir::spirv::VersionAttr>::id = {}; } }
3261
3262#endif // GET_ATTRDEF_CLASSES
3263