33static ::llvm::LogicalResult __mlir_ods_local_type_constraint_Ops1(
34 ::mlir::Operation *op, ::mlir::Type type, ::llvm::StringRef valueKind,
35 unsigned valueIndex) {
36 if (!((::llvm::isa<::mlir::IndexType>(type)))) {
37 return op->emitOpError(valueKind) <<
" #" << valueIndex
38 <<
" must be variadic of index, but got " << type;
40 return ::mlir::success();
43static ::llvm::LogicalResult __mlir_ods_local_type_constraint_Ops2(
44 ::mlir::Operation *op, ::mlir::Type type, ::llvm::StringRef valueKind,
45 unsigned valueIndex) {
46 if (!((::llvm::isa<::mlir::IndexType>(type)))) {
47 return op->emitOpError(valueKind) <<
" #" << valueIndex
48 <<
" must be index, but got " << type;
50 return ::mlir::success();
53static ::llvm::LogicalResult __mlir_ods_local_type_constraint_Ops3(
54 ::mlir::Operation *op, ::mlir::Type type, ::llvm::StringRef valueKind,
55 unsigned valueIndex) {
57 return op->emitOpError(valueKind) <<
" #" << valueIndex
58 <<
" must be integral, felt, or typevar type, but got " << type;
60 return ::mlir::success();
63static ::llvm::LogicalResult __mlir_ods_local_type_constraint_Ops4(
64 ::mlir::Operation *op, ::mlir::Type type, ::llvm::StringRef valueKind,
65 unsigned valueIndex) {
67 return op->emitOpError(valueKind) <<
" #" << valueIndex
68 <<
" must be a valid LLZK type, but got " << type;
70 return ::mlir::success();
73static ::llvm::LogicalResult __mlir_ods_local_attr_constraint_Ops1(
74 ::mlir::Attribute attr, ::llvm::StringRef attrName, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
75 if (attr && !((::llvm::isa<::mlir::AffineMapAttr>(attr))))
76 return emitError() <<
"attribute '" << attrName
77 <<
"' failed to satisfy constraint: AffineMap attribute";
78 return ::mlir::success();
80static ::llvm::LogicalResult __mlir_ods_local_attr_constraint_Ops1(
81 ::mlir::Operation *op, ::mlir::Attribute attr, ::llvm::StringRef attrName) {
82 return __mlir_ods_local_attr_constraint_Ops1(attr, attrName, [op]() {
83 return op->emitOpError();
87static ::llvm::LogicalResult __mlir_ods_local_attr_constraint_Ops2(
88 ::mlir::Attribute attr, ::llvm::StringRef attrName, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
89 if (attr && !(((::llvm::isa<::mlir::IntegerAttr>(attr))) && ((::llvm::isa<::mlir::IndexType>(::llvm::cast<::mlir::IntegerAttr>(attr).getType())))))
90 return emitError() <<
"attribute '" << attrName
91 <<
"' failed to satisfy constraint: index attribute";
92 return ::mlir::success();
94static ::llvm::LogicalResult __mlir_ods_local_attr_constraint_Ops2(
95 ::mlir::Operation *op, ::mlir::Attribute attr, ::llvm::StringRef attrName) {
96 return __mlir_ods_local_attr_constraint_Ops2(attr, attrName, [op]() {
97 return op->emitOpError();
101static ::llvm::LogicalResult __mlir_ods_local_attr_constraint_Ops3(
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_Ops3(
109 ::mlir::Operation *op, ::mlir::Attribute attr, ::llvm::StringRef attrName) {
110 return __mlir_ods_local_attr_constraint_Ops3(attr, attrName, [op]() {
111 return op->emitOpError();
115static ::llvm::LogicalResult __mlir_ods_local_attr_constraint_Ops4(
116 ::mlir::Attribute attr, ::llvm::StringRef attrName, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
117 if (attr && !((::llvm::isa<::mlir::StringAttr>(attr))))
118 return emitError() <<
"attribute '" << attrName
119 <<
"' failed to satisfy constraint: string attribute";
120 return ::mlir::success();
122static ::llvm::LogicalResult __mlir_ods_local_attr_constraint_Ops4(
123 ::mlir::Operation *op, ::mlir::Attribute attr, ::llvm::StringRef attrName) {
124 return __mlir_ods_local_attr_constraint_Ops4(attr, attrName, [op]() {
125 return op->emitOpError();
129static ::llvm::LogicalResult __mlir_ods_local_attr_constraint_Ops5(
130 ::mlir::Attribute attr, ::llvm::StringRef attrName, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
131 if (attr && !(((::llvm::isa<::mlir::TypeAttr>(attr))) && ((::llvm::isa<::mlir::Type>(::llvm::cast<::mlir::TypeAttr>(attr).getValue()))) && ((
::llzk::isValidConstReadType(::llvm::cast<::mlir::TypeAttr>(attr).getValue())))))
132 return emitError() <<
"attribute '" << attrName
133 <<
"' failed to satisfy constraint: type attribute of integral, felt, or typevar type";
134 return ::mlir::success();
136static ::llvm::LogicalResult __mlir_ods_local_attr_constraint_Ops5(
137 ::mlir::Operation *op, ::mlir::Attribute attr, ::llvm::StringRef attrName) {
138 return __mlir_ods_local_attr_constraint_Ops5(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();
166 bool isVariadic[] = {
true};
167 int prevVariadicCount = 0;
168 for (
unsigned i = 0; i < index; ++i)
169 if (isVariadic[i]) ++prevVariadicCount;
173 int variadicSize = (odsOperandsSize - 0) / 1;
178 int start = index + (variadicSize - 1) * prevVariadicCount;
179 int size = isVariadic[index] ? variadicSize : 1;
180 return {start, size};
185 return attr.getValue();
190 return attr.getValue();
198 if (!tblgen_map)
return emitError(loc,
"'poly.applymap' op ""requires attribute 'map'");
200 if (!tblgen_numDims)
return emitError(loc,
"'poly.applymap' op ""requires attribute 'numDims'");
202 if (tblgen_map && !((::llvm::isa<::mlir::AffineMapAttr>(tblgen_map))))
203 return emitError(loc,
"'poly.applymap' op ""attribute 'map' failed to satisfy constraint: AffineMap attribute");
205 if (tblgen_numDims && !(((::llvm::isa<::mlir::IntegerAttr>(tblgen_numDims))) && ((::llvm::isa<::mlir::IndexType>(::llvm::cast<::mlir::IntegerAttr>(tblgen_numDims).getType())))))
206 return emitError(loc,
"'poly.applymap' op ""attribute 'numDims' failed to satisfy constraint: index attribute");
207 return ::mlir::success();
211 bool isVariadic[] = {
true};
212 int prevVariadicCount = 0;
213 for (
unsigned i = 0; i < index; ++i)
214 if (isVariadic[i]) ++prevVariadicCount;
218 int variadicSize = (getOperation()->getNumOperands() - 0) / 1;
223 int start = index + (variadicSize - 1) * prevVariadicCount;
224 int size = isVariadic[index] ? variadicSize : 1;
225 return {start, size};
230 auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
235 ::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
237 emitError() <<
"expected DictionaryAttr to set properties";
238 return ::mlir::failure();
242 auto &propStorage = prop.
map;
243 auto attr = dict.get(
"map");
245 auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<
decltype(propStorage)>>(attr);
247 propStorage = convertedAttr;
249 emitError() <<
"Invalid attribute `map` in property conversion: " << attr;
250 return ::mlir::failure();
256 auto &propStorage = prop.
numDims;
257 auto attr = dict.get(
"numDims");
259 auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<
decltype(propStorage)>>(attr);
261 propStorage = convertedAttr;
263 emitError() <<
"Invalid attribute `numDims` in property conversion: " << attr;
264 return ::mlir::failure();
268 return ::mlir::success();
272 ::mlir::SmallVector<::mlir::NamedAttribute> attrs;
273 ::mlir::Builder odsBuilder{ctx};
276 const auto &propStorage = prop.
map;
278 attrs.push_back(odsBuilder.getNamedAttr(
"map",
283 const auto &propStorage = prop.
numDims;
285 attrs.push_back(odsBuilder.getNamedAttr(
"numDims",
290 return odsBuilder.getDictionaryAttr(attrs);
295 return llvm::hash_combine(
296 llvm::hash_value(prop.
map.getAsOpaquePointer()),
297 llvm::hash_value(prop.
numDims.getAsOpaquePointer()));
304 if (name ==
"numDims")
311 prop.
map = ::llvm::dyn_cast_or_null<std::remove_reference_t<
decltype(prop.
map)>>(value);
315 if (name ==
"numDims") {
316 prop.
numDims = ::llvm::dyn_cast_or_null<std::remove_reference_t<
decltype(prop.
numDims)>>(value);
322 if (prop.
map) attrs.append(
"map", prop.
map);
327::llvm::LogicalResult
ApplyMapOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
330 if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_Ops1(attr,
"map", emitError)))
331 return ::mlir::failure();
336 if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_Ops2(attr,
"numDims", emitError)))
337 return ::mlir::failure();
339 return ::mlir::success();
343 auto &prop = state.getOrAddProperties<
Properties>(); (void)prop;
344 if (::mlir::failed(reader.readAttribute(prop.
map)))
345 return ::mlir::failure();
347 if (::mlir::failed(reader.readAttribute(prop.
numDims)))
348 return ::mlir::failure();
349 return ::mlir::success();
353 auto &prop = getProperties(); (void)prop;
354 writer.writeAttribute(prop.
map);
355 writer.writeAttribute(prop.
numDims);
360 return attr.getValue();
365 return attr.getValue();
369 getProperties().map = ::mlir::AffineMapAttr::get(attrValue);
373 getProperties().numDims = ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIndexType(), attrValue);
376void ApplyMapOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::AffineMapAttr map, ::mlir::ValueRange mapOperands) {
377 odsState.addOperands(mapOperands);
380 props.
setNumDims(odsBuilder.getIntegerAttr(odsBuilder.getIndexType(),
381 map.getAffineMap().getNumDims()));
382 odsState.addTypes(odsBuilder.getIndexType());
386void ApplyMapOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::AffineMap map, ::mlir::ValueRange mapOperands) {
387 build(odsBuilder, odsState, ::mlir::AffineMapAttr::get(map), mapOperands);
391void ApplyMapOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::AffineExpr expr, ::mlir::ValueRange mapOperands) {
392 auto map = ::mlir::AffineMap::inferFromExprList({expr}, odsBuilder.getContext()).front();
393 build(odsBuilder, odsState, map, mapOperands);
398 auto tblgen_map = getProperties().map; (void)tblgen_map;
399 if (!tblgen_map)
return emitOpError(
"requires attribute 'map'");
400 auto tblgen_numDims = getProperties().numDims; (void)tblgen_numDims;
401 if (!tblgen_numDims)
return emitOpError(
"requires attribute 'numDims'");
403 if (::mlir::failed(__mlir_ods_local_attr_constraint_Ops1(*
this, tblgen_map,
"map")))
404 return ::mlir::failure();
406 if (::mlir::failed(__mlir_ods_local_attr_constraint_Ops2(*
this, tblgen_numDims,
"numDims")))
407 return ::mlir::failure();
409 unsigned index = 0; (void)index;
412 for (
auto v : valueGroup0) {
413 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops1(*
this, v.getType(),
"operand", index++)))
414 return ::mlir::failure();
418 unsigned index = 0; (void)index;
421 for (
auto v : valueGroup0) {
422 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops2(*
this, v.getType(),
"result", index++)))
423 return ::mlir::failure();
426 return ::mlir::success();
431 return ::mlir::success();
432 return ::mlir::failure();
435::llvm::LogicalResult
ApplyMapOp::inferReturnTypes(::mlir::MLIRContext *context, ::std::optional<::mlir::Location> location, ::mlir::ValueRange operands, ::mlir::DictionaryAttr attributes, ::mlir::OpaqueProperties properties, ::mlir::RegionRange regions, ::llvm::SmallVectorImpl<::mlir::Type>&inferredReturnTypes) {
436 inferredReturnTypes.resize(1);
437 ::mlir::Builder odsBuilder(context);
438 ::mlir::Type odsInferredType0 = odsBuilder.getIndexType();
439 inferredReturnTypes[0] = odsInferredType0;
440 return ::mlir::success();
443::mlir::ParseResult
ApplyMapOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
444 ::llvm::SmallVector<::mlir::OpAsmParser::UnresolvedOperand, 4> mapOperandsOperands;
445 ::llvm::SMLoc mapOperandsOperandsLoc;
446 (void)mapOperandsOperandsLoc;
447 ::mlir::IntegerAttr numDimsAttr;
448 ::mlir::AffineMapAttr mapAttr;
450 mapOperandsOperandsLoc = parser.getCurrentLocation();
452 if (odsResult) return ::mlir::failure();
456 if (parser.parseCustomAttributeWithFallback(mapAttr, parser.getBuilder().getIndexType())) {
457 return ::mlir::failure();
461 auto loc = parser.getCurrentLocation();(void)loc;
462 if (parser.parseOptionalAttrDict(result.attributes))
463 return ::mlir::failure();
465 return parser.emitError(loc) <<
"'" << result.name.getStringRef() <<
"' op ";
467 return ::mlir::failure();
469 ::mlir::Type odsBuildableType0 = parser.getBuilder().getIndexType();
470 result.addTypes(odsBuildableType0);
471 if (parser.resolveOperands(mapOperandsOperands, odsBuildableType0, mapOperandsOperandsLoc, result.operands))
472 return ::mlir::failure();
473 return ::mlir::success();
480 _odsPrinter.printAttributeWithoutType(
getMapAttr());
481 ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
482 elidedAttrs.push_back(
"numDims");
483 elidedAttrs.push_back(
"map");
484 _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
487void ApplyMapOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
495namespace polymorphic {
506 return attr.getValue();
514 if (!tblgen_const_name)
return emitError(loc,
"'poly.read_const' op ""requires attribute 'const_name'");
516 if (tblgen_const_name && !((::llvm::isa<::mlir::FlatSymbolRefAttr>(tblgen_const_name))))
517 return emitError(loc,
"'poly.read_const' op ""attribute 'const_name' failed to satisfy constraint: flat symbol reference attribute");
518 return ::mlir::success();
522 ::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
524 emitError() <<
"expected DictionaryAttr to set properties";
525 return ::mlir::failure();
530 auto attr = dict.get(
"const_name");
532 auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<
decltype(propStorage)>>(attr);
534 propStorage = convertedAttr;
536 emitError() <<
"Invalid attribute `const_name` in property conversion: " << attr;
537 return ::mlir::failure();
541 return ::mlir::success();
545 ::mlir::SmallVector<::mlir::NamedAttribute> attrs;
546 ::mlir::Builder odsBuilder{ctx};
551 attrs.push_back(odsBuilder.getNamedAttr(
"const_name",
556 return odsBuilder.getDictionaryAttr(attrs);
561 return llvm::hash_combine(
562 llvm::hash_value(prop.
const_name.getAsOpaquePointer()));
566 if (name ==
"const_name")
572 if (name ==
"const_name") {
573 prop.
const_name = ::llvm::dyn_cast_or_null<std::remove_reference_t<
decltype(prop.
const_name)>>(value);
582::llvm::LogicalResult
ConstReadOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
585 if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_Ops3(attr,
"const_name", emitError)))
586 return ::mlir::failure();
588 return ::mlir::success();
592 auto &prop = state.getOrAddProperties<
Properties>(); (void)prop;
593 if (::mlir::failed(reader.readAttribute(prop.
const_name)))
594 return ::mlir::failure();
595 return ::mlir::success();
599 auto &prop = getProperties(); (void)prop;
605 return attr.getValue();
609 getProperties().const_name = ::mlir::SymbolRefAttr::get(::mlir::Builder((*this)->getContext()).getContext(), attrValue);
612void ConstReadOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type val, ::mlir::FlatSymbolRefAttr const_name) {
613 odsState.getOrAddProperties<
Properties>().const_name = const_name;
614 odsState.addTypes(val);
617void ConstReadOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::FlatSymbolRefAttr const_name) {
618 odsState.getOrAddProperties<
Properties>().const_name = const_name;
619 assert(resultTypes.size() == 1u &&
"mismatched number of results");
620 odsState.addTypes(resultTypes);
623void ConstReadOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type val, ::llvm::StringRef const_name) {
624 odsState.getOrAddProperties<
Properties>().const_name = ::mlir::SymbolRefAttr::get(odsBuilder.getContext(), const_name);
625 odsState.addTypes(val);
628void ConstReadOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::llvm::StringRef const_name) {
629 odsState.getOrAddProperties<
Properties>().const_name = ::mlir::SymbolRefAttr::get(odsBuilder.getContext(), const_name);
630 assert(resultTypes.size() == 1u &&
"mismatched number of results");
631 odsState.addTypes(resultTypes);
634void ConstReadOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
635 assert(operands.size() == 0u &&
"mismatched number of parameters");
636 odsState.addOperands(operands);
637 odsState.addAttributes(attributes);
638 assert(resultTypes.size() == 1u &&
"mismatched number of return types");
639 odsState.addTypes(resultTypes);
641 if (!attributes.empty()) {
642 ::mlir::OpaqueProperties properties =
644 std::optional<::mlir::RegisteredOperationName> info =
645 odsState.name.getRegisteredInfo();
646 if (failed(info->setOpPropertiesFromAttribute(odsState.name, properties,
647 odsState.attributes.getDictionary(odsState.getContext()),
nullptr)))
648 ::llvm::report_fatal_error(
"Property conversion failed.");
653 auto tblgen_const_name = getProperties().const_name; (void)tblgen_const_name;
654 if (!tblgen_const_name)
return emitOpError(
"requires attribute 'const_name'");
656 if (::mlir::failed(__mlir_ods_local_attr_constraint_Ops3(*
this, tblgen_const_name,
"const_name")))
657 return ::mlir::failure();
659 unsigned index = 0; (void)index;
662 for (
auto v : valueGroup0) {
663 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops3(*
this, v.getType(),
"result", index++)))
664 return ::mlir::failure();
667 return ::mlir::success();
675 ::mlir::FlatSymbolRefAttr const_nameAttr;
676 ::mlir::Type valRawType{};
677 ::llvm::ArrayRef<::mlir::Type> valTypes(&valRawType, 1);
679 if (parser.parseCustomAttributeWithFallback(const_nameAttr, parser.getBuilder().getType<::mlir::NoneType>())) {
680 return ::mlir::failure();
683 if (parser.parseColon())
684 return ::mlir::failure();
688 if (parser.parseCustomTypeWithFallback(type))
689 return ::mlir::failure();
693 auto loc = parser.getCurrentLocation();(void)loc;
694 if (parser.parseOptionalAttrDict(result.attributes))
695 return ::mlir::failure();
697 return parser.emitError(loc) <<
"'" << result.name.getStringRef() <<
"' op ";
699 return ::mlir::failure();
701 result.addTypes(valTypes);
702 return ::mlir::success();
708 _odsPrinter <<
' ' <<
":";
711 auto type =
getVal().getType();
712 if (
auto validType = ::llvm::dyn_cast<::mlir::Type>(type))
713 _odsPrinter.printStrippedAttrOrType(validType);
717 ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
718 elidedAttrs.push_back(
"const_name");
719 _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
722void ConstReadOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
730namespace polymorphic {
741 return attr.getValue();
749 if (!tblgen_sym_name)
return emitError(loc,
"'poly.expr' op ""requires attribute 'sym_name'");
751 if (tblgen_sym_name && !((::llvm::isa<::mlir::StringAttr>(tblgen_sym_name))))
752 return emitError(loc,
"'poly.expr' op ""attribute 'sym_name' failed to satisfy constraint: string attribute");
753 return ::mlir::success();
757 ::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
759 emitError() <<
"expected DictionaryAttr to set properties";
760 return ::mlir::failure();
765 auto attr = dict.get(
"sym_name");
767 auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<
decltype(propStorage)>>(attr);
769 propStorage = convertedAttr;
771 emitError() <<
"Invalid attribute `sym_name` in property conversion: " << attr;
772 return ::mlir::failure();
776 return ::mlir::success();
780 ::mlir::SmallVector<::mlir::NamedAttribute> attrs;
781 ::mlir::Builder odsBuilder{ctx};
784 const auto &propStorage = prop.
sym_name;
786 attrs.push_back(odsBuilder.getNamedAttr(
"sym_name",
791 return odsBuilder.getDictionaryAttr(attrs);
796 return llvm::hash_combine(
797 llvm::hash_value(prop.
sym_name.getAsOpaquePointer()));
801 if (name ==
"sym_name")
807 if (name ==
"sym_name") {
808 prop.
sym_name = ::llvm::dyn_cast_or_null<std::remove_reference_t<
decltype(prop.
sym_name)>>(value);
820 if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_Ops4(attr,
"sym_name", emitError)))
821 return ::mlir::failure();
823 return ::mlir::success();
827 auto &prop = state.getOrAddProperties<
Properties>(); (void)prop;
828 if (::mlir::failed(reader.readAttribute(prop.
sym_name)))
829 return ::mlir::failure();
830 return ::mlir::success();
834 auto &prop = getProperties(); (void)prop;
835 writer.writeAttribute(prop.
sym_name);
840 return attr.getValue();
844 getProperties().sym_name = ::mlir::Builder((*this)->getContext()).getStringAttr(attrValue);
847void TemplateExprOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::StringAttr sym_name) {
848 odsState.getOrAddProperties<
Properties>().sym_name = sym_name;
849 (void)odsState.addRegion();
852void TemplateExprOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::StringAttr sym_name) {
853 odsState.getOrAddProperties<
Properties>().sym_name = sym_name;
854 (void)odsState.addRegion();
855 assert(resultTypes.size() == 0u &&
"mismatched number of results");
856 odsState.addTypes(resultTypes);
859void TemplateExprOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::llvm::StringRef sym_name) {
860 odsState.getOrAddProperties<
Properties>().sym_name = odsBuilder.getStringAttr(sym_name);
861 (void)odsState.addRegion();
864void TemplateExprOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::llvm::StringRef sym_name) {
865 odsState.getOrAddProperties<
Properties>().sym_name = odsBuilder.getStringAttr(sym_name);
866 (void)odsState.addRegion();
867 assert(resultTypes.size() == 0u &&
"mismatched number of results");
868 odsState.addTypes(resultTypes);
871void TemplateExprOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
872 assert(operands.size() == 0u &&
"mismatched number of parameters");
873 odsState.addOperands(operands);
874 odsState.addAttributes(attributes);
875 for (
unsigned i = 0; i != 1; ++i)
876 (
void)odsState.addRegion();
877 assert(resultTypes.size() == 0u &&
"mismatched number of return types");
878 odsState.addTypes(resultTypes);
880 if (!attributes.empty()) {
881 ::mlir::OpaqueProperties properties =
883 std::optional<::mlir::RegisteredOperationName> info =
884 odsState.name.getRegisteredInfo();
885 if (failed(info->setOpPropertiesFromAttribute(odsState.name, properties,
886 odsState.attributes.getDictionary(odsState.getContext()),
nullptr)))
887 ::llvm::report_fatal_error(
"Property conversion failed.");
892 auto tblgen_sym_name = getProperties().sym_name; (void)tblgen_sym_name;
893 if (!tblgen_sym_name)
return emitOpError(
"requires attribute 'sym_name'");
895 if (::mlir::failed(__mlir_ods_local_attr_constraint_Ops4(*
this, tblgen_sym_name,
"sym_name")))
896 return ::mlir::failure();
898 unsigned index = 0; (void)index;
900 for (
auto ®ion : ::llvm::MutableArrayRef((*this)->getRegion(0)))
901 if (::mlir::failed(__mlir_ods_local_region_constraint_Ops1(*
this, region,
"initializerRegion", index++)))
902 return ::mlir::failure();
904 return ::mlir::success();
912 ::mlir::StringAttr sym_nameAttr;
913 std::unique_ptr<::mlir::Region> initializerRegionRegion = std::make_unique<::mlir::Region>();
915 if (parser.parseSymbolName(sym_nameAttr))
916 return ::mlir::failure();
919 if (parser.parseRegion(*initializerRegionRegion))
920 return ::mlir::failure();
922 if (initializerRegionRegion->empty()) initializerRegionRegion->emplaceBlock();
924 auto loc = parser.getCurrentLocation();(void)loc;
925 if (parser.parseOptionalAttrDict(result.attributes))
926 return ::mlir::failure();
928 return parser.emitError(loc) <<
"'" << result.name.getStringRef() <<
"' op ";
930 return ::mlir::failure();
932 result.addRegion(std::move(initializerRegionRegion));
933 return ::mlir::success();
941 ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
942 elidedAttrs.push_back(
"sym_name");
943 _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
951namespace polymorphic {
962 return attr.getValue();
970 if (!tblgen_sym_name)
return emitError(loc,
"'poly.template' op ""requires attribute 'sym_name'");
972 if (tblgen_sym_name && !((::llvm::isa<::mlir::StringAttr>(tblgen_sym_name))))
973 return emitError(loc,
"'poly.template' op ""attribute 'sym_name' failed to satisfy constraint: string attribute");
974 return ::mlir::success();
978 ::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
980 emitError() <<
"expected DictionaryAttr to set properties";
981 return ::mlir::failure();
986 auto attr = dict.get(
"sym_name");
988 auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<
decltype(propStorage)>>(attr);
990 propStorage = convertedAttr;
992 emitError() <<
"Invalid attribute `sym_name` in property conversion: " << attr;
993 return ::mlir::failure();
997 return ::mlir::success();
1001 ::mlir::SmallVector<::mlir::NamedAttribute> attrs;
1002 ::mlir::Builder odsBuilder{ctx};
1005 const auto &propStorage = prop.
sym_name;
1007 attrs.push_back(odsBuilder.getNamedAttr(
"sym_name",
1012 return odsBuilder.getDictionaryAttr(attrs);
1017 return llvm::hash_combine(
1018 llvm::hash_value(prop.
sym_name.getAsOpaquePointer()));
1022 if (name ==
"sym_name")
1024 return std::nullopt;
1028 if (name ==
"sym_name") {
1029 prop.
sym_name = ::llvm::dyn_cast_or_null<std::remove_reference_t<
decltype(prop.
sym_name)>>(value);
1038::llvm::LogicalResult
TemplateOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
1041 if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_Ops4(attr,
"sym_name", emitError)))
1042 return ::mlir::failure();
1044 return ::mlir::success();
1048 auto &prop = state.getOrAddProperties<
Properties>(); (void)prop;
1049 if (::mlir::failed(reader.readAttribute(prop.
sym_name)))
1050 return ::mlir::failure();
1051 return ::mlir::success();
1055 auto &prop = getProperties(); (void)prop;
1056 writer.writeAttribute(prop.
sym_name);
1061 return attr.getValue();
1065 getProperties().sym_name = ::mlir::Builder((*this)->getContext()).getStringAttr(attrValue);
1068void TemplateOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::StringAttr sym_name) {
1069 odsState.getOrAddProperties<
Properties>().sym_name = sym_name;
1070 (void)odsState.addRegion();
1073void TemplateOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::StringAttr sym_name) {
1074 odsState.getOrAddProperties<
Properties>().sym_name = sym_name;
1075 (void)odsState.addRegion();
1076 assert(resultTypes.size() == 0u &&
"mismatched number of results");
1077 odsState.addTypes(resultTypes);
1080void TemplateOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::llvm::StringRef sym_name) {
1081 odsState.getOrAddProperties<
Properties>().sym_name = odsBuilder.getStringAttr(sym_name);
1082 (void)odsState.addRegion();
1085void TemplateOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::llvm::StringRef sym_name) {
1086 odsState.getOrAddProperties<
Properties>().sym_name = odsBuilder.getStringAttr(sym_name);
1087 (void)odsState.addRegion();
1088 assert(resultTypes.size() == 0u &&
"mismatched number of results");
1089 odsState.addTypes(resultTypes);
1092void TemplateOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
1093 assert(operands.size() == 0u &&
"mismatched number of parameters");
1094 odsState.addOperands(operands);
1095 odsState.addAttributes(attributes);
1096 for (
unsigned i = 0; i != 1; ++i)
1097 (
void)odsState.addRegion();
1098 assert(resultTypes.size() == 0u &&
"mismatched number of return types");
1099 odsState.addTypes(resultTypes);
1101 if (!attributes.empty()) {
1102 ::mlir::OpaqueProperties properties =
1104 std::optional<::mlir::RegisteredOperationName> info =
1105 odsState.name.getRegisteredInfo();
1106 if (failed(info->setOpPropertiesFromAttribute(odsState.name, properties,
1107 odsState.attributes.getDictionary(odsState.getContext()),
nullptr)))
1108 ::llvm::report_fatal_error(
"Property conversion failed.");
1113 auto tblgen_sym_name = getProperties().sym_name; (void)tblgen_sym_name;
1114 if (!tblgen_sym_name)
return emitOpError(
"requires attribute 'sym_name'");
1116 if (::mlir::failed(__mlir_ods_local_attr_constraint_Ops4(*
this, tblgen_sym_name,
"sym_name")))
1117 return ::mlir::failure();
1119 unsigned index = 0; (void)index;
1121 for (
auto ®ion : ::llvm::MutableArrayRef((*this)->getRegion(0)))
1122 if (::mlir::failed(__mlir_ods_local_region_constraint_Ops1(*
this, region,
"bodyRegion", index++)))
1123 return ::mlir::failure();
1125 return ::mlir::success();
1133 ::mlir::StringAttr sym_nameAttr;
1134 std::unique_ptr<::mlir::Region> bodyRegionRegion = std::make_unique<::mlir::Region>();
1136 if (parser.parseSymbolName(sym_nameAttr))
1137 return ::mlir::failure();
1140 if (parser.parseRegion(*bodyRegionRegion))
1141 return ::mlir::failure();
1143 if (bodyRegionRegion->empty()) bodyRegionRegion->emplaceBlock();
1145 auto loc = parser.getCurrentLocation();(void)loc;
1146 if (parser.parseOptionalAttrDict(result.attributes))
1147 return ::mlir::failure();
1149 return parser.emitError(loc) <<
"'" << result.name.getStringRef() <<
"' op ";
1151 return ::mlir::failure();
1153 result.addRegion(std::move(bodyRegionRegion));
1154 return ::mlir::success();
1162 ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
1163 elidedAttrs.push_back(
"sym_name");
1164 _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
1172namespace polymorphic {
1183 return attr.getValue();
1188 return attr ? ::std::optional<::mlir::Type>(::llvm::cast<::mlir::Type>(attr.getValue())) : (::std::nullopt);
1196 if (!tblgen_sym_name)
return emitError(loc,
"'poly.param' op ""requires attribute 'sym_name'");
1199 if (tblgen_sym_name && !((::llvm::isa<::mlir::StringAttr>(tblgen_sym_name))))
1200 return emitError(loc,
"'poly.param' op ""attribute 'sym_name' failed to satisfy constraint: string attribute");
1202 if (tblgen_type_opt && !(((::llvm::isa<::mlir::TypeAttr>(tblgen_type_opt))) && ((::llvm::isa<::mlir::Type>(::llvm::cast<::mlir::TypeAttr>(tblgen_type_opt).getValue()))) && ((
::llzk::isValidConstReadType(::llvm::cast<::mlir::TypeAttr>(tblgen_type_opt).getValue())))))
1203 return emitError(loc,
"'poly.param' op ""attribute 'type_opt' failed to satisfy constraint: type attribute of integral, felt, or typevar type");
1204 return ::mlir::success();
1208 ::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
1210 emitError() <<
"expected DictionaryAttr to set properties";
1211 return ::mlir::failure();
1216 auto attr = dict.get(
"sym_name");
1218 auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<
decltype(propStorage)>>(attr);
1219 if (convertedAttr) {
1220 propStorage = convertedAttr;
1222 emitError() <<
"Invalid attribute `sym_name` in property conversion: " << attr;
1223 return ::mlir::failure();
1230 auto attr = dict.get(
"type_opt");
1232 auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<
decltype(propStorage)>>(attr);
1233 if (convertedAttr) {
1234 propStorage = convertedAttr;
1236 emitError() <<
"Invalid attribute `type_opt` in property conversion: " << attr;
1237 return ::mlir::failure();
1241 return ::mlir::success();
1245 ::mlir::SmallVector<::mlir::NamedAttribute> attrs;
1246 ::mlir::Builder odsBuilder{ctx};
1249 const auto &propStorage = prop.
sym_name;
1251 attrs.push_back(odsBuilder.getNamedAttr(
"sym_name",
1256 const auto &propStorage = prop.
type_opt;
1258 attrs.push_back(odsBuilder.getNamedAttr(
"type_opt",
1263 return odsBuilder.getDictionaryAttr(attrs);
1268 return llvm::hash_combine(
1269 llvm::hash_value(prop.
sym_name.getAsOpaquePointer()),
1270 llvm::hash_value(prop.
type_opt.getAsOpaquePointer()));
1274 if (name ==
"sym_name")
1277 if (name ==
"type_opt")
1279 return std::nullopt;
1283 if (name ==
"sym_name") {
1284 prop.
sym_name = ::llvm::dyn_cast_or_null<std::remove_reference_t<
decltype(prop.
sym_name)>>(value);
1288 if (name ==
"type_opt") {
1289 prop.
type_opt = ::llvm::dyn_cast_or_null<std::remove_reference_t<
decltype(prop.
type_opt)>>(value);
1303 if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_Ops4(attr,
"sym_name", emitError)))
1304 return ::mlir::failure();
1309 if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_Ops5(attr,
"type_opt", emitError)))
1310 return ::mlir::failure();
1312 return ::mlir::success();
1316 auto &prop = state.getOrAddProperties<
Properties>(); (void)prop;
1317 if (::mlir::failed(reader.readAttribute(prop.
sym_name)))
1318 return ::mlir::failure();
1320 if (::mlir::failed(reader.readOptionalAttribute(prop.
type_opt)))
1321 return ::mlir::failure();
1322 return ::mlir::success();
1326 auto &prop = getProperties(); (void)prop;
1327 writer.writeAttribute(prop.
sym_name);
1329 writer.writeOptionalAttribute(prop.
type_opt);
1334 return attr.getValue();
1339 return attr ? ::std::optional<::mlir::Type>(::llvm::cast<::mlir::Type>(attr.getValue())) : (::std::nullopt);
1343 getProperties().sym_name = ::mlir::Builder((*this)->getContext()).getStringAttr(attrValue);
1347 auto &odsProp = getProperties().type_opt;
1349 odsProp = ::mlir::TypeAttr::get(*attrValue);
1354void TemplateParamOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::StringAttr sym_name, ::mlir::TypeAttr type_opt) {
1355 odsState.getOrAddProperties<
Properties>().sym_name = sym_name;
1357 odsState.getOrAddProperties<
Properties>().type_opt = type_opt;
1361void TemplateParamOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::StringAttr sym_name, ::mlir::TypeAttr type_opt) {
1362 odsState.getOrAddProperties<
Properties>().sym_name = sym_name;
1364 odsState.getOrAddProperties<
Properties>().type_opt = type_opt;
1366 assert(resultTypes.size() == 0u &&
"mismatched number of results");
1367 odsState.addTypes(resultTypes);
1370void TemplateParamOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::llvm::StringRef sym_name, ::mlir::TypeAttr type_opt) {
1371 odsState.getOrAddProperties<
Properties>().sym_name = odsBuilder.getStringAttr(sym_name);
1373 odsState.getOrAddProperties<
Properties>().type_opt = type_opt;
1377void TemplateParamOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::llvm::StringRef sym_name, ::mlir::TypeAttr type_opt) {
1378 odsState.getOrAddProperties<
Properties>().sym_name = odsBuilder.getStringAttr(sym_name);
1380 odsState.getOrAddProperties<
Properties>().type_opt = type_opt;
1382 assert(resultTypes.size() == 0u &&
"mismatched number of results");
1383 odsState.addTypes(resultTypes);
1386void TemplateParamOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
1387 assert(operands.size() == 0u &&
"mismatched number of parameters");
1388 odsState.addOperands(operands);
1389 odsState.addAttributes(attributes);
1390 assert(resultTypes.size() == 0u &&
"mismatched number of return types");
1391 odsState.addTypes(resultTypes);
1393 if (!attributes.empty()) {
1394 ::mlir::OpaqueProperties properties =
1396 std::optional<::mlir::RegisteredOperationName> info =
1397 odsState.name.getRegisteredInfo();
1398 if (failed(info->setOpPropertiesFromAttribute(odsState.name, properties,
1399 odsState.attributes.getDictionary(odsState.getContext()),
nullptr)))
1400 ::llvm::report_fatal_error(
"Property conversion failed.");
1405 auto tblgen_sym_name = getProperties().sym_name; (void)tblgen_sym_name;
1406 if (!tblgen_sym_name)
return emitOpError(
"requires attribute 'sym_name'");
1407 auto tblgen_type_opt = getProperties().type_opt; (void)tblgen_type_opt;
1409 if (::mlir::failed(__mlir_ods_local_attr_constraint_Ops4(*
this, tblgen_sym_name,
"sym_name")))
1410 return ::mlir::failure();
1412 if (::mlir::failed(__mlir_ods_local_attr_constraint_Ops5(*
this, tblgen_type_opt,
"type_opt")))
1413 return ::mlir::failure();
1414 return ::mlir::success();
1422 ::mlir::StringAttr sym_nameAttr;
1423 ::mlir::TypeAttr type_optAttr;
1425 if (parser.parseSymbolName(sym_nameAttr))
1426 return ::mlir::failure();
1428 if (::mlir::succeeded(parser.parseOptionalColon())) {
1430 if (parser.parseCustomAttributeWithFallback(type_optAttr, parser.getBuilder().getType<::mlir::NoneType>())) {
1431 return ::mlir::failure();
1436 auto loc = parser.getCurrentLocation();(void)loc;
1437 if (parser.parseOptionalAttrDict(result.attributes))
1438 return ::mlir::failure();
1440 return parser.emitError(loc) <<
"'" << result.name.getStringRef() <<
"' op ";
1442 return ::mlir::failure();
1444 return ::mlir::success();
1451 _odsPrinter <<
' ' <<
":";
1455 ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
1456 elidedAttrs.push_back(
"sym_name");
1457 elidedAttrs.push_back(
"type_opt");
1458 _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
1466namespace polymorphic {
1477 return ::mlir::success();
1480void UnifiableCastOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value input) {
1481 odsState.addOperands(input);
1482 odsState.addTypes(result);
1485void UnifiableCastOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input) {
1486 odsState.addOperands(input);
1487 assert(resultTypes.size() == 1u &&
"mismatched number of results");
1488 odsState.addTypes(resultTypes);
1491void UnifiableCastOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
1492 assert(operands.size() == 1u &&
"mismatched number of parameters");
1493 odsState.addOperands(operands);
1494 odsState.addAttributes(attributes);
1495 assert(resultTypes.size() == 1u &&
"mismatched number of return types");
1496 odsState.addTypes(resultTypes);
1501 unsigned index = 0; (void)index;
1504 for (
auto v : valueGroup0) {
1505 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops4(*
this, v.getType(),
"operand", index++)))
1506 return ::mlir::failure();
1510 unsigned index = 0; (void)index;
1513 for (
auto v : valueGroup0) {
1514 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops4(*
this, v.getType(),
"result", index++)))
1515 return ::mlir::failure();
1518 return ::mlir::success();
1523 return ::mlir::success();
1524 return ::mlir::failure();
1528 ::mlir::OpAsmParser::UnresolvedOperand inputRawOperand{};
1529 ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> inputOperands(&inputRawOperand, 1); ::llvm::SMLoc inputOperandsLoc;
1530 (void)inputOperandsLoc;
1531 ::llvm::ArrayRef<::mlir::Type> inputTypes;
1532 ::llvm::ArrayRef<::mlir::Type> allResultTypes;
1534 inputOperandsLoc = parser.getCurrentLocation();
1535 if (parser.parseOperand(inputRawOperand))
1536 return ::mlir::failure();
1537 if (parser.parseColon())
1538 return ::mlir::failure();
1540 ::mlir::FunctionType input__allResult_functionType;
1541 if (parser.parseType(input__allResult_functionType))
1542 return ::mlir::failure();
1543 inputTypes = input__allResult_functionType.getInputs();
1544 allResultTypes = input__allResult_functionType.getResults();
1546 auto loc = parser.getCurrentLocation();(void)loc;
1547 if (parser.parseOptionalAttrDict(result.attributes))
1548 return ::mlir::failure();
1550 result.addTypes(allResultTypes);
1551 if (parser.resolveOperands(inputOperands, inputTypes, inputOperandsLoc, result.operands))
1552 return ::mlir::failure();
1553 return ::mlir::success();
1559 _odsPrinter <<
' ' <<
":";
1561 _odsPrinter.printFunctionalType(::llvm::ArrayRef<::mlir::Type>(
getInput().getType()), getOperation()->getResultTypes());
1562 ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
1563 _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
1574namespace polymorphic {
1585 return ::mlir::success();
1588void YieldOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value val) {
1589 odsState.addOperands(val);
1592void YieldOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value val) {
1593 odsState.addOperands(val);
1594 assert(resultTypes.size() == 0u &&
"mismatched number of results");
1595 odsState.addTypes(resultTypes);
1598void YieldOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
1599 assert(operands.size() == 1u &&
"mismatched number of parameters");
1600 odsState.addOperands(operands);
1601 odsState.addAttributes(attributes);
1602 assert(resultTypes.size() == 0u &&
"mismatched number of return types");
1603 odsState.addTypes(resultTypes);
1608 unsigned index = 0; (void)index;
1611 for (
auto v : valueGroup0) {
1612 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops3(*
this, v.getType(),
"operand", index++)))
1613 return ::mlir::failure();
1616 return ::mlir::success();
1623::mlir::ParseResult
YieldOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
1624 ::mlir::OpAsmParser::UnresolvedOperand valRawOperand{};
1625 ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> valOperands(&valRawOperand, 1); ::llvm::SMLoc valOperandsLoc;
1626 (void)valOperandsLoc;
1627 ::mlir::Type valRawType{};
1628 ::llvm::ArrayRef<::mlir::Type> valTypes(&valRawType, 1);
1630 valOperandsLoc = parser.getCurrentLocation();
1631 if (parser.parseOperand(valRawOperand))
1632 return ::mlir::failure();
1633 if (parser.parseColon())
1634 return ::mlir::failure();
1638 if (parser.parseCustomTypeWithFallback(type))
1639 return ::mlir::failure();
1643 auto loc = parser.getCurrentLocation();(void)loc;
1644 if (parser.parseOptionalAttrDict(result.attributes))
1645 return ::mlir::failure();
1647 if (parser.resolveOperands(valOperands, valTypes, valOperandsLoc, result.operands))
1648 return ::mlir::failure();
1649 return ::mlir::success();
1655 _odsPrinter <<
' ' <<
":";
1658 auto type =
getVal().getType();
1659 if (
auto validType = ::llvm::dyn_cast<::mlir::Type>(type))
1660 _odsPrinter.printStrippedAttrOrType(validType);
1662 _odsPrinter << type;
1664 ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
1665 _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
1669 ::mlir::RegionBranchPoint point) {
1670 return ::mlir::MutableOperandRange(*
this);
ApplyMapOpAdaptor(ApplyMapOp op)
::llvm::LogicalResult verify(::mlir::Location loc)
ApplyMapOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
::mlir::ValueRange getOperands()
::mlir::AffineMapAttr getMapAttr()
::mlir::IntegerAttr getNumDimsAttr()
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index)
::mlir::Operation::result_range getODSResults(unsigned index)
::llvm::APInt getNumDims()
::mlir::Operation::operand_range getMapOperands()
::llvm::LogicalResult verify()
void print(::mlir::OpAsmPrinter &_odsPrinter)
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
::llvm::LogicalResult inferReturnTypes(::mlir::MLIRContext *context, ::std::optional<::mlir::Location > location, ::mlir::ValueRange operands, ::mlir::DictionaryAttr attributes, ::mlir::OpaqueProperties properties, ::mlir::RegionRange regions, ::llvm::SmallVectorImpl<::mlir::Type > &inferredReturnTypes)
::llvm::LogicalResult verifyInvariants()
static llvm::hash_code computePropertiesHash(const Properties &prop)
FoldAdaptor::Properties Properties
::mlir::Operation::operand_range getODSOperands(unsigned index)
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::AffineMapAttr map, ::mlir::ValueRange mapOperands={})
::mlir::StringAttr getMapAttrName()
::mlir::AffineMap getMap()
static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs)
void writeProperties(::mlir::DialectBytecodeWriter &writer)
void setMap(::mlir::AffineMap attrValue)
::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop)
::mlir::StringAttr getNumDimsAttrName()
::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
::mlir::MutableOperandRange getMapOperandsMutable()
::llvm::LogicalResult verifyInvariantsImpl()
static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value)
::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state)
::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect > > &effects)
static std::optional< mlir::Attribute > getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name)
void setNumDims(::llvm::APInt attrValue)
::llvm::LogicalResult verify(::mlir::Location loc)
ConstReadOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
ConstReadOpAdaptor(ConstReadOp op)
::mlir::ValueRange getOperands()
void writeProperties(::mlir::DialectBytecodeWriter &writer)
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
void print(::mlir::OpAsmPrinter &_odsPrinter)
FoldAdaptor::Properties Properties
::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
::mlir::TypedValue<::mlir::Type > getVal()
::mlir::StringAttr getConstNameAttrName()
::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop)
static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value)
::mlir::Operation::result_range getODSResults(unsigned index)
::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
static llvm::hash_code computePropertiesHash(const Properties &prop)
void setConstName(::llvm::StringRef attrValue)
::llvm::LogicalResult verifyInvariantsImpl()
void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect > > &effects)
::mlir::FlatSymbolRefAttr getConstNameAttr()
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type val, ::mlir::FlatSymbolRefAttr const_name)
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)
::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state)
::llvm::LogicalResult verifyInvariants()
::llvm::StringRef getConstName()
::llvm::LogicalResult verify(::mlir::Location loc)
TemplateExprOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
TemplateExprOpAdaptor(TemplateExprOp op)
::mlir::ValueRange getOperands()
::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value)
::mlir::StringAttr getSymNameAttr()
static std::optional< mlir::Attribute > getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name)
::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop)
static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs)
::mlir::Region & getInitializerRegion()
static llvm::hash_code computePropertiesHash(const Properties &prop)
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
::llvm::LogicalResult verifyInvariantsImpl()
::llvm::StringRef getSymName()
void setSymName(::llvm::StringRef attrValue)
void writeProperties(::mlir::DialectBytecodeWriter &writer)
::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state)
FoldAdaptor::Properties Properties
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::StringAttr sym_name)
::mlir::StringAttr getSymNameAttrName()
::llvm::LogicalResult verifyInvariants()
void print(::mlir::OpAsmPrinter &_odsPrinter)
TemplateOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
::llvm::LogicalResult verify(::mlir::Location loc)
TemplateOpAdaptor(TemplateOp op)
::mlir::ValueRange getOperands()
::mlir::Region & getBodyRegion()
::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
::mlir::StringAttr getSymNameAttrName()
static llvm::hash_code computePropertiesHash(const Properties &prop)
::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop)
void writeProperties(::mlir::DialectBytecodeWriter &writer)
void print(::mlir::OpAsmPrinter &_odsPrinter)
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs)
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::StringAttr sym_name)
static std::optional< mlir::Attribute > getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name)
FoldAdaptor::Properties Properties
::mlir::StringAttr getSymNameAttr()
::llvm::LogicalResult verifyInvariantsImpl()
void setSymName(::llvm::StringRef attrValue)
static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value)
::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state)
::llvm::StringRef getSymName()
::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
::llvm::LogicalResult verifyInvariants()
::llvm::LogicalResult verify(::mlir::Location loc)
TemplateParamOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
TemplateParamOpAdaptor(TemplateParamOp op)
::mlir::ValueRange getOperands()
::llvm::LogicalResult verifyInvariants()
::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
void setSymName(::llvm::StringRef attrValue)
::mlir::StringAttr getTypeOptAttrName()
void setTypeOpt(::std::optional<::mlir::Type > attrValue)
::mlir::TypeAttr getTypeOptAttr()
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::StringAttr sym_name, ::mlir::TypeAttr type_opt)
::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop)
static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value)
FoldAdaptor::Properties Properties
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
void writeProperties(::mlir::DialectBytecodeWriter &writer)
::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state)
void print(::mlir::OpAsmPrinter &_odsPrinter)
::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
::mlir::StringAttr getSymNameAttrName()
::mlir::StringAttr getSymNameAttr()
static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs)
::llvm::LogicalResult verifyInvariantsImpl()
::std::optional<::mlir::Type > getTypeOpt()
::llvm::StringRef getSymName()
static std::optional< mlir::Attribute > getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name)
static llvm::hash_code computePropertiesHash(const Properties &prop)
UnifiableCastOpAdaptor(UnifiableCastOp op)
UnifiableCastOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs={}, const ::mlir::EmptyProperties &properties={}, ::mlir::RegionRange regions={})
::llvm::LogicalResult verify(::mlir::Location loc)
::mlir::ValueRange getOperands()
::llvm::LogicalResult verify()
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value input)
void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect > > &effects)
::mlir::Operation::operand_range getODSOperands(unsigned index)
::mlir::TypedValue<::mlir::Type > getInput()
::llvm::LogicalResult verifyInvariantsImpl()
::llvm::LogicalResult verifyInvariants()
::mlir::Operation::result_range getODSResults(unsigned index)
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
void print(::mlir::OpAsmPrinter &_odsPrinter)
::llvm::LogicalResult verify(::mlir::Location loc)
YieldOpAdaptor(YieldOp op)
YieldOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs={}, const ::mlir::EmptyProperties &properties={}, ::mlir::RegionRange regions={})
::mlir::ValueRange getOperands()
::mlir::MutableOperandRange getMutableSuccessorOperands(::mlir::RegionBranchPoint point)
::llvm::LogicalResult verifyInvariantsImpl()
void print(::mlir::OpAsmPrinter &_odsPrinter)
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
::llvm::LogicalResult verifyInvariants()
::mlir::Operation::operand_range getODSOperands(unsigned index)
::mlir::TypedValue<::mlir::Type > getVal()
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value val)
const Properties & getProperties()
::mlir::AffineMap getMap()
::mlir::IntegerAttr getNumDimsAttr()
ApplyMapOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
::mlir::DictionaryAttr odsAttrs
::mlir::AffineMapAttr getMapAttr()
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize)
::llvm::APInt getNumDims()
::mlir::RegionRange odsRegions
::std::optional<::mlir::OperationName > odsOpName
const Properties & getProperties()
::mlir::FlatSymbolRefAttr getConstNameAttr()
ConstReadOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
::std::optional<::mlir::OperationName > odsOpName
::mlir::RegionRange odsRegions
::llvm::StringRef getConstName()
::mlir::DictionaryAttr odsAttrs
const Properties & getProperties()
TemplateExprOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
::std::optional<::mlir::OperationName > odsOpName
::mlir::RegionRange odsRegions
::mlir::RegionRange getRegions()
::mlir::DictionaryAttr odsAttrs
::llvm::StringRef getSymName()
::mlir::StringAttr getSymNameAttr()
TemplateOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
::mlir::RegionRange odsRegions
const Properties & getProperties()
::mlir::StringAttr getSymNameAttr()
::mlir::DictionaryAttr odsAttrs
::std::optional<::mlir::OperationName > odsOpName
::mlir::RegionRange getRegions()
::llvm::StringRef getSymName()
::std::optional<::mlir::OperationName > odsOpName
::llvm::StringRef getSymName()
::mlir::TypeAttr getTypeOptAttr()
::std::optional<::mlir::Type > getTypeOpt()
TemplateParamOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
::mlir::RegionRange odsRegions
::mlir::StringAttr getSymNameAttr()
const Properties & getProperties()
::mlir::DictionaryAttr odsAttrs
void printDimAndSymbolList(mlir::OpAsmPrinter &printer, mlir::Operation *op, mlir::OperandRange mapOperands, mlir::IntegerAttr numDims)
bool isValidType(Type type)
mlir::ParseResult parseDimAndSymbolList(mlir::OpAsmParser &parser, mlir::SmallVector< mlir::OpAsmParser::UnresolvedOperand, N > &mapOperands, mlir::IntegerAttr &numDims)
bool isValidConstReadType(Type type)
void setMap(const ::mlir::AffineMapAttr &propValue)
void setNumDims(const ::mlir::IntegerAttr &propValue)