29static ::llvm::LogicalResult __mlir_ods_local_type_constraint_Ops1(
30 ::mlir::Operation *op, ::mlir::Type type, ::llvm::StringRef valueKind,
31 unsigned valueIndex) {
32 if (!((::llvm::isa<::llzk::component::StructType>(type)))) {
33 return op->emitOpError(valueKind) <<
" #" << valueIndex
34 <<
" must be circuit component, but got " << type;
36 return ::mlir::success();
39static ::llvm::LogicalResult __mlir_ods_local_type_constraint_Ops2(
40 ::mlir::Operation *op, ::mlir::Type type, ::llvm::StringRef valueKind,
41 unsigned valueIndex) {
42 if (!((::llvm::isa<::mlir::IndexType>(type)))) {
43 return op->emitOpError(valueKind) <<
" #" << valueIndex
44 <<
" must be variadic of index, but got " << type;
46 return ::mlir::success();
49static ::llvm::LogicalResult __mlir_ods_local_type_constraint_Ops3(
50 ::mlir::Operation *op, ::mlir::Type type, ::llvm::StringRef valueKind,
51 unsigned valueIndex) {
53 return op->emitOpError(valueKind) <<
" #" << valueIndex
54 <<
" must be a valid LLZK type, but got " << type;
56 return ::mlir::success();
59static ::llvm::LogicalResult __mlir_ods_local_attr_constraint_Ops1(
60 ::mlir::Attribute attr, ::llvm::StringRef attrName, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
61 if (attr && !((::llvm::isa<::mlir::StringAttr>(attr))))
62 return emitError() <<
"attribute '" << attrName
63 <<
"' failed to satisfy constraint: string attribute";
64 return ::mlir::success();
66static ::llvm::LogicalResult __mlir_ods_local_attr_constraint_Ops1(
67 ::mlir::Operation *op, ::mlir::Attribute attr, ::llvm::StringRef attrName) {
68 return __mlir_ods_local_attr_constraint_Ops1(attr, attrName, [op]() {
69 return op->emitOpError();
73static ::llvm::LogicalResult __mlir_ods_local_attr_constraint_Ops2(
74 ::mlir::Attribute attr, ::llvm::StringRef attrName, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
75 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())))))
76 return emitError() <<
"attribute '" << attrName
77 <<
"' failed to satisfy constraint: type attribute of a valid LLZK type";
78 return ::mlir::success();
80static ::llvm::LogicalResult __mlir_ods_local_attr_constraint_Ops2(
81 ::mlir::Operation *op, ::mlir::Attribute attr, ::llvm::StringRef attrName) {
82 return __mlir_ods_local_attr_constraint_Ops2(attr, attrName, [op]() {
83 return op->emitOpError();
87static ::llvm::LogicalResult __mlir_ods_local_attr_constraint_Ops3(
88 ::mlir::Attribute attr, ::llvm::StringRef attrName, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
89 if (attr && !((::llvm::isa<::mlir::UnitAttr>(attr))))
90 return emitError() <<
"attribute '" << attrName
91 <<
"' failed to satisfy constraint: unit attribute";
92 return ::mlir::success();
94static ::llvm::LogicalResult __mlir_ods_local_attr_constraint_Ops3(
95 ::mlir::Operation *op, ::mlir::Attribute attr, ::llvm::StringRef attrName) {
96 return __mlir_ods_local_attr_constraint_Ops3(attr, attrName, [op]() {
97 return op->emitOpError();
101static ::llvm::LogicalResult __mlir_ods_local_attr_constraint_Ops4(
102 ::mlir::Attribute attr, ::llvm::StringRef attrName, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
103 if (attr && !((::llvm::isa<::mlir::FlatSymbolRefAttr>(attr))))
104 return emitError() <<
"attribute '" << attrName
105 <<
"' failed to satisfy constraint: flat symbol reference attribute";
106 return ::mlir::success();
108static ::llvm::LogicalResult __mlir_ods_local_attr_constraint_Ops4(
109 ::mlir::Operation *op, ::mlir::Attribute attr, ::llvm::StringRef attrName) {
110 return __mlir_ods_local_attr_constraint_Ops4(attr, attrName, [op]() {
111 return op->emitOpError();
115static ::llvm::LogicalResult __mlir_ods_local_attr_constraint_Ops5(
116 ::mlir::Attribute attr, ::llvm::StringRef attrName, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
117 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)))))
118 return emitError() <<
"attribute '" << attrName
119 <<
"' failed to satisfy constraint: symbol reference attribute or index attribute or AffineMap attribute";
120 return ::mlir::success();
122static ::llvm::LogicalResult __mlir_ods_local_attr_constraint_Ops5(
123 ::mlir::Operation *op, ::mlir::Attribute attr, ::llvm::StringRef attrName) {
124 return __mlir_ods_local_attr_constraint_Ops5(attr, attrName, [op]() {
125 return op->emitOpError();
129static ::llvm::LogicalResult __mlir_ods_local_attr_constraint_Ops6(
130 ::mlir::Attribute attr, ::llvm::StringRef attrName, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
131 if (attr && !((::llvm::isa<::mlir::DenseI32ArrayAttr>(attr))))
132 return emitError() <<
"attribute '" << attrName
133 <<
"' failed to satisfy constraint: i32 dense array attribute";
134 return ::mlir::success();
136static ::llvm::LogicalResult __mlir_ods_local_attr_constraint_Ops6(
137 ::mlir::Operation *op, ::mlir::Attribute attr, ::llvm::StringRef attrName) {
138 return __mlir_ods_local_attr_constraint_Ops6(attr, attrName, [op]() {
139 return op->emitOpError();
143static ::llvm::LogicalResult __mlir_ods_local_region_constraint_Ops1(
144 ::mlir::Operation *op, ::mlir::Region ®ion, ::llvm::StringRef regionName,
145 unsigned regionIndex) {
146 if (!((::llvm::hasNItems(region, 1)))) {
147 return op->emitOpError(
"region #") << regionIndex
148 << (regionName.empty() ?
" " :
" ('" + regionName +
"') ")
149 <<
"failed to verify constraint: region with 1 blocks";
151 return ::mlir::success();
169 return ::mlir::success();
173 ::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
175 emitError() <<
"expected DictionaryAttr to set properties";
176 return ::mlir::failure();
178 return ::mlir::success();
182 ::mlir::SmallVector<::mlir::NamedAttribute> attrs;
183 ::mlir::Builder odsBuilder{ctx};
186 return odsBuilder.getDictionaryAttr(attrs);
191 using llvm::hash_value;
192 return llvm::hash_combine();
206 return ::mlir::success();
210 odsState.addTypes(result);
215 build(builder, __state__, std::forward<
decltype(result)>(result));
216 auto __res__ = ::llvm::dyn_cast<CreateStructOp>(builder.create(__state__));
217 assert(__res__ &&
"builder didn't return the right type");
222 return create(builder, builder.getLoc(), std::forward<
decltype(result)>(result));
225void CreateStructOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes) {
226 assert(resultTypes.size() == 1u &&
"mismatched number of results");
227 odsState.addTypes(resultTypes);
232 build(builder, __state__, std::forward<
decltype(resultTypes)>(resultTypes));
233 auto __res__ = ::llvm::dyn_cast<CreateStructOp>(builder.create(__state__));
234 assert(__res__ &&
"builder didn't return the right type");
239 return create(builder, builder.getLoc(), std::forward<
decltype(resultTypes)>(resultTypes));
242void CreateStructOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
243 assert(operands.size() == 0u &&
"mismatched number of parameters");
244 odsState.addOperands(operands);
245 odsState.addAttributes(attributes);
246 assert(resultTypes.size() == 1u &&
"mismatched number of return types");
247 odsState.addTypes(resultTypes);
250CreateStructOp CreateStructOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
252 build(builder, __state__, std::forward<
decltype(resultTypes)>(resultTypes), std::forward<
decltype(operands)>(operands), std::forward<
decltype(attributes)>(attributes));
253 auto __res__ = ::llvm::dyn_cast<CreateStructOp>(builder.create(__state__));
254 assert(__res__ &&
"builder didn't return the right type");
259 return create(builder, builder.getLoc(), std::forward<
decltype(resultTypes)>(resultTypes), std::forward<
decltype(operands)>(operands), std::forward<
decltype(attributes)>(attributes));
262void CreateStructOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands,
const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
263 assert(operands.size() == 0u &&
"mismatched number of parameters");
264 odsState.addOperands(operands);
265 odsState.useProperties(
const_cast<Properties&
>(properties));
266 odsState.addAttributes(discardableAttributes);
267 assert(resultTypes.size() == 1u &&
"mismatched number of return types");
268 odsState.addTypes(resultTypes);
271CreateStructOp CreateStructOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands,
const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
273 build(builder, __state__, std::forward<
decltype(resultTypes)>(resultTypes), std::forward<
decltype(operands)>(operands), std::forward<
decltype(properties)>(properties), std::forward<
decltype(discardableAttributes)>(discardableAttributes));
274 auto __res__ = ::llvm::dyn_cast<CreateStructOp>(builder.create(__state__));
275 assert(__res__ &&
"builder didn't return the right type");
280 return create(builder, builder.getLoc(), std::forward<
decltype(resultTypes)>(resultTypes), std::forward<
decltype(operands)>(operands), std::forward<
decltype(properties)>(properties), std::forward<
decltype(discardableAttributes)>(discardableAttributes));
285 unsigned index = 0; (void)index;
288 for (
auto v : valueGroup0) {
289 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops1(*
this, v.getType(),
"result", index++)))
290 return ::mlir::failure();
293 return ::mlir::success();
301 ::mlir::Type resultRawType{};
302 ::llvm::ArrayRef<::mlir::Type> resultTypes(&resultRawType, 1);
303 if (parser.parseColon())
304 return ::mlir::failure();
308 if (parser.parseCustomTypeWithFallback(type))
309 return ::mlir::failure();
310 resultRawType = type;
313 auto loc = parser.getCurrentLocation();(void)loc;
314 if (parser.parseOptionalAttrDict(result.attributes))
315 return ::mlir::failure();
317 return parser.emitError(loc) <<
"'" << result.name.getStringRef() <<
"' op ";
319 return ::mlir::failure();
321 result.addTypes(resultTypes);
322 return ::mlir::success();
326 _odsPrinter <<
' ' <<
":";
330 if (
auto validType = ::llvm::dyn_cast<::llzk::component::StructType>(type))
331 _odsPrinter.printStrippedAttrOrType(validType);
335 ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
336 _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
356 return attr.getValue();
361 return ::llvm::cast<::mlir::Type>(attr.getValue());
365 auto attr = ::llvm::dyn_cast_or_null<::mlir::UnitAttr>(
getProperties().column);
367 attr = ((
false) ? ::mlir::Builder(
odsAttrs.getContext()).getUnitAttr() :
nullptr);
374 return ((
false) ? ::mlir::Builder(
odsAttrs.getContext()).getUnitAttr() :
nullptr) !=
nullptr;
375 return attr !=
nullptr;
379 auto attr = ::llvm::dyn_cast_or_null<::mlir::UnitAttr>(
getProperties().signal);
381 attr = ((
false) ? ::mlir::Builder(
odsAttrs.getContext()).getUnitAttr() :
nullptr);
388 return ((
false) ? ::mlir::Builder(
odsAttrs.getContext()).getUnitAttr() :
nullptr) !=
nullptr;
389 return attr !=
nullptr;
400 if (!tblgen_sym_name)
return emitError(loc,
"'struct.member' op requires attribute 'sym_name'");
402 if (!tblgen_type)
return emitError(loc,
"'struct.member' op requires attribute 'type'");
404 if (tblgen_sym_name && !((::llvm::isa<::mlir::StringAttr>(tblgen_sym_name))))
405 return emitError(loc,
"'struct.member' op attribute 'sym_name' failed to satisfy constraint: string attribute");
407 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())))))
408 return emitError(loc,
"'struct.member' op attribute 'type' failed to satisfy constraint: type attribute of a valid LLZK type");
410 if (tblgen_column && !((::llvm::isa<::mlir::UnitAttr>(tblgen_column))))
411 return emitError(loc,
"'struct.member' op attribute 'column' failed to satisfy constraint: unit attribute");
413 if (tblgen_signal && !((::llvm::isa<::mlir::UnitAttr>(tblgen_signal))))
414 return emitError(loc,
"'struct.member' op attribute 'signal' failed to satisfy constraint: unit attribute");
415 return ::mlir::success();
419 ::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
421 emitError() <<
"expected DictionaryAttr to set properties";
422 return ::mlir::failure();
426 auto &propStorage = prop.
column;
427 auto attr = dict.get(
"column");
429 auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<
decltype(propStorage)>>(attr);
431 propStorage = convertedAttr;
433 emitError() <<
"Invalid attribute `column` in property conversion: " << attr;
434 return ::mlir::failure();
440 auto &propStorage = prop.
signal;
441 auto attr = dict.get(
"signal");
443 auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<
decltype(propStorage)>>(attr);
445 propStorage = convertedAttr;
447 emitError() <<
"Invalid attribute `signal` in property conversion: " << attr;
448 return ::mlir::failure();
455 auto attr = dict.get(
"sym_name");
457 auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<
decltype(propStorage)>>(attr);
459 propStorage = convertedAttr;
461 emitError() <<
"Invalid attribute `sym_name` in property conversion: " << attr;
462 return ::mlir::failure();
468 auto &propStorage = prop.
type;
469 auto attr = dict.get(
"type");
471 auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<
decltype(propStorage)>>(attr);
473 propStorage = convertedAttr;
475 emitError() <<
"Invalid attribute `type` in property conversion: " << attr;
476 return ::mlir::failure();
480 return ::mlir::success();
484 ::mlir::SmallVector<::mlir::NamedAttribute> attrs;
485 ::mlir::Builder odsBuilder{ctx};
488 const auto &propStorage = prop.
column;
490 attrs.push_back(odsBuilder.getNamedAttr(
"column",
495 const auto &propStorage = prop.
signal;
497 attrs.push_back(odsBuilder.getNamedAttr(
"signal",
502 const auto &propStorage = prop.
sym_name;
504 attrs.push_back(odsBuilder.getNamedAttr(
"sym_name",
509 const auto &propStorage = prop.
type;
511 attrs.push_back(odsBuilder.getNamedAttr(
"type",
516 return odsBuilder.getDictionaryAttr(attrs);
521 using llvm::hash_value;
522 return llvm::hash_combine(
523 llvm::hash_value(prop.
column.getAsOpaquePointer()),
524 llvm::hash_value(prop.
signal.getAsOpaquePointer()),
525 llvm::hash_value(prop.
sym_name.getAsOpaquePointer()),
526 llvm::hash_value(prop.
type.getAsOpaquePointer()));
530 if (name ==
"column")
533 if (name ==
"signal")
536 if (name ==
"sym_name")
545 if (name ==
"column") {
546 prop.
column = ::llvm::dyn_cast_or_null<std::remove_reference_t<
decltype(prop.
column)>>(value);
550 if (name ==
"signal") {
551 prop.
signal = ::llvm::dyn_cast_or_null<std::remove_reference_t<
decltype(prop.
signal)>>(value);
555 if (name ==
"sym_name") {
556 prop.
sym_name = ::llvm::dyn_cast_or_null<std::remove_reference_t<
decltype(prop.
sym_name)>>(value);
560 if (name ==
"type") {
561 prop.
type = ::llvm::dyn_cast_or_null<std::remove_reference_t<
decltype(prop.
type)>>(value);
573 if (prop.
type) attrs.append(
"type", prop.
type);
576::llvm::LogicalResult
MemberDefOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
579 if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_Ops3(attr,
"column", emitError)))
580 return ::mlir::failure();
585 if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_Ops3(attr,
"signal", emitError)))
586 return ::mlir::failure();
591 if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_Ops1(attr,
"sym_name", emitError)))
592 return ::mlir::failure();
597 if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_Ops2(attr,
"type", emitError)))
598 return ::mlir::failure();
600 return ::mlir::success();
604 auto &prop = state.getOrAddProperties<
Properties>(); (void)prop;
605 if (::mlir::failed(reader.readOptionalAttribute(prop.
column)))
606 return ::mlir::failure();
608 if (::mlir::failed(reader.readOptionalAttribute(prop.
signal)))
609 return ::mlir::failure();
611 if (::mlir::failed(reader.readAttribute(prop.
sym_name)))
612 return ::mlir::failure();
614 if (::mlir::failed(reader.readAttribute(prop.
type)))
615 return ::mlir::failure();
616 return ::mlir::success();
620 auto &prop = getProperties(); (void)prop;
622 writer.writeOptionalAttribute(prop.
column);
624 writer.writeOptionalAttribute(prop.
signal);
625 writer.writeAttribute(prop.
sym_name);
626 writer.writeAttribute(prop.
type);
631 return attr.getValue();
636 return ::llvm::cast<::mlir::Type>(attr.getValue());
642 return ((
false) ? ::mlir::Builder((*this)->getContext()).getUnitAttr() :
nullptr) !=
nullptr;
643 return attr !=
nullptr;
649 return ((
false) ? ::mlir::Builder((*this)->getContext()).getUnitAttr() :
nullptr) !=
nullptr;
650 return attr !=
nullptr;
654 getProperties().sym_name = ::mlir::Builder((*this)->getContext()).getStringAttr(attrValue);
658 getProperties().type = ::mlir::TypeAttr::get(attrValue);
662 auto &odsProp = getProperties().column;
664 odsProp = ((attrValue) ? ::mlir::Builder((*this)->getContext()).getUnitAttr() :
nullptr);
670 auto &odsProp = getProperties().signal;
672 odsProp = ((attrValue) ? ::mlir::Builder((*this)->getContext()).getUnitAttr() :
nullptr);
677MemberDefOp MemberDefOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::StringAttr sym_name, ::mlir::TypeAttr type,
bool isSignal,
bool isColumn) {
679 build(builder, __state__, std::forward<
decltype(sym_name)>(sym_name), std::forward<
decltype(type)>(type), std::forward<
decltype(isSignal)>(isSignal), std::forward<
decltype(isColumn)>(isColumn));
680 auto __res__ = ::llvm::dyn_cast<MemberDefOp>(builder.create(__state__));
681 assert(__res__ &&
"builder didn't return the right type");
686 return create(builder, builder.getLoc(), std::forward<
decltype(sym_name)>(sym_name), std::forward<
decltype(type)>(type), std::forward<
decltype(isSignal)>(isSignal), std::forward<
decltype(isColumn)>(isColumn));
689MemberDefOp MemberDefOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::llvm::StringRef sym_name, ::mlir::Type type,
bool isSignal,
bool isColumn) {
691 build(builder, __state__, std::forward<
decltype(sym_name)>(sym_name), std::forward<
decltype(type)>(type), std::forward<
decltype(isSignal)>(isSignal), std::forward<
decltype(isColumn)>(isColumn));
692 auto __res__ = ::llvm::dyn_cast<MemberDefOp>(builder.create(__state__));
693 assert(__res__ &&
"builder didn't return the right type");
698 return create(builder, builder.getLoc(), std::forward<
decltype(sym_name)>(sym_name), std::forward<
decltype(type)>(type), std::forward<
decltype(isSignal)>(isSignal), std::forward<
decltype(isColumn)>(isColumn));
701MemberDefOp MemberDefOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes,
bool isSignal,
bool isColumn) {
703 build(builder, __state__, std::forward<
decltype(resultTypes)>(resultTypes), std::forward<
decltype(operands)>(operands), std::forward<
decltype(attributes)>(attributes), std::forward<
decltype(isSignal)>(isSignal), std::forward<
decltype(isColumn)>(isColumn));
704 auto __res__ = ::llvm::dyn_cast<MemberDefOp>(builder.create(__state__));
705 assert(__res__ &&
"builder didn't return the right type");
709MemberDefOp MemberDefOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes,
bool isSignal,
bool isColumn) {
710 return create(builder, builder.getLoc(), std::forward<
decltype(resultTypes)>(resultTypes), std::forward<
decltype(operands)>(operands), std::forward<
decltype(attributes)>(attributes), std::forward<
decltype(isSignal)>(isSignal), std::forward<
decltype(isColumn)>(isColumn));
713void MemberDefOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes,
bool isSignal,
bool isColumn) {
714 build(odsBuilder, odsState, {}, {}, attributes, isSignal, isColumn);
717MemberDefOp MemberDefOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes,
bool isSignal,
bool isColumn) {
719 build(builder, __state__, std::forward<
decltype(attributes)>(attributes), std::forward<
decltype(isSignal)>(isSignal), std::forward<
decltype(isColumn)>(isColumn));
720 auto __res__ = ::llvm::dyn_cast<MemberDefOp>(builder.create(__state__));
721 assert(__res__ &&
"builder didn't return the right type");
726 return create(builder, builder.getLoc(), std::forward<
decltype(attributes)>(attributes), std::forward<
decltype(isSignal)>(isSignal), std::forward<
decltype(isColumn)>(isColumn));
730 auto tblgen_column = getProperties().column; (void)tblgen_column;
731 auto tblgen_signal = getProperties().signal; (void)tblgen_signal;
732 auto tblgen_sym_name = getProperties().sym_name; (void)tblgen_sym_name;
733 if (!tblgen_sym_name)
return emitOpError(
"requires attribute 'sym_name'");
734 auto tblgen_type = getProperties().type; (void)tblgen_type;
735 if (!tblgen_type)
return emitOpError(
"requires attribute 'type'");
737 if (::mlir::failed(__mlir_ods_local_attr_constraint_Ops1(*
this, tblgen_sym_name,
"sym_name")))
738 return ::mlir::failure();
740 if (::mlir::failed(__mlir_ods_local_attr_constraint_Ops2(*
this, tblgen_type,
"type")))
741 return ::mlir::failure();
743 if (::mlir::failed(__mlir_ods_local_attr_constraint_Ops3(*
this, tblgen_column,
"column")))
744 return ::mlir::failure();
746 if (::mlir::failed(__mlir_ods_local_attr_constraint_Ops3(*
this, tblgen_signal,
"signal")))
747 return ::mlir::failure();
748 return ::mlir::success();
753 return ::mlir::success();
754 return ::mlir::failure();
758 ::mlir::StringAttr sym_nameAttr;
759 ::mlir::TypeAttr typeAttr;
761 if (parser.parseSymbolName(sym_nameAttr))
762 return ::mlir::failure();
764 if (parser.parseColon())
765 return ::mlir::failure();
767 if (parser.parseCustomAttributeWithFallback(typeAttr, parser.getBuilder().getType<::mlir::NoneType>())) {
768 return ::mlir::failure();
772 auto loc = parser.getCurrentLocation();(void)loc;
773 if (parser.parseOptionalAttrDict(result.attributes))
774 return ::mlir::failure();
776 return parser.emitError(loc) <<
"'" << result.name.getStringRef() <<
"' op ";
778 return ::mlir::failure();
780 return ::mlir::success();
786 _odsPrinter <<
' ' <<
":";
788 _odsPrinter.printAttributeWithoutType(
getTypeAttr());
789 ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
790 elidedAttrs.push_back(
"sym_name");
791 elidedAttrs.push_back(
"type");
793 ::mlir::Builder odsBuilder(getContext());
795 if(attr && (attr == ((
false) ? odsBuilder.getUnitAttr() :
nullptr)))
796 elidedAttrs.push_back(
"column");
799 ::mlir::Builder odsBuilder(getContext());
801 if(attr && (attr == ((
false) ? odsBuilder.getUnitAttr() :
nullptr)))
802 elidedAttrs.push_back(
"signal");
804 _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
824 bool isVariadic[] = {
false,
true};
825 int prevVariadicCount = 0;
826 for (
unsigned i = 0; i < index; ++i)
827 if (isVariadic[i]) ++prevVariadicCount;
831 int variadicSize = (odsOperandsSize - 1) / 1;
836 int start = index + (variadicSize - 1) * prevVariadicCount;
837 int size = isVariadic[index] ? variadicSize : 1;
838 return {start, size};
843 return attr.getValue();
848 return attr ? ::std::optional<::mlir::Attribute>(attr) : (::std::nullopt);
852 auto attr = ::llvm::dyn_cast_or_null<::mlir::DenseI32ArrayAttr>(
getProperties().numDimsPerMap);
872 if (!tblgen_mapOpGroupSizes)
return emitError(loc,
"'struct.readm' op requires attribute 'mapOpGroupSizes'");
874 if (!tblgen_member_name)
return emitError(loc,
"'struct.readm' op requires attribute 'member_name'");
878 if (tblgen_member_name && !((::llvm::isa<::mlir::FlatSymbolRefAttr>(tblgen_member_name))))
879 return emitError(loc,
"'struct.readm' op attribute 'member_name' failed to satisfy constraint: flat symbol reference attribute");
881 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)))))
882 return emitError(loc,
"'struct.readm' op attribute 'tableOffset' failed to satisfy constraint: symbol reference attribute or index attribute or AffineMap attribute");
884 if (tblgen_numDimsPerMap && !((::llvm::isa<::mlir::DenseI32ArrayAttr>(tblgen_numDimsPerMap))))
885 return emitError(loc,
"'struct.readm' op attribute 'numDimsPerMap' failed to satisfy constraint: i32 dense array attribute");
887 if (tblgen_mapOpGroupSizes && !((::llvm::isa<::mlir::DenseI32ArrayAttr>(tblgen_mapOpGroupSizes))))
888 return emitError(loc,
"'struct.readm' op attribute 'mapOpGroupSizes' failed to satisfy constraint: i32 dense array attribute");
889 return ::mlir::success();
893 bool isVariadic[] = {
false,
true};
894 int prevVariadicCount = 0;
895 for (
unsigned i = 0; i < index; ++i)
896 if (isVariadic[i]) ++prevVariadicCount;
900 int variadicSize = (getOperation()->getNumOperands() - 1) / 1;
905 int start = index + (variadicSize - 1) * prevVariadicCount;
906 int size = isVariadic[index] ? variadicSize : 1;
907 return {start, size};
912 auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
917 ::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
919 emitError() <<
"expected DictionaryAttr to set properties";
920 return ::mlir::failure();
925 auto attr = dict.get(
"mapOpGroupSizes");
927 auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<
decltype(propStorage)>>(attr);
929 propStorage = convertedAttr;
931 emitError() <<
"Invalid attribute `mapOpGroupSizes` in property conversion: " << attr;
932 return ::mlir::failure();
939 auto attr = dict.get(
"member_name");
941 auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<
decltype(propStorage)>>(attr);
943 propStorage = convertedAttr;
945 emitError() <<
"Invalid attribute `member_name` in property conversion: " << attr;
946 return ::mlir::failure();
953 auto attr = dict.get(
"numDimsPerMap");
955 auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<
decltype(propStorage)>>(attr);
957 propStorage = convertedAttr;
959 emitError() <<
"Invalid attribute `numDimsPerMap` in property conversion: " << attr;
960 return ::mlir::failure();
967 auto attr = dict.get(
"tableOffset");
969 auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<
decltype(propStorage)>>(attr);
971 propStorage = convertedAttr;
973 emitError() <<
"Invalid attribute `tableOffset` in property conversion: " << attr;
974 return ::mlir::failure();
978 return ::mlir::success();
982 ::mlir::SmallVector<::mlir::NamedAttribute> attrs;
983 ::mlir::Builder odsBuilder{ctx};
988 attrs.push_back(odsBuilder.getNamedAttr(
"mapOpGroupSizes",
995 attrs.push_back(odsBuilder.getNamedAttr(
"member_name",
1002 attrs.push_back(odsBuilder.getNamedAttr(
"numDimsPerMap",
1009 attrs.push_back(odsBuilder.getNamedAttr(
"tableOffset",
1014 return odsBuilder.getDictionaryAttr(attrs);
1019 using llvm::hash_value;
1020 return llvm::hash_combine(
1022 llvm::hash_value(prop.
member_name.getAsOpaquePointer()),
1024 llvm::hash_value(prop.
tableOffset.getAsOpaquePointer()));
1028 if (name ==
"mapOpGroupSizes")
1031 if (name ==
"member_name")
1034 if (name ==
"numDimsPerMap")
1037 if (name ==
"tableOffset")
1039 return std::nullopt;
1043 if (name ==
"mapOpGroupSizes") {
1048 if (name ==
"member_name") {
1053 if (name ==
"numDimsPerMap") {
1058 if (name ==
"tableOffset") {
1077 if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_Ops6(attr,
"mapOpGroupSizes", emitError)))
1078 return ::mlir::failure();
1083 if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_Ops4(attr,
"member_name", emitError)))
1084 return ::mlir::failure();
1089 if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_Ops6(attr,
"numDimsPerMap", emitError)))
1090 return ::mlir::failure();
1095 if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_Ops5(attr,
"tableOffset", emitError)))
1096 return ::mlir::failure();
1098 return ::mlir::success();
1102 auto &prop = state.getOrAddProperties<
Properties>(); (void)prop;
1104 return ::mlir::failure();
1106 if (::mlir::failed(reader.readAttribute(prop.
member_name)))
1107 return ::mlir::failure();
1109 if (::mlir::failed(reader.readOptionalAttribute(prop.
numDimsPerMap)))
1110 return ::mlir::failure();
1112 if (::mlir::failed(reader.readOptionalAttribute(prop.
tableOffset)))
1113 return ::mlir::failure();
1114 return ::mlir::success();
1118 auto &prop = getProperties(); (void)prop;
1129 return attr.getValue();
1134 return attr ? ::std::optional<::mlir::Attribute>(attr) : (::std::nullopt);
1148 getProperties().member_name = ::mlir::SymbolRefAttr::get(::mlir::Builder((*this)->getContext()).getContext(), attrValue);
1152 getProperties().numDimsPerMap = ::mlir::Builder((*this)->getContext()).getDenseI32ArrayAttr(attrValue);
1156 getProperties().mapOpGroupSizes = ::mlir::Builder((*this)->getContext()).getDenseI32ArrayAttr(attrValue);
1161 build(builder, __state__, std::forward<
decltype(resultType)>(resultType), std::forward<
decltype(
component)>(
component), std::forward<
decltype(member)>(member));
1162 auto __res__ = ::llvm::dyn_cast<MemberReadOp>(builder.create(__state__));
1163 assert(__res__ &&
"builder didn't return the right type");
1168 return create(builder, builder.getLoc(), std::forward<
decltype(resultType)>(resultType), std::forward<
decltype(
component)>(
component), std::forward<
decltype(member)>(member));
1171MemberReadOp MemberReadOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type resultType, ::mlir::Value
component, ::mlir::StringAttr member, ::mlir::Attribute dist, ::mlir::ValueRange mapOperands, std::optional<int32_t> numDims) {
1173 build(builder, __state__, std::forward<
decltype(resultType)>(resultType), std::forward<
decltype(
component)>(
component), std::forward<
decltype(member)>(member), std::forward<
decltype(dist)>(dist), std::forward<
decltype(mapOperands)>(mapOperands), std::forward<
decltype(numDims)>(numDims));
1174 auto __res__ = ::llvm::dyn_cast<MemberReadOp>(builder.create(__state__));
1175 assert(__res__ &&
"builder didn't return the right type");
1179MemberReadOp MemberReadOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type resultType, ::mlir::Value
component, ::mlir::StringAttr member, ::mlir::Attribute dist, ::mlir::ValueRange mapOperands, std::optional<int32_t> numDims) {
1180 return create(builder, builder.getLoc(), std::forward<
decltype(resultType)>(resultType), std::forward<
decltype(
component)>(
component), std::forward<
decltype(member)>(member), std::forward<
decltype(dist)>(dist), std::forward<
decltype(mapOperands)>(mapOperands), std::forward<
decltype(numDims)>(numDims));
1183void MemberReadOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type resultType, ::mlir::Value
component, ::mlir::StringAttr member, ::mlir::SymbolRefAttr dist) {
1184 build(odsBuilder, odsState, resultType,
component, member, dist, ::mlir::ValueRange(), std::nullopt);
1190 build(builder, __state__, std::forward<
decltype(resultType)>(resultType), std::forward<
decltype(
component)>(
component), std::forward<
decltype(member)>(member), std::forward<
decltype(dist)>(dist));
1191 auto __res__ = ::llvm::dyn_cast<MemberReadOp>(builder.create(__state__));
1192 assert(__res__ &&
"builder didn't return the right type");
1197 return create(builder, builder.getLoc(), std::forward<
decltype(resultType)>(resultType), std::forward<
decltype(
component)>(
component), std::forward<
decltype(member)>(member), std::forward<
decltype(dist)>(dist));
1200void MemberReadOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type resultType, ::mlir::Value
component, ::mlir::StringAttr member, ::mlir::IntegerAttr dist) {
1201 build(odsBuilder, odsState, resultType,
component, member, dist, ::mlir::ValueRange(), std::nullopt);
1207 build(builder, __state__, std::forward<
decltype(resultType)>(resultType), std::forward<
decltype(
component)>(
component), std::forward<
decltype(member)>(member), std::forward<
decltype(dist)>(dist));
1208 auto __res__ = ::llvm::dyn_cast<MemberReadOp>(builder.create(__state__));
1209 assert(__res__ &&
"builder didn't return the right type");
1214 return create(builder, builder.getLoc(), std::forward<
decltype(resultType)>(resultType), std::forward<
decltype(
component)>(
component), std::forward<
decltype(member)>(member), std::forward<
decltype(dist)>(dist));
1217MemberReadOp MemberReadOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::mlir::ArrayRef<::mlir::NamedAttribute> attrs) {
1219 build(builder, __state__, std::forward<
decltype(resultTypes)>(resultTypes), std::forward<
decltype(operands)>(operands), std::forward<
decltype(attrs)>(attrs));
1220 auto __res__ = ::llvm::dyn_cast<MemberReadOp>(builder.create(__state__));
1221 assert(__res__ &&
"builder didn't return the right type");
1225MemberReadOp MemberReadOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::mlir::ArrayRef<::mlir::NamedAttribute> attrs) {
1226 return create(builder, builder.getLoc(), std::forward<
decltype(resultTypes)>(resultTypes), std::forward<
decltype(operands)>(operands), std::forward<
decltype(attrs)>(attrs));
1230 ::mlir::Builder odsBuilder(opName.getContext());
1232 properties.
numDimsPerMap = odsBuilder.getDenseI32ArrayAttr({});
1236 auto tblgen_mapOpGroupSizes = getProperties().mapOpGroupSizes; (void)tblgen_mapOpGroupSizes;
1237 if (!tblgen_mapOpGroupSizes)
return emitOpError(
"requires attribute 'mapOpGroupSizes'");
1238 auto tblgen_member_name = getProperties().member_name; (void)tblgen_member_name;
1239 if (!tblgen_member_name)
return emitOpError(
"requires attribute 'member_name'");
1240 auto tblgen_numDimsPerMap = getProperties().numDimsPerMap; (void)tblgen_numDimsPerMap;
1241 auto tblgen_tableOffset = getProperties().tableOffset; (void)tblgen_tableOffset;
1243 if (::mlir::failed(__mlir_ods_local_attr_constraint_Ops4(*
this, tblgen_member_name,
"member_name")))
1244 return ::mlir::failure();
1246 if (::mlir::failed(__mlir_ods_local_attr_constraint_Ops5(*
this, tblgen_tableOffset,
"tableOffset")))
1247 return ::mlir::failure();
1249 if (::mlir::failed(__mlir_ods_local_attr_constraint_Ops6(*
this, tblgen_numDimsPerMap,
"numDimsPerMap")))
1250 return ::mlir::failure();
1252 if (::mlir::failed(__mlir_ods_local_attr_constraint_Ops6(*
this, tblgen_mapOpGroupSizes,
"mapOpGroupSizes")))
1253 return ::mlir::failure();
1255 unsigned index = 0; (void)index;
1258 for (
auto v : valueGroup0) {
1259 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops1(*
this, v.getType(),
"operand", index++)))
1260 return ::mlir::failure();
1263 if (::mlir::failed(::mlir::OpTrait::impl::verifyValueSizeAttr(*
this,
"mapOpGroupSizes",
"mapOperands", valueGroup1.size())))
1264 return ::mlir::failure();
1266 for (
auto v : valueGroup1) {
1267 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops2(*
this, v.getType(),
"operand", index++)))
1268 return ::mlir::failure();
1272 unsigned index = 0; (void)index;
1275 for (
auto v : valueGroup0) {
1276 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops3(*
this, v.getType(),
"result", index++)))
1277 return ::mlir::failure();
1280 return ::mlir::success();
1285 return ::mlir::success();
1286 return ::mlir::failure();
1290 ::mlir::OpAsmParser::UnresolvedOperand componentRawOperand{};
1291 ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> componentOperands(&componentRawOperand, 1); ::llvm::SMLoc componentOperandsLoc;
1292 (void)componentOperandsLoc;
1293 ::mlir::FlatSymbolRefAttr member_nameAttr;
1294 ::llvm::SmallVector<::mlir::OpAsmParser::UnresolvedOperand, 4> mapOperandsOperands;
1295 llvm::SmallVector<int32_t> mapOperandsOperandGroupSizes;
1296 ::llvm::SMLoc mapOperandsOperandsLoc;
1297 (void)mapOperandsOperandsLoc;
1298 ::mlir::DenseI32ArrayAttr numDimsPerMapAttr;
1299 ::mlir::Type componentRawType{};
1300 ::llvm::ArrayRef<::mlir::Type> componentTypes(&componentRawType, 1);
1301 ::mlir::Type valRawType{};
1302 ::llvm::ArrayRef<::mlir::Type> valTypes(&valRawType, 1);
1304 componentOperandsLoc = parser.getCurrentLocation();
1305 if (parser.parseOperand(componentRawOperand))
1306 return ::mlir::failure();
1307 if (parser.parseLSquare())
1308 return ::mlir::failure();
1310 if (parser.parseCustomAttributeWithFallback(member_nameAttr, parser.getBuilder().getType<::mlir::NoneType>())) {
1311 return ::mlir::failure();
1314 if (parser.parseRSquare())
1315 return ::mlir::failure();
1316 if (::mlir::succeeded(parser.parseOptionalLBrace())) {
1318 mapOperandsOperandsLoc = parser.getCurrentLocation();
1319 ::llvm::SmallVector<::llvm::SmallVector<::mlir::OpAsmParser::UnresolvedOperand>> mapOperandsOperandGroups;
1321 if (odsResult) return ::mlir::failure();
1322 for (
const auto &subRange : mapOperandsOperandGroups) {
1323 mapOperandsOperands.append(subRange.begin(), subRange.end());
1324 mapOperandsOperandGroupSizes.push_back(subRange.size());
1326 if (numDimsPerMapAttr)
1329 if (parser.parseRBrace())
1330 return ::mlir::failure();
1332 if (parser.parseColon())
1333 return ::mlir::failure();
1337 if (parser.parseCustomTypeWithFallback(type))
1338 return ::mlir::failure();
1339 componentRawType = type;
1341 if (parser.parseComma())
1342 return ::mlir::failure();
1346 if (parser.parseCustomTypeWithFallback(type))
1347 return ::mlir::failure();
1351 auto loc = parser.getCurrentLocation();(void)loc;
1352 if (parser.parseOptionalAttrDict(result.attributes))
1353 return ::mlir::failure();
1355 return parser.emitError(loc) <<
"'" << result.name.getStringRef() <<
"' op ";
1357 return ::mlir::failure();
1359 result.getOrAddProperties<
MemberReadOp::Properties>().mapOpGroupSizes = parser.getBuilder().getDenseI32ArrayAttr(mapOperandsOperandGroupSizes);
1360 ::mlir::Type odsBuildableType0 = parser.getBuilder().getIndexType();
1361 result.addTypes(valTypes);
1362 if (parser.resolveOperands(componentOperands, componentTypes, componentOperandsLoc, result.operands))
1363 return ::mlir::failure();
1364 if (parser.resolveOperands(mapOperandsOperands, odsBuildableType0, mapOperandsOperandsLoc, result.operands))
1365 return ::mlir::failure();
1366 return ::mlir::success();
1376 _odsPrinter <<
' ' <<
"{";
1380 _odsPrinter <<
' ' <<
":";
1384 if (
auto validType = ::llvm::dyn_cast<::llzk::component::StructType>(type))
1385 _odsPrinter.printStrippedAttrOrType(validType);
1387 _odsPrinter << type;
1392 auto type =
getVal().getType();
1393 if (
auto validType = ::llvm::dyn_cast<::mlir::Type>(type))
1394 _odsPrinter.printStrippedAttrOrType(validType);
1396 _odsPrinter << type;
1398 ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
1399 elidedAttrs.push_back(
"mapOpGroupSizes");
1400 elidedAttrs.push_back(
"member_name");
1401 elidedAttrs.push_back(
"numDimsPerMap");
1403 ::mlir::Builder odsBuilder(getContext());
1405 if(attr && (attr == odsBuilder.getDenseI32ArrayAttr({})))
1406 elidedAttrs.push_back(
"numDimsPerMap");
1408 _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
1412 effects.emplace_back(::mlir::MemoryEffects::Read::get(), 0,
false, ::mlir::SideEffects::DefaultResource::get());
1437 return attr.getValue();
1446 if (!tblgen_member_name)
return emitError(loc,
"'struct.writem' op requires attribute 'member_name'");
1448 if (tblgen_member_name && !((::llvm::isa<::mlir::FlatSymbolRefAttr>(tblgen_member_name))))
1449 return emitError(loc,
"'struct.writem' op attribute 'member_name' failed to satisfy constraint: flat symbol reference attribute");
1450 return ::mlir::success();
1454 ::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
1456 emitError() <<
"expected DictionaryAttr to set properties";
1457 return ::mlir::failure();
1462 auto attr = dict.get(
"member_name");
1464 auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<
decltype(propStorage)>>(attr);
1465 if (convertedAttr) {
1466 propStorage = convertedAttr;
1468 emitError() <<
"Invalid attribute `member_name` in property conversion: " << attr;
1469 return ::mlir::failure();
1473 return ::mlir::success();
1477 ::mlir::SmallVector<::mlir::NamedAttribute> attrs;
1478 ::mlir::Builder odsBuilder{ctx};
1483 attrs.push_back(odsBuilder.getNamedAttr(
"member_name",
1488 return odsBuilder.getDictionaryAttr(attrs);
1493 using llvm::hash_value;
1494 return llvm::hash_combine(
1495 llvm::hash_value(prop.
member_name.getAsOpaquePointer()));
1499 if (name ==
"member_name")
1501 return std::nullopt;
1505 if (name ==
"member_name") {
1518 if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_Ops4(attr,
"member_name", emitError)))
1519 return ::mlir::failure();
1521 return ::mlir::success();
1525 auto &prop = state.getOrAddProperties<
Properties>(); (void)prop;
1526 if (::mlir::failed(reader.readAttribute(prop.
member_name)))
1527 return ::mlir::failure();
1528 return ::mlir::success();
1532 auto &prop = getProperties(); (void)prop;
1538 return attr.getValue();
1542 getProperties().member_name = ::mlir::SymbolRefAttr::get(::mlir::Builder((*this)->getContext()).getContext(), attrValue);
1545void MemberWriteOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value
component, ::mlir::FlatSymbolRefAttr member_name, ::mlir::Value val) {
1547 odsState.addOperands(val);
1548 odsState.getOrAddProperties<
Properties>().member_name = member_name;
1553 build(builder, __state__, std::forward<
decltype(
component)>(
component), std::forward<
decltype(member_name)>(member_name), std::forward<
decltype(val)>(val));
1554 auto __res__ = ::llvm::dyn_cast<MemberWriteOp>(builder.create(__state__));
1555 assert(__res__ &&
"builder didn't return the right type");
1560 return create(builder, builder.getLoc(), std::forward<
decltype(
component)>(
component), std::forward<
decltype(member_name)>(member_name), std::forward<
decltype(val)>(val));
1563void MemberWriteOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value
component, ::mlir::FlatSymbolRefAttr member_name, ::mlir::Value val) {
1565 odsState.addOperands(val);
1566 odsState.getOrAddProperties<
Properties>().member_name = member_name;
1567 assert(resultTypes.size() == 0u &&
"mismatched number of results");
1568 odsState.addTypes(resultTypes);
1573 build(builder, __state__, std::forward<
decltype(resultTypes)>(resultTypes), std::forward<
decltype(
component)>(
component), std::forward<
decltype(member_name)>(member_name), std::forward<
decltype(val)>(val));
1574 auto __res__ = ::llvm::dyn_cast<MemberWriteOp>(builder.create(__state__));
1575 assert(__res__ &&
"builder didn't return the right type");
1580 return create(builder, builder.getLoc(), std::forward<
decltype(resultTypes)>(resultTypes), std::forward<
decltype(
component)>(
component), std::forward<
decltype(member_name)>(member_name), std::forward<
decltype(val)>(val));
1583void MemberWriteOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value
component, ::llvm::StringRef member_name, ::mlir::Value val) {
1585 odsState.addOperands(val);
1586 odsState.getOrAddProperties<
Properties>().member_name = ::mlir::SymbolRefAttr::get(odsBuilder.getContext(), member_name);
1591 build(builder, __state__, std::forward<
decltype(
component)>(
component), std::forward<
decltype(member_name)>(member_name), std::forward<
decltype(val)>(val));
1592 auto __res__ = ::llvm::dyn_cast<MemberWriteOp>(builder.create(__state__));
1593 assert(__res__ &&
"builder didn't return the right type");
1598 return create(builder, builder.getLoc(), std::forward<
decltype(
component)>(
component), std::forward<
decltype(member_name)>(member_name), std::forward<
decltype(val)>(val));
1601void MemberWriteOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value
component, ::llvm::StringRef member_name, ::mlir::Value val) {
1603 odsState.addOperands(val);
1604 odsState.getOrAddProperties<
Properties>().member_name = ::mlir::SymbolRefAttr::get(odsBuilder.getContext(), member_name);
1605 assert(resultTypes.size() == 0u &&
"mismatched number of results");
1606 odsState.addTypes(resultTypes);
1611 build(builder, __state__, std::forward<
decltype(resultTypes)>(resultTypes), std::forward<
decltype(
component)>(
component), std::forward<
decltype(member_name)>(member_name), std::forward<
decltype(val)>(val));
1612 auto __res__ = ::llvm::dyn_cast<MemberWriteOp>(builder.create(__state__));
1613 assert(__res__ &&
"builder didn't return the right type");
1618 return create(builder, builder.getLoc(), std::forward<
decltype(resultTypes)>(resultTypes), std::forward<
decltype(
component)>(
component), std::forward<
decltype(member_name)>(member_name), std::forward<
decltype(val)>(val));
1621void MemberWriteOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
1622 assert(operands.size() == 2u &&
"mismatched number of parameters");
1623 odsState.addOperands(operands);
1624 odsState.addAttributes(attributes);
1625 assert(resultTypes.size() == 0u &&
"mismatched number of return types");
1626 odsState.addTypes(resultTypes);
1628 if (!attributes.empty()) {
1630 ::mlir::PropertyRef properties = odsState.getRawProperties();
1631 std::optional<::mlir::RegisteredOperationName> info =
1632 odsState.name.getRegisteredInfo();
1633 if (failed(info->setOpPropertiesFromAttribute(odsState.name, properties,
1634 odsState.attributes.getDictionary(odsState.getContext()),
nullptr)))
1635 ::llvm::report_fatal_error(
"Property conversion failed.");
1639MemberWriteOp MemberWriteOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
1641 build(builder, __state__, std::forward<
decltype(resultTypes)>(resultTypes), std::forward<
decltype(operands)>(operands), std::forward<
decltype(attributes)>(attributes));
1642 auto __res__ = ::llvm::dyn_cast<MemberWriteOp>(builder.create(__state__));
1643 assert(__res__ &&
"builder didn't return the right type");
1647MemberWriteOp MemberWriteOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
1648 return create(builder, builder.getLoc(), std::forward<
decltype(resultTypes)>(resultTypes), std::forward<
decltype(operands)>(operands), std::forward<
decltype(attributes)>(attributes));
1651void MemberWriteOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands,
const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
1652 assert(operands.size() == 2u &&
"mismatched number of parameters");
1653 odsState.addOperands(operands);
1654 odsState.useProperties(
const_cast<Properties&
>(properties));
1655 odsState.addAttributes(discardableAttributes);
1656 assert(resultTypes.size() == 0u &&
"mismatched number of return types");
1657 odsState.addTypes(resultTypes);
1660MemberWriteOp MemberWriteOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands,
const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
1662 build(builder, __state__, std::forward<
decltype(resultTypes)>(resultTypes), std::forward<
decltype(operands)>(operands), std::forward<
decltype(properties)>(properties), std::forward<
decltype(discardableAttributes)>(discardableAttributes));
1663 auto __res__ = ::llvm::dyn_cast<MemberWriteOp>(builder.create(__state__));
1664 assert(__res__ &&
"builder didn't return the right type");
1669 return create(builder, builder.getLoc(), std::forward<
decltype(resultTypes)>(resultTypes), std::forward<
decltype(operands)>(operands), std::forward<
decltype(properties)>(properties), std::forward<
decltype(discardableAttributes)>(discardableAttributes));
1673 auto tblgen_member_name = getProperties().member_name; (void)tblgen_member_name;
1674 if (!tblgen_member_name)
return emitOpError(
"requires attribute 'member_name'");
1676 if (::mlir::failed(__mlir_ods_local_attr_constraint_Ops4(*
this, tblgen_member_name,
"member_name")))
1677 return ::mlir::failure();
1679 unsigned index = 0; (void)index;
1682 for (
auto v : valueGroup0) {
1683 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops1(*
this, v.getType(),
"operand", index++)))
1684 return ::mlir::failure();
1688 for (
auto v : valueGroup1) {
1689 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops3(*
this, v.getType(),
"operand", index++)))
1690 return ::mlir::failure();
1693 return ::mlir::success();
1701 ::mlir::OpAsmParser::UnresolvedOperand componentRawOperand{};
1702 ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> componentOperands(&componentRawOperand, 1); ::llvm::SMLoc componentOperandsLoc;
1703 (void)componentOperandsLoc;
1704 ::mlir::FlatSymbolRefAttr member_nameAttr;
1705 ::mlir::OpAsmParser::UnresolvedOperand valRawOperand{};
1706 ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> valOperands(&valRawOperand, 1); ::llvm::SMLoc valOperandsLoc;
1707 (void)valOperandsLoc;
1708 ::mlir::Type componentRawType{};
1709 ::llvm::ArrayRef<::mlir::Type> componentTypes(&componentRawType, 1);
1710 ::mlir::Type valRawType{};
1711 ::llvm::ArrayRef<::mlir::Type> valTypes(&valRawType, 1);
1713 componentOperandsLoc = parser.getCurrentLocation();
1714 if (parser.parseOperand(componentRawOperand))
1715 return ::mlir::failure();
1716 if (parser.parseLSquare())
1717 return ::mlir::failure();
1719 if (parser.parseCustomAttributeWithFallback(member_nameAttr, parser.getBuilder().getType<::mlir::NoneType>())) {
1720 return ::mlir::failure();
1723 if (parser.parseRSquare())
1724 return ::mlir::failure();
1725 if (parser.parseEqual())
1726 return ::mlir::failure();
1728 valOperandsLoc = parser.getCurrentLocation();
1729 if (parser.parseOperand(valRawOperand))
1730 return ::mlir::failure();
1731 if (parser.parseColon())
1732 return ::mlir::failure();
1736 if (parser.parseCustomTypeWithFallback(type))
1737 return ::mlir::failure();
1738 componentRawType = type;
1740 if (parser.parseComma())
1741 return ::mlir::failure();
1745 if (parser.parseCustomTypeWithFallback(type))
1746 return ::mlir::failure();
1750 auto loc = parser.getCurrentLocation();(void)loc;
1751 if (parser.parseOptionalAttrDict(result.attributes))
1752 return ::mlir::failure();
1754 return parser.emitError(loc) <<
"'" << result.name.getStringRef() <<
"' op ";
1756 return ::mlir::failure();
1758 if (parser.resolveOperands(componentOperands, componentTypes, componentOperandsLoc, result.operands))
1759 return ::mlir::failure();
1760 if (parser.resolveOperands(valOperands, valTypes, valOperandsLoc, result.operands))
1761 return ::mlir::failure();
1762 return ::mlir::success();
1771 _odsPrinter <<
' ' <<
"=";
1774 _odsPrinter <<
' ' <<
":";
1778 if (
auto validType = ::llvm::dyn_cast<::llzk::component::StructType>(type))
1779 _odsPrinter.printStrippedAttrOrType(validType);
1781 _odsPrinter << type;
1786 auto type =
getVal().getType();
1787 if (
auto validType = ::llvm::dyn_cast<::mlir::Type>(type))
1788 _odsPrinter.printStrippedAttrOrType(validType);
1790 _odsPrinter << type;
1792 ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
1793 elidedAttrs.push_back(
"member_name");
1794 _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
1798 effects.emplace_back(::mlir::MemoryEffects::Write::get(), 0,
false, ::mlir::SideEffects::DefaultResource::get());
1823 return attr.getValue();
1832 if (!tblgen_sym_name)
return emitError(loc,
"'struct.def' op requires attribute 'sym_name'");
1834 if (tblgen_sym_name && !((::llvm::isa<::mlir::StringAttr>(tblgen_sym_name))))
1835 return emitError(loc,
"'struct.def' op attribute 'sym_name' failed to satisfy constraint: string attribute");
1836 return ::mlir::success();
1840 ::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
1842 emitError() <<
"expected DictionaryAttr to set properties";
1843 return ::mlir::failure();
1848 auto attr = dict.get(
"sym_name");
1850 auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<
decltype(propStorage)>>(attr);
1851 if (convertedAttr) {
1852 propStorage = convertedAttr;
1854 emitError() <<
"Invalid attribute `sym_name` in property conversion: " << attr;
1855 return ::mlir::failure();
1859 return ::mlir::success();
1863 ::mlir::SmallVector<::mlir::NamedAttribute> attrs;
1864 ::mlir::Builder odsBuilder{ctx};
1867 const auto &propStorage = prop.
sym_name;
1869 attrs.push_back(odsBuilder.getNamedAttr(
"sym_name",
1874 return odsBuilder.getDictionaryAttr(attrs);
1879 using llvm::hash_value;
1880 return llvm::hash_combine(
1881 llvm::hash_value(prop.
sym_name.getAsOpaquePointer()));
1885 if (name ==
"sym_name")
1887 return std::nullopt;
1891 if (name ==
"sym_name") {
1892 prop.
sym_name = ::llvm::dyn_cast_or_null<std::remove_reference_t<
decltype(prop.
sym_name)>>(value);
1901::llvm::LogicalResult
StructDefOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
1904 if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_Ops1(attr,
"sym_name", emitError)))
1905 return ::mlir::failure();
1907 return ::mlir::success();
1912 return attr.getValue();
1916 getProperties().sym_name = ::mlir::Builder((*this)->getContext()).getStringAttr(attrValue);
1919void StructDefOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::StringAttr sym_name) {
1920 odsState.getOrAddProperties<
Properties>().sym_name = sym_name;
1921 (void)odsState.addRegion();
1926 build(builder, __state__, std::forward<
decltype(sym_name)>(sym_name));
1927 auto __res__ = ::llvm::dyn_cast<StructDefOp>(builder.create(__state__));
1928 assert(__res__ &&
"builder didn't return the right type");
1933 return create(builder, builder.getLoc(), std::forward<
decltype(sym_name)>(sym_name));
1936void StructDefOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::StringAttr sym_name) {
1937 odsState.getOrAddProperties<
Properties>().sym_name = sym_name;
1938 (void)odsState.addRegion();
1939 assert(resultTypes.size() == 0u &&
"mismatched number of results");
1940 odsState.addTypes(resultTypes);
1945 build(builder, __state__, std::forward<
decltype(resultTypes)>(resultTypes), std::forward<
decltype(sym_name)>(sym_name));
1946 auto __res__ = ::llvm::dyn_cast<StructDefOp>(builder.create(__state__));
1947 assert(__res__ &&
"builder didn't return the right type");
1952 return create(builder, builder.getLoc(), std::forward<
decltype(resultTypes)>(resultTypes), std::forward<
decltype(sym_name)>(sym_name));
1955void StructDefOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::llvm::StringRef sym_name) {
1956 odsState.getOrAddProperties<
Properties>().sym_name = odsBuilder.getStringAttr(sym_name);
1957 (void)odsState.addRegion();
1962 build(builder, __state__, std::forward<
decltype(sym_name)>(sym_name));
1963 auto __res__ = ::llvm::dyn_cast<StructDefOp>(builder.create(__state__));
1964 assert(__res__ &&
"builder didn't return the right type");
1969 return create(builder, builder.getLoc(), std::forward<
decltype(sym_name)>(sym_name));
1972void StructDefOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::llvm::StringRef sym_name) {
1973 odsState.getOrAddProperties<
Properties>().sym_name = odsBuilder.getStringAttr(sym_name);
1974 (void)odsState.addRegion();
1975 assert(resultTypes.size() == 0u &&
"mismatched number of results");
1976 odsState.addTypes(resultTypes);
1981 build(builder, __state__, std::forward<
decltype(resultTypes)>(resultTypes), std::forward<
decltype(sym_name)>(sym_name));
1982 auto __res__ = ::llvm::dyn_cast<StructDefOp>(builder.create(__state__));
1983 assert(__res__ &&
"builder didn't return the right type");
1988 return create(builder, builder.getLoc(), std::forward<
decltype(resultTypes)>(resultTypes), std::forward<
decltype(sym_name)>(sym_name));
1991void StructDefOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
1992 assert(operands.size() == 0u &&
"mismatched number of parameters");
1993 odsState.addOperands(operands);
1994 odsState.addAttributes(attributes);
1995 for (
unsigned i = 0; i != 1; ++i)
1996 (
void)odsState.addRegion();
1997 assert(resultTypes.size() == 0u &&
"mismatched number of return types");
1998 odsState.addTypes(resultTypes);
2000 if (!attributes.empty()) {
2002 ::mlir::PropertyRef properties = odsState.getRawProperties();
2003 std::optional<::mlir::RegisteredOperationName> info =
2004 odsState.name.getRegisteredInfo();
2005 if (failed(info->setOpPropertiesFromAttribute(odsState.name, properties,
2006 odsState.attributes.getDictionary(odsState.getContext()),
nullptr)))
2007 ::llvm::report_fatal_error(
"Property conversion failed.");
2011StructDefOp StructDefOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
2013 build(builder, __state__, std::forward<
decltype(resultTypes)>(resultTypes), std::forward<
decltype(operands)>(operands), std::forward<
decltype(attributes)>(attributes));
2014 auto __res__ = ::llvm::dyn_cast<StructDefOp>(builder.create(__state__));
2015 assert(__res__ &&
"builder didn't return the right type");
2019StructDefOp StructDefOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
2020 return create(builder, builder.getLoc(), std::forward<
decltype(resultTypes)>(resultTypes), std::forward<
decltype(operands)>(operands), std::forward<
decltype(attributes)>(attributes));
2023void StructDefOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands,
const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
2024 assert(operands.size() == 0u &&
"mismatched number of parameters");
2025 odsState.addOperands(operands);
2026 odsState.useProperties(
const_cast<Properties&
>(properties));
2027 odsState.addAttributes(discardableAttributes);
2028 for (
unsigned i = 0; i != 1; ++i)
2029 (
void)odsState.addRegion();
2030 assert(resultTypes.size() == 0u &&
"mismatched number of return types");
2031 odsState.addTypes(resultTypes);
2034StructDefOp StructDefOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands,
const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
2036 build(builder, __state__, std::forward<
decltype(resultTypes)>(resultTypes), std::forward<
decltype(operands)>(operands), std::forward<
decltype(properties)>(properties), std::forward<
decltype(discardableAttributes)>(discardableAttributes));
2037 auto __res__ = ::llvm::dyn_cast<StructDefOp>(builder.create(__state__));
2038 assert(__res__ &&
"builder didn't return the right type");
2042StructDefOp StructDefOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands,
const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
2043 return create(builder, builder.getLoc(), std::forward<
decltype(resultTypes)>(resultTypes), std::forward<
decltype(operands)>(operands), std::forward<
decltype(properties)>(properties), std::forward<
decltype(discardableAttributes)>(discardableAttributes));
2047 auto tblgen_sym_name = getProperties().sym_name; (void)tblgen_sym_name;
2048 if (!tblgen_sym_name)
return emitOpError(
"requires attribute 'sym_name'");
2050 if (::mlir::failed(__mlir_ods_local_attr_constraint_Ops1(*
this, tblgen_sym_name,
"sym_name")))
2051 return ::mlir::failure();
2053 unsigned index = 0; (void)index;
2055 for (
auto ®ion : ::llvm::MutableArrayRef((*this)->getRegion(0)))
2056 if (::mlir::failed(__mlir_ods_local_region_constraint_Ops1(*
this, region,
"bodyRegion", index++)))
2057 return ::mlir::failure();
2059 return ::mlir::success();
2067 ::mlir::StringAttr sym_nameAttr;
2068 std::unique_ptr<::mlir::Region> bodyRegionRegion = std::make_unique<::mlir::Region>();
2070 if (parser.parseSymbolName(sym_nameAttr))
2071 return ::mlir::failure();
2074 if (parser.parseRegion(*bodyRegionRegion))
2075 return ::mlir::failure();
2077 if (bodyRegionRegion->empty()) bodyRegionRegion->emplaceBlock();
2079 auto loc = parser.getCurrentLocation();(void)loc;
2080 if (parser.parseOptionalAttrDict(result.attributes))
2081 return ::mlir::failure();
2083 return parser.emitError(loc) <<
"'" << result.name.getStringRef() <<
"' op ";
2085 return ::mlir::failure();
2087 result.addRegion(std::move(bodyRegionRegion));
2088 return ::mlir::success();
2096 ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
2097 elidedAttrs.push_back(
"sym_name");
2098 _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
::llvm::LogicalResult verify(::mlir::Location loc)
CreateStructOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
CreateStructOpAdaptor(CreateStructOp op)
::mlir::ValueRange getOperands()
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result)
::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
::mlir::Operation::result_range getODSResults(unsigned index)
::llvm::LogicalResult verifyInvariantsImpl()
static std::optional< mlir::Attribute > getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name)
::llvm::LogicalResult verifyInvariants()
static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value)
::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
FoldAdaptor::Properties Properties
static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs)
static constexpr ::llvm::StringLiteral getOperationName()
::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop)
::mlir::TypedValue<::llzk::component::StructType > getResult()
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
static CreateStructOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result)
void print(::mlir::OpAsmPrinter &_odsPrinter)
static llvm::hash_code computePropertiesHash(const Properties &prop)
MemberDefOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
::llvm::LogicalResult verify(::mlir::Location loc)
MemberDefOpAdaptor(MemberDefOp op)
::mlir::ValueRange getOperands()
::llvm::StringRef getSymName()
void setSignal(bool attrValue)
::mlir::StringAttr getTypeAttrName()
::mlir::StringAttr getColumnAttrName()
::llvm::LogicalResult verifyInvariants()
static std::optional< mlir::Attribute > getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name)
::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs)
::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
::llvm::LogicalResult verifyInvariantsImpl()
::mlir::UnitAttr getSignalAttr()
void print(::mlir::OpAsmPrinter &_odsPrinter)
::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop)
static constexpr ::llvm::StringLiteral getOperationName()
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)
void setColumn(bool attrValue)
::mlir::TypeAttr getTypeAttr()
static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value)
::mlir::StringAttr getSignalAttrName()
static llvm::hash_code computePropertiesHash(const Properties &prop)
::mlir::StringAttr getSymNameAttr()
void writeProperties(::mlir::DialectBytecodeWriter &writer)
void setType(::mlir::Type attrValue)
static MemberDefOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::StringAttr sym_name, ::mlir::TypeAttr type, bool isSignal=false, bool isColumn=false)
::llvm::LogicalResult verify()
FoldAdaptor::Properties Properties
void setSymName(::llvm::StringRef attrValue)
::mlir::UnitAttr getColumnAttr()
::mlir::StringAttr getSymNameAttrName()
MemberReadOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
MemberReadOpAdaptor(MemberReadOp op)
::llvm::LogicalResult verify(::mlir::Location loc)
::mlir::ValueRange getOperands()
::mlir::MutableOperandRangeRange getMapOperandsMutable()
static std::optional< mlir::Attribute > getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name)
static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs)
::mlir::TypedValue<::llzk::component::StructType > getComponent()
static llvm::hash_code computePropertiesHash(const Properties &prop)
static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value)
void setMapOpGroupSizes(::llvm::ArrayRef< int32_t > attrValue)
::mlir::TypedValue<::mlir::Type > getVal()
static MemberReadOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type resultType, ::mlir::Value component, ::mlir::StringAttr member)
::std::optional<::mlir::Attribute > getTableOffset()
::mlir::OperandRangeRange getMapOperands()
bool isRead()
Return true if the op is a read, false if it's a write.
::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop)
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type resultType, ::mlir::Value component, ::mlir::StringAttr member)
::llvm::LogicalResult verifyInvariantsImpl()
static void populateDefaultProperties(::mlir::OperationName opName, Properties &properties)
::mlir::FlatSymbolRefAttr getMemberNameAttr()
::llvm::ArrayRef< int32_t > getMapOpGroupSizes()
::mlir::StringAttr getMapOpGroupSizesAttrName()
void setNumDimsPerMap(::llvm::ArrayRef< int32_t > attrValue)
::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index)
::mlir::Operation::result_range getODSResults(unsigned index)
::llvm::LogicalResult verifyInvariants()
::llvm::ArrayRef< int32_t > getNumDimsPerMap()
void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect > > &effects)
::llvm::StringRef getMemberName()
static constexpr ::llvm::StringLiteral getOperationName()
::mlir::StringAttr getTableOffsetAttrName()
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
void writeProperties(::mlir::DialectBytecodeWriter &writer)
::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state)
::llvm::LogicalResult verify()
::mlir::Operation::operand_range getODSOperands(unsigned index)
::mlir::Attribute getTableOffsetAttr()
void setMemberName(::llvm::StringRef attrValue)
::mlir::StringAttr getMemberNameAttrName()
::mlir::DenseI32ArrayAttr getMapOpGroupSizesAttr()
void print(::mlir::OpAsmPrinter &_odsPrinter)
::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
FoldAdaptor::Properties Properties
::mlir::DenseI32ArrayAttr getNumDimsPerMapAttr()
::mlir::StringAttr getNumDimsPerMapAttrName()
MemberWriteOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
::llvm::LogicalResult verify(::mlir::Location loc)
MemberWriteOpAdaptor(MemberWriteOp op)
::mlir::ValueRange getOperands()
void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect > > &effects)
::mlir::TypedValue<::llzk::component::StructType > getComponent()
void setMemberName(::llvm::StringRef attrValue)
FoldAdaptor::Properties Properties
static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs)
::mlir::FlatSymbolRefAttr getMemberNameAttr()
bool isRead()
Return true if the op is a read, false if it's a write.
::llvm::LogicalResult verifyInvariants()
void print(::mlir::OpAsmPrinter &_odsPrinter)
static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value)
::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state)
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value component, ::mlir::FlatSymbolRefAttr member_name, ::mlir::Value val)
void writeProperties(::mlir::DialectBytecodeWriter &writer)
static constexpr ::llvm::StringLiteral getOperationName()
::llvm::StringRef getMemberName()
::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop)
::mlir::Operation::operand_range getODSOperands(unsigned index)
::llvm::LogicalResult verifyInvariantsImpl()
static std::optional< mlir::Attribute > getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name)
static MemberWriteOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value component, ::mlir::FlatSymbolRefAttr member_name, ::mlir::Value val)
::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
::mlir::TypedValue<::mlir::Type > getVal()
::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
static llvm::hash_code computePropertiesHash(const Properties &prop)
::mlir::StringAttr getMemberNameAttrName()
StructDefOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
StructDefOpAdaptor(StructDefOp op)
::llvm::LogicalResult verify(::mlir::Location loc)
::mlir::ValueRange getOperands()
static llvm::hash_code computePropertiesHash(const Properties &prop)
static std::optional< mlir::Attribute > getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name)
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::StringAttr sym_name)
static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value)
::mlir::Region & getBodyRegion()
static constexpr ::llvm::StringLiteral getOperationName()
static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs)
::llvm::LogicalResult verifyInvariants()
::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop)
::llvm::StringRef getSymName()
FoldAdaptor::Properties Properties
static StructDefOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::StringAttr sym_name)
::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
::mlir::StringAttr getSymNameAttr()
void setSymName(::llvm::StringRef attrValue)
::llvm::LogicalResult verifyInvariantsImpl()
::mlir::StringAttr getSymNameAttrName()
void print(::mlir::OpAsmPrinter &_odsPrinter)
CreateStructOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
const Properties & getProperties()
::std::optional<::mlir::OperationName > odsOpName
::mlir::RegionRange odsRegions
::mlir::DictionaryAttr odsAttrs
::mlir::RegionRange odsRegions
::mlir::StringAttr getSymNameAttr()
::llvm::StringRef getSymName()
const Properties & getProperties()
::mlir::UnitAttr getColumnAttr()
::mlir::DictionaryAttr odsAttrs
::mlir::UnitAttr getSignalAttr()
MemberDefOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
::std::optional<::mlir::OperationName > odsOpName
::mlir::TypeAttr getTypeAttr()
::mlir::DictionaryAttr odsAttrs
const Properties & getProperties()
::mlir::RegionRange odsRegions
::std::optional<::mlir::Attribute > getTableOffset()
::llvm::ArrayRef< int32_t > getNumDimsPerMap()
::mlir::DenseI32ArrayAttr getMapOpGroupSizesAttr()
::mlir::Attribute getTableOffsetAttr()
::llvm::ArrayRef< int32_t > getMapOpGroupSizes()
MemberReadOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
::std::optional<::mlir::OperationName > odsOpName
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize)
::llvm::StringRef getMemberName()
::mlir::FlatSymbolRefAttr getMemberNameAttr()
::mlir::DenseI32ArrayAttr getNumDimsPerMapAttr()
MemberWriteOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
::llvm::StringRef getMemberName()
::std::optional<::mlir::OperationName > odsOpName
::mlir::DictionaryAttr odsAttrs
const Properties & getProperties()
::mlir::FlatSymbolRefAttr getMemberNameAttr()
::mlir::RegionRange odsRegions
::mlir::RegionRange getRegions()
::mlir::RegionRange odsRegions
::mlir::DictionaryAttr odsAttrs
StructDefOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
::mlir::StringAttr getSymNameAttr()
::std::optional<::mlir::OperationName > odsOpName
::llvm::StringRef getSymName()
const Properties & getProperties()
Common interface for operations that read or write from a struct member.
Common interface for constant parameter-like symbol operations that can be defined within a TemplateO...
bool isValidType(Type type)
void printMultiDimAndSymbolList(mlir::OpAsmPrinter &printer, mlir::Operation *op, mlir::OperandRangeRange multiMapOperands, mlir::DenseI32ArrayAttr numDimsPerMap)
mlir::ParseResult parseMultiDimAndSymbolList(mlir::OpAsmParser &parser, mlir::SmallVector< mlir::SmallVector< mlir::OpAsmParser::UnresolvedOperand > > &multiMapOperands, mlir::DenseI32ArrayAttr &numDimsPerMap)
mapOpGroupSizesTy mapOpGroupSizes
numDimsPerMapTy numDimsPerMap
tableOffsetTy tableOffset
member_nameTy member_name
member_nameTy member_name