LLZK 0.1.0
Veridise's ZK Language IR
Loading...
Searching...
No Matches
Ops.cpp.inc
Go to the documentation of this file.
1/*===- TableGen'erated file -------------------------------------*- C++ -*-===*\
2|* *|
3|* Op Definitions *|
4|* *|
5|* Automatically generated file, do not edit! *|
6|* From: Ops.td *|
7|* *|
8\*===----------------------------------------------------------------------===*/
9
10#ifdef GET_OP_LIST
11#undef GET_OP_LIST
12
18#endif // GET_OP_LIST
19
20#ifdef GET_OP_CLASSES
21#undef GET_OP_CLASSES
22
23
24//===----------------------------------------------------------------------===//
25// Local Utility Method Definitions
26//===----------------------------------------------------------------------===//
27
28namespace llzk {
29namespace component {
30
31static ::llvm::LogicalResult __mlir_ods_local_type_constraint_Ops1(
32 ::mlir::Operation *op, ::mlir::Type type, ::llvm::StringRef valueKind,
33 unsigned valueIndex) {
34 if (!((::llvm::isa<::llzk::component::StructType>(type)))) {
35 return op->emitOpError(valueKind) << " #" << valueIndex
36 << " must be circuit component, but got " << type;
37 }
38 return ::mlir::success();
39}
40
41static ::llvm::LogicalResult __mlir_ods_local_type_constraint_Ops2(
42 ::mlir::Operation *op, ::mlir::Type type, ::llvm::StringRef valueKind,
43 unsigned valueIndex) {
44 if (!((::llvm::isa<::mlir::IndexType>(type)))) {
45 return op->emitOpError(valueKind) << " #" << valueIndex
46 << " must be variadic of index, but got " << type;
47 }
48 return ::mlir::success();
49}
50
51static ::llvm::LogicalResult __mlir_ods_local_type_constraint_Ops3(
52 ::mlir::Operation *op, ::mlir::Type type, ::llvm::StringRef valueKind,
53 unsigned valueIndex) {
54 if (!((::llzk::isValidType(type)))) {
55 return op->emitOpError(valueKind) << " #" << valueIndex
56 << " must be a valid LLZK type, but got " << type;
57 }
58 return ::mlir::success();
59}
60
61static ::llvm::LogicalResult __mlir_ods_local_attr_constraint_Ops1(
62 ::mlir::Attribute attr, ::llvm::StringRef attrName, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
63 if (attr && !((::llvm::isa<::mlir::StringAttr>(attr))))
64 return emitError() << "attribute '" << attrName
65 << "' failed to satisfy constraint: string attribute";
66 return ::mlir::success();
67}
68static ::llvm::LogicalResult __mlir_ods_local_attr_constraint_Ops1(
69 ::mlir::Operation *op, ::mlir::Attribute attr, ::llvm::StringRef attrName) {
70 return __mlir_ods_local_attr_constraint_Ops1(attr, attrName, [op]() {
71 return op->emitOpError();
72 });
73}
74
75static ::llvm::LogicalResult __mlir_ods_local_attr_constraint_Ops2(
76 ::mlir::Attribute attr, ::llvm::StringRef attrName, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
77 if (attr && !(((::llvm::isa<::mlir::TypeAttr>(attr))) && ((::llvm::isa<::mlir::Type>(::llvm::cast<::mlir::TypeAttr>(attr).getValue()))) && ((::llzk::isValidType(::llvm::cast<::mlir::TypeAttr>(attr).getValue())))))
78 return emitError() << "attribute '" << attrName
79 << "' failed to satisfy constraint: type attribute of a valid LLZK type";
80 return ::mlir::success();
81}
82static ::llvm::LogicalResult __mlir_ods_local_attr_constraint_Ops2(
83 ::mlir::Operation *op, ::mlir::Attribute attr, ::llvm::StringRef attrName) {
84 return __mlir_ods_local_attr_constraint_Ops2(attr, attrName, [op]() {
85 return op->emitOpError();
86 });
87}
88
89static ::llvm::LogicalResult __mlir_ods_local_attr_constraint_Ops3(
90 ::mlir::Attribute attr, ::llvm::StringRef attrName, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
91 if (attr && !((::llvm::isa<::mlir::UnitAttr>(attr))))
92 return emitError() << "attribute '" << attrName
93 << "' failed to satisfy constraint: unit attribute";
94 return ::mlir::success();
95}
96static ::llvm::LogicalResult __mlir_ods_local_attr_constraint_Ops3(
97 ::mlir::Operation *op, ::mlir::Attribute attr, ::llvm::StringRef attrName) {
98 return __mlir_ods_local_attr_constraint_Ops3(attr, attrName, [op]() {
99 return op->emitOpError();
100 });
101}
102
103static ::llvm::LogicalResult __mlir_ods_local_attr_constraint_Ops4(
104 ::mlir::Attribute attr, ::llvm::StringRef attrName, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
105 if (attr && !((::llvm::isa<::mlir::FlatSymbolRefAttr>(attr))))
106 return emitError() << "attribute '" << attrName
107 << "' failed to satisfy constraint: flat symbol reference attribute";
108 return ::mlir::success();
109}
110static ::llvm::LogicalResult __mlir_ods_local_attr_constraint_Ops4(
111 ::mlir::Operation *op, ::mlir::Attribute attr, ::llvm::StringRef attrName) {
112 return __mlir_ods_local_attr_constraint_Ops4(attr, attrName, [op]() {
113 return op->emitOpError();
114 });
115}
116
117static ::llvm::LogicalResult __mlir_ods_local_attr_constraint_Ops5(
118 ::mlir::Attribute attr, ::llvm::StringRef attrName, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
119 if (attr && !(((::llvm::isa<::mlir::SymbolRefAttr>(attr))) || (((::llvm::isa<::mlir::IntegerAttr>(attr))) && ((::llvm::isa<::mlir::IndexType>(::llvm::cast<::mlir::IntegerAttr>(attr).getType())))) || ((::llvm::isa<::mlir::AffineMapAttr>(attr)))))
120 return emitError() << "attribute '" << attrName
121 << "' failed to satisfy constraint: symbol reference attribute or index attribute or AffineMap attribute";
122 return ::mlir::success();
123}
124static ::llvm::LogicalResult __mlir_ods_local_attr_constraint_Ops5(
125 ::mlir::Operation *op, ::mlir::Attribute attr, ::llvm::StringRef attrName) {
126 return __mlir_ods_local_attr_constraint_Ops5(attr, attrName, [op]() {
127 return op->emitOpError();
128 });
129}
130
131static ::llvm::LogicalResult __mlir_ods_local_attr_constraint_Ops6(
132 ::mlir::Attribute attr, ::llvm::StringRef attrName, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
133 if (attr && !((::llvm::isa<::mlir::DenseI32ArrayAttr>(attr))))
134 return emitError() << "attribute '" << attrName
135 << "' failed to satisfy constraint: i32 dense array attribute";
136 return ::mlir::success();
137}
138static ::llvm::LogicalResult __mlir_ods_local_attr_constraint_Ops6(
139 ::mlir::Operation *op, ::mlir::Attribute attr, ::llvm::StringRef attrName) {
140 return __mlir_ods_local_attr_constraint_Ops6(attr, attrName, [op]() {
141 return op->emitOpError();
142 });
143}
144
145static ::llvm::LogicalResult __mlir_ods_local_attr_constraint_Ops7(
146 ::mlir::Attribute attr, ::llvm::StringRef attrName, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
147 if (attr && !(((::llvm::isa<::mlir::ArrayAttr>(attr))) && (::llvm::all_of(::llvm::cast<::mlir::ArrayAttr>(attr), [&](::mlir::Attribute attr) { return attr && ((::llvm::isa<::mlir::FlatSymbolRefAttr>(attr))); }))))
148 return emitError() << "attribute '" << attrName
149 << "' failed to satisfy constraint: flat symbol ref array attribute";
150 return ::mlir::success();
151}
152static ::llvm::LogicalResult __mlir_ods_local_attr_constraint_Ops7(
153 ::mlir::Operation *op, ::mlir::Attribute attr, ::llvm::StringRef attrName) {
154 return __mlir_ods_local_attr_constraint_Ops7(attr, attrName, [op]() {
155 return op->emitOpError();
156 });
157}
158
159static ::llvm::LogicalResult __mlir_ods_local_region_constraint_Ops1(
160 ::mlir::Operation *op, ::mlir::Region &region, ::llvm::StringRef regionName,
161 unsigned regionIndex) {
162 if (!((::llvm::hasNItems(region, 1)))) {
163 return op->emitOpError("region #") << regionIndex
164 << (regionName.empty() ? " " : " ('" + regionName + "') ")
165 << "failed to verify constraint: region with 1 blocks";
166 }
167 return ::mlir::success();
168}
169} // namespace component
170} // namespace llzk
171namespace llzk {
172namespace component {
173
174//===----------------------------------------------------------------------===//
175// ::llzk::component::CreateStructOp definitions
176//===----------------------------------------------------------------------===//
177
178namespace detail {
179} // namespace detail
181
182::llvm::LogicalResult CreateStructOpAdaptor::verify(::mlir::Location loc) {
183 return ::mlir::success();
184}
185
186void CreateStructOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result) {
187 odsState.addTypes(result);
188}
189
190void CreateStructOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes) {
191 assert(resultTypes.size() == 1u && "mismatched number of results");
192 odsState.addTypes(resultTypes);
193}
194
195void CreateStructOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
196 assert(operands.size() == 0u && "mismatched number of parameters");
197 odsState.addOperands(operands);
198 odsState.addAttributes(attributes);
199 assert(resultTypes.size() == 1u && "mismatched number of return types");
200 odsState.addTypes(resultTypes);
201}
202
204 {
205 unsigned index = 0; (void)index;
206 auto valueGroup0 = getODSResults(0);
207
208 for (auto v : valueGroup0) {
209 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops1(*this, v.getType(), "result", index++)))
210 return ::mlir::failure();
211 }
212 }
213 return ::mlir::success();
214}
215
216::llvm::LogicalResult CreateStructOp::verifyInvariants() {
217 return verifyInvariantsImpl();
218}
219
220::mlir::ParseResult CreateStructOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
221 ::mlir::Type resultRawType{};
222 ::llvm::ArrayRef<::mlir::Type> resultTypes(&resultRawType, 1);
223 if (parser.parseColon())
224 return ::mlir::failure();
225
226 {
228 if (parser.parseCustomTypeWithFallback(type))
229 return ::mlir::failure();
230 resultRawType = type;
231 }
232 {
233 auto loc = parser.getCurrentLocation();(void)loc;
234 if (parser.parseOptionalAttrDict(result.attributes))
235 return ::mlir::failure();
236 }
237 result.addTypes(resultTypes);
238 return ::mlir::success();
239}
240
241void CreateStructOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
242 _odsPrinter << ' ' << ":";
243 _odsPrinter << ' ';
244 {
245 auto type = getResult().getType();
246 if (auto validType = ::llvm::dyn_cast<::llzk::component::StructType>(type))
247 _odsPrinter.printStrippedAttrOrType(validType);
248 else
249 _odsPrinter << type;
250 }
251 ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
252 _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
253}
254
255} // namespace component
256} // namespace llzk
257MLIR_DEFINE_EXPLICIT_TYPE_ID(::llzk::component::CreateStructOp)
258
259namespace llzk {
260namespace component {
261
262//===----------------------------------------------------------------------===//
263// ::llzk::component::FieldDefOp definitions
264//===----------------------------------------------------------------------===//
265
266namespace detail {
267FieldDefOpGenericAdaptorBase::FieldDefOpGenericAdaptorBase(FieldDefOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
268
270 auto attr = getSymNameAttr();
271 return attr.getValue();
272}
273
275 auto attr = getTypeAttr();
276 return ::llvm::cast<::mlir::Type>(attr.getValue());
277}
278
280 auto attr = ::llvm::dyn_cast_or_null<::mlir::UnitAttr>(getProperties().column);
281 if (!attr)
282 attr = ((false) ? ::mlir::Builder(odsAttrs.getContext()).getUnitAttr() : nullptr);
283 return attr;
284}
285
287 auto attr = getColumnAttr();
288 if (!attr)
289 return ((false) ? ::mlir::Builder(odsAttrs.getContext()).getUnitAttr() : nullptr) != nullptr;
290 return attr != nullptr;
291}
292
293} // namespace detail
295
296::llvm::LogicalResult FieldDefOpAdaptor::verify(::mlir::Location loc) {
297 auto tblgen_column = getProperties().column; (void)tblgen_column;
298 auto tblgen_sym_name = getProperties().sym_name; (void)tblgen_sym_name;
299 if (!tblgen_sym_name) return emitError(loc, "'struct.field' op ""requires attribute 'sym_name'");
300 auto tblgen_type = getProperties().type; (void)tblgen_type;
301 if (!tblgen_type) return emitError(loc, "'struct.field' op ""requires attribute 'type'");
302
303 if (tblgen_sym_name && !((::llvm::isa<::mlir::StringAttr>(tblgen_sym_name))))
304 return emitError(loc, "'struct.field' op ""attribute 'sym_name' failed to satisfy constraint: string attribute");
305
306 if (tblgen_type && !(((::llvm::isa<::mlir::TypeAttr>(tblgen_type))) && ((::llvm::isa<::mlir::Type>(::llvm::cast<::mlir::TypeAttr>(tblgen_type).getValue()))) && ((::llzk::isValidType(::llvm::cast<::mlir::TypeAttr>(tblgen_type).getValue())))))
307 return emitError(loc, "'struct.field' op ""attribute 'type' failed to satisfy constraint: type attribute of a valid LLZK type");
308
309 if (tblgen_column && !((::llvm::isa<::mlir::UnitAttr>(tblgen_column))))
310 return emitError(loc, "'struct.field' op ""attribute 'column' failed to satisfy constraint: unit attribute");
311 return ::mlir::success();
312}
313
314::llvm::LogicalResult FieldDefOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
315 ::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
316 if (!dict) {
317 emitError() << "expected DictionaryAttr to set properties";
318 return ::mlir::failure();
319 }
320
321 {
322 auto &propStorage = prop.column;
323 auto attr = dict.get("column");
324 if (attr) {
325 auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
326 if (convertedAttr) {
327 propStorage = convertedAttr;
328 } else {
329 emitError() << "Invalid attribute `column` in property conversion: " << attr;
330 return ::mlir::failure();
331 }
332 }
333 }
334
335 {
336 auto &propStorage = prop.sym_name;
337 auto attr = dict.get("sym_name");
338 if (attr) {
339 auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
340 if (convertedAttr) {
341 propStorage = convertedAttr;
342 } else {
343 emitError() << "Invalid attribute `sym_name` in property conversion: " << attr;
344 return ::mlir::failure();
345 }
346 }
347 }
348
349 {
350 auto &propStorage = prop.type;
351 auto attr = dict.get("type");
352 if (attr) {
353 auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
354 if (convertedAttr) {
355 propStorage = convertedAttr;
356 } else {
357 emitError() << "Invalid attribute `type` in property conversion: " << attr;
358 return ::mlir::failure();
359 }
360 }
361 }
362 return ::mlir::success();
363}
364
365::mlir::Attribute FieldDefOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
366 ::mlir::SmallVector<::mlir::NamedAttribute> attrs;
367 ::mlir::Builder odsBuilder{ctx};
368
369 {
370 const auto &propStorage = prop.column;
371 if (propStorage)
372 attrs.push_back(odsBuilder.getNamedAttr("column",
373 propStorage));
374 }
375
376 {
377 const auto &propStorage = prop.sym_name;
378 if (propStorage)
379 attrs.push_back(odsBuilder.getNamedAttr("sym_name",
380 propStorage));
381 }
382
383 {
384 const auto &propStorage = prop.type;
385 if (propStorage)
386 attrs.push_back(odsBuilder.getNamedAttr("type",
387 propStorage));
388 }
389
390 if (!attrs.empty())
391 return odsBuilder.getDictionaryAttr(attrs);
392 return {};
393}
394
395llvm::hash_code FieldDefOp::computePropertiesHash(const Properties &prop) {
396 return llvm::hash_combine(
397 llvm::hash_value(prop.column.getAsOpaquePointer()),
398 llvm::hash_value(prop.sym_name.getAsOpaquePointer()),
399 llvm::hash_value(prop.type.getAsOpaquePointer()));
400}
401
402std::optional<mlir::Attribute> FieldDefOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
403 if (name == "column")
404 return prop.column;
405
406 if (name == "sym_name")
407 return prop.sym_name;
408
409 if (name == "type")
410 return prop.type;
411 return std::nullopt;
412}
413
414void FieldDefOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
415 if (name == "column") {
416 prop.column = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.column)>>(value);
417 return;
418 }
419
420 if (name == "sym_name") {
421 prop.sym_name = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.sym_name)>>(value);
422 return;
423 }
424
425 if (name == "type") {
426 prop.type = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.type)>>(value);
427 return;
428 }
429}
430
431void FieldDefOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
432 if (prop.column) attrs.append("column", prop.column);
433
434 if (prop.sym_name) attrs.append("sym_name", prop.sym_name);
435
436 if (prop.type) attrs.append("type", prop.type);
437}
438
439::llvm::LogicalResult FieldDefOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
440 {
441 ::mlir::Attribute attr = attrs.get(getColumnAttrName(opName));
442 if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_Ops3(attr, "column", emitError)))
443 return ::mlir::failure();
444 }
445
446 {
447 ::mlir::Attribute attr = attrs.get(getSymNameAttrName(opName));
448 if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_Ops1(attr, "sym_name", emitError)))
449 return ::mlir::failure();
450 }
451
452 {
453 ::mlir::Attribute attr = attrs.get(getTypeAttrName(opName));
454 if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_Ops2(attr, "type", emitError)))
455 return ::mlir::failure();
456 }
457 return ::mlir::success();
458}
459
460::llvm::LogicalResult FieldDefOp::readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state) {
461 auto &prop = state.getOrAddProperties<Properties>(); (void)prop;
462 if (::mlir::failed(reader.readOptionalAttribute(prop.column)))
463 return ::mlir::failure();
464
465 if (::mlir::failed(reader.readAttribute(prop.sym_name)))
466 return ::mlir::failure();
467
468 if (::mlir::failed(reader.readAttribute(prop.type)))
469 return ::mlir::failure();
470 return ::mlir::success();
471}
472
473void FieldDefOp::writeProperties(::mlir::DialectBytecodeWriter &writer) {
474 auto &prop = getProperties(); (void)prop;
475
476 writer.writeOptionalAttribute(prop.column);
477 writer.writeAttribute(prop.sym_name);
478 writer.writeAttribute(prop.type);
479}
480
481::llvm::StringRef FieldDefOp::getSymName() {
482 auto attr = getSymNameAttr();
483 return attr.getValue();
484}
485
486::mlir::Type FieldDefOp::getType() {
487 auto attr = getTypeAttr();
488 return ::llvm::cast<::mlir::Type>(attr.getValue());
489}
490
492 auto attr = getColumnAttr();
493 if (!attr)
494 return ((false) ? ::mlir::Builder((*this)->getContext()).getUnitAttr() : nullptr) != nullptr;
495 return attr != nullptr;
496}
497
498void FieldDefOp::setSymName(::llvm::StringRef attrValue) {
499 getProperties().sym_name = ::mlir::Builder((*this)->getContext()).getStringAttr(attrValue);
500}
501
502void FieldDefOp::setType(::mlir::Type attrValue) {
503 getProperties().type = ::mlir::TypeAttr::get(attrValue);
504}
505
506void FieldDefOp::setColumn(bool attrValue) {
507 auto &odsProp = getProperties().column;
508 if (attrValue)
509 odsProp = ((attrValue) ? ::mlir::Builder((*this)->getContext()).getUnitAttr() : nullptr);
510 else
511 odsProp = nullptr;
512}
513
514void FieldDefOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes, bool isColumn) {
515 build(odsBuilder, odsState, {}, {}, attributes, isColumn);
516}
517
518::llvm::LogicalResult FieldDefOp::verifyInvariantsImpl() {
519 auto tblgen_column = getProperties().column; (void)tblgen_column;
520 auto tblgen_sym_name = getProperties().sym_name; (void)tblgen_sym_name;
521 if (!tblgen_sym_name) return emitOpError("requires attribute 'sym_name'");
522 auto tblgen_type = getProperties().type; (void)tblgen_type;
523 if (!tblgen_type) return emitOpError("requires attribute 'type'");
524
525 if (::mlir::failed(__mlir_ods_local_attr_constraint_Ops1(*this, tblgen_sym_name, "sym_name")))
526 return ::mlir::failure();
527
528 if (::mlir::failed(__mlir_ods_local_attr_constraint_Ops2(*this, tblgen_type, "type")))
529 return ::mlir::failure();
530
531 if (::mlir::failed(__mlir_ods_local_attr_constraint_Ops3(*this, tblgen_column, "column")))
532 return ::mlir::failure();
533 return ::mlir::success();
534}
535
536::llvm::LogicalResult FieldDefOp::verifyInvariants() {
537 return verifyInvariantsImpl();
538}
539
540::mlir::ParseResult FieldDefOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
541 ::mlir::StringAttr sym_nameAttr;
542 ::mlir::TypeAttr typeAttr;
543
544 if (parser.parseSymbolName(sym_nameAttr))
545 return ::mlir::failure();
546 if (sym_nameAttr) result.getOrAddProperties<FieldDefOp::Properties>().sym_name = sym_nameAttr;
547 if (parser.parseColon())
548 return ::mlir::failure();
549
550 if (parser.parseCustomAttributeWithFallback(typeAttr, parser.getBuilder().getType<::mlir::NoneType>())) {
551 return ::mlir::failure();
552 }
553 if (typeAttr) result.getOrAddProperties<FieldDefOp::Properties>().type = typeAttr;
554 {
555 auto loc = parser.getCurrentLocation();(void)loc;
556 if (parser.parseOptionalAttrDict(result.attributes))
557 return ::mlir::failure();
558 if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() {
559 return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op ";
560 })))
561 return ::mlir::failure();
562 }
563 return ::mlir::success();
564}
565
566void FieldDefOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
567 _odsPrinter << ' ';
568 _odsPrinter.printSymbolName(getSymNameAttr().getValue());
569 _odsPrinter << ' ' << ":";
570 _odsPrinter << ' ';
571 _odsPrinter.printAttributeWithoutType(getTypeAttr());
572 ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
573 elidedAttrs.push_back("sym_name");
574 elidedAttrs.push_back("type");
575 {
576 ::mlir::Builder odsBuilder(getContext());
577 ::mlir::Attribute attr = getColumnAttr();
578 if(attr && (attr == ((false) ? odsBuilder.getUnitAttr() : nullptr)))
579 elidedAttrs.push_back("column");
580 }
581 _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
582}
583
584} // namespace component
585} // namespace llzk
586MLIR_DEFINE_EXPLICIT_TYPE_ID(::llzk::component::FieldDefOp)
587
588namespace llzk {
589namespace component {
590
591//===----------------------------------------------------------------------===//
592// ::llzk::component::FieldReadOp definitions
593//===----------------------------------------------------------------------===//
594
595namespace detail {
596FieldReadOpGenericAdaptorBase::FieldReadOpGenericAdaptorBase(FieldReadOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
597
598std::pair<unsigned, unsigned> FieldReadOpGenericAdaptorBase::getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize) {
599 bool isVariadic[] = {false, true};
600 int prevVariadicCount = 0;
601 for (unsigned i = 0; i < index; ++i)
602 if (isVariadic[i]) ++prevVariadicCount;
603
604 // Calculate how many dynamic values a static variadic operand corresponds to.
605 // This assumes all static variadic operands have the same dynamic value count.
606 int variadicSize = (odsOperandsSize - 1) / 1;
607 // `index` passed in as the parameter is the static index which counts each
608 // operand (variadic or not) as size 1. So here for each previous static variadic
609 // operand, we need to offset by (variadicSize - 1) to get where the dynamic
610 // value pack for this static operand starts.
611 int start = index + (variadicSize - 1) * prevVariadicCount;
612 int size = isVariadic[index] ? variadicSize : 1;
613 return {start, size};
614}
615
617 auto attr = getFieldNameAttr();
618 return attr.getValue();
619}
620
621::std::optional<::mlir::Attribute> FieldReadOpGenericAdaptorBase::getTableOffset() {
622 auto attr = getTableOffsetAttr();
623 return attr ? ::std::optional<::mlir::Attribute>(attr) : (::std::nullopt);
624}
625
627 auto attr = ::llvm::dyn_cast_or_null<::mlir::DenseI32ArrayAttr>(getProperties().numDimsPerMap);
628 return attr;
629}
630
632 auto attr = getNumDimsPerMapAttr();
633 return attr;
634}
635
637 auto attr = getMapOpGroupSizesAttr();
638 return attr;
639}
640
641} // namespace detail
643
644::llvm::LogicalResult FieldReadOpAdaptor::verify(::mlir::Location loc) {
645 auto tblgen_field_name = getProperties().field_name; (void)tblgen_field_name;
646 if (!tblgen_field_name) return emitError(loc, "'struct.readf' op ""requires attribute 'field_name'");
647 auto tblgen_mapOpGroupSizes = getProperties().mapOpGroupSizes; (void)tblgen_mapOpGroupSizes;
648 if (!tblgen_mapOpGroupSizes) return emitError(loc, "'struct.readf' op ""requires attribute 'mapOpGroupSizes'");
649 auto tblgen_numDimsPerMap = getProperties().numDimsPerMap; (void)tblgen_numDimsPerMap;
650 auto tblgen_tableOffset = getProperties().tableOffset; (void)tblgen_tableOffset;
651
652 if (tblgen_field_name && !((::llvm::isa<::mlir::FlatSymbolRefAttr>(tblgen_field_name))))
653 return emitError(loc, "'struct.readf' op ""attribute 'field_name' failed to satisfy constraint: flat symbol reference attribute");
654
655 if (tblgen_tableOffset && !(((::llvm::isa<::mlir::SymbolRefAttr>(tblgen_tableOffset))) || (((::llvm::isa<::mlir::IntegerAttr>(tblgen_tableOffset))) && ((::llvm::isa<::mlir::IndexType>(::llvm::cast<::mlir::IntegerAttr>(tblgen_tableOffset).getType())))) || ((::llvm::isa<::mlir::AffineMapAttr>(tblgen_tableOffset)))))
656 return emitError(loc, "'struct.readf' op ""attribute 'tableOffset' failed to satisfy constraint: symbol reference attribute or index attribute or AffineMap attribute");
657
658 if (tblgen_numDimsPerMap && !((::llvm::isa<::mlir::DenseI32ArrayAttr>(tblgen_numDimsPerMap))))
659 return emitError(loc, "'struct.readf' op ""attribute 'numDimsPerMap' failed to satisfy constraint: i32 dense array attribute");
660
661 if (tblgen_mapOpGroupSizes && !((::llvm::isa<::mlir::DenseI32ArrayAttr>(tblgen_mapOpGroupSizes))))
662 return emitError(loc, "'struct.readf' op ""attribute 'mapOpGroupSizes' failed to satisfy constraint: i32 dense array attribute");
663 return ::mlir::success();
664}
665
666std::pair<unsigned, unsigned> FieldReadOp::getODSOperandIndexAndLength(unsigned index) {
667 bool isVariadic[] = {false, true};
668 int prevVariadicCount = 0;
669 for (unsigned i = 0; i < index; ++i)
670 if (isVariadic[i]) ++prevVariadicCount;
671
672 // Calculate how many dynamic values a static variadic operand corresponds to.
673 // This assumes all static variadic operands have the same dynamic value count.
674 int variadicSize = (getOperation()->getNumOperands() - 1) / 1;
675 // `index` passed in as the parameter is the static index which counts each
676 // operand (variadic or not) as size 1. So here for each previous static variadic
677 // operand, we need to offset by (variadicSize - 1) to get where the dynamic
678 // value pack for this static operand starts.
679 int start = index + (variadicSize - 1) * prevVariadicCount;
680 int size = isVariadic[index] ? variadicSize : 1;
681 return {start, size};
682}
683
684::mlir::MutableOperandRangeRange FieldReadOp::getMapOperandsMutable() {
685 auto range = getODSOperandIndexAndLength(1);
686 auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
687 return mutableRange.split(*(*this)->getAttrDictionary().getNamed(getMapOpGroupSizesAttrName()));
688}
689
690::llvm::LogicalResult FieldReadOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
691 ::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
692 if (!dict) {
693 emitError() << "expected DictionaryAttr to set properties";
694 return ::mlir::failure();
695 }
696
697 {
698 auto &propStorage = prop.field_name;
699 auto attr = dict.get("field_name");
700 if (attr) {
701 auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
702 if (convertedAttr) {
703 propStorage = convertedAttr;
704 } else {
705 emitError() << "Invalid attribute `field_name` in property conversion: " << attr;
706 return ::mlir::failure();
707 }
708 }
709 }
710
711 {
712 auto &propStorage = prop.mapOpGroupSizes;
713 auto attr = dict.get("mapOpGroupSizes");
714 if (attr) {
715 auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
716 if (convertedAttr) {
717 propStorage = convertedAttr;
718 } else {
719 emitError() << "Invalid attribute `mapOpGroupSizes` in property conversion: " << attr;
720 return ::mlir::failure();
721 }
722 }
723 }
724
725 {
726 auto &propStorage = prop.numDimsPerMap;
727 auto attr = dict.get("numDimsPerMap");
728 if (attr) {
729 auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
730 if (convertedAttr) {
731 propStorage = convertedAttr;
732 } else {
733 emitError() << "Invalid attribute `numDimsPerMap` in property conversion: " << attr;
734 return ::mlir::failure();
735 }
736 }
737 }
738
739 {
740 auto &propStorage = prop.tableOffset;
741 auto attr = dict.get("tableOffset");
742 if (attr) {
743 auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
744 if (convertedAttr) {
745 propStorage = convertedAttr;
746 } else {
747 emitError() << "Invalid attribute `tableOffset` in property conversion: " << attr;
748 return ::mlir::failure();
749 }
750 }
751 }
752 return ::mlir::success();
753}
754
755::mlir::Attribute FieldReadOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
756 ::mlir::SmallVector<::mlir::NamedAttribute> attrs;
757 ::mlir::Builder odsBuilder{ctx};
758
759 {
760 const auto &propStorage = prop.field_name;
761 if (propStorage)
762 attrs.push_back(odsBuilder.getNamedAttr("field_name",
763 propStorage));
764 }
765
766 {
767 const auto &propStorage = prop.mapOpGroupSizes;
768 if (propStorage)
769 attrs.push_back(odsBuilder.getNamedAttr("mapOpGroupSizes",
770 propStorage));
771 }
772
773 {
774 const auto &propStorage = prop.numDimsPerMap;
775 if (propStorage)
776 attrs.push_back(odsBuilder.getNamedAttr("numDimsPerMap",
777 propStorage));
778 }
779
780 {
781 const auto &propStorage = prop.tableOffset;
782 if (propStorage)
783 attrs.push_back(odsBuilder.getNamedAttr("tableOffset",
784 propStorage));
785 }
786
787 if (!attrs.empty())
788 return odsBuilder.getDictionaryAttr(attrs);
789 return {};
790}
791
792llvm::hash_code FieldReadOp::computePropertiesHash(const Properties &prop) {
793 return llvm::hash_combine(
794 llvm::hash_value(prop.field_name.getAsOpaquePointer()),
795 llvm::hash_value(prop.mapOpGroupSizes.getAsOpaquePointer()),
796 llvm::hash_value(prop.numDimsPerMap.getAsOpaquePointer()),
797 llvm::hash_value(prop.tableOffset.getAsOpaquePointer()));
798}
799
800std::optional<mlir::Attribute> FieldReadOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
801 if (name == "field_name")
802 return prop.field_name;
803
804 if (name == "mapOpGroupSizes")
805 return prop.mapOpGroupSizes;
806
807 if (name == "numDimsPerMap")
808 return prop.numDimsPerMap;
809
810 if (name == "tableOffset")
811 return prop.tableOffset;
812 return std::nullopt;
813}
814
815void FieldReadOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
816 if (name == "field_name") {
817 prop.field_name = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.field_name)>>(value);
818 return;
819 }
820
821 if (name == "mapOpGroupSizes") {
822 prop.mapOpGroupSizes = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.mapOpGroupSizes)>>(value);
823 return;
824 }
825
826 if (name == "numDimsPerMap") {
827 prop.numDimsPerMap = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.numDimsPerMap)>>(value);
828 return;
829 }
830
831 if (name == "tableOffset") {
832 prop.tableOffset = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.tableOffset)>>(value);
833 return;
834 }
835}
836
837void FieldReadOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
838 if (prop.field_name) attrs.append("field_name", prop.field_name);
839
840 if (prop.mapOpGroupSizes) attrs.append("mapOpGroupSizes", prop.mapOpGroupSizes);
841
842 if (prop.numDimsPerMap) attrs.append("numDimsPerMap", prop.numDimsPerMap);
843
844 if (prop.tableOffset) attrs.append("tableOffset", prop.tableOffset);
845}
846
847::llvm::LogicalResult FieldReadOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
848 {
849 ::mlir::Attribute attr = attrs.get(getFieldNameAttrName(opName));
850 if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_Ops4(attr, "field_name", emitError)))
851 return ::mlir::failure();
852 }
853
854 {
855 ::mlir::Attribute attr = attrs.get(getMapOpGroupSizesAttrName(opName));
856 if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_Ops6(attr, "mapOpGroupSizes", emitError)))
857 return ::mlir::failure();
858 }
859
860 {
861 ::mlir::Attribute attr = attrs.get(getNumDimsPerMapAttrName(opName));
862 if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_Ops6(attr, "numDimsPerMap", emitError)))
863 return ::mlir::failure();
864 }
865
866 {
867 ::mlir::Attribute attr = attrs.get(getTableOffsetAttrName(opName));
868 if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_Ops5(attr, "tableOffset", emitError)))
869 return ::mlir::failure();
870 }
871 return ::mlir::success();
872}
873
874::llvm::LogicalResult FieldReadOp::readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state) {
875 auto &prop = state.getOrAddProperties<Properties>(); (void)prop;
876 if (::mlir::failed(reader.readAttribute(prop.field_name)))
877 return ::mlir::failure();
878
879 if (::mlir::failed(reader.readAttribute(prop.mapOpGroupSizes)))
880 return ::mlir::failure();
881
882 if (::mlir::failed(reader.readOptionalAttribute(prop.numDimsPerMap)))
883 return ::mlir::failure();
884
885 if (::mlir::failed(reader.readOptionalAttribute(prop.tableOffset)))
886 return ::mlir::failure();
887 return ::mlir::success();
888}
889
890void FieldReadOp::writeProperties(::mlir::DialectBytecodeWriter &writer) {
891 auto &prop = getProperties(); (void)prop;
892 writer.writeAttribute(prop.field_name);
893 writer.writeAttribute(prop.mapOpGroupSizes);
894
895 writer.writeOptionalAttribute(prop.numDimsPerMap);
896
897 writer.writeOptionalAttribute(prop.tableOffset);
898}
899
900::llvm::StringRef FieldReadOp::getFieldName() {
901 auto attr = getFieldNameAttr();
902 return attr.getValue();
903}
904
905::std::optional<::mlir::Attribute> FieldReadOp::getTableOffset() {
906 auto attr = getTableOffsetAttr();
907 return attr ? ::std::optional<::mlir::Attribute>(attr) : (::std::nullopt);
908}
909
910::llvm::ArrayRef<int32_t> FieldReadOp::getNumDimsPerMap() {
911 auto attr = getNumDimsPerMapAttr();
912 return attr;
913}
914
915::llvm::ArrayRef<int32_t> FieldReadOp::getMapOpGroupSizes() {
916 auto attr = getMapOpGroupSizesAttr();
917 return attr;
918}
919
920void FieldReadOp::setFieldName(::llvm::StringRef attrValue) {
921 getProperties().field_name = ::mlir::SymbolRefAttr::get(::mlir::Builder((*this)->getContext()).getContext(), attrValue);
922}
923
924void FieldReadOp::setNumDimsPerMap(::llvm::ArrayRef<int32_t> attrValue) {
925 getProperties().numDimsPerMap = ::mlir::Builder((*this)->getContext()).getDenseI32ArrayAttr(attrValue);
926}
927
928void FieldReadOp::setMapOpGroupSizes(::llvm::ArrayRef<int32_t> attrValue) {
929 getProperties().mapOpGroupSizes = ::mlir::Builder((*this)->getContext()).getDenseI32ArrayAttr(attrValue);
930}
931
932void FieldReadOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type resultType, ::mlir::Value component, ::mlir::StringAttr field, ::mlir::SymbolRefAttr dist) {
933 build(odsBuilder, odsState, resultType, component, field, dist, ::mlir::ValueRange(), std::nullopt);
934
935}
936
937void FieldReadOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type resultType, ::mlir::Value component, ::mlir::StringAttr field, ::mlir::IntegerAttr dist) {
938 build(odsBuilder, odsState, resultType, component, field, dist, ::mlir::ValueRange(), std::nullopt);
939
940}
941
942void FieldReadOp::populateDefaultProperties(::mlir::OperationName opName, Properties &properties) {
943 ::mlir::Builder odsBuilder(opName.getContext());
944 if (!properties.numDimsPerMap)
945 properties.numDimsPerMap = odsBuilder.getDenseI32ArrayAttr({});
946}
947
948::llvm::LogicalResult FieldReadOp::verifyInvariantsImpl() {
949 auto tblgen_field_name = getProperties().field_name; (void)tblgen_field_name;
950 if (!tblgen_field_name) return emitOpError("requires attribute 'field_name'");
951 auto tblgen_mapOpGroupSizes = getProperties().mapOpGroupSizes; (void)tblgen_mapOpGroupSizes;
952 if (!tblgen_mapOpGroupSizes) return emitOpError("requires attribute 'mapOpGroupSizes'");
953 auto tblgen_numDimsPerMap = getProperties().numDimsPerMap; (void)tblgen_numDimsPerMap;
954 auto tblgen_tableOffset = getProperties().tableOffset; (void)tblgen_tableOffset;
955
956 if (::mlir::failed(__mlir_ods_local_attr_constraint_Ops4(*this, tblgen_field_name, "field_name")))
957 return ::mlir::failure();
958
959 if (::mlir::failed(__mlir_ods_local_attr_constraint_Ops5(*this, tblgen_tableOffset, "tableOffset")))
960 return ::mlir::failure();
961
962 if (::mlir::failed(__mlir_ods_local_attr_constraint_Ops6(*this, tblgen_numDimsPerMap, "numDimsPerMap")))
963 return ::mlir::failure();
964
965 if (::mlir::failed(__mlir_ods_local_attr_constraint_Ops6(*this, tblgen_mapOpGroupSizes, "mapOpGroupSizes")))
966 return ::mlir::failure();
967 {
968 unsigned index = 0; (void)index;
969 auto valueGroup0 = getODSOperands(0);
970
971 for (auto v : valueGroup0) {
972 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops1(*this, v.getType(), "operand", index++)))
973 return ::mlir::failure();
974 }
975 auto valueGroup1 = getODSOperands(1);
976 if (::mlir::failed(::mlir::OpTrait::impl::verifyValueSizeAttr(*this, "mapOpGroupSizes", "mapOperands", valueGroup1.size())))
977 return ::mlir::failure();
978
979 for (auto v : valueGroup1) {
980 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops2(*this, v.getType(), "operand", index++)))
981 return ::mlir::failure();
982 }
983 }
984 {
985 unsigned index = 0; (void)index;
986 auto valueGroup0 = getODSResults(0);
987
988 for (auto v : valueGroup0) {
989 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops3(*this, v.getType(), "result", index++)))
990 return ::mlir::failure();
991 }
992 }
993 return ::mlir::success();
994}
995
996::llvm::LogicalResult FieldReadOp::verifyInvariants() {
997 if(::mlir::succeeded(verifyInvariantsImpl()) && ::mlir::succeeded(verify()))
998 return ::mlir::success();
999 return ::mlir::failure();
1000}
1001
1002::mlir::ParseResult FieldReadOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
1003 ::mlir::OpAsmParser::UnresolvedOperand componentRawOperand{};
1004 ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> componentOperands(&componentRawOperand, 1); ::llvm::SMLoc componentOperandsLoc;
1005 (void)componentOperandsLoc;
1006 ::mlir::FlatSymbolRefAttr field_nameAttr;
1007 ::llvm::SmallVector<::mlir::OpAsmParser::UnresolvedOperand, 4> mapOperandsOperands;
1008 llvm::SmallVector<int32_t> mapOperandsOperandGroupSizes;
1009 ::llvm::SMLoc mapOperandsOperandsLoc;
1010 (void)mapOperandsOperandsLoc;
1011 ::mlir::DenseI32ArrayAttr numDimsPerMapAttr;
1012 ::mlir::Type componentRawType{};
1013 ::llvm::ArrayRef<::mlir::Type> componentTypes(&componentRawType, 1);
1014 ::mlir::Type valRawType{};
1015 ::llvm::ArrayRef<::mlir::Type> valTypes(&valRawType, 1);
1016
1017 componentOperandsLoc = parser.getCurrentLocation();
1018 if (parser.parseOperand(componentRawOperand))
1019 return ::mlir::failure();
1020 if (parser.parseLSquare())
1021 return ::mlir::failure();
1022
1023 if (parser.parseCustomAttributeWithFallback(field_nameAttr, parser.getBuilder().getType<::mlir::NoneType>())) {
1024 return ::mlir::failure();
1025 }
1026 if (field_nameAttr) result.getOrAddProperties<FieldReadOp::Properties>().field_name = field_nameAttr;
1027 if (parser.parseRSquare())
1028 return ::mlir::failure();
1029 if (::mlir::succeeded(parser.parseOptionalLBrace())) {
1030 {
1031 mapOperandsOperandsLoc = parser.getCurrentLocation();
1032 ::llvm::SmallVector<::llvm::SmallVector<::mlir::OpAsmParser::UnresolvedOperand>> mapOperandsOperandGroups;
1033 auto odsResult = parseMultiDimAndSymbolList(parser, mapOperandsOperandGroups, numDimsPerMapAttr);
1034 if (odsResult) return ::mlir::failure();
1035 for (const auto &subRange : mapOperandsOperandGroups) {
1036 mapOperandsOperands.append(subRange.begin(), subRange.end());
1037 mapOperandsOperandGroupSizes.push_back(subRange.size());
1038 }
1039 if (numDimsPerMapAttr)
1040 result.getOrAddProperties<FieldReadOp::Properties>().numDimsPerMap = numDimsPerMapAttr;
1041 }
1042 if (parser.parseRBrace())
1043 return ::mlir::failure();
1044 }
1045 if (parser.parseColon())
1046 return ::mlir::failure();
1047
1048 {
1050 if (parser.parseCustomTypeWithFallback(type))
1051 return ::mlir::failure();
1052 componentRawType = type;
1053 }
1054 if (parser.parseComma())
1055 return ::mlir::failure();
1056
1057 {
1058 ::mlir::Type type;
1059 if (parser.parseCustomTypeWithFallback(type))
1060 return ::mlir::failure();
1061 valRawType = type;
1062 }
1063 {
1064 auto loc = parser.getCurrentLocation();(void)loc;
1065 if (parser.parseOptionalAttrDict(result.attributes))
1066 return ::mlir::failure();
1067 if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() {
1068 return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op ";
1069 })))
1070 return ::mlir::failure();
1071 }
1072 result.getOrAddProperties<FieldReadOp::Properties>().mapOpGroupSizes = parser.getBuilder().getDenseI32ArrayAttr(mapOperandsOperandGroupSizes);
1073 ::mlir::Type odsBuildableType0 = parser.getBuilder().getIndexType();
1074 result.addTypes(valTypes);
1075 if (parser.resolveOperands(componentOperands, componentTypes, componentOperandsLoc, result.operands))
1076 return ::mlir::failure();
1077 if (parser.resolveOperands(mapOperandsOperands, odsBuildableType0, mapOperandsOperandsLoc, result.operands))
1078 return ::mlir::failure();
1079 return ::mlir::success();
1080}
1081
1082void FieldReadOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
1083 _odsPrinter << ' ';
1084 _odsPrinter << getComponent();
1085 _odsPrinter << "[";
1086 _odsPrinter.printAttributeWithoutType(getFieldNameAttr());
1087 _odsPrinter << "]";
1088 if (((!getMapOperands().empty()) || (getNumDimsPerMapAttr() != ::mlir::OpBuilder((*this)->getContext()).getDenseI32ArrayAttr({})))) {
1089 _odsPrinter << ' ' << "{";
1091 _odsPrinter << "}";
1092 }
1093 _odsPrinter << ' ' << ":";
1094 _odsPrinter << ' ';
1095 {
1096 auto type = getComponent().getType();
1097 if (auto validType = ::llvm::dyn_cast<::llzk::component::StructType>(type))
1098 _odsPrinter.printStrippedAttrOrType(validType);
1099 else
1100 _odsPrinter << type;
1101 }
1102 _odsPrinter << ",";
1103 _odsPrinter << ' ';
1104 {
1105 auto type = getVal().getType();
1106 if (auto validType = ::llvm::dyn_cast<::mlir::Type>(type))
1107 _odsPrinter.printStrippedAttrOrType(validType);
1108 else
1109 _odsPrinter << type;
1110 }
1111 ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
1112 elidedAttrs.push_back("mapOpGroupSizes");
1113 elidedAttrs.push_back("field_name");
1114 elidedAttrs.push_back("numDimsPerMap");
1115 {
1116 ::mlir::Builder odsBuilder(getContext());
1117 ::mlir::Attribute attr = getNumDimsPerMapAttr();
1118 if(attr && (attr == odsBuilder.getDenseI32ArrayAttr({})))
1119 elidedAttrs.push_back("numDimsPerMap");
1120 }
1121 _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
1122}
1123
1126 return true;
1127}
1128} // namespace component
1129} // namespace llzk
1130MLIR_DEFINE_EXPLICIT_TYPE_ID(::llzk::component::FieldReadOp)
1131
1132namespace llzk {
1133namespace component {
1134
1135//===----------------------------------------------------------------------===//
1136// ::llzk::component::FieldWriteOp definitions
1137//===----------------------------------------------------------------------===//
1138
1139namespace detail {
1140FieldWriteOpGenericAdaptorBase::FieldWriteOpGenericAdaptorBase(FieldWriteOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
1141
1143 auto attr = getFieldNameAttr();
1144 return attr.getValue();
1145}
1146
1147} // namespace detail
1149
1150::llvm::LogicalResult FieldWriteOpAdaptor::verify(::mlir::Location loc) {
1151 auto tblgen_field_name = getProperties().field_name; (void)tblgen_field_name;
1152 if (!tblgen_field_name) return emitError(loc, "'struct.writef' op ""requires attribute 'field_name'");
1153
1154 if (tblgen_field_name && !((::llvm::isa<::mlir::FlatSymbolRefAttr>(tblgen_field_name))))
1155 return emitError(loc, "'struct.writef' op ""attribute 'field_name' failed to satisfy constraint: flat symbol reference attribute");
1156 return ::mlir::success();
1157}
1158
1159::llvm::LogicalResult FieldWriteOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
1160 ::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
1161 if (!dict) {
1162 emitError() << "expected DictionaryAttr to set properties";
1163 return ::mlir::failure();
1164 }
1165
1166 {
1167 auto &propStorage = prop.field_name;
1168 auto attr = dict.get("field_name");
1169 if (attr) {
1170 auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
1171 if (convertedAttr) {
1172 propStorage = convertedAttr;
1173 } else {
1174 emitError() << "Invalid attribute `field_name` in property conversion: " << attr;
1175 return ::mlir::failure();
1176 }
1177 }
1178 }
1179 return ::mlir::success();
1180}
1181
1182::mlir::Attribute FieldWriteOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
1183 ::mlir::SmallVector<::mlir::NamedAttribute> attrs;
1184 ::mlir::Builder odsBuilder{ctx};
1185
1186 {
1187 const auto &propStorage = prop.field_name;
1188 if (propStorage)
1189 attrs.push_back(odsBuilder.getNamedAttr("field_name",
1190 propStorage));
1191 }
1192
1193 if (!attrs.empty())
1194 return odsBuilder.getDictionaryAttr(attrs);
1195 return {};
1196}
1197
1199 return llvm::hash_combine(
1200 llvm::hash_value(prop.field_name.getAsOpaquePointer()));
1201}
1202
1203std::optional<mlir::Attribute> FieldWriteOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
1204 if (name == "field_name")
1205 return prop.field_name;
1206 return std::nullopt;
1207}
1208
1209void FieldWriteOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
1210 if (name == "field_name") {
1211 prop.field_name = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.field_name)>>(value);
1212 return;
1213 }
1214}
1215
1216void FieldWriteOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
1217 if (prop.field_name) attrs.append("field_name", prop.field_name);
1218}
1219
1220::llvm::LogicalResult FieldWriteOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
1221 {
1222 ::mlir::Attribute attr = attrs.get(getFieldNameAttrName(opName));
1223 if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_Ops4(attr, "field_name", emitError)))
1224 return ::mlir::failure();
1225 }
1226 return ::mlir::success();
1227}
1228
1229::llvm::LogicalResult FieldWriteOp::readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state) {
1230 auto &prop = state.getOrAddProperties<Properties>(); (void)prop;
1231 if (::mlir::failed(reader.readAttribute(prop.field_name)))
1232 return ::mlir::failure();
1233 return ::mlir::success();
1234}
1235
1236void FieldWriteOp::writeProperties(::mlir::DialectBytecodeWriter &writer) {
1237 auto &prop = getProperties(); (void)prop;
1238 writer.writeAttribute(prop.field_name);
1239}
1240
1241::llvm::StringRef FieldWriteOp::getFieldName() {
1242 auto attr = getFieldNameAttr();
1243 return attr.getValue();
1244}
1245
1246void FieldWriteOp::setFieldName(::llvm::StringRef attrValue) {
1247 getProperties().field_name = ::mlir::SymbolRefAttr::get(::mlir::Builder((*this)->getContext()).getContext(), attrValue);
1248}
1249
1250void FieldWriteOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value component, ::mlir::FlatSymbolRefAttr field_name, ::mlir::Value val) {
1251 odsState.addOperands(component);
1252 odsState.addOperands(val);
1253 odsState.getOrAddProperties<Properties>().field_name = field_name;
1254}
1255
1256void FieldWriteOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value component, ::mlir::FlatSymbolRefAttr field_name, ::mlir::Value val) {
1257 odsState.addOperands(component);
1258 odsState.addOperands(val);
1259 odsState.getOrAddProperties<Properties>().field_name = field_name;
1260 assert(resultTypes.size() == 0u && "mismatched number of results");
1261 odsState.addTypes(resultTypes);
1262}
1263
1264void FieldWriteOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value component, ::llvm::StringRef field_name, ::mlir::Value val) {
1265 odsState.addOperands(component);
1266 odsState.addOperands(val);
1267 odsState.getOrAddProperties<Properties>().field_name = ::mlir::SymbolRefAttr::get(odsBuilder.getContext(), field_name);
1268}
1269
1270void FieldWriteOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value component, ::llvm::StringRef field_name, ::mlir::Value val) {
1271 odsState.addOperands(component);
1272 odsState.addOperands(val);
1273 odsState.getOrAddProperties<Properties>().field_name = ::mlir::SymbolRefAttr::get(odsBuilder.getContext(), field_name);
1274 assert(resultTypes.size() == 0u && "mismatched number of results");
1275 odsState.addTypes(resultTypes);
1276}
1277
1278void FieldWriteOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
1279 assert(operands.size() == 2u && "mismatched number of parameters");
1280 odsState.addOperands(operands);
1281 odsState.addAttributes(attributes);
1282 assert(resultTypes.size() == 0u && "mismatched number of return types");
1283 odsState.addTypes(resultTypes);
1284
1285 if (!attributes.empty()) {
1286 ::mlir::OpaqueProperties properties =
1287 &odsState.getOrAddProperties<FieldWriteOp::Properties>();
1288 std::optional<::mlir::RegisteredOperationName> info =
1289 odsState.name.getRegisteredInfo();
1290 if (failed(info->setOpPropertiesFromAttribute(odsState.name, properties,
1291 odsState.attributes.getDictionary(odsState.getContext()), nullptr)))
1292 ::llvm::report_fatal_error("Property conversion failed.");
1293 }
1294}
1295
1296::llvm::LogicalResult FieldWriteOp::verifyInvariantsImpl() {
1297 auto tblgen_field_name = getProperties().field_name; (void)tblgen_field_name;
1298 if (!tblgen_field_name) return emitOpError("requires attribute 'field_name'");
1299
1300 if (::mlir::failed(__mlir_ods_local_attr_constraint_Ops4(*this, tblgen_field_name, "field_name")))
1301 return ::mlir::failure();
1302 {
1303 unsigned index = 0; (void)index;
1304 auto valueGroup0 = getODSOperands(0);
1305
1306 for (auto v : valueGroup0) {
1307 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops1(*this, v.getType(), "operand", index++)))
1308 return ::mlir::failure();
1309 }
1310 auto valueGroup1 = getODSOperands(1);
1311
1312 for (auto v : valueGroup1) {
1313 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops3(*this, v.getType(), "operand", index++)))
1314 return ::mlir::failure();
1315 }
1316 }
1317 return ::mlir::success();
1318}
1319
1320::llvm::LogicalResult FieldWriteOp::verifyInvariants() {
1321 return verifyInvariantsImpl();
1322}
1323
1324::mlir::ParseResult FieldWriteOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
1325 ::mlir::OpAsmParser::UnresolvedOperand componentRawOperand{};
1326 ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> componentOperands(&componentRawOperand, 1); ::llvm::SMLoc componentOperandsLoc;
1327 (void)componentOperandsLoc;
1328 ::mlir::FlatSymbolRefAttr field_nameAttr;
1329 ::mlir::OpAsmParser::UnresolvedOperand valRawOperand{};
1330 ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> valOperands(&valRawOperand, 1); ::llvm::SMLoc valOperandsLoc;
1331 (void)valOperandsLoc;
1332 ::mlir::Type componentRawType{};
1333 ::llvm::ArrayRef<::mlir::Type> componentTypes(&componentRawType, 1);
1334 ::mlir::Type valRawType{};
1335 ::llvm::ArrayRef<::mlir::Type> valTypes(&valRawType, 1);
1336
1337 componentOperandsLoc = parser.getCurrentLocation();
1338 if (parser.parseOperand(componentRawOperand))
1339 return ::mlir::failure();
1340 if (parser.parseLSquare())
1341 return ::mlir::failure();
1342
1343 if (parser.parseCustomAttributeWithFallback(field_nameAttr, parser.getBuilder().getType<::mlir::NoneType>())) {
1344 return ::mlir::failure();
1345 }
1346 if (field_nameAttr) result.getOrAddProperties<FieldWriteOp::Properties>().field_name = field_nameAttr;
1347 if (parser.parseRSquare())
1348 return ::mlir::failure();
1349 if (parser.parseEqual())
1350 return ::mlir::failure();
1351
1352 valOperandsLoc = parser.getCurrentLocation();
1353 if (parser.parseOperand(valRawOperand))
1354 return ::mlir::failure();
1355 if (parser.parseColon())
1356 return ::mlir::failure();
1357
1358 {
1360 if (parser.parseCustomTypeWithFallback(type))
1361 return ::mlir::failure();
1362 componentRawType = type;
1363 }
1364 if (parser.parseComma())
1365 return ::mlir::failure();
1366
1367 {
1368 ::mlir::Type type;
1369 if (parser.parseCustomTypeWithFallback(type))
1370 return ::mlir::failure();
1371 valRawType = type;
1372 }
1373 {
1374 auto loc = parser.getCurrentLocation();(void)loc;
1375 if (parser.parseOptionalAttrDict(result.attributes))
1376 return ::mlir::failure();
1377 if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() {
1378 return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op ";
1379 })))
1380 return ::mlir::failure();
1381 }
1382 if (parser.resolveOperands(componentOperands, componentTypes, componentOperandsLoc, result.operands))
1383 return ::mlir::failure();
1384 if (parser.resolveOperands(valOperands, valTypes, valOperandsLoc, result.operands))
1385 return ::mlir::failure();
1386 return ::mlir::success();
1387}
1388
1389void FieldWriteOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
1390 _odsPrinter << ' ';
1391 _odsPrinter << getComponent();
1392 _odsPrinter << "[";
1393 _odsPrinter.printAttributeWithoutType(getFieldNameAttr());
1394 _odsPrinter << "]";
1395 _odsPrinter << ' ' << "=";
1396 _odsPrinter << ' ';
1397 _odsPrinter << getVal();
1398 _odsPrinter << ' ' << ":";
1399 _odsPrinter << ' ';
1400 {
1401 auto type = getComponent().getType();
1402 if (auto validType = ::llvm::dyn_cast<::llzk::component::StructType>(type))
1403 _odsPrinter.printStrippedAttrOrType(validType);
1404 else
1405 _odsPrinter << type;
1406 }
1407 _odsPrinter << ",";
1408 _odsPrinter << ' ';
1409 {
1410 auto type = getVal().getType();
1411 if (auto validType = ::llvm::dyn_cast<::mlir::Type>(type))
1412 _odsPrinter.printStrippedAttrOrType(validType);
1413 else
1414 _odsPrinter << type;
1415 }
1416 ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
1417 elidedAttrs.push_back("field_name");
1418 _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
1419}
1420
1423 return false;
1424}
1425} // namespace component
1426} // namespace llzk
1427MLIR_DEFINE_EXPLICIT_TYPE_ID(::llzk::component::FieldWriteOp)
1428
1429namespace llzk {
1430namespace component {
1431
1432//===----------------------------------------------------------------------===//
1433// ::llzk::component::StructDefOp definitions
1434//===----------------------------------------------------------------------===//
1435
1436namespace detail {
1438
1440 auto attr = getSymNameAttr();
1441 return attr.getValue();
1442}
1443
1444::std::optional< ::mlir::ArrayAttr > StructDefOpGenericAdaptorBase::getConstParams() {
1445 auto attr = getConstParamsAttr();
1446 return attr ? ::std::optional< ::mlir::ArrayAttr >(attr) : (::std::nullopt);
1447}
1448
1449} // namespace detail
1451
1452::llvm::LogicalResult StructDefOpAdaptor::verify(::mlir::Location loc) {
1453 auto tblgen_const_params = getProperties().const_params; (void)tblgen_const_params;
1454 auto tblgen_sym_name = getProperties().sym_name; (void)tblgen_sym_name;
1455 if (!tblgen_sym_name) return emitError(loc, "'struct.def' op ""requires attribute 'sym_name'");
1456
1457 if (tblgen_sym_name && !((::llvm::isa<::mlir::StringAttr>(tblgen_sym_name))))
1458 return emitError(loc, "'struct.def' op ""attribute 'sym_name' failed to satisfy constraint: string attribute");
1459
1460 if (tblgen_const_params && !(((::llvm::isa<::mlir::ArrayAttr>(tblgen_const_params))) && (::llvm::all_of(::llvm::cast<::mlir::ArrayAttr>(tblgen_const_params), [&](::mlir::Attribute attr) { return attr && ((::llvm::isa<::mlir::FlatSymbolRefAttr>(attr))); }))))
1461 return emitError(loc, "'struct.def' op ""attribute 'const_params' failed to satisfy constraint: flat symbol ref array attribute");
1462 return ::mlir::success();
1463}
1464
1465::llvm::LogicalResult StructDefOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
1466 ::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
1467 if (!dict) {
1468 emitError() << "expected DictionaryAttr to set properties";
1469 return ::mlir::failure();
1470 }
1471
1472 {
1473 auto &propStorage = prop.const_params;
1474 auto attr = dict.get("const_params");
1475 if (attr) {
1476 auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
1477 if (convertedAttr) {
1478 propStorage = convertedAttr;
1479 } else {
1480 emitError() << "Invalid attribute `const_params` in property conversion: " << attr;
1481 return ::mlir::failure();
1482 }
1483 }
1484 }
1485
1486 {
1487 auto &propStorage = prop.sym_name;
1488 auto attr = dict.get("sym_name");
1489 if (attr) {
1490 auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
1491 if (convertedAttr) {
1492 propStorage = convertedAttr;
1493 } else {
1494 emitError() << "Invalid attribute `sym_name` in property conversion: " << attr;
1495 return ::mlir::failure();
1496 }
1497 }
1498 }
1499 return ::mlir::success();
1500}
1501
1502::mlir::Attribute StructDefOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
1503 ::mlir::SmallVector<::mlir::NamedAttribute> attrs;
1504 ::mlir::Builder odsBuilder{ctx};
1505
1506 {
1507 const auto &propStorage = prop.const_params;
1508 if (propStorage)
1509 attrs.push_back(odsBuilder.getNamedAttr("const_params",
1510 propStorage));
1511 }
1512
1513 {
1514 const auto &propStorage = prop.sym_name;
1515 if (propStorage)
1516 attrs.push_back(odsBuilder.getNamedAttr("sym_name",
1517 propStorage));
1518 }
1519
1520 if (!attrs.empty())
1521 return odsBuilder.getDictionaryAttr(attrs);
1522 return {};
1523}
1524
1526 return llvm::hash_combine(
1527 llvm::hash_value(prop.const_params.getAsOpaquePointer()),
1528 llvm::hash_value(prop.sym_name.getAsOpaquePointer()));
1529}
1530
1531std::optional<mlir::Attribute> StructDefOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
1532 if (name == "const_params")
1533 return prop.const_params;
1534
1535 if (name == "sym_name")
1536 return prop.sym_name;
1537 return std::nullopt;
1538}
1539
1540void StructDefOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
1541 if (name == "const_params") {
1542 prop.const_params = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.const_params)>>(value);
1543 return;
1544 }
1545
1546 if (name == "sym_name") {
1547 prop.sym_name = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.sym_name)>>(value);
1548 return;
1549 }
1550}
1551
1552void StructDefOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
1553 if (prop.const_params) attrs.append("const_params", prop.const_params);
1554
1555 if (prop.sym_name) attrs.append("sym_name", prop.sym_name);
1556}
1557
1558::llvm::LogicalResult StructDefOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
1559 {
1560 ::mlir::Attribute attr = attrs.get(getConstParamsAttrName(opName));
1561 if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_Ops7(attr, "const_params", emitError)))
1562 return ::mlir::failure();
1563 }
1564
1565 {
1566 ::mlir::Attribute attr = attrs.get(getSymNameAttrName(opName));
1567 if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_Ops1(attr, "sym_name", emitError)))
1568 return ::mlir::failure();
1569 }
1570 return ::mlir::success();
1571}
1572
1573::llvm::LogicalResult StructDefOp::readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state) {
1574 auto &prop = state.getOrAddProperties<Properties>(); (void)prop;
1575 if (::mlir::failed(reader.readOptionalAttribute(prop.const_params)))
1576 return ::mlir::failure();
1577
1578 if (::mlir::failed(reader.readAttribute(prop.sym_name)))
1579 return ::mlir::failure();
1580 return ::mlir::success();
1581}
1582
1583void StructDefOp::writeProperties(::mlir::DialectBytecodeWriter &writer) {
1584 auto &prop = getProperties(); (void)prop;
1585
1586 writer.writeOptionalAttribute(prop.const_params);
1587 writer.writeAttribute(prop.sym_name);
1588}
1589
1590::llvm::StringRef StructDefOp::getSymName() {
1591 auto attr = getSymNameAttr();
1592 return attr.getValue();
1593}
1594
1595::std::optional< ::mlir::ArrayAttr > StructDefOp::getConstParams() {
1596 auto attr = getConstParamsAttr();
1597 return attr ? ::std::optional< ::mlir::ArrayAttr >(attr) : (::std::nullopt);
1598}
1599
1600void StructDefOp::setSymName(::llvm::StringRef attrValue) {
1601 getProperties().sym_name = ::mlir::Builder((*this)->getContext()).getStringAttr(attrValue);
1602}
1603
1604void StructDefOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::StringAttr sym_name, /*optional*/::mlir::ArrayAttr const_params) {
1605 odsState.getOrAddProperties<Properties>().sym_name = sym_name;
1606 if (const_params) {
1607 odsState.getOrAddProperties<Properties>().const_params = const_params;
1608 }
1609 (void)odsState.addRegion();
1610}
1611
1612void StructDefOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::StringAttr sym_name, /*optional*/::mlir::ArrayAttr const_params) {
1613 odsState.getOrAddProperties<Properties>().sym_name = sym_name;
1614 if (const_params) {
1615 odsState.getOrAddProperties<Properties>().const_params = const_params;
1616 }
1617 (void)odsState.addRegion();
1618 assert(resultTypes.size() == 0u && "mismatched number of results");
1619 odsState.addTypes(resultTypes);
1620}
1621
1622void StructDefOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::llvm::StringRef sym_name, /*optional*/::mlir::ArrayAttr const_params) {
1623 odsState.getOrAddProperties<Properties>().sym_name = odsBuilder.getStringAttr(sym_name);
1624 if (const_params) {
1625 odsState.getOrAddProperties<Properties>().const_params = const_params;
1626 }
1627 (void)odsState.addRegion();
1628}
1629
1630void StructDefOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::llvm::StringRef sym_name, /*optional*/::mlir::ArrayAttr const_params) {
1631 odsState.getOrAddProperties<Properties>().sym_name = odsBuilder.getStringAttr(sym_name);
1632 if (const_params) {
1633 odsState.getOrAddProperties<Properties>().const_params = const_params;
1634 }
1635 (void)odsState.addRegion();
1636 assert(resultTypes.size() == 0u && "mismatched number of results");
1637 odsState.addTypes(resultTypes);
1638}
1639
1640void StructDefOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
1641 assert(operands.size() == 0u && "mismatched number of parameters");
1642 odsState.addOperands(operands);
1643 odsState.addAttributes(attributes);
1644 for (unsigned i = 0; i != 1; ++i)
1645 (void)odsState.addRegion();
1646 assert(resultTypes.size() == 0u && "mismatched number of return types");
1647 odsState.addTypes(resultTypes);
1648
1649 if (!attributes.empty()) {
1650 ::mlir::OpaqueProperties properties =
1651 &odsState.getOrAddProperties<StructDefOp::Properties>();
1652 std::optional<::mlir::RegisteredOperationName> info =
1653 odsState.name.getRegisteredInfo();
1654 if (failed(info->setOpPropertiesFromAttribute(odsState.name, properties,
1655 odsState.attributes.getDictionary(odsState.getContext()), nullptr)))
1656 ::llvm::report_fatal_error("Property conversion failed.");
1657 }
1658}
1659
1660::llvm::LogicalResult StructDefOp::verifyInvariantsImpl() {
1661 auto tblgen_const_params = getProperties().const_params; (void)tblgen_const_params;
1662 auto tblgen_sym_name = getProperties().sym_name; (void)tblgen_sym_name;
1663 if (!tblgen_sym_name) return emitOpError("requires attribute 'sym_name'");
1664
1665 if (::mlir::failed(__mlir_ods_local_attr_constraint_Ops1(*this, tblgen_sym_name, "sym_name")))
1666 return ::mlir::failure();
1667
1668 if (::mlir::failed(__mlir_ods_local_attr_constraint_Ops7(*this, tblgen_const_params, "const_params")))
1669 return ::mlir::failure();
1670 {
1671 unsigned index = 0; (void)index;
1672
1673 for (auto &region : ::llvm::MutableArrayRef((*this)->getRegion(0)))
1674 if (::mlir::failed(__mlir_ods_local_region_constraint_Ops1(*this, region, "bodyRegion", index++)))
1675 return ::mlir::failure();
1676 }
1677 return ::mlir::success();
1678}
1679
1680::llvm::LogicalResult StructDefOp::verifyInvariants() {
1681 return verifyInvariantsImpl();
1682}
1683
1684::mlir::ParseResult StructDefOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
1685 ::mlir::StringAttr sym_nameAttr;
1686 ::mlir::ArrayAttr const_paramsAttr;
1687 std::unique_ptr<::mlir::Region> bodyRegionRegion = std::make_unique<::mlir::Region>();
1688
1689 if (parser.parseSymbolName(sym_nameAttr))
1690 return ::mlir::failure();
1691 if (sym_nameAttr) result.getOrAddProperties<StructDefOp::Properties>().sym_name = sym_nameAttr;
1692 if (::mlir::succeeded(parser.parseOptionalLess())) {
1693
1694 if (parser.parseCustomAttributeWithFallback(const_paramsAttr, parser.getBuilder().getType<::mlir::NoneType>())) {
1695 return ::mlir::failure();
1696 }
1697 if (const_paramsAttr) result.getOrAddProperties<StructDefOp::Properties>().const_params = const_paramsAttr;
1698 if (parser.parseGreater())
1699 return ::mlir::failure();
1700 }
1701
1702 if (parser.parseRegion(*bodyRegionRegion))
1703 return ::mlir::failure();
1704
1705 if (bodyRegionRegion->empty()) bodyRegionRegion->emplaceBlock();
1706 {
1707 auto loc = parser.getCurrentLocation();(void)loc;
1708 if (parser.parseOptionalAttrDict(result.attributes))
1709 return ::mlir::failure();
1710 if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() {
1711 return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op ";
1712 })))
1713 return ::mlir::failure();
1714 }
1715 result.addRegion(std::move(bodyRegionRegion));
1716 return ::mlir::success();
1717}
1718
1719void StructDefOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
1720 _odsPrinter << ' ';
1721 _odsPrinter.printSymbolName(getSymNameAttr().getValue());
1722 if (getConstParamsAttr()) {
1723 _odsPrinter << "<";
1724 _odsPrinter.printAttributeWithoutType(getConstParamsAttr());
1725 _odsPrinter << ">";
1726 }
1727 _odsPrinter << ' ';
1728 _odsPrinter.printRegion(getBodyRegion());
1729 ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
1730 elidedAttrs.push_back("sym_name");
1731 elidedAttrs.push_back("const_params");
1732 _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
1733}
1734
1735} // namespace component
1736} // namespace llzk
1737MLIR_DEFINE_EXPLICIT_TYPE_ID(::llzk::component::StructDefOp)
1738
1739
1740#endif // GET_OP_CLASSES
1741
MlirStringRef name
Definition Poly.cpp:48
CreateStructOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs={}, const ::mlir::EmptyProperties &properties={}, ::mlir::RegionRange regions={})
Definition Ops.h.inc:74
::llvm::LogicalResult verify(::mlir::Location loc)
Definition Ops.cpp.inc:182
CreateStructOpAdaptor(CreateStructOp op)
Definition Ops.cpp.inc:180
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result)
Definition Ops.cpp.inc:186
::mlir::Operation::result_range getODSResults(unsigned index)
Definition Ops.h.inc:137
::llvm::LogicalResult verifyInvariantsImpl()
Definition Ops.cpp.inc:203
::llvm::LogicalResult verifyInvariants()
Definition Ops.cpp.inc:216
::mlir::TypedValue<::llzk::component::StructType > getResult()
Definition Ops.h.inc:143
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
Definition Ops.cpp.inc:220
void print(::mlir::OpAsmPrinter &_odsPrinter)
Definition Ops.cpp.inc:241
FieldDefOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:259
::llvm::LogicalResult verify(::mlir::Location loc)
Definition Ops.cpp.inc:296
static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs)
Definition Ops.cpp.inc:431
FoldAdaptor::Properties Properties
Definition Ops.h.inc:302
::mlir::StringAttr getColumnAttrName()
Definition Ops.h.inc:308
::llvm::LogicalResult verifyInvariantsImpl()
Definition Ops.cpp.inc:518
::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state)
Definition Ops.cpp.inc:460
void setColumn(bool attrValue)
Definition Ops.cpp.inc:506
::mlir::StringAttr getSymNameAttrName()
Definition Ops.h.inc:316
::mlir::TypeAttr getTypeAttr()
Definition Ops.h.inc:370
::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:439
static llvm::hash_code computePropertiesHash(const Properties &prop)
Definition Ops.cpp.inc:395
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::StringAttr sym_name, ::mlir::TypeAttr type, bool isColumn=false)
void print(::mlir::OpAsmPrinter &_odsPrinter)
Definition Ops.cpp.inc:566
::llvm::LogicalResult verifyInvariants()
Definition Ops.cpp.inc:536
::mlir::StringAttr getTypeAttrName()
Definition Ops.h.inc:324
static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value)
Definition Ops.cpp.inc:414
static std::optional< mlir::Attribute > getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name)
Definition Ops.cpp.inc:402
void writeProperties(::mlir::DialectBytecodeWriter &writer)
Definition Ops.cpp.inc:473
void setSymName(::llvm::StringRef attrValue)
Definition Ops.cpp.inc:498
void setType(::mlir::Type attrValue)
Definition Ops.cpp.inc:502
::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop)
Definition Ops.cpp.inc:365
::llvm::StringRef getSymName()
Definition Ops.cpp.inc:481
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
Definition Ops.cpp.inc:540
::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:314
::mlir::StringAttr getSymNameAttr()
Definition Ops.h.inc:365
::mlir::UnitAttr getColumnAttr()
Definition Ops.h.inc:375
::llvm::LogicalResult verify(::mlir::Location loc)
Definition Ops.cpp.inc:644
FieldReadOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:542
FoldAdaptor::Properties Properties
Definition Ops.h.inc:601
::mlir::StringAttr getNumDimsPerMapAttrName()
Definition Ops.h.inc:623
::mlir::OperandRangeRange getMapOperands()
Definition Ops.h.inc:654
::mlir::MutableOperandRangeRange getMapOperandsMutable()
Definition Ops.cpp.inc:684
::mlir::TypedValue<::mlir::Type > getVal()
Definition Ops.h.inc:674
::mlir::DenseI32ArrayAttr getNumDimsPerMapAttr()
Definition Ops.h.inc:697
::mlir::StringAttr getFieldNameAttrName()
Definition Ops.h.inc:607
::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:690
::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:847
void setNumDimsPerMap(::llvm::ArrayRef< int32_t > attrValue)
Definition Ops.cpp.inc:924
::mlir::StringAttr getTableOffsetAttrName()
Definition Ops.h.inc:631
::llvm::StringRef getFieldName()
Definition Ops.cpp.inc:900
::mlir::DenseI32ArrayAttr getMapOpGroupSizesAttr()
Definition Ops.h.inc:702
::llvm::LogicalResult verify()
Definition Ops.cpp:671
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type resultType, ::mlir::Value component, ::mlir::StringAttr field)
static void populateDefaultProperties(::mlir::OperationName opName, Properties &properties)
Definition Ops.cpp.inc:942
bool isRead()
Return true if the op is a read, false if it's a write.
Definition Ops.cpp.inc:1125
::mlir::TypedValue<::llzk::component::StructType > getComponent()
Definition Ops.h.inc:650
::llvm::ArrayRef< int32_t > getNumDimsPerMap()
Definition Ops.cpp.inc:910
static std::optional< mlir::Attribute > getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name)
Definition Ops.cpp.inc:800
::mlir::FlatSymbolRefAttr getFieldNameAttr()
Definition Ops.h.inc:687
::llvm::LogicalResult verifyInvariants()
Definition Ops.cpp.inc:996
::mlir::StringAttr getMapOpGroupSizesAttrName()
Definition Ops.h.inc:615
::mlir::Operation::result_range getODSResults(unsigned index)
Definition Ops.h.inc:668
::llvm::LogicalResult verifyInvariantsImpl()
Definition Ops.cpp.inc:948
::mlir::Operation::operand_range getODSOperands(unsigned index)
Definition Ops.h.inc:644
void setMapOpGroupSizes(::llvm::ArrayRef< int32_t > attrValue)
Definition Ops.cpp.inc:928
::std::optional<::mlir::Attribute > getTableOffset()
Definition Ops.cpp.inc:905
static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs)
Definition Ops.cpp.inc:837
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
Definition Ops.cpp.inc:1002
static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value)
Definition Ops.cpp.inc:815
::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop)
Definition Ops.cpp.inc:755
static llvm::hash_code computePropertiesHash(const Properties &prop)
Definition Ops.cpp.inc:792
::llvm::ArrayRef< int32_t > getMapOpGroupSizes()
Definition Ops.cpp.inc:915
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index)
Definition Ops.cpp.inc:666
::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state)
Definition Ops.cpp.inc:874
void setFieldName(::llvm::StringRef attrValue)
Definition Ops.cpp.inc:920
void writeProperties(::mlir::DialectBytecodeWriter &writer)
Definition Ops.cpp.inc:890
::mlir::Attribute getTableOffsetAttr()
Definition Ops.h.inc:692
void print(::mlir::OpAsmPrinter &_odsPrinter)
Definition Ops.cpp.inc:1082
FieldWriteOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:835
::llvm::LogicalResult verify(::mlir::Location loc)
Definition Ops.cpp.inc:1150
void writeProperties(::mlir::DialectBytecodeWriter &writer)
Definition Ops.cpp.inc:1236
bool isRead()
Return true if the op is a read, false if it's a write.
Definition Ops.cpp.inc:1422
::llvm::StringRef getFieldName()
Definition Ops.cpp.inc:1241
::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state)
Definition Ops.cpp.inc:1229
::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:1220
void setFieldName(::llvm::StringRef attrValue)
Definition Ops.cpp.inc:1246
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
Definition Ops.cpp.inc:1324
::mlir::StringAttr getFieldNameAttrName()
Definition Ops.h.inc:892
static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs)
Definition Ops.cpp.inc:1216
::mlir::TypedValue<::llzk::component::StructType > getComponent()
Definition Ops.h.inc:914
::llvm::LogicalResult verifyInvariantsImpl()
Definition Ops.cpp.inc:1296
::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop)
Definition Ops.cpp.inc:1182
::mlir::Operation::operand_range getODSOperands(unsigned index)
Definition Ops.h.inc:908
::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:1159
::mlir::TypedValue<::mlir::Type > getVal()
Definition Ops.h.inc:918
::mlir::FlatSymbolRefAttr getFieldNameAttr()
Definition Ops.h.inc:951
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value component, ::mlir::FlatSymbolRefAttr field_name, ::mlir::Value val)
Definition Ops.cpp.inc:1250
::llvm::LogicalResult verifyInvariants()
Definition Ops.cpp.inc:1320
static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value)
Definition Ops.cpp.inc:1209
FoldAdaptor::Properties Properties
Definition Ops.h.inc:886
static llvm::hash_code computePropertiesHash(const Properties &prop)
Definition Ops.cpp.inc:1198
void print(::mlir::OpAsmPrinter &_odsPrinter)
Definition Ops.cpp.inc:1389
static std::optional< mlir::Attribute > getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name)
Definition Ops.cpp.inc:1203
StructDefOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:1087
::llvm::LogicalResult verify(::mlir::Location loc)
Definition Ops.cpp.inc:1452
static llvm::hash_code computePropertiesHash(const Properties &prop)
Definition Ops.cpp.inc:1525
static std::optional< mlir::Attribute > getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name)
Definition Ops.cpp.inc:1531
static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value)
Definition Ops.cpp.inc:1540
::mlir::Region & getBodyRegion()
Definition Ops.h.inc:1176
::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state)
Definition Ops.cpp.inc:1573
static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs)
Definition Ops.cpp.inc:1552
::llvm::LogicalResult verifyInvariants()
Definition Ops.cpp.inc:1680
::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop)
Definition Ops.cpp.inc:1502
::llvm::StringRef getSymName()
Definition Ops.cpp.inc:1590
FoldAdaptor::Properties Properties
Definition Ops.h.inc:1130
::mlir::StringAttr getConstParamsAttrName()
Definition Ops.h.inc:1136
::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:1558
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
Definition Ops.cpp.inc:1684
void writeProperties(::mlir::DialectBytecodeWriter &writer)
Definition Ops.cpp.inc:1583
::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:1465
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::StringAttr sym_name, ::mlir::ArrayAttr const_params)
Definition Ops.cpp.inc:1604
::mlir::StringAttr getSymNameAttr()
Definition Ops.h.inc:1189
::std::optional< ::mlir::ArrayAttr > getConstParams()
Definition Ops.cpp.inc:1595
void setSymName(::llvm::StringRef attrValue)
Definition Ops.cpp.inc:1600
::llvm::LogicalResult verifyInvariantsImpl()
Definition Ops.cpp.inc:1660
::mlir::ArrayAttr getConstParamsAttr()
Definition Ops.h.inc:1194
::mlir::StringAttr getSymNameAttrName()
Definition Ops.h.inc:1144
void print(::mlir::OpAsmPrinter &_odsPrinter)
Definition Ops.cpp.inc:1719
FieldDefOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:220
::std::optional<::mlir::OperationName > odsOpName
Definition Ops.h.inc:216
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize)
Definition Ops.cpp.inc:598
FieldReadOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:500
::std::optional<::mlir::Attribute > getTableOffset()
Definition Ops.cpp.inc:621
::mlir::DenseI32ArrayAttr getMapOpGroupSizesAttr()
Definition Ops.h.inc:529
::std::optional<::mlir::OperationName > odsOpName
Definition Ops.h.inc:496
FieldWriteOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:804
::std::optional<::mlir::OperationName > odsOpName
Definition Ops.h.inc:800
::std::optional< ::mlir::ArrayAttr > getConstParams()
Definition Ops.cpp.inc:1444
StructDefOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:1042
::std::optional<::mlir::OperationName > odsOpName
Definition Ops.h.inc:1038
bool isValidType(Type type)
void printMultiDimAndSymbolList(mlir::OpAsmPrinter &printer, mlir::Operation *op, mlir::OperandRangeRange multiMapOperands, mlir::DenseI32ArrayAttr numDimsPerMap)
Definition OpHelpers.h:115
mlir::ParseResult parseMultiDimAndSymbolList(mlir::OpAsmParser &parser, mlir::SmallVector< mlir::SmallVector< mlir::OpAsmParser::UnresolvedOperand > > &multiMapOperands, mlir::DenseI32ArrayAttr &numDimsPerMap)
Definition OpHelpers.h:107