LLZK 0.1.0
An open-source IR for Zero Knowledge (ZK) circuits
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::MemberDefOp definitions
264//===----------------------------------------------------------------------===//
265
266namespace detail {
267MemberDefOpGenericAdaptorBase::MemberDefOpGenericAdaptorBase(MemberDefOp 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
294 auto attr = ::llvm::dyn_cast_or_null<::mlir::UnitAttr>(getProperties().signal);
295 if (!attr)
296 attr = ((false) ? ::mlir::Builder(odsAttrs.getContext()).getUnitAttr() : nullptr);
297 return attr;
298}
299
301 auto attr = getSignalAttr();
302 if (!attr)
303 return ((false) ? ::mlir::Builder(odsAttrs.getContext()).getUnitAttr() : nullptr) != nullptr;
304 return attr != nullptr;
305}
306
307} // namespace detail
309
310::llvm::LogicalResult MemberDefOpAdaptor::verify(::mlir::Location loc) {
311 auto tblgen_column = getProperties().column; (void)tblgen_column;
312 auto tblgen_signal = getProperties().signal; (void)tblgen_signal;
313 auto tblgen_sym_name = getProperties().sym_name; (void)tblgen_sym_name;
314 if (!tblgen_sym_name) return emitError(loc, "'struct.member' op ""requires attribute 'sym_name'");
315 auto tblgen_type = getProperties().type; (void)tblgen_type;
316 if (!tblgen_type) return emitError(loc, "'struct.member' op ""requires attribute 'type'");
317
318 if (tblgen_sym_name && !((::llvm::isa<::mlir::StringAttr>(tblgen_sym_name))))
319 return emitError(loc, "'struct.member' op ""attribute 'sym_name' failed to satisfy constraint: string attribute");
320
321 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())))))
322 return emitError(loc, "'struct.member' op ""attribute 'type' failed to satisfy constraint: type attribute of a valid LLZK type");
323
324 if (tblgen_column && !((::llvm::isa<::mlir::UnitAttr>(tblgen_column))))
325 return emitError(loc, "'struct.member' op ""attribute 'column' failed to satisfy constraint: unit attribute");
326
327 if (tblgen_signal && !((::llvm::isa<::mlir::UnitAttr>(tblgen_signal))))
328 return emitError(loc, "'struct.member' op ""attribute 'signal' failed to satisfy constraint: unit attribute");
329 return ::mlir::success();
330}
331
332::llvm::LogicalResult MemberDefOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
333 ::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
334 if (!dict) {
335 emitError() << "expected DictionaryAttr to set properties";
336 return ::mlir::failure();
337 }
338
339 {
340 auto &propStorage = prop.column;
341 auto attr = dict.get("column");
342 if (attr) {
343 auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
344 if (convertedAttr) {
345 propStorage = convertedAttr;
346 } else {
347 emitError() << "Invalid attribute `column` in property conversion: " << attr;
348 return ::mlir::failure();
349 }
350 }
351 }
352
353 {
354 auto &propStorage = prop.signal;
355 auto attr = dict.get("signal");
356 if (attr) {
357 auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
358 if (convertedAttr) {
359 propStorage = convertedAttr;
360 } else {
361 emitError() << "Invalid attribute `signal` in property conversion: " << attr;
362 return ::mlir::failure();
363 }
364 }
365 }
366
367 {
368 auto &propStorage = prop.sym_name;
369 auto attr = dict.get("sym_name");
370 if (attr) {
371 auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
372 if (convertedAttr) {
373 propStorage = convertedAttr;
374 } else {
375 emitError() << "Invalid attribute `sym_name` in property conversion: " << attr;
376 return ::mlir::failure();
377 }
378 }
379 }
380
381 {
382 auto &propStorage = prop.type;
383 auto attr = dict.get("type");
384 if (attr) {
385 auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
386 if (convertedAttr) {
387 propStorage = convertedAttr;
388 } else {
389 emitError() << "Invalid attribute `type` in property conversion: " << attr;
390 return ::mlir::failure();
391 }
392 }
393 }
394 return ::mlir::success();
395}
396
397::mlir::Attribute MemberDefOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
398 ::mlir::SmallVector<::mlir::NamedAttribute> attrs;
399 ::mlir::Builder odsBuilder{ctx};
400
401 {
402 const auto &propStorage = prop.column;
403 if (propStorage)
404 attrs.push_back(odsBuilder.getNamedAttr("column",
405 propStorage));
406 }
407
408 {
409 const auto &propStorage = prop.signal;
410 if (propStorage)
411 attrs.push_back(odsBuilder.getNamedAttr("signal",
412 propStorage));
413 }
414
415 {
416 const auto &propStorage = prop.sym_name;
417 if (propStorage)
418 attrs.push_back(odsBuilder.getNamedAttr("sym_name",
419 propStorage));
420 }
421
422 {
423 const auto &propStorage = prop.type;
424 if (propStorage)
425 attrs.push_back(odsBuilder.getNamedAttr("type",
426 propStorage));
427 }
428
429 if (!attrs.empty())
430 return odsBuilder.getDictionaryAttr(attrs);
431 return {};
432}
433
434llvm::hash_code MemberDefOp::computePropertiesHash(const Properties &prop) {
435 return llvm::hash_combine(
436 llvm::hash_value(prop.column.getAsOpaquePointer()),
437 llvm::hash_value(prop.signal.getAsOpaquePointer()),
438 llvm::hash_value(prop.sym_name.getAsOpaquePointer()),
439 llvm::hash_value(prop.type.getAsOpaquePointer()));
440}
441
442std::optional<mlir::Attribute> MemberDefOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
443 if (name == "column")
444 return prop.column;
445
446 if (name == "signal")
447 return prop.signal;
448
449 if (name == "sym_name")
450 return prop.sym_name;
451
452 if (name == "type")
453 return prop.type;
454 return std::nullopt;
455}
456
457void MemberDefOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
458 if (name == "column") {
459 prop.column = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.column)>>(value);
460 return;
461 }
462
463 if (name == "signal") {
464 prop.signal = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.signal)>>(value);
465 return;
466 }
467
468 if (name == "sym_name") {
469 prop.sym_name = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.sym_name)>>(value);
470 return;
471 }
472
473 if (name == "type") {
474 prop.type = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.type)>>(value);
475 return;
476 }
477}
478
479void MemberDefOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
480 if (prop.column) attrs.append("column", prop.column);
481
482 if (prop.signal) attrs.append("signal", prop.signal);
483
484 if (prop.sym_name) attrs.append("sym_name", prop.sym_name);
485
486 if (prop.type) attrs.append("type", prop.type);
487}
488
489::llvm::LogicalResult MemberDefOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
490 {
491 ::mlir::Attribute attr = attrs.get(getColumnAttrName(opName));
492 if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_Ops3(attr, "column", emitError)))
493 return ::mlir::failure();
494 }
495
496 {
497 ::mlir::Attribute attr = attrs.get(getSignalAttrName(opName));
498 if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_Ops3(attr, "signal", emitError)))
499 return ::mlir::failure();
500 }
501
502 {
503 ::mlir::Attribute attr = attrs.get(getSymNameAttrName(opName));
504 if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_Ops1(attr, "sym_name", emitError)))
505 return ::mlir::failure();
506 }
507
508 {
509 ::mlir::Attribute attr = attrs.get(getTypeAttrName(opName));
510 if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_Ops2(attr, "type", emitError)))
511 return ::mlir::failure();
512 }
513 return ::mlir::success();
514}
515
516::llvm::LogicalResult MemberDefOp::readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state) {
517 auto &prop = state.getOrAddProperties<Properties>(); (void)prop;
518 if (::mlir::failed(reader.readOptionalAttribute(prop.column)))
519 return ::mlir::failure();
520
521 if (::mlir::failed(reader.readOptionalAttribute(prop.signal)))
522 return ::mlir::failure();
523
524 if (::mlir::failed(reader.readAttribute(prop.sym_name)))
525 return ::mlir::failure();
526
527 if (::mlir::failed(reader.readAttribute(prop.type)))
528 return ::mlir::failure();
529 return ::mlir::success();
530}
531
532void MemberDefOp::writeProperties(::mlir::DialectBytecodeWriter &writer) {
533 auto &prop = getProperties(); (void)prop;
534
535 writer.writeOptionalAttribute(prop.column);
536
537 writer.writeOptionalAttribute(prop.signal);
538 writer.writeAttribute(prop.sym_name);
539 writer.writeAttribute(prop.type);
540}
541
542::llvm::StringRef MemberDefOp::getSymName() {
543 auto attr = getSymNameAttr();
544 return attr.getValue();
545}
546
547::mlir::Type MemberDefOp::getType() {
548 auto attr = getTypeAttr();
549 return ::llvm::cast<::mlir::Type>(attr.getValue());
550}
551
553 auto attr = getColumnAttr();
554 if (!attr)
555 return ((false) ? ::mlir::Builder((*this)->getContext()).getUnitAttr() : nullptr) != nullptr;
556 return attr != nullptr;
557}
558
560 auto attr = getSignalAttr();
561 if (!attr)
562 return ((false) ? ::mlir::Builder((*this)->getContext()).getUnitAttr() : nullptr) != nullptr;
563 return attr != nullptr;
564}
565
566void MemberDefOp::setSymName(::llvm::StringRef attrValue) {
567 getProperties().sym_name = ::mlir::Builder((*this)->getContext()).getStringAttr(attrValue);
568}
569
570void MemberDefOp::setType(::mlir::Type attrValue) {
571 getProperties().type = ::mlir::TypeAttr::get(attrValue);
572}
573
574void MemberDefOp::setColumn(bool attrValue) {
575 auto &odsProp = getProperties().column;
576 if (attrValue)
577 odsProp = ((attrValue) ? ::mlir::Builder((*this)->getContext()).getUnitAttr() : nullptr);
578 else
579 odsProp = nullptr;
580}
581
582void MemberDefOp::setSignal(bool attrValue) {
583 auto &odsProp = getProperties().signal;
584 if (attrValue)
585 odsProp = ((attrValue) ? ::mlir::Builder((*this)->getContext()).getUnitAttr() : nullptr);
586 else
587 odsProp = nullptr;
588}
589
590void MemberDefOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes, bool isSignal, bool isColumn) {
591 build(odsBuilder, odsState, {}, {}, attributes, isSignal, isColumn);
592}
593
594::llvm::LogicalResult MemberDefOp::verifyInvariantsImpl() {
595 auto tblgen_column = getProperties().column; (void)tblgen_column;
596 auto tblgen_signal = getProperties().signal; (void)tblgen_signal;
597 auto tblgen_sym_name = getProperties().sym_name; (void)tblgen_sym_name;
598 if (!tblgen_sym_name) return emitOpError("requires attribute 'sym_name'");
599 auto tblgen_type = getProperties().type; (void)tblgen_type;
600 if (!tblgen_type) return emitOpError("requires attribute 'type'");
601
602 if (::mlir::failed(__mlir_ods_local_attr_constraint_Ops1(*this, tblgen_sym_name, "sym_name")))
603 return ::mlir::failure();
604
605 if (::mlir::failed(__mlir_ods_local_attr_constraint_Ops2(*this, tblgen_type, "type")))
606 return ::mlir::failure();
607
608 if (::mlir::failed(__mlir_ods_local_attr_constraint_Ops3(*this, tblgen_column, "column")))
609 return ::mlir::failure();
610
611 if (::mlir::failed(__mlir_ods_local_attr_constraint_Ops3(*this, tblgen_signal, "signal")))
612 return ::mlir::failure();
613 return ::mlir::success();
614}
615
616::llvm::LogicalResult MemberDefOp::verifyInvariants() {
617 return verifyInvariantsImpl();
618}
619
620::mlir::ParseResult MemberDefOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
621 ::mlir::StringAttr sym_nameAttr;
622 ::mlir::TypeAttr typeAttr;
623
624 if (parser.parseSymbolName(sym_nameAttr))
625 return ::mlir::failure();
626 if (sym_nameAttr) result.getOrAddProperties<MemberDefOp::Properties>().sym_name = sym_nameAttr;
627 if (parser.parseColon())
628 return ::mlir::failure();
629
630 if (parser.parseCustomAttributeWithFallback(typeAttr, parser.getBuilder().getType<::mlir::NoneType>())) {
631 return ::mlir::failure();
632 }
633 if (typeAttr) result.getOrAddProperties<MemberDefOp::Properties>().type = typeAttr;
634 {
635 auto loc = parser.getCurrentLocation();(void)loc;
636 if (parser.parseOptionalAttrDict(result.attributes))
637 return ::mlir::failure();
638 if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() {
639 return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op ";
640 })))
641 return ::mlir::failure();
642 }
643 return ::mlir::success();
644}
645
646void MemberDefOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
647 _odsPrinter << ' ';
648 _odsPrinter.printSymbolName(getSymNameAttr().getValue());
649 _odsPrinter << ' ' << ":";
650 _odsPrinter << ' ';
651 _odsPrinter.printAttributeWithoutType(getTypeAttr());
652 ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
653 elidedAttrs.push_back("sym_name");
654 elidedAttrs.push_back("type");
655 {
656 ::mlir::Builder odsBuilder(getContext());
657 ::mlir::Attribute attr = getColumnAttr();
658 if(attr && (attr == ((false) ? odsBuilder.getUnitAttr() : nullptr)))
659 elidedAttrs.push_back("column");
660 }
661 {
662 ::mlir::Builder odsBuilder(getContext());
663 ::mlir::Attribute attr = getSignalAttr();
664 if(attr && (attr == ((false) ? odsBuilder.getUnitAttr() : nullptr)))
665 elidedAttrs.push_back("signal");
666 }
667 _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
668}
669
670} // namespace component
671} // namespace llzk
672MLIR_DEFINE_EXPLICIT_TYPE_ID(::llzk::component::MemberDefOp)
673
674namespace llzk {
675namespace component {
676
677//===----------------------------------------------------------------------===//
678// ::llzk::component::MemberReadOp definitions
679//===----------------------------------------------------------------------===//
680
681namespace detail {
682MemberReadOpGenericAdaptorBase::MemberReadOpGenericAdaptorBase(MemberReadOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
683
684std::pair<unsigned, unsigned> MemberReadOpGenericAdaptorBase::getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize) {
685 bool isVariadic[] = {false, true};
686 int prevVariadicCount = 0;
687 for (unsigned i = 0; i < index; ++i)
688 if (isVariadic[i]) ++prevVariadicCount;
689
690 // Calculate how many dynamic values a static variadic operand corresponds to.
691 // This assumes all static variadic operands have the same dynamic value count.
692 int variadicSize = (odsOperandsSize - 1) / 1;
693 // `index` passed in as the parameter is the static index which counts each
694 // operand (variadic or not) as size 1. So here for each previous static variadic
695 // operand, we need to offset by (variadicSize - 1) to get where the dynamic
696 // value pack for this static operand starts.
697 int start = index + (variadicSize - 1) * prevVariadicCount;
698 int size = isVariadic[index] ? variadicSize : 1;
699 return {start, size};
700}
701
703 auto attr = getMemberNameAttr();
704 return attr.getValue();
705}
706
707::std::optional<::mlir::Attribute> MemberReadOpGenericAdaptorBase::getTableOffset() {
708 auto attr = getTableOffsetAttr();
709 return attr ? ::std::optional<::mlir::Attribute>(attr) : (::std::nullopt);
710}
711
713 auto attr = ::llvm::dyn_cast_or_null<::mlir::DenseI32ArrayAttr>(getProperties().numDimsPerMap);
714 return attr;
715}
716
718 auto attr = getNumDimsPerMapAttr();
719 return attr;
720}
721
723 auto attr = getMapOpGroupSizesAttr();
724 return attr;
725}
726
727} // namespace detail
729
730::llvm::LogicalResult MemberReadOpAdaptor::verify(::mlir::Location loc) {
731 auto tblgen_mapOpGroupSizes = getProperties().mapOpGroupSizes; (void)tblgen_mapOpGroupSizes;
732 if (!tblgen_mapOpGroupSizes) return emitError(loc, "'struct.readm' op ""requires attribute 'mapOpGroupSizes'");
733 auto tblgen_member_name = getProperties().member_name; (void)tblgen_member_name;
734 if (!tblgen_member_name) return emitError(loc, "'struct.readm' op ""requires attribute 'member_name'");
735 auto tblgen_numDimsPerMap = getProperties().numDimsPerMap; (void)tblgen_numDimsPerMap;
736 auto tblgen_tableOffset = getProperties().tableOffset; (void)tblgen_tableOffset;
737
738 if (tblgen_member_name && !((::llvm::isa<::mlir::FlatSymbolRefAttr>(tblgen_member_name))))
739 return emitError(loc, "'struct.readm' op ""attribute 'member_name' failed to satisfy constraint: flat symbol reference attribute");
740
741 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)))))
742 return emitError(loc, "'struct.readm' op ""attribute 'tableOffset' failed to satisfy constraint: symbol reference attribute or index attribute or AffineMap attribute");
743
744 if (tblgen_numDimsPerMap && !((::llvm::isa<::mlir::DenseI32ArrayAttr>(tblgen_numDimsPerMap))))
745 return emitError(loc, "'struct.readm' op ""attribute 'numDimsPerMap' failed to satisfy constraint: i32 dense array attribute");
746
747 if (tblgen_mapOpGroupSizes && !((::llvm::isa<::mlir::DenseI32ArrayAttr>(tblgen_mapOpGroupSizes))))
748 return emitError(loc, "'struct.readm' op ""attribute 'mapOpGroupSizes' failed to satisfy constraint: i32 dense array attribute");
749 return ::mlir::success();
750}
751
752std::pair<unsigned, unsigned> MemberReadOp::getODSOperandIndexAndLength(unsigned index) {
753 bool isVariadic[] = {false, true};
754 int prevVariadicCount = 0;
755 for (unsigned i = 0; i < index; ++i)
756 if (isVariadic[i]) ++prevVariadicCount;
757
758 // Calculate how many dynamic values a static variadic operand corresponds to.
759 // This assumes all static variadic operands have the same dynamic value count.
760 int variadicSize = (getOperation()->getNumOperands() - 1) / 1;
761 // `index` passed in as the parameter is the static index which counts each
762 // operand (variadic or not) as size 1. So here for each previous static variadic
763 // operand, we need to offset by (variadicSize - 1) to get where the dynamic
764 // value pack for this static operand starts.
765 int start = index + (variadicSize - 1) * prevVariadicCount;
766 int size = isVariadic[index] ? variadicSize : 1;
767 return {start, size};
768}
769
770::mlir::MutableOperandRangeRange MemberReadOp::getMapOperandsMutable() {
771 auto range = getODSOperandIndexAndLength(1);
772 auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
773 return mutableRange.split(*(*this)->getAttrDictionary().getNamed(getMapOpGroupSizesAttrName()));
774}
775
776::llvm::LogicalResult MemberReadOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
777 ::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
778 if (!dict) {
779 emitError() << "expected DictionaryAttr to set properties";
780 return ::mlir::failure();
781 }
782
783 {
784 auto &propStorage = prop.mapOpGroupSizes;
785 auto attr = dict.get("mapOpGroupSizes");
786 if (attr) {
787 auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
788 if (convertedAttr) {
789 propStorage = convertedAttr;
790 } else {
791 emitError() << "Invalid attribute `mapOpGroupSizes` in property conversion: " << attr;
792 return ::mlir::failure();
793 }
794 }
795 }
796
797 {
798 auto &propStorage = prop.member_name;
799 auto attr = dict.get("member_name");
800 if (attr) {
801 auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
802 if (convertedAttr) {
803 propStorage = convertedAttr;
804 } else {
805 emitError() << "Invalid attribute `member_name` in property conversion: " << attr;
806 return ::mlir::failure();
807 }
808 }
809 }
810
811 {
812 auto &propStorage = prop.numDimsPerMap;
813 auto attr = dict.get("numDimsPerMap");
814 if (attr) {
815 auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
816 if (convertedAttr) {
817 propStorage = convertedAttr;
818 } else {
819 emitError() << "Invalid attribute `numDimsPerMap` in property conversion: " << attr;
820 return ::mlir::failure();
821 }
822 }
823 }
824
825 {
826 auto &propStorage = prop.tableOffset;
827 auto attr = dict.get("tableOffset");
828 if (attr) {
829 auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
830 if (convertedAttr) {
831 propStorage = convertedAttr;
832 } else {
833 emitError() << "Invalid attribute `tableOffset` in property conversion: " << attr;
834 return ::mlir::failure();
835 }
836 }
837 }
838 return ::mlir::success();
839}
840
841::mlir::Attribute MemberReadOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
842 ::mlir::SmallVector<::mlir::NamedAttribute> attrs;
843 ::mlir::Builder odsBuilder{ctx};
844
845 {
846 const auto &propStorage = prop.mapOpGroupSizes;
847 if (propStorage)
848 attrs.push_back(odsBuilder.getNamedAttr("mapOpGroupSizes",
849 propStorage));
850 }
851
852 {
853 const auto &propStorage = prop.member_name;
854 if (propStorage)
855 attrs.push_back(odsBuilder.getNamedAttr("member_name",
856 propStorage));
857 }
858
859 {
860 const auto &propStorage = prop.numDimsPerMap;
861 if (propStorage)
862 attrs.push_back(odsBuilder.getNamedAttr("numDimsPerMap",
863 propStorage));
864 }
865
866 {
867 const auto &propStorage = prop.tableOffset;
868 if (propStorage)
869 attrs.push_back(odsBuilder.getNamedAttr("tableOffset",
870 propStorage));
871 }
872
873 if (!attrs.empty())
874 return odsBuilder.getDictionaryAttr(attrs);
875 return {};
876}
877
879 return llvm::hash_combine(
880 llvm::hash_value(prop.mapOpGroupSizes.getAsOpaquePointer()),
881 llvm::hash_value(prop.member_name.getAsOpaquePointer()),
882 llvm::hash_value(prop.numDimsPerMap.getAsOpaquePointer()),
883 llvm::hash_value(prop.tableOffset.getAsOpaquePointer()));
884}
885
886std::optional<mlir::Attribute> MemberReadOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
887 if (name == "mapOpGroupSizes")
888 return prop.mapOpGroupSizes;
889
890 if (name == "member_name")
891 return prop.member_name;
892
893 if (name == "numDimsPerMap")
894 return prop.numDimsPerMap;
895
896 if (name == "tableOffset")
897 return prop.tableOffset;
898 return std::nullopt;
899}
900
901void MemberReadOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
902 if (name == "mapOpGroupSizes") {
903 prop.mapOpGroupSizes = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.mapOpGroupSizes)>>(value);
904 return;
905 }
906
907 if (name == "member_name") {
908 prop.member_name = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.member_name)>>(value);
909 return;
910 }
911
912 if (name == "numDimsPerMap") {
913 prop.numDimsPerMap = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.numDimsPerMap)>>(value);
914 return;
915 }
916
917 if (name == "tableOffset") {
918 prop.tableOffset = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.tableOffset)>>(value);
919 return;
920 }
921}
922
923void MemberReadOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
924 if (prop.mapOpGroupSizes) attrs.append("mapOpGroupSizes", prop.mapOpGroupSizes);
925
926 if (prop.member_name) attrs.append("member_name", prop.member_name);
927
928 if (prop.numDimsPerMap) attrs.append("numDimsPerMap", prop.numDimsPerMap);
929
930 if (prop.tableOffset) attrs.append("tableOffset", prop.tableOffset);
931}
932
933::llvm::LogicalResult MemberReadOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
934 {
935 ::mlir::Attribute attr = attrs.get(getMapOpGroupSizesAttrName(opName));
936 if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_Ops6(attr, "mapOpGroupSizes", emitError)))
937 return ::mlir::failure();
938 }
939
940 {
941 ::mlir::Attribute attr = attrs.get(getMemberNameAttrName(opName));
942 if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_Ops4(attr, "member_name", emitError)))
943 return ::mlir::failure();
944 }
945
946 {
947 ::mlir::Attribute attr = attrs.get(getNumDimsPerMapAttrName(opName));
948 if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_Ops6(attr, "numDimsPerMap", emitError)))
949 return ::mlir::failure();
950 }
951
952 {
953 ::mlir::Attribute attr = attrs.get(getTableOffsetAttrName(opName));
954 if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_Ops5(attr, "tableOffset", emitError)))
955 return ::mlir::failure();
956 }
957 return ::mlir::success();
958}
959
960::llvm::LogicalResult MemberReadOp::readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state) {
961 auto &prop = state.getOrAddProperties<Properties>(); (void)prop;
962 if (::mlir::failed(reader.readAttribute(prop.mapOpGroupSizes)))
963 return ::mlir::failure();
964
965 if (::mlir::failed(reader.readAttribute(prop.member_name)))
966 return ::mlir::failure();
967
968 if (::mlir::failed(reader.readOptionalAttribute(prop.numDimsPerMap)))
969 return ::mlir::failure();
970
971 if (::mlir::failed(reader.readOptionalAttribute(prop.tableOffset)))
972 return ::mlir::failure();
973 return ::mlir::success();
974}
975
976void MemberReadOp::writeProperties(::mlir::DialectBytecodeWriter &writer) {
977 auto &prop = getProperties(); (void)prop;
978 writer.writeAttribute(prop.mapOpGroupSizes);
979 writer.writeAttribute(prop.member_name);
980
981 writer.writeOptionalAttribute(prop.numDimsPerMap);
982
983 writer.writeOptionalAttribute(prop.tableOffset);
984}
985
986::llvm::StringRef MemberReadOp::getMemberName() {
987 auto attr = getMemberNameAttr();
988 return attr.getValue();
989}
990
991::std::optional<::mlir::Attribute> MemberReadOp::getTableOffset() {
992 auto attr = getTableOffsetAttr();
993 return attr ? ::std::optional<::mlir::Attribute>(attr) : (::std::nullopt);
994}
995
996::llvm::ArrayRef<int32_t> MemberReadOp::getNumDimsPerMap() {
997 auto attr = getNumDimsPerMapAttr();
998 return attr;
999}
1000
1001::llvm::ArrayRef<int32_t> MemberReadOp::getMapOpGroupSizes() {
1002 auto attr = getMapOpGroupSizesAttr();
1003 return attr;
1004}
1005
1006void MemberReadOp::setMemberName(::llvm::StringRef attrValue) {
1007 getProperties().member_name = ::mlir::SymbolRefAttr::get(::mlir::Builder((*this)->getContext()).getContext(), attrValue);
1008}
1009
1010void MemberReadOp::setNumDimsPerMap(::llvm::ArrayRef<int32_t> attrValue) {
1011 getProperties().numDimsPerMap = ::mlir::Builder((*this)->getContext()).getDenseI32ArrayAttr(attrValue);
1012}
1013
1014void MemberReadOp::setMapOpGroupSizes(::llvm::ArrayRef<int32_t> attrValue) {
1015 getProperties().mapOpGroupSizes = ::mlir::Builder((*this)->getContext()).getDenseI32ArrayAttr(attrValue);
1016}
1017
1018void MemberReadOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type resultType, ::mlir::Value component, ::mlir::StringAttr member, ::mlir::SymbolRefAttr dist) {
1019 build(odsBuilder, odsState, resultType, component, member, dist, ::mlir::ValueRange(), std::nullopt);
1020
1021}
1022
1023void MemberReadOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type resultType, ::mlir::Value component, ::mlir::StringAttr member, ::mlir::IntegerAttr dist) {
1024 build(odsBuilder, odsState, resultType, component, member, dist, ::mlir::ValueRange(), std::nullopt);
1025
1026}
1027
1028void MemberReadOp::populateDefaultProperties(::mlir::OperationName opName, Properties &properties) {
1029 ::mlir::Builder odsBuilder(opName.getContext());
1030 if (!properties.numDimsPerMap)
1031 properties.numDimsPerMap = odsBuilder.getDenseI32ArrayAttr({});
1032}
1033
1034::llvm::LogicalResult MemberReadOp::verifyInvariantsImpl() {
1035 auto tblgen_mapOpGroupSizes = getProperties().mapOpGroupSizes; (void)tblgen_mapOpGroupSizes;
1036 if (!tblgen_mapOpGroupSizes) return emitOpError("requires attribute 'mapOpGroupSizes'");
1037 auto tblgen_member_name = getProperties().member_name; (void)tblgen_member_name;
1038 if (!tblgen_member_name) return emitOpError("requires attribute 'member_name'");
1039 auto tblgen_numDimsPerMap = getProperties().numDimsPerMap; (void)tblgen_numDimsPerMap;
1040 auto tblgen_tableOffset = getProperties().tableOffset; (void)tblgen_tableOffset;
1041
1042 if (::mlir::failed(__mlir_ods_local_attr_constraint_Ops4(*this, tblgen_member_name, "member_name")))
1043 return ::mlir::failure();
1044
1045 if (::mlir::failed(__mlir_ods_local_attr_constraint_Ops5(*this, tblgen_tableOffset, "tableOffset")))
1046 return ::mlir::failure();
1047
1048 if (::mlir::failed(__mlir_ods_local_attr_constraint_Ops6(*this, tblgen_numDimsPerMap, "numDimsPerMap")))
1049 return ::mlir::failure();
1050
1051 if (::mlir::failed(__mlir_ods_local_attr_constraint_Ops6(*this, tblgen_mapOpGroupSizes, "mapOpGroupSizes")))
1052 return ::mlir::failure();
1053 {
1054 unsigned index = 0; (void)index;
1055 auto valueGroup0 = getODSOperands(0);
1056
1057 for (auto v : valueGroup0) {
1058 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops1(*this, v.getType(), "operand", index++)))
1059 return ::mlir::failure();
1060 }
1061 auto valueGroup1 = getODSOperands(1);
1062 if (::mlir::failed(::mlir::OpTrait::impl::verifyValueSizeAttr(*this, "mapOpGroupSizes", "mapOperands", valueGroup1.size())))
1063 return ::mlir::failure();
1064
1065 for (auto v : valueGroup1) {
1066 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops2(*this, v.getType(), "operand", index++)))
1067 return ::mlir::failure();
1068 }
1069 }
1070 {
1071 unsigned index = 0; (void)index;
1072 auto valueGroup0 = getODSResults(0);
1073
1074 for (auto v : valueGroup0) {
1075 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops3(*this, v.getType(), "result", index++)))
1076 return ::mlir::failure();
1077 }
1078 }
1079 return ::mlir::success();
1080}
1081
1082::llvm::LogicalResult MemberReadOp::verifyInvariants() {
1083 if(::mlir::succeeded(verifyInvariantsImpl()) && ::mlir::succeeded(verify()))
1084 return ::mlir::success();
1085 return ::mlir::failure();
1086}
1087
1088::mlir::ParseResult MemberReadOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
1089 ::mlir::OpAsmParser::UnresolvedOperand componentRawOperand{};
1090 ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> componentOperands(&componentRawOperand, 1); ::llvm::SMLoc componentOperandsLoc;
1091 (void)componentOperandsLoc;
1092 ::mlir::FlatSymbolRefAttr member_nameAttr;
1093 ::llvm::SmallVector<::mlir::OpAsmParser::UnresolvedOperand, 4> mapOperandsOperands;
1094 llvm::SmallVector<int32_t> mapOperandsOperandGroupSizes;
1095 ::llvm::SMLoc mapOperandsOperandsLoc;
1096 (void)mapOperandsOperandsLoc;
1097 ::mlir::DenseI32ArrayAttr numDimsPerMapAttr;
1098 ::mlir::Type componentRawType{};
1099 ::llvm::ArrayRef<::mlir::Type> componentTypes(&componentRawType, 1);
1100 ::mlir::Type valRawType{};
1101 ::llvm::ArrayRef<::mlir::Type> valTypes(&valRawType, 1);
1102
1103 componentOperandsLoc = parser.getCurrentLocation();
1104 if (parser.parseOperand(componentRawOperand))
1105 return ::mlir::failure();
1106 if (parser.parseLSquare())
1107 return ::mlir::failure();
1108
1109 if (parser.parseCustomAttributeWithFallback(member_nameAttr, parser.getBuilder().getType<::mlir::NoneType>())) {
1110 return ::mlir::failure();
1111 }
1112 if (member_nameAttr) result.getOrAddProperties<MemberReadOp::Properties>().member_name = member_nameAttr;
1113 if (parser.parseRSquare())
1114 return ::mlir::failure();
1115 if (::mlir::succeeded(parser.parseOptionalLBrace())) {
1116 {
1117 mapOperandsOperandsLoc = parser.getCurrentLocation();
1118 ::llvm::SmallVector<::llvm::SmallVector<::mlir::OpAsmParser::UnresolvedOperand>> mapOperandsOperandGroups;
1119 auto odsResult = parseMultiDimAndSymbolList(parser, mapOperandsOperandGroups, numDimsPerMapAttr);
1120 if (odsResult) return ::mlir::failure();
1121 for (const auto &subRange : mapOperandsOperandGroups) {
1122 mapOperandsOperands.append(subRange.begin(), subRange.end());
1123 mapOperandsOperandGroupSizes.push_back(subRange.size());
1124 }
1125 if (numDimsPerMapAttr)
1126 result.getOrAddProperties<MemberReadOp::Properties>().numDimsPerMap = numDimsPerMapAttr;
1127 }
1128 if (parser.parseRBrace())
1129 return ::mlir::failure();
1130 }
1131 if (parser.parseColon())
1132 return ::mlir::failure();
1133
1134 {
1136 if (parser.parseCustomTypeWithFallback(type))
1137 return ::mlir::failure();
1138 componentRawType = type;
1139 }
1140 if (parser.parseComma())
1141 return ::mlir::failure();
1142
1143 {
1144 ::mlir::Type type;
1145 if (parser.parseCustomTypeWithFallback(type))
1146 return ::mlir::failure();
1147 valRawType = type;
1148 }
1149 {
1150 auto loc = parser.getCurrentLocation();(void)loc;
1151 if (parser.parseOptionalAttrDict(result.attributes))
1152 return ::mlir::failure();
1153 if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() {
1154 return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op ";
1155 })))
1156 return ::mlir::failure();
1157 }
1158 result.getOrAddProperties<MemberReadOp::Properties>().mapOpGroupSizes = parser.getBuilder().getDenseI32ArrayAttr(mapOperandsOperandGroupSizes);
1159 ::mlir::Type odsBuildableType0 = parser.getBuilder().getIndexType();
1160 result.addTypes(valTypes);
1161 if (parser.resolveOperands(componentOperands, componentTypes, componentOperandsLoc, result.operands))
1162 return ::mlir::failure();
1163 if (parser.resolveOperands(mapOperandsOperands, odsBuildableType0, mapOperandsOperandsLoc, result.operands))
1164 return ::mlir::failure();
1165 return ::mlir::success();
1166}
1167
1168void MemberReadOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
1169 _odsPrinter << ' ';
1170 _odsPrinter << getComponent();
1171 _odsPrinter << "[";
1172 _odsPrinter.printAttributeWithoutType(getMemberNameAttr());
1173 _odsPrinter << "]";
1174 if (((!getMapOperands().empty()) || (getNumDimsPerMapAttr() != ::mlir::OpBuilder((*this)->getContext()).getDenseI32ArrayAttr({})))) {
1175 _odsPrinter << ' ' << "{";
1177 _odsPrinter << "}";
1178 }
1179 _odsPrinter << ' ' << ":";
1180 _odsPrinter << ' ';
1181 {
1182 auto type = getComponent().getType();
1183 if (auto validType = ::llvm::dyn_cast<::llzk::component::StructType>(type))
1184 _odsPrinter.printStrippedAttrOrType(validType);
1185 else
1186 _odsPrinter << type;
1187 }
1188 _odsPrinter << ",";
1189 _odsPrinter << ' ';
1190 {
1191 auto type = getVal().getType();
1192 if (auto validType = ::llvm::dyn_cast<::mlir::Type>(type))
1193 _odsPrinter.printStrippedAttrOrType(validType);
1194 else
1195 _odsPrinter << type;
1196 }
1197 ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
1198 elidedAttrs.push_back("mapOpGroupSizes");
1199 elidedAttrs.push_back("member_name");
1200 elidedAttrs.push_back("numDimsPerMap");
1201 {
1202 ::mlir::Builder odsBuilder(getContext());
1203 ::mlir::Attribute attr = getNumDimsPerMapAttr();
1204 if(attr && (attr == odsBuilder.getDenseI32ArrayAttr({})))
1205 elidedAttrs.push_back("numDimsPerMap");
1206 }
1207 _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
1208}
1209
1212 return true;
1213}
1214} // namespace component
1215} // namespace llzk
1216MLIR_DEFINE_EXPLICIT_TYPE_ID(::llzk::component::MemberReadOp)
1217
1218namespace llzk {
1219namespace component {
1220
1221//===----------------------------------------------------------------------===//
1222// ::llzk::component::MemberWriteOp definitions
1223//===----------------------------------------------------------------------===//
1224
1225namespace detail {
1227
1229 auto attr = getMemberNameAttr();
1230 return attr.getValue();
1231}
1232
1233} // namespace detail
1235
1236::llvm::LogicalResult MemberWriteOpAdaptor::verify(::mlir::Location loc) {
1237 auto tblgen_member_name = getProperties().member_name; (void)tblgen_member_name;
1238 if (!tblgen_member_name) return emitError(loc, "'struct.writem' op ""requires attribute 'member_name'");
1239
1240 if (tblgen_member_name && !((::llvm::isa<::mlir::FlatSymbolRefAttr>(tblgen_member_name))))
1241 return emitError(loc, "'struct.writem' op ""attribute 'member_name' failed to satisfy constraint: flat symbol reference attribute");
1242 return ::mlir::success();
1243}
1244
1245::llvm::LogicalResult MemberWriteOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
1246 ::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
1247 if (!dict) {
1248 emitError() << "expected DictionaryAttr to set properties";
1249 return ::mlir::failure();
1250 }
1251
1252 {
1253 auto &propStorage = prop.member_name;
1254 auto attr = dict.get("member_name");
1255 if (attr) {
1256 auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
1257 if (convertedAttr) {
1258 propStorage = convertedAttr;
1259 } else {
1260 emitError() << "Invalid attribute `member_name` in property conversion: " << attr;
1261 return ::mlir::failure();
1262 }
1263 }
1264 }
1265 return ::mlir::success();
1266}
1267
1268::mlir::Attribute MemberWriteOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
1269 ::mlir::SmallVector<::mlir::NamedAttribute> attrs;
1270 ::mlir::Builder odsBuilder{ctx};
1271
1272 {
1273 const auto &propStorage = prop.member_name;
1274 if (propStorage)
1275 attrs.push_back(odsBuilder.getNamedAttr("member_name",
1276 propStorage));
1277 }
1278
1279 if (!attrs.empty())
1280 return odsBuilder.getDictionaryAttr(attrs);
1281 return {};
1282}
1283
1285 return llvm::hash_combine(
1286 llvm::hash_value(prop.member_name.getAsOpaquePointer()));
1287}
1288
1289std::optional<mlir::Attribute> MemberWriteOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
1290 if (name == "member_name")
1291 return prop.member_name;
1292 return std::nullopt;
1293}
1294
1295void MemberWriteOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
1296 if (name == "member_name") {
1297 prop.member_name = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.member_name)>>(value);
1298 return;
1299 }
1300}
1301
1302void MemberWriteOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
1303 if (prop.member_name) attrs.append("member_name", prop.member_name);
1304}
1305
1306::llvm::LogicalResult MemberWriteOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
1307 {
1308 ::mlir::Attribute attr = attrs.get(getMemberNameAttrName(opName));
1309 if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_Ops4(attr, "member_name", emitError)))
1310 return ::mlir::failure();
1311 }
1312 return ::mlir::success();
1313}
1314
1315::llvm::LogicalResult MemberWriteOp::readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state) {
1316 auto &prop = state.getOrAddProperties<Properties>(); (void)prop;
1317 if (::mlir::failed(reader.readAttribute(prop.member_name)))
1318 return ::mlir::failure();
1319 return ::mlir::success();
1320}
1321
1322void MemberWriteOp::writeProperties(::mlir::DialectBytecodeWriter &writer) {
1323 auto &prop = getProperties(); (void)prop;
1324 writer.writeAttribute(prop.member_name);
1325}
1326
1327::llvm::StringRef MemberWriteOp::getMemberName() {
1328 auto attr = getMemberNameAttr();
1329 return attr.getValue();
1330}
1331
1332void MemberWriteOp::setMemberName(::llvm::StringRef attrValue) {
1333 getProperties().member_name = ::mlir::SymbolRefAttr::get(::mlir::Builder((*this)->getContext()).getContext(), attrValue);
1334}
1335
1336void MemberWriteOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value component, ::mlir::FlatSymbolRefAttr member_name, ::mlir::Value val) {
1337 odsState.addOperands(component);
1338 odsState.addOperands(val);
1339 odsState.getOrAddProperties<Properties>().member_name = member_name;
1340}
1341
1342void MemberWriteOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value component, ::mlir::FlatSymbolRefAttr member_name, ::mlir::Value val) {
1343 odsState.addOperands(component);
1344 odsState.addOperands(val);
1345 odsState.getOrAddProperties<Properties>().member_name = member_name;
1346 assert(resultTypes.size() == 0u && "mismatched number of results");
1347 odsState.addTypes(resultTypes);
1348}
1349
1350void MemberWriteOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value component, ::llvm::StringRef member_name, ::mlir::Value val) {
1351 odsState.addOperands(component);
1352 odsState.addOperands(val);
1353 odsState.getOrAddProperties<Properties>().member_name = ::mlir::SymbolRefAttr::get(odsBuilder.getContext(), member_name);
1354}
1355
1356void MemberWriteOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value component, ::llvm::StringRef member_name, ::mlir::Value val) {
1357 odsState.addOperands(component);
1358 odsState.addOperands(val);
1359 odsState.getOrAddProperties<Properties>().member_name = ::mlir::SymbolRefAttr::get(odsBuilder.getContext(), member_name);
1360 assert(resultTypes.size() == 0u && "mismatched number of results");
1361 odsState.addTypes(resultTypes);
1362}
1363
1364void MemberWriteOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
1365 assert(operands.size() == 2u && "mismatched number of parameters");
1366 odsState.addOperands(operands);
1367 odsState.addAttributes(attributes);
1368 assert(resultTypes.size() == 0u && "mismatched number of return types");
1369 odsState.addTypes(resultTypes);
1370
1371 if (!attributes.empty()) {
1372 ::mlir::OpaqueProperties properties =
1373 &odsState.getOrAddProperties<MemberWriteOp::Properties>();
1374 std::optional<::mlir::RegisteredOperationName> info =
1375 odsState.name.getRegisteredInfo();
1376 if (failed(info->setOpPropertiesFromAttribute(odsState.name, properties,
1377 odsState.attributes.getDictionary(odsState.getContext()), nullptr)))
1378 ::llvm::report_fatal_error("Property conversion failed.");
1379 }
1380}
1381
1383 auto tblgen_member_name = getProperties().member_name; (void)tblgen_member_name;
1384 if (!tblgen_member_name) return emitOpError("requires attribute 'member_name'");
1385
1386 if (::mlir::failed(__mlir_ods_local_attr_constraint_Ops4(*this, tblgen_member_name, "member_name")))
1387 return ::mlir::failure();
1388 {
1389 unsigned index = 0; (void)index;
1390 auto valueGroup0 = getODSOperands(0);
1391
1392 for (auto v : valueGroup0) {
1393 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops1(*this, v.getType(), "operand", index++)))
1394 return ::mlir::failure();
1395 }
1396 auto valueGroup1 = getODSOperands(1);
1397
1398 for (auto v : valueGroup1) {
1399 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops3(*this, v.getType(), "operand", index++)))
1400 return ::mlir::failure();
1401 }
1402 }
1403 return ::mlir::success();
1404}
1405
1406::llvm::LogicalResult MemberWriteOp::verifyInvariants() {
1407 return verifyInvariantsImpl();
1408}
1409
1410::mlir::ParseResult MemberWriteOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
1411 ::mlir::OpAsmParser::UnresolvedOperand componentRawOperand{};
1412 ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> componentOperands(&componentRawOperand, 1); ::llvm::SMLoc componentOperandsLoc;
1413 (void)componentOperandsLoc;
1414 ::mlir::FlatSymbolRefAttr member_nameAttr;
1415 ::mlir::OpAsmParser::UnresolvedOperand valRawOperand{};
1416 ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> valOperands(&valRawOperand, 1); ::llvm::SMLoc valOperandsLoc;
1417 (void)valOperandsLoc;
1418 ::mlir::Type componentRawType{};
1419 ::llvm::ArrayRef<::mlir::Type> componentTypes(&componentRawType, 1);
1420 ::mlir::Type valRawType{};
1421 ::llvm::ArrayRef<::mlir::Type> valTypes(&valRawType, 1);
1422
1423 componentOperandsLoc = parser.getCurrentLocation();
1424 if (parser.parseOperand(componentRawOperand))
1425 return ::mlir::failure();
1426 if (parser.parseLSquare())
1427 return ::mlir::failure();
1428
1429 if (parser.parseCustomAttributeWithFallback(member_nameAttr, parser.getBuilder().getType<::mlir::NoneType>())) {
1430 return ::mlir::failure();
1431 }
1432 if (member_nameAttr) result.getOrAddProperties<MemberWriteOp::Properties>().member_name = member_nameAttr;
1433 if (parser.parseRSquare())
1434 return ::mlir::failure();
1435 if (parser.parseEqual())
1436 return ::mlir::failure();
1437
1438 valOperandsLoc = parser.getCurrentLocation();
1439 if (parser.parseOperand(valRawOperand))
1440 return ::mlir::failure();
1441 if (parser.parseColon())
1442 return ::mlir::failure();
1443
1444 {
1446 if (parser.parseCustomTypeWithFallback(type))
1447 return ::mlir::failure();
1448 componentRawType = type;
1449 }
1450 if (parser.parseComma())
1451 return ::mlir::failure();
1452
1453 {
1454 ::mlir::Type type;
1455 if (parser.parseCustomTypeWithFallback(type))
1456 return ::mlir::failure();
1457 valRawType = type;
1458 }
1459 {
1460 auto loc = parser.getCurrentLocation();(void)loc;
1461 if (parser.parseOptionalAttrDict(result.attributes))
1462 return ::mlir::failure();
1463 if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() {
1464 return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op ";
1465 })))
1466 return ::mlir::failure();
1467 }
1468 if (parser.resolveOperands(componentOperands, componentTypes, componentOperandsLoc, result.operands))
1469 return ::mlir::failure();
1470 if (parser.resolveOperands(valOperands, valTypes, valOperandsLoc, result.operands))
1471 return ::mlir::failure();
1472 return ::mlir::success();
1473}
1474
1475void MemberWriteOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
1476 _odsPrinter << ' ';
1477 _odsPrinter << getComponent();
1478 _odsPrinter << "[";
1479 _odsPrinter.printAttributeWithoutType(getMemberNameAttr());
1480 _odsPrinter << "]";
1481 _odsPrinter << ' ' << "=";
1482 _odsPrinter << ' ';
1483 _odsPrinter << getVal();
1484 _odsPrinter << ' ' << ":";
1485 _odsPrinter << ' ';
1486 {
1487 auto type = getComponent().getType();
1488 if (auto validType = ::llvm::dyn_cast<::llzk::component::StructType>(type))
1489 _odsPrinter.printStrippedAttrOrType(validType);
1490 else
1491 _odsPrinter << type;
1492 }
1493 _odsPrinter << ",";
1494 _odsPrinter << ' ';
1495 {
1496 auto type = getVal().getType();
1497 if (auto validType = ::llvm::dyn_cast<::mlir::Type>(type))
1498 _odsPrinter.printStrippedAttrOrType(validType);
1499 else
1500 _odsPrinter << type;
1501 }
1502 ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
1503 elidedAttrs.push_back("member_name");
1504 _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
1505}
1506
1509 return false;
1510}
1511} // namespace component
1512} // namespace llzk
1513MLIR_DEFINE_EXPLICIT_TYPE_ID(::llzk::component::MemberWriteOp)
1514
1515namespace llzk {
1516namespace component {
1517
1518//===----------------------------------------------------------------------===//
1519// ::llzk::component::StructDefOp definitions
1520//===----------------------------------------------------------------------===//
1521
1522namespace detail {
1524
1526 auto attr = getSymNameAttr();
1527 return attr.getValue();
1528}
1529
1530::std::optional< ::mlir::ArrayAttr > StructDefOpGenericAdaptorBase::getConstParams() {
1531 auto attr = getConstParamsAttr();
1532 return attr ? ::std::optional< ::mlir::ArrayAttr >(attr) : (::std::nullopt);
1533}
1534
1535} // namespace detail
1537
1538::llvm::LogicalResult StructDefOpAdaptor::verify(::mlir::Location loc) {
1539 auto tblgen_const_params = getProperties().const_params; (void)tblgen_const_params;
1540 auto tblgen_sym_name = getProperties().sym_name; (void)tblgen_sym_name;
1541 if (!tblgen_sym_name) return emitError(loc, "'struct.def' op ""requires attribute 'sym_name'");
1542
1543 if (tblgen_sym_name && !((::llvm::isa<::mlir::StringAttr>(tblgen_sym_name))))
1544 return emitError(loc, "'struct.def' op ""attribute 'sym_name' failed to satisfy constraint: string attribute");
1545
1546 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))); }))))
1547 return emitError(loc, "'struct.def' op ""attribute 'const_params' failed to satisfy constraint: flat symbol ref array attribute");
1548 return ::mlir::success();
1549}
1550
1551::llvm::LogicalResult StructDefOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
1552 ::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
1553 if (!dict) {
1554 emitError() << "expected DictionaryAttr to set properties";
1555 return ::mlir::failure();
1556 }
1557
1558 {
1559 auto &propStorage = prop.const_params;
1560 auto attr = dict.get("const_params");
1561 if (attr) {
1562 auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
1563 if (convertedAttr) {
1564 propStorage = convertedAttr;
1565 } else {
1566 emitError() << "Invalid attribute `const_params` in property conversion: " << attr;
1567 return ::mlir::failure();
1568 }
1569 }
1570 }
1571
1572 {
1573 auto &propStorage = prop.sym_name;
1574 auto attr = dict.get("sym_name");
1575 if (attr) {
1576 auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
1577 if (convertedAttr) {
1578 propStorage = convertedAttr;
1579 } else {
1580 emitError() << "Invalid attribute `sym_name` in property conversion: " << attr;
1581 return ::mlir::failure();
1582 }
1583 }
1584 }
1585 return ::mlir::success();
1586}
1587
1588::mlir::Attribute StructDefOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
1589 ::mlir::SmallVector<::mlir::NamedAttribute> attrs;
1590 ::mlir::Builder odsBuilder{ctx};
1591
1592 {
1593 const auto &propStorage = prop.const_params;
1594 if (propStorage)
1595 attrs.push_back(odsBuilder.getNamedAttr("const_params",
1596 propStorage));
1597 }
1598
1599 {
1600 const auto &propStorage = prop.sym_name;
1601 if (propStorage)
1602 attrs.push_back(odsBuilder.getNamedAttr("sym_name",
1603 propStorage));
1604 }
1605
1606 if (!attrs.empty())
1607 return odsBuilder.getDictionaryAttr(attrs);
1608 return {};
1609}
1610
1612 return llvm::hash_combine(
1613 llvm::hash_value(prop.const_params.getAsOpaquePointer()),
1614 llvm::hash_value(prop.sym_name.getAsOpaquePointer()));
1615}
1616
1617std::optional<mlir::Attribute> StructDefOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
1618 if (name == "const_params")
1619 return prop.const_params;
1620
1621 if (name == "sym_name")
1622 return prop.sym_name;
1623 return std::nullopt;
1624}
1625
1626void StructDefOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
1627 if (name == "const_params") {
1628 prop.const_params = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.const_params)>>(value);
1629 return;
1630 }
1631
1632 if (name == "sym_name") {
1633 prop.sym_name = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.sym_name)>>(value);
1634 return;
1635 }
1636}
1637
1638void StructDefOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
1639 if (prop.const_params) attrs.append("const_params", prop.const_params);
1640
1641 if (prop.sym_name) attrs.append("sym_name", prop.sym_name);
1642}
1643
1644::llvm::LogicalResult StructDefOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
1645 {
1646 ::mlir::Attribute attr = attrs.get(getConstParamsAttrName(opName));
1647 if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_Ops7(attr, "const_params", emitError)))
1648 return ::mlir::failure();
1649 }
1650
1651 {
1652 ::mlir::Attribute attr = attrs.get(getSymNameAttrName(opName));
1653 if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_Ops1(attr, "sym_name", emitError)))
1654 return ::mlir::failure();
1655 }
1656 return ::mlir::success();
1657}
1658
1659::llvm::LogicalResult StructDefOp::readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state) {
1660 auto &prop = state.getOrAddProperties<Properties>(); (void)prop;
1661 if (::mlir::failed(reader.readOptionalAttribute(prop.const_params)))
1662 return ::mlir::failure();
1663
1664 if (::mlir::failed(reader.readAttribute(prop.sym_name)))
1665 return ::mlir::failure();
1666 return ::mlir::success();
1667}
1668
1669void StructDefOp::writeProperties(::mlir::DialectBytecodeWriter &writer) {
1670 auto &prop = getProperties(); (void)prop;
1671
1672 writer.writeOptionalAttribute(prop.const_params);
1673 writer.writeAttribute(prop.sym_name);
1674}
1675
1676::llvm::StringRef StructDefOp::getSymName() {
1677 auto attr = getSymNameAttr();
1678 return attr.getValue();
1679}
1680
1681::std::optional< ::mlir::ArrayAttr > StructDefOp::getConstParams() {
1682 auto attr = getConstParamsAttr();
1683 return attr ? ::std::optional< ::mlir::ArrayAttr >(attr) : (::std::nullopt);
1684}
1685
1686void StructDefOp::setSymName(::llvm::StringRef attrValue) {
1687 getProperties().sym_name = ::mlir::Builder((*this)->getContext()).getStringAttr(attrValue);
1688}
1689
1690void StructDefOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::StringAttr sym_name, /*optional*/::mlir::ArrayAttr const_params) {
1691 odsState.getOrAddProperties<Properties>().sym_name = sym_name;
1692 if (const_params) {
1693 odsState.getOrAddProperties<Properties>().const_params = const_params;
1694 }
1695 (void)odsState.addRegion();
1696}
1697
1698void StructDefOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::StringAttr sym_name, /*optional*/::mlir::ArrayAttr const_params) {
1699 odsState.getOrAddProperties<Properties>().sym_name = sym_name;
1700 if (const_params) {
1701 odsState.getOrAddProperties<Properties>().const_params = const_params;
1702 }
1703 (void)odsState.addRegion();
1704 assert(resultTypes.size() == 0u && "mismatched number of results");
1705 odsState.addTypes(resultTypes);
1706}
1707
1708void StructDefOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::llvm::StringRef sym_name, /*optional*/::mlir::ArrayAttr const_params) {
1709 odsState.getOrAddProperties<Properties>().sym_name = odsBuilder.getStringAttr(sym_name);
1710 if (const_params) {
1711 odsState.getOrAddProperties<Properties>().const_params = const_params;
1712 }
1713 (void)odsState.addRegion();
1714}
1715
1716void StructDefOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::llvm::StringRef sym_name, /*optional*/::mlir::ArrayAttr const_params) {
1717 odsState.getOrAddProperties<Properties>().sym_name = odsBuilder.getStringAttr(sym_name);
1718 if (const_params) {
1719 odsState.getOrAddProperties<Properties>().const_params = const_params;
1720 }
1721 (void)odsState.addRegion();
1722 assert(resultTypes.size() == 0u && "mismatched number of results");
1723 odsState.addTypes(resultTypes);
1724}
1725
1726void StructDefOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
1727 assert(operands.size() == 0u && "mismatched number of parameters");
1728 odsState.addOperands(operands);
1729 odsState.addAttributes(attributes);
1730 for (unsigned i = 0; i != 1; ++i)
1731 (void)odsState.addRegion();
1732 assert(resultTypes.size() == 0u && "mismatched number of return types");
1733 odsState.addTypes(resultTypes);
1734
1735 if (!attributes.empty()) {
1736 ::mlir::OpaqueProperties properties =
1737 &odsState.getOrAddProperties<StructDefOp::Properties>();
1738 std::optional<::mlir::RegisteredOperationName> info =
1739 odsState.name.getRegisteredInfo();
1740 if (failed(info->setOpPropertiesFromAttribute(odsState.name, properties,
1741 odsState.attributes.getDictionary(odsState.getContext()), nullptr)))
1742 ::llvm::report_fatal_error("Property conversion failed.");
1743 }
1744}
1745
1746::llvm::LogicalResult StructDefOp::verifyInvariantsImpl() {
1747 auto tblgen_const_params = getProperties().const_params; (void)tblgen_const_params;
1748 auto tblgen_sym_name = getProperties().sym_name; (void)tblgen_sym_name;
1749 if (!tblgen_sym_name) return emitOpError("requires attribute 'sym_name'");
1750
1751 if (::mlir::failed(__mlir_ods_local_attr_constraint_Ops1(*this, tblgen_sym_name, "sym_name")))
1752 return ::mlir::failure();
1753
1754 if (::mlir::failed(__mlir_ods_local_attr_constraint_Ops7(*this, tblgen_const_params, "const_params")))
1755 return ::mlir::failure();
1756 {
1757 unsigned index = 0; (void)index;
1758
1759 for (auto &region : ::llvm::MutableArrayRef((*this)->getRegion(0)))
1760 if (::mlir::failed(__mlir_ods_local_region_constraint_Ops1(*this, region, "bodyRegion", index++)))
1761 return ::mlir::failure();
1762 }
1763 return ::mlir::success();
1764}
1765
1766::llvm::LogicalResult StructDefOp::verifyInvariants() {
1767 return verifyInvariantsImpl();
1768}
1769
1770::mlir::ParseResult StructDefOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
1771 ::mlir::StringAttr sym_nameAttr;
1772 ::mlir::ArrayAttr const_paramsAttr;
1773 std::unique_ptr<::mlir::Region> bodyRegionRegion = std::make_unique<::mlir::Region>();
1774
1775 if (parser.parseSymbolName(sym_nameAttr))
1776 return ::mlir::failure();
1777 if (sym_nameAttr) result.getOrAddProperties<StructDefOp::Properties>().sym_name = sym_nameAttr;
1778 if (::mlir::succeeded(parser.parseOptionalLess())) {
1779
1780 if (parser.parseCustomAttributeWithFallback(const_paramsAttr, parser.getBuilder().getType<::mlir::NoneType>())) {
1781 return ::mlir::failure();
1782 }
1783 if (const_paramsAttr) result.getOrAddProperties<StructDefOp::Properties>().const_params = const_paramsAttr;
1784 if (parser.parseGreater())
1785 return ::mlir::failure();
1786 }
1787
1788 if (parser.parseRegion(*bodyRegionRegion))
1789 return ::mlir::failure();
1790
1791 if (bodyRegionRegion->empty()) bodyRegionRegion->emplaceBlock();
1792 {
1793 auto loc = parser.getCurrentLocation();(void)loc;
1794 if (parser.parseOptionalAttrDict(result.attributes))
1795 return ::mlir::failure();
1796 if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() {
1797 return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op ";
1798 })))
1799 return ::mlir::failure();
1800 }
1801 result.addRegion(std::move(bodyRegionRegion));
1802 return ::mlir::success();
1803}
1804
1805void StructDefOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
1806 _odsPrinter << ' ';
1807 _odsPrinter.printSymbolName(getSymNameAttr().getValue());
1808 if (getConstParamsAttr()) {
1809 _odsPrinter << "<";
1810 _odsPrinter.printAttributeWithoutType(getConstParamsAttr());
1811 _odsPrinter << ">";
1812 }
1813 _odsPrinter << ' ';
1814 _odsPrinter.printRegion(getBodyRegion());
1815 ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
1816 elidedAttrs.push_back("sym_name");
1817 elidedAttrs.push_back("const_params");
1818 _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
1819}
1820
1821} // namespace component
1822} // namespace llzk
1823MLIR_DEFINE_EXPLICIT_TYPE_ID(::llzk::component::StructDefOp)
1824
1825
1826#endif // GET_OP_CLASSES
1827
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
MemberDefOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:272
::llvm::LogicalResult verify(::mlir::Location loc)
Definition Ops.cpp.inc:310
::llvm::StringRef getSymName()
Definition Ops.cpp.inc:542
void setSignal(bool attrValue)
Definition Ops.cpp.inc:582
::mlir::StringAttr getTypeAttrName()
Definition Ops.h.inc:345
::mlir::StringAttr getColumnAttrName()
Definition Ops.h.inc:321
::llvm::LogicalResult verifyInvariants()
Definition Ops.cpp.inc:616
static std::optional< mlir::Attribute > getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name)
Definition Ops.cpp.inc:442
::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:332
static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs)
Definition Ops.cpp.inc:479
::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:489
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
Definition Ops.cpp.inc:620
::llvm::LogicalResult verifyInvariantsImpl()
Definition Ops.cpp.inc:594
::mlir::UnitAttr getSignalAttr()
Definition Ops.h.inc:401
void print(::mlir::OpAsmPrinter &_odsPrinter)
Definition Ops.cpp.inc:646
::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop)
Definition Ops.cpp.inc:397
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::StringAttr sym_name, ::mlir::TypeAttr type, bool isSignal=false, bool isColumn=false)
::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state)
Definition Ops.cpp.inc:516
void setColumn(bool attrValue)
Definition Ops.cpp.inc:574
::mlir::TypeAttr getTypeAttr()
Definition Ops.h.inc:391
static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value)
Definition Ops.cpp.inc:457
::mlir::StringAttr getSignalAttrName()
Definition Ops.h.inc:329
static llvm::hash_code computePropertiesHash(const Properties &prop)
Definition Ops.cpp.inc:434
::mlir::StringAttr getSymNameAttr()
Definition Ops.h.inc:386
void writeProperties(::mlir::DialectBytecodeWriter &writer)
Definition Ops.cpp.inc:532
void setType(::mlir::Type attrValue)
Definition Ops.cpp.inc:570
FoldAdaptor::Properties Properties
Definition Ops.h.inc:315
void setSymName(::llvm::StringRef attrValue)
Definition Ops.cpp.inc:566
::mlir::UnitAttr getColumnAttr()
Definition Ops.h.inc:396
::mlir::StringAttr getSymNameAttrName()
Definition Ops.h.inc:337
MemberReadOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:579
::llvm::LogicalResult verify(::mlir::Location loc)
Definition Ops.cpp.inc:730
::mlir::MutableOperandRangeRange getMapOperandsMutable()
Definition Ops.cpp.inc:770
static std::optional< mlir::Attribute > getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name)
Definition Ops.cpp.inc:886
static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs)
Definition Ops.cpp.inc:923
::mlir::TypedValue<::llzk::component::StructType > getComponent()
Definition Ops.h.inc:687
static llvm::hash_code computePropertiesHash(const Properties &prop)
Definition Ops.cpp.inc:878
static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value)
Definition Ops.cpp.inc:901
void setMapOpGroupSizes(::llvm::ArrayRef< int32_t > attrValue)
Definition Ops.cpp.inc:1014
::mlir::TypedValue<::mlir::Type > getVal()
Definition Ops.h.inc:711
::std::optional<::mlir::Attribute > getTableOffset()
Definition Ops.cpp.inc:991
::mlir::OperandRangeRange getMapOperands()
Definition Ops.h.inc:691
bool isRead()
Return true if the op is a read, false if it's a write.
Definition Ops.cpp.inc:1211
::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop)
Definition Ops.cpp.inc:841
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type resultType, ::mlir::Value component, ::mlir::StringAttr member)
::llvm::LogicalResult verifyInvariantsImpl()
Definition Ops.cpp.inc:1034
static void populateDefaultProperties(::mlir::OperationName opName, Properties &properties)
Definition Ops.cpp.inc:1028
::mlir::FlatSymbolRefAttr getMemberNameAttr()
Definition Ops.h.inc:724
::llvm::ArrayRef< int32_t > getMapOpGroupSizes()
Definition Ops.cpp.inc:1001
::mlir::StringAttr getMapOpGroupSizesAttrName()
Definition Ops.h.inc:644
void setNumDimsPerMap(::llvm::ArrayRef< int32_t > attrValue)
Definition Ops.cpp.inc:1010
::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:933
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index)
Definition Ops.cpp.inc:752
::mlir::Operation::result_range getODSResults(unsigned index)
Definition Ops.h.inc:705
::llvm::LogicalResult verifyInvariants()
Definition Ops.cpp.inc:1082
::llvm::ArrayRef< int32_t > getNumDimsPerMap()
Definition Ops.cpp.inc:996
::llvm::StringRef getMemberName()
Definition Ops.cpp.inc:986
::mlir::StringAttr getTableOffsetAttrName()
Definition Ops.h.inc:668
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
Definition Ops.cpp.inc:1088
void writeProperties(::mlir::DialectBytecodeWriter &writer)
Definition Ops.cpp.inc:976
::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state)
Definition Ops.cpp.inc:960
::llvm::LogicalResult verify()
Definition Ops.cpp:716
::mlir::Operation::operand_range getODSOperands(unsigned index)
Definition Ops.h.inc:681
::mlir::Attribute getTableOffsetAttr()
Definition Ops.h.inc:729
void setMemberName(::llvm::StringRef attrValue)
Definition Ops.cpp.inc:1006
::mlir::StringAttr getMemberNameAttrName()
Definition Ops.h.inc:652
::mlir::DenseI32ArrayAttr getMapOpGroupSizesAttr()
Definition Ops.h.inc:739
void print(::mlir::OpAsmPrinter &_odsPrinter)
Definition Ops.cpp.inc:1168
::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:776
FoldAdaptor::Properties Properties
Definition Ops.h.inc:638
::mlir::DenseI32ArrayAttr getNumDimsPerMapAttr()
Definition Ops.h.inc:734
::mlir::StringAttr getNumDimsPerMapAttrName()
Definition Ops.h.inc:660
MemberWriteOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:872
::llvm::LogicalResult verify(::mlir::Location loc)
Definition Ops.cpp.inc:1236
::mlir::TypedValue<::llzk::component::StructType > getComponent()
Definition Ops.h.inc:951
void setMemberName(::llvm::StringRef attrValue)
Definition Ops.cpp.inc:1332
FoldAdaptor::Properties Properties
Definition Ops.h.inc:923
static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs)
Definition Ops.cpp.inc:1302
::mlir::FlatSymbolRefAttr getMemberNameAttr()
Definition Ops.h.inc:988
bool isRead()
Return true if the op is a read, false if it's a write.
Definition Ops.cpp.inc:1508
::llvm::LogicalResult verifyInvariants()
Definition Ops.cpp.inc:1406
void print(::mlir::OpAsmPrinter &_odsPrinter)
Definition Ops.cpp.inc:1475
static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value)
Definition Ops.cpp.inc:1295
::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state)
Definition Ops.cpp.inc:1315
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value component, ::mlir::FlatSymbolRefAttr member_name, ::mlir::Value val)
Definition Ops.cpp.inc:1336
void writeProperties(::mlir::DialectBytecodeWriter &writer)
Definition Ops.cpp.inc:1322
::llvm::StringRef getMemberName()
Definition Ops.cpp.inc:1327
::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop)
Definition Ops.cpp.inc:1268
::mlir::Operation::operand_range getODSOperands(unsigned index)
Definition Ops.h.inc:945
::llvm::LogicalResult verifyInvariantsImpl()
Definition Ops.cpp.inc:1382
static std::optional< mlir::Attribute > getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name)
Definition Ops.cpp.inc:1289
::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:1245
::mlir::TypedValue<::mlir::Type > getVal()
Definition Ops.h.inc:955
::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:1306
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
Definition Ops.cpp.inc:1410
static llvm::hash_code computePropertiesHash(const Properties &prop)
Definition Ops.cpp.inc:1284
::mlir::StringAttr getMemberNameAttrName()
Definition Ops.h.inc:929
StructDefOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:1124
::llvm::LogicalResult verify(::mlir::Location loc)
Definition Ops.cpp.inc:1538
static llvm::hash_code computePropertiesHash(const Properties &prop)
Definition Ops.cpp.inc:1611
static std::optional< mlir::Attribute > getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name)
Definition Ops.cpp.inc:1617
static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value)
Definition Ops.cpp.inc:1626
::mlir::Region & getBodyRegion()
Definition Ops.h.inc:1213
::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state)
Definition Ops.cpp.inc:1659
static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs)
Definition Ops.cpp.inc:1638
::llvm::LogicalResult verifyInvariants()
Definition Ops.cpp.inc:1766
::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop)
Definition Ops.cpp.inc:1588
::llvm::StringRef getSymName()
Definition Ops.cpp.inc:1676
FoldAdaptor::Properties Properties
Definition Ops.h.inc:1167
::mlir::StringAttr getConstParamsAttrName()
Definition Ops.h.inc:1173
::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:1644
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
Definition Ops.cpp.inc:1770
void writeProperties(::mlir::DialectBytecodeWriter &writer)
Definition Ops.cpp.inc:1669
::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:1551
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::StringAttr sym_name, ::mlir::ArrayAttr const_params)
Definition Ops.cpp.inc:1690
::mlir::StringAttr getSymNameAttr()
Definition Ops.h.inc:1226
::std::optional< ::mlir::ArrayAttr > getConstParams()
Definition Ops.cpp.inc:1681
void setSymName(::llvm::StringRef attrValue)
Definition Ops.cpp.inc:1686
::llvm::LogicalResult verifyInvariantsImpl()
Definition Ops.cpp.inc:1746
::mlir::ArrayAttr getConstParamsAttr()
Definition Ops.h.inc:1231
::mlir::StringAttr getSymNameAttrName()
Definition Ops.h.inc:1181
void print(::mlir::OpAsmPrinter &_odsPrinter)
Definition Ops.cpp.inc:1805
MemberDefOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:231
::std::optional<::mlir::OperationName > odsOpName
Definition Ops.h.inc:227
::std::optional<::mlir::Attribute > getTableOffset()
Definition Ops.cpp.inc:707
MemberReadOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:537
::std::optional<::mlir::OperationName > odsOpName
Definition Ops.h.inc:533
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize)
Definition Ops.cpp.inc:684
MemberWriteOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:841
::std::optional<::mlir::OperationName > odsOpName
Definition Ops.h.inc:837
::std::optional< ::mlir::ArrayAttr > getConstParams()
Definition Ops.cpp.inc:1530
StructDefOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:1079
::std::optional<::mlir::OperationName > odsOpName
Definition Ops.h.inc:1075
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