27static ::llvm::LogicalResult __mlir_ods_local_type_constraint_Ops1(
28 ::mlir::Operation *op, ::mlir::Type type, ::llvm::StringRef valueKind,
29 unsigned valueIndex) {
31 return op->emitOpError(valueKind) <<
" #" << valueIndex
32 <<
" must be variadic of a valid LLZK type, but got " << type;
34 return ::mlir::success();
37static ::llvm::LogicalResult __mlir_ods_local_type_constraint_Ops2(
38 ::mlir::Operation *op, ::mlir::Type type, ::llvm::StringRef valueKind,
39 unsigned valueIndex) {
40 if (!((::llvm::isa<::mlir::IndexType>(type)))) {
41 return op->emitOpError(valueKind) <<
" #" << valueIndex
42 <<
" must be variadic of index, but got " << type;
44 return ::mlir::success();
47static ::llvm::LogicalResult __mlir_ods_local_attr_constraint_Ops1(
48 ::mlir::Attribute attr, ::llvm::StringRef attrName, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
49 if (attr && !((::llvm::isa<::mlir::SymbolRefAttr>(attr))))
50 return emitError() <<
"attribute '" << attrName
51 <<
"' failed to satisfy constraint: symbol reference attribute";
52 return ::mlir::success();
54static ::llvm::LogicalResult __mlir_ods_local_attr_constraint_Ops1(
55 ::mlir::Operation *op, ::mlir::Attribute attr, ::llvm::StringRef attrName) {
56 return __mlir_ods_local_attr_constraint_Ops1(attr, attrName, [op]() {
57 return op->emitOpError();
61static ::llvm::LogicalResult __mlir_ods_local_attr_constraint_Ops2(
62 ::mlir::Attribute attr, ::llvm::StringRef attrName, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
63 if (attr && !((::llvm::isa<::mlir::ArrayAttr>(attr))))
64 return emitError() <<
"attribute '" << attrName
65 <<
"' failed to satisfy constraint: array attribute";
66 return ::mlir::success();
68static ::llvm::LogicalResult __mlir_ods_local_attr_constraint_Ops2(
69 ::mlir::Operation *op, ::mlir::Attribute attr, ::llvm::StringRef attrName) {
70 return __mlir_ods_local_attr_constraint_Ops2(attr, attrName, [op]() {
71 return op->emitOpError();
75static ::llvm::LogicalResult __mlir_ods_local_attr_constraint_Ops3(
76 ::mlir::Attribute attr, ::llvm::StringRef attrName, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
77 if (attr && !((::llvm::isa<::mlir::DenseI32ArrayAttr>(attr))))
78 return emitError() <<
"attribute '" << attrName
79 <<
"' failed to satisfy constraint: i32 dense array attribute";
80 return ::mlir::success();
82static ::llvm::LogicalResult __mlir_ods_local_attr_constraint_Ops3(
83 ::mlir::Operation *op, ::mlir::Attribute attr, ::llvm::StringRef attrName) {
84 return __mlir_ods_local_attr_constraint_Ops3(attr, attrName, [op]() {
85 return op->emitOpError();
89static ::llvm::LogicalResult __mlir_ods_local_attr_constraint_Ops4(
90 ::mlir::Attribute attr, ::llvm::StringRef attrName, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
91 if (attr && !(((::llvm::isa<::mlir::ArrayAttr>(attr))) && (::llvm::all_of(::llvm::cast<::mlir::ArrayAttr>(attr), [&](::mlir::Attribute attr) {
return attr && ((::llvm::isa<::mlir::DictionaryAttr>(attr))); }))))
92 return emitError() <<
"attribute '" << attrName
93 <<
"' failed to satisfy constraint: Array of dictionary attributes";
94 return ::mlir::success();
96static ::llvm::LogicalResult __mlir_ods_local_attr_constraint_Ops4(
97 ::mlir::Operation *op, ::mlir::Attribute attr, ::llvm::StringRef attrName) {
98 return __mlir_ods_local_attr_constraint_Ops4(attr, attrName, [op]() {
99 return op->emitOpError();
103static ::llvm::LogicalResult __mlir_ods_local_attr_constraint_Ops5(
104 ::mlir::Attribute attr, ::llvm::StringRef attrName, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
105 if (attr && !((::llvm::isa<::mlir::StringAttr>(attr))))
106 return emitError() <<
"attribute '" << attrName
107 <<
"' failed to satisfy constraint: string attribute";
108 return ::mlir::success();
110static ::llvm::LogicalResult __mlir_ods_local_attr_constraint_Ops5(
111 ::mlir::Operation *op, ::mlir::Attribute attr, ::llvm::StringRef attrName) {
112 return __mlir_ods_local_attr_constraint_Ops5(attr, attrName, [op]() {
113 return op->emitOpError();
117static ::llvm::LogicalResult __mlir_ods_local_attr_constraint_Ops6(
118 ::mlir::Attribute attr, ::llvm::StringRef attrName, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
119 if (attr && !(((::llvm::isa<::mlir::TypeAttr>(attr))) && ((::llvm::isa<::mlir::FunctionType>(::llvm::cast<::mlir::TypeAttr>(attr).getValue()))) && ((::llvm::isa<::mlir::FunctionType>(::llvm::cast<::mlir::TypeAttr>(attr).getValue())))))
120 return emitError() <<
"attribute '" << attrName
121 <<
"' failed to satisfy constraint: type attribute of function type";
122 return ::mlir::success();
124static ::llvm::LogicalResult __mlir_ods_local_attr_constraint_Ops6(
125 ::mlir::Operation *op, ::mlir::Attribute attr, ::llvm::StringRef attrName) {
126 return __mlir_ods_local_attr_constraint_Ops6(attr, attrName, [op]() {
127 return op->emitOpError();
131static ::llvm::LogicalResult __mlir_ods_local_region_constraint_Ops1(
132 ::mlir::Operation *op, ::mlir::Region ®ion, ::llvm::StringRef regionName,
133 unsigned regionIndex) {
135 return op->emitOpError(
"region #") << regionIndex
136 << (regionName.empty() ?
" " :
" ('" + regionName +
"') ")
137 <<
"failed to verify constraint: any region";
139 return ::mlir::success();
156 for (
unsigned i = 0; i < index; ++i)
157 start += sizeAttr[i];
158 return {start, sizeAttr[index]};
168 return attr ? ::std::optional< ::mlir::ArrayAttr >(attr) : (::std::nullopt);
172 auto attr = ::llvm::dyn_cast_or_null<::mlir::DenseI32ArrayAttr>(
getProperties().numDimsPerMap);
188 return attr ? ::std::optional< ::mlir::ArrayAttr >(attr) : (::std::nullopt);
193 return attr ? ::std::optional< ::mlir::ArrayAttr >(attr) : (::std::nullopt);
203 if (!tblgen_callee)
return emitError(loc,
"'function.call' op requires attribute 'callee'");
205 if (!tblgen_mapOpGroupSizes)
return emitError(loc,
"'function.call' op requires attribute 'mapOpGroupSizes'");
210 if (tblgen_callee && !((::llvm::isa<::mlir::SymbolRefAttr>(tblgen_callee))))
211 return emitError(loc,
"'function.call' op attribute 'callee' failed to satisfy constraint: symbol reference attribute");
213 if (tblgen_templateParams && !((::llvm::isa<::mlir::ArrayAttr>(tblgen_templateParams))))
214 return emitError(loc,
"'function.call' op attribute 'templateParams' failed to satisfy constraint: array attribute");
216 if (tblgen_numDimsPerMap && !((::llvm::isa<::mlir::DenseI32ArrayAttr>(tblgen_numDimsPerMap))))
217 return emitError(loc,
"'function.call' op attribute 'numDimsPerMap' failed to satisfy constraint: i32 dense array attribute");
219 if (tblgen_mapOpGroupSizes && !((::llvm::isa<::mlir::DenseI32ArrayAttr>(tblgen_mapOpGroupSizes))))
220 return emitError(loc,
"'function.call' op attribute 'mapOpGroupSizes' failed to satisfy constraint: i32 dense array attribute");
222 if (tblgen_arg_attrs && !(((::llvm::isa<::mlir::ArrayAttr>(tblgen_arg_attrs))) && (::llvm::all_of(::llvm::cast<::mlir::ArrayAttr>(tblgen_arg_attrs), [&](::mlir::Attribute attr) {
return attr && ((::llvm::isa<::mlir::DictionaryAttr>(attr))); }))))
223 return emitError(loc,
"'function.call' op attribute 'arg_attrs' failed to satisfy constraint: Array of dictionary attributes");
225 if (tblgen_res_attrs && !(((::llvm::isa<::mlir::ArrayAttr>(tblgen_res_attrs))) && (::llvm::all_of(::llvm::cast<::mlir::ArrayAttr>(tblgen_res_attrs), [&](::mlir::Attribute attr) {
return attr && ((::llvm::isa<::mlir::DictionaryAttr>(attr))); }))))
226 return emitError(loc,
"'function.call' op attribute 'res_attrs' failed to satisfy constraint: Array of dictionary attributes");
227 return ::mlir::success();
231 ::llvm::ArrayRef<int32_t> sizeAttr = getProperties().operandSegmentSizes;
234 for (
unsigned i = 0; i < index; ++i)
235 start += sizeAttr[i];
236 return {start, sizeAttr[index]};
241 auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second, ::mlir::MutableOperandRange::OperandSegment(0u, {getOperandSegmentSizesAttrName(), ::mlir::DenseI32ArrayAttr::get(getContext(), getProperties().operandSegmentSizes)}));
247 auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second, ::mlir::MutableOperandRange::OperandSegment(1u, {getOperandSegmentSizesAttrName(), ::mlir::DenseI32ArrayAttr::get(getContext(), getProperties().operandSegmentSizes)}));
252 bool isVariadic[] = {
true};
253 int prevVariadicCount = 0;
254 for (
unsigned i = 0; i < index; ++i)
255 if (isVariadic[i]) ++prevVariadicCount;
259 int variadicSize = (getOperation()->getNumResults() - 0) / 1;
264 int start = index + (variadicSize - 1) * prevVariadicCount;
265 int size = isVariadic[index] ? variadicSize : 1;
266 return {start, size};
270 ::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
272 emitError() <<
"expected DictionaryAttr to set properties";
273 return ::mlir::failure();
278 auto attr = dict.get(
"arg_attrs");
280 auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<
decltype(propStorage)>>(attr);
282 propStorage = convertedAttr;
284 emitError() <<
"Invalid attribute `arg_attrs` in property conversion: " << attr;
285 return ::mlir::failure();
291 auto &propStorage = prop.
callee;
292 auto attr = dict.get(
"callee");
294 auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<
decltype(propStorage)>>(attr);
296 propStorage = convertedAttr;
298 emitError() <<
"Invalid attribute `callee` in property conversion: " << attr;
299 return ::mlir::failure();
306 auto attr = dict.get(
"mapOpGroupSizes");
308 auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<
decltype(propStorage)>>(attr);
310 propStorage = convertedAttr;
312 emitError() <<
"Invalid attribute `mapOpGroupSizes` in property conversion: " << attr;
313 return ::mlir::failure();
320 auto attr = dict.get(
"numDimsPerMap");
322 auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<
decltype(propStorage)>>(attr);
324 propStorage = convertedAttr;
326 emitError() <<
"Invalid attribute `numDimsPerMap` in property conversion: " << attr;
327 return ::mlir::failure();
334 auto attr = dict.get(
"res_attrs");
336 auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<
decltype(propStorage)>>(attr);
338 propStorage = convertedAttr;
340 emitError() <<
"Invalid attribute `res_attrs` in property conversion: " << attr;
341 return ::mlir::failure();
348 auto attr = dict.get(
"templateParams");
350 auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<
decltype(propStorage)>>(attr);
352 propStorage = convertedAttr;
354 emitError() <<
"Invalid attribute `templateParams` in property conversion: " << attr;
355 return ::mlir::failure();
361 auto setFromAttr = [] (
auto &propStorage, ::mlir::Attribute propAttr,
362 ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) -> ::mlir::LogicalResult {
363 return convertFromAttribute(propStorage, propAttr, emitError);
365 auto attr = dict.get(
"operandSegmentSizes");
if (!attr) attr = dict.get(
"operand_segment_sizes");;
368 return emitError() <<
"for `operandSegmentSizes`: ";
370 return ::mlir::failure();
372 return ::mlir::success();
376 ::mlir::SmallVector<::mlir::NamedAttribute> attrs;
377 ::mlir::Builder odsBuilder{ctx};
380 const auto &propStorage = prop.
arg_attrs;
382 attrs.push_back(odsBuilder.getNamedAttr(
"arg_attrs",
387 const auto &propStorage = prop.
callee;
389 attrs.push_back(odsBuilder.getNamedAttr(
"callee",
396 attrs.push_back(odsBuilder.getNamedAttr(
"mapOpGroupSizes",
403 attrs.push_back(odsBuilder.getNamedAttr(
"numDimsPerMap",
408 const auto &propStorage = prop.
res_attrs;
410 attrs.push_back(odsBuilder.getNamedAttr(
"res_attrs",
417 attrs.push_back(odsBuilder.getNamedAttr(
"templateParams",
423 auto attr = [&]() -> ::mlir::Attribute {
424 return ::mlir::DenseI32ArrayAttr::get(ctx, propStorage);
426 attrs.push_back(odsBuilder.getNamedAttr(
"operandSegmentSizes", attr));
430 return odsBuilder.getDictionaryAttr(attrs);
435 auto hash_operandSegmentSizes_ = [] (
const auto &propStorage) -> llvm::hash_code {
436 using ::llvm::hash_value;
437 return ::llvm::hash_combine_range(std::begin(propStorage), std::end(propStorage));;
439 using llvm::hash_value;
440 return llvm::hash_combine(
441 llvm::hash_value(prop.
arg_attrs.getAsOpaquePointer()),
442 llvm::hash_value(prop.
callee.getAsOpaquePointer()),
445 llvm::hash_value(prop.
res_attrs.getAsOpaquePointer()),
451 if (name ==
"arg_attrs")
454 if (name ==
"callee")
457 if (name ==
"mapOpGroupSizes")
460 if (name ==
"numDimsPerMap")
463 if (name ==
"res_attrs")
466 if (name ==
"templateParams")
468 if (name ==
"operand_segment_sizes" || name ==
"operandSegmentSizes")
return [&]() -> ::mlir::Attribute { return ::mlir::DenseI32ArrayAttr::get(ctx, prop.
operandSegmentSizes); }();
473 if (name ==
"arg_attrs") {
474 prop.
arg_attrs = ::llvm::dyn_cast_or_null<std::remove_reference_t<
decltype(prop.
arg_attrs)>>(value);
478 if (name ==
"callee") {
479 prop.
callee = ::llvm::dyn_cast_or_null<std::remove_reference_t<
decltype(prop.
callee)>>(value);
483 if (name ==
"mapOpGroupSizes") {
488 if (name ==
"numDimsPerMap") {
493 if (name ==
"res_attrs") {
494 prop.
res_attrs = ::llvm::dyn_cast_or_null<std::remove_reference_t<
decltype(prop.
res_attrs)>>(value);
498 if (name ==
"templateParams") {
502 if (name ==
"operand_segment_sizes" || name ==
"operandSegmentSizes") {
503 auto arrAttr = ::llvm::dyn_cast_or_null<::mlir::DenseI32ArrayAttr>(value);
504 if (!arrAttr)
return;
524 attrs.append(
"operandSegmentSizes", [&]() -> ::mlir::Attribute { return ::mlir::DenseI32ArrayAttr::get(ctx, prop.
operandSegmentSizes); }());
527::llvm::LogicalResult
CallOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
530 if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_Ops4(attr,
"arg_attrs", emitError)))
531 return ::mlir::failure();
536 if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_Ops1(attr,
"callee", emitError)))
537 return ::mlir::failure();
542 if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_Ops3(attr,
"mapOpGroupSizes", emitError)))
543 return ::mlir::failure();
548 if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_Ops3(attr,
"numDimsPerMap", emitError)))
549 return ::mlir::failure();
554 if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_Ops4(attr,
"res_attrs", emitError)))
555 return ::mlir::failure();
560 if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_Ops2(attr,
"templateParams", emitError)))
561 return ::mlir::failure();
563 return ::mlir::success();
573 return attr ? ::std::optional< ::mlir::ArrayAttr >(attr) : (::std::nullopt);
588 return attr ? ::std::optional< ::mlir::ArrayAttr >(attr) : (::std::nullopt);
593 return attr ? ::std::optional< ::mlir::ArrayAttr >(attr) : (::std::nullopt);
597 getProperties().numDimsPerMap = ::mlir::Builder((*this)->getContext()).getDenseI32ArrayAttr(attrValue);
601 getProperties().mapOpGroupSizes = ::mlir::Builder((*this)->getContext()).getDenseI32ArrayAttr(attrValue);
604CallOp CallOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::SymbolRefAttr callee, ::mlir::ValueRange argOperands, ::llvm::ArrayRef<::mlir::Attribute> templateParams) {
606 build(builder, __state__, std::forward<
decltype(resultTypes)>(resultTypes), std::forward<
decltype(callee)>(callee), std::forward<
decltype(argOperands)>(argOperands), std::forward<
decltype(templateParams)>(templateParams));
607 auto __res__ = ::llvm::dyn_cast<CallOp>(builder.create(__state__));
608 assert(__res__ &&
"builder didn't return the right type");
612CallOp CallOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::SymbolRefAttr callee, ::mlir::ValueRange argOperands, ::llvm::ArrayRef<::mlir::Attribute> templateParams) {
613 return create(builder, builder.getLoc(), std::forward<
decltype(resultTypes)>(resultTypes), std::forward<
decltype(callee)>(callee), std::forward<
decltype(argOperands)>(argOperands), std::forward<
decltype(templateParams)>(templateParams));
616CallOp CallOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::SymbolRefAttr callee, ::llvm::ArrayRef<::mlir::ValueRange> mapOperands, ::mlir::DenseI32ArrayAttr numDimsPerMap, ::mlir::ValueRange argOperands, ::llvm::ArrayRef<::mlir::Attribute> templateParams) {
618 build(builder, __state__, std::forward<
decltype(resultTypes)>(resultTypes), std::forward<
decltype(callee)>(callee), std::forward<
decltype(mapOperands)>(mapOperands), std::forward<
decltype(numDimsPerMap)>(numDimsPerMap), std::forward<
decltype(argOperands)>(argOperands), std::forward<
decltype(templateParams)>(templateParams));
619 auto __res__ = ::llvm::dyn_cast<CallOp>(builder.create(__state__));
620 assert(__res__ &&
"builder didn't return the right type");
624CallOp CallOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::SymbolRefAttr callee, ::llvm::ArrayRef<::mlir::ValueRange> mapOperands, ::mlir::DenseI32ArrayAttr numDimsPerMap, ::mlir::ValueRange argOperands, ::llvm::ArrayRef<::mlir::Attribute> templateParams) {
625 return create(builder, builder.getLoc(), std::forward<
decltype(resultTypes)>(resultTypes), std::forward<
decltype(callee)>(callee), std::forward<
decltype(mapOperands)>(mapOperands), std::forward<
decltype(numDimsPerMap)>(numDimsPerMap), std::forward<
decltype(argOperands)>(argOperands), std::forward<
decltype(templateParams)>(templateParams));
628void CallOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::SymbolRefAttr callee, ::llvm::ArrayRef<::mlir::ValueRange> mapOperands, ::llvm::ArrayRef<int32_t> numDimsPerMap, ::mlir::ValueRange argOperands, ::llvm::ArrayRef<::mlir::Attribute> templateParams) {
629 build(odsBuilder, odsState, resultTypes, callee, mapOperands,
630 odsBuilder.getDenseI32ArrayAttr(numDimsPerMap),
631 argOperands, templateParams);
635CallOp CallOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::SymbolRefAttr callee, ::llvm::ArrayRef<::mlir::ValueRange> mapOperands, ::llvm::ArrayRef<int32_t> numDimsPerMap, ::mlir::ValueRange argOperands, ::llvm::ArrayRef<::mlir::Attribute> templateParams) {
637 build(builder, __state__, std::forward<
decltype(resultTypes)>(resultTypes), std::forward<
decltype(callee)>(callee), std::forward<
decltype(mapOperands)>(mapOperands), std::forward<
decltype(numDimsPerMap)>(numDimsPerMap), std::forward<
decltype(argOperands)>(argOperands), std::forward<
decltype(templateParams)>(templateParams));
638 auto __res__ = ::llvm::dyn_cast<CallOp>(builder.create(__state__));
639 assert(__res__ &&
"builder didn't return the right type");
643CallOp CallOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::SymbolRefAttr callee, ::llvm::ArrayRef<::mlir::ValueRange> mapOperands, ::llvm::ArrayRef<int32_t> numDimsPerMap, ::mlir::ValueRange argOperands, ::llvm::ArrayRef<::mlir::Attribute> templateParams) {
644 return create(builder, builder.getLoc(), std::forward<
decltype(resultTypes)>(resultTypes), std::forward<
decltype(callee)>(callee), std::forward<
decltype(mapOperands)>(mapOperands), std::forward<
decltype(numDimsPerMap)>(numDimsPerMap), std::forward<
decltype(argOperands)>(argOperands), std::forward<
decltype(templateParams)>(templateParams));
650 argOperands, templateParams);
656 build(builder, __state__, std::forward<
decltype(callee)>(callee), std::forward<
decltype(argOperands)>(argOperands), std::forward<
decltype(templateParams)>(templateParams));
657 auto __res__ = ::llvm::dyn_cast<CallOp>(builder.create(__state__));
658 assert(__res__ &&
"builder didn't return the right type");
663 return create(builder, builder.getLoc(), std::forward<
decltype(callee)>(callee), std::forward<
decltype(argOperands)>(argOperands), std::forward<
decltype(templateParams)>(templateParams));
666void CallOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState,
::llzk::function::FuncDefOp callee, ::llvm::ArrayRef<::mlir::ValueRange> mapOperands, ::mlir::DenseI32ArrayAttr numDimsPerMap, ::mlir::ValueRange argOperands, ::llvm::ArrayRef<::mlir::Attribute> templateParams) {
669 argOperands, templateParams);
673CallOp CallOp::create(::mlir::OpBuilder &builder, ::mlir::Location location,
::llzk::function::FuncDefOp callee, ::llvm::ArrayRef<::mlir::ValueRange> mapOperands, ::mlir::DenseI32ArrayAttr numDimsPerMap, ::mlir::ValueRange argOperands, ::llvm::ArrayRef<::mlir::Attribute> templateParams) {
675 build(builder, __state__, std::forward<
decltype(callee)>(callee), std::forward<
decltype(mapOperands)>(mapOperands), std::forward<
decltype(numDimsPerMap)>(numDimsPerMap), std::forward<
decltype(argOperands)>(argOperands), std::forward<
decltype(templateParams)>(templateParams));
676 auto __res__ = ::llvm::dyn_cast<CallOp>(builder.create(__state__));
677 assert(__res__ &&
"builder didn't return the right type");
681CallOp CallOp::create(::mlir::ImplicitLocOpBuilder &builder,
::llzk::function::FuncDefOp callee, ::llvm::ArrayRef<::mlir::ValueRange> mapOperands, ::mlir::DenseI32ArrayAttr numDimsPerMap, ::mlir::ValueRange argOperands, ::llvm::ArrayRef<::mlir::Attribute> templateParams) {
682 return create(builder, builder.getLoc(), std::forward<
decltype(callee)>(callee), std::forward<
decltype(mapOperands)>(mapOperands), std::forward<
decltype(numDimsPerMap)>(numDimsPerMap), std::forward<
decltype(argOperands)>(argOperands), std::forward<
decltype(templateParams)>(templateParams));
685void CallOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState,
::llzk::function::FuncDefOp callee, ::llvm::ArrayRef<::mlir::ValueRange> mapOperands, ::llvm::ArrayRef<int32_t> numDimsPerMap, ::mlir::ValueRange argOperands, ::llvm::ArrayRef<::mlir::Attribute> templateParams) {
686 build(odsBuilder, odsState, callee, mapOperands,
687 odsBuilder.getDenseI32ArrayAttr(numDimsPerMap),
688 argOperands, templateParams);
692CallOp CallOp::create(::mlir::OpBuilder &builder, ::mlir::Location location,
::llzk::function::FuncDefOp callee, ::llvm::ArrayRef<::mlir::ValueRange> mapOperands, ::llvm::ArrayRef<int32_t> numDimsPerMap, ::mlir::ValueRange argOperands, ::llvm::ArrayRef<::mlir::Attribute> templateParams) {
694 build(builder, __state__, std::forward<
decltype(callee)>(callee), std::forward<
decltype(mapOperands)>(mapOperands), std::forward<
decltype(numDimsPerMap)>(numDimsPerMap), std::forward<
decltype(argOperands)>(argOperands), std::forward<
decltype(templateParams)>(templateParams));
695 auto __res__ = ::llvm::dyn_cast<CallOp>(builder.create(__state__));
696 assert(__res__ &&
"builder didn't return the right type");
700CallOp CallOp::create(::mlir::ImplicitLocOpBuilder &builder,
::llzk::function::FuncDefOp callee, ::llvm::ArrayRef<::mlir::ValueRange> mapOperands, ::llvm::ArrayRef<int32_t> numDimsPerMap, ::mlir::ValueRange argOperands, ::llvm::ArrayRef<::mlir::Attribute> templateParams) {
701 return create(builder, builder.getLoc(), std::forward<
decltype(callee)>(callee), std::forward<
decltype(mapOperands)>(mapOperands), std::forward<
decltype(numDimsPerMap)>(numDimsPerMap), std::forward<
decltype(argOperands)>(argOperands), std::forward<
decltype(templateParams)>(templateParams));
705 ::mlir::Builder odsBuilder(opName.getContext());
707 properties.
numDimsPerMap = odsBuilder.getDenseI32ArrayAttr({});
711 auto tblgen_arg_attrs = getProperties().arg_attrs; (void)tblgen_arg_attrs;
712 auto tblgen_callee = getProperties().callee; (void)tblgen_callee;
713 if (!tblgen_callee)
return emitOpError(
"requires attribute 'callee'");
714 auto tblgen_mapOpGroupSizes = getProperties().mapOpGroupSizes; (void)tblgen_mapOpGroupSizes;
715 if (!tblgen_mapOpGroupSizes)
return emitOpError(
"requires attribute 'mapOpGroupSizes'");
716 auto tblgen_numDimsPerMap = getProperties().numDimsPerMap; (void)tblgen_numDimsPerMap;
717 auto tblgen_res_attrs = getProperties().res_attrs; (void)tblgen_res_attrs;
718 auto tblgen_templateParams = getProperties().templateParams; (void)tblgen_templateParams;
720 if (::mlir::failed(__mlir_ods_local_attr_constraint_Ops1(*
this, tblgen_callee,
"callee")))
721 return ::mlir::failure();
723 if (::mlir::failed(__mlir_ods_local_attr_constraint_Ops2(*
this, tblgen_templateParams,
"templateParams")))
724 return ::mlir::failure();
726 if (::mlir::failed(__mlir_ods_local_attr_constraint_Ops3(*
this, tblgen_numDimsPerMap,
"numDimsPerMap")))
727 return ::mlir::failure();
729 if (::mlir::failed(__mlir_ods_local_attr_constraint_Ops3(*
this, tblgen_mapOpGroupSizes,
"mapOpGroupSizes")))
730 return ::mlir::failure();
732 if (::mlir::failed(__mlir_ods_local_attr_constraint_Ops4(*
this, tblgen_arg_attrs,
"arg_attrs")))
733 return ::mlir::failure();
735 if (::mlir::failed(__mlir_ods_local_attr_constraint_Ops4(*
this, tblgen_res_attrs,
"res_attrs")))
736 return ::mlir::failure();
738 unsigned index = 0; (void)index;
741 for (
auto v : valueGroup0) {
742 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops1(*
this, v.getType(),
"operand", index++)))
743 return ::mlir::failure();
746 if (::mlir::failed(::mlir::OpTrait::impl::verifyValueSizeAttr(*
this,
"mapOpGroupSizes",
"mapOperands", valueGroup1.size())))
747 return ::mlir::failure();
749 for (
auto v : valueGroup1) {
750 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops2(*
this, v.getType(),
"operand", index++)))
751 return ::mlir::failure();
755 unsigned index = 0; (void)index;
758 for (
auto v : valueGroup0) {
759 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops1(*
this, v.getType(),
"result", index++)))
760 return ::mlir::failure();
763 return ::mlir::success();
770::mlir::ParseResult
CallOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
771 ::mlir::SymbolRefAttr calleeAttr;
772 ::mlir::ArrayAttr templateParamsAttr;
773 ::llvm::SmallVector<::mlir::OpAsmParser::UnresolvedOperand, 4> argOperandsOperands;
774 ::llvm::SMLoc argOperandsOperandsLoc;
775 (void)argOperandsOperandsLoc;
776 ::llvm::SmallVector<::mlir::OpAsmParser::UnresolvedOperand, 4> mapOperandsOperands;
777 llvm::SmallVector<int32_t> mapOperandsOperandGroupSizes;
778 ::llvm::SMLoc mapOperandsOperandsLoc;
779 (void)mapOperandsOperandsLoc;
780 ::mlir::DenseI32ArrayAttr numDimsPerMapAttr;
781 ::llvm::ArrayRef<::mlir::Type> argOperandsTypes;
782 ::llvm::ArrayRef<::mlir::Type> allResultTypes;
784 if (parser.parseCustomAttributeWithFallback(calleeAttr, parser.getBuilder().getType<::mlir::NoneType>())) {
785 return ::mlir::failure();
788 if (::mlir::succeeded(parser.parseOptionalLess())) {
791 if (odsResult) return ::mlir::failure();
792 if (templateParamsAttr)
795 if (parser.parseGreater())
796 return ::mlir::failure();
798 if (parser.parseLParen())
799 return ::mlir::failure();
801 argOperandsOperandsLoc = parser.getCurrentLocation();
802 if (parser.parseOperandList(argOperandsOperands))
803 return ::mlir::failure();
804 if (parser.parseRParen())
805 return ::mlir::failure();
806 if (::mlir::succeeded(parser.parseOptionalLBrace())) {
808 mapOperandsOperandsLoc = parser.getCurrentLocation();
809 ::llvm::SmallVector<::llvm::SmallVector<::mlir::OpAsmParser::UnresolvedOperand>> mapOperandsOperandGroups;
811 if (odsResult) return ::mlir::failure();
812 for (
const auto &subRange : mapOperandsOperandGroups) {
813 mapOperandsOperands.append(subRange.begin(), subRange.end());
814 mapOperandsOperandGroupSizes.push_back(subRange.size());
816 if (numDimsPerMapAttr)
819 if (parser.parseRBrace())
820 return ::mlir::failure();
822 if (parser.parseColon())
823 return ::mlir::failure();
825 ::mlir::FunctionType argOperands__allResult_functionType;
826 if (parser.parseType(argOperands__allResult_functionType))
827 return ::mlir::failure();
828 argOperandsTypes = argOperands__allResult_functionType.getInputs();
829 allResultTypes = argOperands__allResult_functionType.getResults();
832 if (odsResult) return ::mlir::failure();
834::llvm::copy(::llvm::ArrayRef<int32_t>({
static_cast<int32_t
>(argOperandsOperands.size()),
static_cast<int32_t
>(mapOperandsOperands.size())}), result.getOrAddProperties<
CallOp::Properties>().operandSegmentSizes.begin());
835 result.getOrAddProperties<
CallOp::Properties>().mapOpGroupSizes = parser.getBuilder().getDenseI32ArrayAttr(mapOperandsOperandGroupSizes);
836 ::mlir::Type odsBuildableType0 = parser.getBuilder().getIndexType();
837 result.addTypes(allResultTypes);
838 if (parser.resolveOperands(argOperandsOperands, argOperandsTypes, argOperandsOperandsLoc, result.operands))
839 return ::mlir::failure();
840 if (parser.resolveOperands(mapOperandsOperands, odsBuildableType0, mapOperandsOperandsLoc, result.operands))
841 return ::mlir::failure();
842 return ::mlir::success();
846 ::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
848 emitError() <<
"expected DictionaryAttr to set properties";
849 return ::mlir::failure();
853 ::mlir::DenseSet<::mlir::StringAttr> usedKeys;
854 ::mlir::MLIRContext *ctx = dict.getContext();
859 auto mapOpGroupSizesAttrName = ::mlir::StringAttr::get(ctx,
"mapOpGroupSizes");
860 auto attr = dict.get(mapOpGroupSizesAttrName);
861 usedKeys.insert(mapOpGroupSizesAttrName);
864 emitError() <<
"expected key entry for mapOpGroupSizes in DictionaryAttr to set "
866 return ::mlir::failure();
868 auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<
decltype(propStorage)>>(attr);
870 propStorage = convertedAttr;
872 emitError() <<
"Invalid attribute `mapOpGroupSizes` in property conversion: " << attr;
873 return ::mlir::failure();
880 auto arg_attrsAttrName = ::mlir::StringAttr::get(ctx,
"arg_attrs");
881 auto attr = dict.get(arg_attrsAttrName);
882 usedKeys.insert(arg_attrsAttrName);
885 emitError() <<
"expected key entry for arg_attrs in DictionaryAttr to set "
887 return ::mlir::failure();
889 auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<
decltype(propStorage)>>(attr);
891 propStorage = convertedAttr;
893 emitError() <<
"Invalid attribute `arg_attrs` in property conversion: " << attr;
894 return ::mlir::failure();
901 auto res_attrsAttrName = ::mlir::StringAttr::get(ctx,
"res_attrs");
902 auto attr = dict.get(res_attrsAttrName);
903 usedKeys.insert(res_attrsAttrName);
906 emitError() <<
"expected key entry for res_attrs in DictionaryAttr to set "
908 return ::mlir::failure();
910 auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<
decltype(propStorage)>>(attr);
912 propStorage = convertedAttr;
914 emitError() <<
"Invalid attribute `res_attrs` in property conversion: " << attr;
915 return ::mlir::failure();
920 for (::mlir::NamedAttribute attr : dict) {
921 if (!usedKeys.contains(attr.getName()))
922 return emitError() <<
"unknown key '" << attr.getName() <<
923 "' when parsing properties dictionary";
925 return ::mlir::success();
940 _odsPrinter <<
' ' <<
"{";
944 _odsPrinter <<
' ' <<
":";
946 _odsPrinter.printFunctionalType(
getArgOperands().getTypes(), getOperation()->getResultTypes());
969 return attr.getValue();
974 return ::llvm::cast<::mlir::FunctionType>(attr.getValue());
979 return attr ? ::std::optional< ::mlir::ArrayAttr >(attr) : (::std::nullopt);
984 return attr ? ::std::optional< ::mlir::ArrayAttr >(attr) : (::std::nullopt);
994 if (!tblgen_function_type)
return emitError(loc,
"'function.def' op requires attribute 'function_type'");
997 if (!tblgen_sym_name)
return emitError(loc,
"'function.def' op requires attribute 'sym_name'");
999 if (tblgen_sym_name && !((::llvm::isa<::mlir::StringAttr>(tblgen_sym_name))))
1000 return emitError(loc,
"'function.def' op attribute 'sym_name' failed to satisfy constraint: string attribute");
1002 if (tblgen_function_type && !(((::llvm::isa<::mlir::TypeAttr>(tblgen_function_type))) && ((::llvm::isa<::mlir::FunctionType>(::llvm::cast<::mlir::TypeAttr>(tblgen_function_type).getValue()))) && ((::llvm::isa<::mlir::FunctionType>(::llvm::cast<::mlir::TypeAttr>(tblgen_function_type).getValue())))))
1003 return emitError(loc,
"'function.def' op attribute 'function_type' failed to satisfy constraint: type attribute of function type");
1005 if (tblgen_arg_attrs && !(((::llvm::isa<::mlir::ArrayAttr>(tblgen_arg_attrs))) && (::llvm::all_of(::llvm::cast<::mlir::ArrayAttr>(tblgen_arg_attrs), [&](::mlir::Attribute attr) {
return attr && ((::llvm::isa<::mlir::DictionaryAttr>(attr))); }))))
1006 return emitError(loc,
"'function.def' op attribute 'arg_attrs' failed to satisfy constraint: Array of dictionary attributes");
1008 if (tblgen_res_attrs && !(((::llvm::isa<::mlir::ArrayAttr>(tblgen_res_attrs))) && (::llvm::all_of(::llvm::cast<::mlir::ArrayAttr>(tblgen_res_attrs), [&](::mlir::Attribute attr) {
return attr && ((::llvm::isa<::mlir::DictionaryAttr>(attr))); }))))
1009 return emitError(loc,
"'function.def' op attribute 'res_attrs' failed to satisfy constraint: Array of dictionary attributes");
1010 return ::mlir::success();
1014 ::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
1016 emitError() <<
"expected DictionaryAttr to set properties";
1017 return ::mlir::failure();
1022 auto attr = dict.get(
"arg_attrs");
1024 auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<
decltype(propStorage)>>(attr);
1025 if (convertedAttr) {
1026 propStorage = convertedAttr;
1028 emitError() <<
"Invalid attribute `arg_attrs` in property conversion: " << attr;
1029 return ::mlir::failure();
1036 auto attr = dict.get(
"function_type");
1038 auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<
decltype(propStorage)>>(attr);
1039 if (convertedAttr) {
1040 propStorage = convertedAttr;
1042 emitError() <<
"Invalid attribute `function_type` in property conversion: " << attr;
1043 return ::mlir::failure();
1050 auto attr = dict.get(
"res_attrs");
1052 auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<
decltype(propStorage)>>(attr);
1053 if (convertedAttr) {
1054 propStorage = convertedAttr;
1056 emitError() <<
"Invalid attribute `res_attrs` in property conversion: " << attr;
1057 return ::mlir::failure();
1064 auto attr = dict.get(
"sym_name");
1066 auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<
decltype(propStorage)>>(attr);
1067 if (convertedAttr) {
1068 propStorage = convertedAttr;
1070 emitError() <<
"Invalid attribute `sym_name` in property conversion: " << attr;
1071 return ::mlir::failure();
1075 return ::mlir::success();
1079 ::mlir::SmallVector<::mlir::NamedAttribute> attrs;
1080 ::mlir::Builder odsBuilder{ctx};
1083 const auto &propStorage = prop.
arg_attrs;
1085 attrs.push_back(odsBuilder.getNamedAttr(
"arg_attrs",
1092 attrs.push_back(odsBuilder.getNamedAttr(
"function_type",
1097 const auto &propStorage = prop.
res_attrs;
1099 attrs.push_back(odsBuilder.getNamedAttr(
"res_attrs",
1104 const auto &propStorage = prop.
sym_name;
1106 attrs.push_back(odsBuilder.getNamedAttr(
"sym_name",
1111 return odsBuilder.getDictionaryAttr(attrs);
1116 using llvm::hash_value;
1117 return llvm::hash_combine(
1118 llvm::hash_value(prop.
arg_attrs.getAsOpaquePointer()),
1120 llvm::hash_value(prop.
res_attrs.getAsOpaquePointer()),
1121 llvm::hash_value(prop.
sym_name.getAsOpaquePointer()));
1125 if (name ==
"arg_attrs")
1128 if (name ==
"function_type")
1131 if (name ==
"res_attrs")
1134 if (name ==
"sym_name")
1136 return std::nullopt;
1140 if (name ==
"arg_attrs") {
1141 prop.
arg_attrs = ::llvm::dyn_cast_or_null<std::remove_reference_t<
decltype(prop.
arg_attrs)>>(value);
1145 if (name ==
"function_type") {
1150 if (name ==
"res_attrs") {
1151 prop.
res_attrs = ::llvm::dyn_cast_or_null<std::remove_reference_t<
decltype(prop.
res_attrs)>>(value);
1155 if (name ==
"sym_name") {
1156 prop.
sym_name = ::llvm::dyn_cast_or_null<std::remove_reference_t<
decltype(prop.
sym_name)>>(value);
1171::llvm::LogicalResult
FuncDefOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
1174 if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_Ops4(attr,
"arg_attrs", emitError)))
1175 return ::mlir::failure();
1180 if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_Ops6(attr,
"function_type", emitError)))
1181 return ::mlir::failure();
1186 if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_Ops4(attr,
"res_attrs", emitError)))
1187 return ::mlir::failure();
1192 if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_Ops5(attr,
"sym_name", emitError)))
1193 return ::mlir::failure();
1195 return ::mlir::success();
1199 auto &prop = state.getOrAddProperties<
Properties>(); (void)prop;
1200 if (::mlir::failed(reader.readOptionalAttribute(prop.
arg_attrs)))
1201 return ::mlir::failure();
1203 if (::mlir::failed(reader.readAttribute(prop.
function_type)))
1204 return ::mlir::failure();
1206 if (::mlir::failed(reader.readOptionalAttribute(prop.
res_attrs)))
1207 return ::mlir::failure();
1209 if (::mlir::failed(reader.readAttribute(prop.
sym_name)))
1210 return ::mlir::failure();
1211 return ::mlir::success();
1215 auto &prop = getProperties(); (void)prop;
1217 writer.writeOptionalAttribute(prop.
arg_attrs);
1220 writer.writeOptionalAttribute(prop.
res_attrs);
1221 writer.writeAttribute(prop.
sym_name);
1226 return attr.getValue();
1231 return ::llvm::cast<::mlir::FunctionType>(attr.getValue());
1236 return attr ? ::std::optional< ::mlir::ArrayAttr >(attr) : (::std::nullopt);
1241 return attr ? ::std::optional< ::mlir::ArrayAttr >(attr) : (::std::nullopt);
1245 getProperties().sym_name = ::mlir::Builder((*this)->getContext()).getStringAttr(attrValue);
1249 getProperties().function_type = ::mlir::TypeAttr::get(attrValue);
1252FuncDefOp FuncDefOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::llvm::StringRef name, ::mlir::FunctionType type, ::llvm::ArrayRef<::mlir::NamedAttribute> attrs, ::llvm::ArrayRef<::mlir::DictionaryAttr> argAttrs) {
1254 build(builder, __state__, std::forward<
decltype(name)>(name), std::forward<
decltype(type)>(type), std::forward<
decltype(attrs)>(attrs), std::forward<
decltype(argAttrs)>(argAttrs));
1255 auto __res__ = ::llvm::dyn_cast<FuncDefOp>(builder.create(__state__));
1256 assert(__res__ &&
"builder didn't return the right type");
1260FuncDefOp FuncDefOp::create(::mlir::ImplicitLocOpBuilder &builder, ::llvm::StringRef name, ::mlir::FunctionType type, ::llvm::ArrayRef<::mlir::NamedAttribute> attrs, ::llvm::ArrayRef<::mlir::DictionaryAttr> argAttrs) {
1261 return create(builder, builder.getLoc(), std::forward<
decltype(name)>(name), std::forward<
decltype(type)>(type), std::forward<
decltype(attrs)>(attrs), std::forward<
decltype(argAttrs)>(argAttrs));
1264void FuncDefOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::StringAttr sym_name, ::mlir::TypeAttr function_type, ::mlir::ArrayAttr arg_attrs, ::mlir::ArrayAttr res_attrs) {
1265 odsState.getOrAddProperties<
Properties>().sym_name = sym_name;
1266 odsState.getOrAddProperties<
Properties>().function_type = function_type;
1268 odsState.getOrAddProperties<
Properties>().arg_attrs = arg_attrs;
1271 odsState.getOrAddProperties<
Properties>().res_attrs = res_attrs;
1273 (void)odsState.addRegion();
1276FuncDefOp FuncDefOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::StringAttr sym_name, ::mlir::TypeAttr function_type, ::mlir::ArrayAttr arg_attrs, ::mlir::ArrayAttr res_attrs) {
1278 build(builder, __state__, std::forward<
decltype(sym_name)>(sym_name), std::forward<
decltype(function_type)>(function_type), std::forward<
decltype(arg_attrs)>(arg_attrs), std::forward<
decltype(res_attrs)>(res_attrs));
1279 auto __res__ = ::llvm::dyn_cast<FuncDefOp>(builder.create(__state__));
1280 assert(__res__ &&
"builder didn't return the right type");
1284FuncDefOp FuncDefOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::StringAttr sym_name, ::mlir::TypeAttr function_type, ::mlir::ArrayAttr arg_attrs, ::mlir::ArrayAttr res_attrs) {
1285 return create(builder, builder.getLoc(), std::forward<
decltype(sym_name)>(sym_name), std::forward<
decltype(function_type)>(function_type), std::forward<
decltype(arg_attrs)>(arg_attrs), std::forward<
decltype(res_attrs)>(res_attrs));
1288void FuncDefOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::StringAttr sym_name, ::mlir::TypeAttr function_type, ::mlir::ArrayAttr arg_attrs, ::mlir::ArrayAttr res_attrs) {
1289 odsState.getOrAddProperties<
Properties>().sym_name = sym_name;
1290 odsState.getOrAddProperties<
Properties>().function_type = function_type;
1292 odsState.getOrAddProperties<
Properties>().arg_attrs = arg_attrs;
1295 odsState.getOrAddProperties<
Properties>().res_attrs = res_attrs;
1297 (void)odsState.addRegion();
1298 assert(resultTypes.size() == 0u &&
"mismatched number of results");
1299 odsState.addTypes(resultTypes);
1302FuncDefOp FuncDefOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::StringAttr sym_name, ::mlir::TypeAttr function_type, ::mlir::ArrayAttr arg_attrs, ::mlir::ArrayAttr res_attrs) {
1304 build(builder, __state__, std::forward<
decltype(resultTypes)>(resultTypes), std::forward<
decltype(sym_name)>(sym_name), std::forward<
decltype(function_type)>(function_type), std::forward<
decltype(arg_attrs)>(arg_attrs), std::forward<
decltype(res_attrs)>(res_attrs));
1305 auto __res__ = ::llvm::dyn_cast<FuncDefOp>(builder.create(__state__));
1306 assert(__res__ &&
"builder didn't return the right type");
1310FuncDefOp FuncDefOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::StringAttr sym_name, ::mlir::TypeAttr function_type, ::mlir::ArrayAttr arg_attrs, ::mlir::ArrayAttr res_attrs) {
1311 return create(builder, builder.getLoc(), std::forward<
decltype(resultTypes)>(resultTypes), std::forward<
decltype(sym_name)>(sym_name), std::forward<
decltype(function_type)>(function_type), std::forward<
decltype(arg_attrs)>(arg_attrs), std::forward<
decltype(res_attrs)>(res_attrs));
1314void FuncDefOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::llvm::StringRef sym_name, ::mlir::FunctionType function_type, ::mlir::ArrayAttr arg_attrs, ::mlir::ArrayAttr res_attrs) {
1315 odsState.getOrAddProperties<
Properties>().sym_name = odsBuilder.getStringAttr(sym_name);
1316 odsState.getOrAddProperties<
Properties>().function_type = ::mlir::TypeAttr::get(function_type);
1318 odsState.getOrAddProperties<
Properties>().arg_attrs = arg_attrs;
1321 odsState.getOrAddProperties<
Properties>().res_attrs = res_attrs;
1323 (void)odsState.addRegion();
1326FuncDefOp FuncDefOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::llvm::StringRef sym_name, ::mlir::FunctionType function_type, ::mlir::ArrayAttr arg_attrs, ::mlir::ArrayAttr res_attrs) {
1328 build(builder, __state__, std::forward<
decltype(sym_name)>(sym_name), std::forward<
decltype(function_type)>(function_type), std::forward<
decltype(arg_attrs)>(arg_attrs), std::forward<
decltype(res_attrs)>(res_attrs));
1329 auto __res__ = ::llvm::dyn_cast<FuncDefOp>(builder.create(__state__));
1330 assert(__res__ &&
"builder didn't return the right type");
1334FuncDefOp FuncDefOp::create(::mlir::ImplicitLocOpBuilder &builder, ::llvm::StringRef sym_name, ::mlir::FunctionType function_type, ::mlir::ArrayAttr arg_attrs, ::mlir::ArrayAttr res_attrs) {
1335 return create(builder, builder.getLoc(), std::forward<
decltype(sym_name)>(sym_name), std::forward<
decltype(function_type)>(function_type), std::forward<
decltype(arg_attrs)>(arg_attrs), std::forward<
decltype(res_attrs)>(res_attrs));
1338void FuncDefOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::llvm::StringRef sym_name, ::mlir::FunctionType function_type, ::mlir::ArrayAttr arg_attrs, ::mlir::ArrayAttr res_attrs) {
1339 odsState.getOrAddProperties<
Properties>().sym_name = odsBuilder.getStringAttr(sym_name);
1340 odsState.getOrAddProperties<
Properties>().function_type = ::mlir::TypeAttr::get(function_type);
1342 odsState.getOrAddProperties<
Properties>().arg_attrs = arg_attrs;
1345 odsState.getOrAddProperties<
Properties>().res_attrs = res_attrs;
1347 (void)odsState.addRegion();
1348 assert(resultTypes.size() == 0u &&
"mismatched number of results");
1349 odsState.addTypes(resultTypes);
1352FuncDefOp FuncDefOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::llvm::StringRef sym_name, ::mlir::FunctionType function_type, ::mlir::ArrayAttr arg_attrs, ::mlir::ArrayAttr res_attrs) {
1354 build(builder, __state__, std::forward<
decltype(resultTypes)>(resultTypes), std::forward<
decltype(sym_name)>(sym_name), std::forward<
decltype(function_type)>(function_type), std::forward<
decltype(arg_attrs)>(arg_attrs), std::forward<
decltype(res_attrs)>(res_attrs));
1355 auto __res__ = ::llvm::dyn_cast<FuncDefOp>(builder.create(__state__));
1356 assert(__res__ &&
"builder didn't return the right type");
1360FuncDefOp FuncDefOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::llvm::StringRef sym_name, ::mlir::FunctionType function_type, ::mlir::ArrayAttr arg_attrs, ::mlir::ArrayAttr res_attrs) {
1361 return create(builder, builder.getLoc(), std::forward<
decltype(resultTypes)>(resultTypes), std::forward<
decltype(sym_name)>(sym_name), std::forward<
decltype(function_type)>(function_type), std::forward<
decltype(arg_attrs)>(arg_attrs), std::forward<
decltype(res_attrs)>(res_attrs));
1364void FuncDefOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
1365 assert(operands.size() == 0u &&
"mismatched number of parameters");
1366 odsState.addOperands(operands);
1367 odsState.addAttributes(attributes);
1368 for (
unsigned i = 0; i != 1; ++i)
1369 (
void)odsState.addRegion();
1370 assert(resultTypes.size() == 0u &&
"mismatched number of return types");
1371 odsState.addTypes(resultTypes);
1373 if (!attributes.empty()) {
1375 ::mlir::PropertyRef properties = odsState.getRawProperties();
1376 std::optional<::mlir::RegisteredOperationName> info =
1377 odsState.name.getRegisteredInfo();
1378 if (failed(info->setOpPropertiesFromAttribute(odsState.name, properties,
1379 odsState.attributes.getDictionary(odsState.getContext()),
nullptr)))
1380 ::llvm::report_fatal_error(
"Property conversion failed.");
1384FuncDefOp FuncDefOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
1386 build(builder, __state__, std::forward<
decltype(resultTypes)>(resultTypes), std::forward<
decltype(operands)>(operands), std::forward<
decltype(attributes)>(attributes));
1387 auto __res__ = ::llvm::dyn_cast<FuncDefOp>(builder.create(__state__));
1388 assert(__res__ &&
"builder didn't return the right type");
1392FuncDefOp FuncDefOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
1393 return create(builder, builder.getLoc(), std::forward<
decltype(resultTypes)>(resultTypes), std::forward<
decltype(operands)>(operands), std::forward<
decltype(attributes)>(attributes));
1396void FuncDefOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands,
const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
1397 assert(operands.size() == 0u &&
"mismatched number of parameters");
1398 odsState.addOperands(operands);
1399 odsState.useProperties(
const_cast<Properties&
>(properties));
1400 odsState.addAttributes(discardableAttributes);
1401 for (
unsigned i = 0; i != 1; ++i)
1402 (
void)odsState.addRegion();
1403 assert(resultTypes.size() == 0u &&
"mismatched number of return types");
1404 odsState.addTypes(resultTypes);
1407FuncDefOp FuncDefOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands,
const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
1409 build(builder, __state__, std::forward<
decltype(resultTypes)>(resultTypes), std::forward<
decltype(operands)>(operands), std::forward<
decltype(properties)>(properties), std::forward<
decltype(discardableAttributes)>(discardableAttributes));
1410 auto __res__ = ::llvm::dyn_cast<FuncDefOp>(builder.create(__state__));
1411 assert(__res__ &&
"builder didn't return the right type");
1415FuncDefOp FuncDefOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands,
const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
1416 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));
1420 auto tblgen_arg_attrs = getProperties().arg_attrs; (void)tblgen_arg_attrs;
1421 auto tblgen_function_type = getProperties().function_type; (void)tblgen_function_type;
1422 if (!tblgen_function_type)
return emitOpError(
"requires attribute 'function_type'");
1423 auto tblgen_res_attrs = getProperties().res_attrs; (void)tblgen_res_attrs;
1424 auto tblgen_sym_name = getProperties().sym_name; (void)tblgen_sym_name;
1425 if (!tblgen_sym_name)
return emitOpError(
"requires attribute 'sym_name'");
1427 if (::mlir::failed(__mlir_ods_local_attr_constraint_Ops5(*
this, tblgen_sym_name,
"sym_name")))
1428 return ::mlir::failure();
1430 if (::mlir::failed(__mlir_ods_local_attr_constraint_Ops6(*
this, tblgen_function_type,
"function_type")))
1431 return ::mlir::failure();
1433 if (::mlir::failed(__mlir_ods_local_attr_constraint_Ops4(*
this, tblgen_arg_attrs,
"arg_attrs")))
1434 return ::mlir::failure();
1436 if (::mlir::failed(__mlir_ods_local_attr_constraint_Ops4(*
this, tblgen_res_attrs,
"res_attrs")))
1437 return ::mlir::failure();
1439 unsigned index = 0; (void)index;
1441 for (
auto ®ion : ::llvm::MutableArrayRef((*this)->getRegion(0)))
1442 if (::mlir::failed(__mlir_ods_local_region_constraint_Ops1(*
this, region,
"body", index++)))
1443 return ::mlir::failure();
1445 return ::mlir::success();
1450 return ::mlir::success();
1451 return ::mlir::failure();
1455 ::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
1457 emitError() <<
"expected DictionaryAttr to set properties";
1458 return ::mlir::failure();
1462 ::mlir::DenseSet<::mlir::StringAttr> usedKeys;
1463 ::mlir::MLIRContext *ctx = dict.getContext();
1468 auto sym_nameAttrName = ::mlir::StringAttr::get(ctx,
"sym_name");
1469 auto attr = dict.get(sym_nameAttrName);
1470 usedKeys.insert(sym_nameAttrName);
1473 emitError() <<
"expected key entry for sym_name in DictionaryAttr to set "
1475 return ::mlir::failure();
1477 auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<
decltype(propStorage)>>(attr);
1478 if (convertedAttr) {
1479 propStorage = convertedAttr;
1481 emitError() <<
"Invalid attribute `sym_name` in property conversion: " << attr;
1482 return ::mlir::failure();
1489 auto function_typeAttrName = ::mlir::StringAttr::get(ctx,
"function_type");
1490 auto attr = dict.get(function_typeAttrName);
1491 usedKeys.insert(function_typeAttrName);
1494 emitError() <<
"expected key entry for function_type in DictionaryAttr to set "
1496 return ::mlir::failure();
1498 auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<
decltype(propStorage)>>(attr);
1499 if (convertedAttr) {
1500 propStorage = convertedAttr;
1502 emitError() <<
"Invalid attribute `function_type` in property conversion: " << attr;
1503 return ::mlir::failure();
1510 auto arg_attrsAttrName = ::mlir::StringAttr::get(ctx,
"arg_attrs");
1511 auto attr = dict.get(arg_attrsAttrName);
1512 usedKeys.insert(arg_attrsAttrName);
1513 if (attr ||
false) {
1515 emitError() <<
"expected key entry for arg_attrs in DictionaryAttr to set "
1517 return ::mlir::failure();
1519 auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<
decltype(propStorage)>>(attr);
1520 if (convertedAttr) {
1521 propStorage = convertedAttr;
1523 emitError() <<
"Invalid attribute `arg_attrs` in property conversion: " << attr;
1524 return ::mlir::failure();
1531 auto res_attrsAttrName = ::mlir::StringAttr::get(ctx,
"res_attrs");
1532 auto attr = dict.get(res_attrsAttrName);
1533 usedKeys.insert(res_attrsAttrName);
1534 if (attr ||
false) {
1536 emitError() <<
"expected key entry for res_attrs in DictionaryAttr to set "
1538 return ::mlir::failure();
1540 auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<
decltype(propStorage)>>(attr);
1541 if (convertedAttr) {
1542 propStorage = convertedAttr;
1544 emitError() <<
"Invalid attribute `res_attrs` in property conversion: " << attr;
1545 return ::mlir::failure();
1550 for (::mlir::NamedAttribute attr : dict) {
1551 if (!usedKeys.contains(attr.getName()))
1552 return emitError() <<
"unknown key '" << attr.getName() <<
1553 "' when parsing properties dictionary";
1555 return ::mlir::success();
1575 bool isVariadic[] = {
true};
1576 int prevVariadicCount = 0;
1577 for (
unsigned i = 0; i < index; ++i)
1578 if (isVariadic[i]) ++prevVariadicCount;
1582 int variadicSize = (odsOperandsSize - 0) / 1;
1587 int start = index + (variadicSize - 1) * prevVariadicCount;
1588 int size = isVariadic[index] ? variadicSize : 1;
1589 return {start, size};
1597 return ::mlir::success();
1601 bool isVariadic[] = {
true};
1602 int prevVariadicCount = 0;
1603 for (
unsigned i = 0; i < index; ++i)
1604 if (isVariadic[i]) ++prevVariadicCount;
1608 int variadicSize = (getOperation()->getNumOperands() - 0) / 1;
1613 int start = index + (variadicSize - 1) * prevVariadicCount;
1614 int size = isVariadic[index] ? variadicSize : 1;
1615 return {start, size};
1620 auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
1621 return mutableRange;
1625 ::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
1627 emitError() <<
"expected DictionaryAttr to set properties";
1628 return ::mlir::failure();
1630 return ::mlir::success();
1634 ::mlir::SmallVector<::mlir::NamedAttribute> attrs;
1635 ::mlir::Builder odsBuilder{ctx};
1638 return odsBuilder.getDictionaryAttr(attrs);
1643 using llvm::hash_value;
1644 return llvm::hash_combine();
1648 return std::nullopt;
1657::llvm::LogicalResult
ReturnOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
1658 return ::mlir::success();
1662 build(odsBuilder, odsState, ::mlir::ValueRange {});
1668 build(builder, __state__);
1669 auto __res__ = ::llvm::dyn_cast<ReturnOp>(builder.create(__state__));
1670 assert(__res__ &&
"builder didn't return the right type");
1675 return create(builder, builder.getLoc());
1678void ReturnOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands) {
1679 odsState.addOperands(operands);
1684 build(builder, __state__, std::forward<
decltype(operands)>(operands));
1685 auto __res__ = ::llvm::dyn_cast<ReturnOp>(builder.create(__state__));
1686 assert(__res__ &&
"builder didn't return the right type");
1691 return create(builder, builder.getLoc(), std::forward<
decltype(operands)>(operands));
1694void ReturnOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
1695 odsState.addOperands(operands);
1696 odsState.addAttributes(attributes);
1697 assert(resultTypes.size() == 0u &&
"mismatched number of return types");
1698 odsState.addTypes(resultTypes);
1701ReturnOp ReturnOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
1703 build(builder, __state__, std::forward<
decltype(resultTypes)>(resultTypes), std::forward<
decltype(operands)>(operands), std::forward<
decltype(attributes)>(attributes));
1704 auto __res__ = ::llvm::dyn_cast<ReturnOp>(builder.create(__state__));
1705 assert(__res__ &&
"builder didn't return the right type");
1709ReturnOp ReturnOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
1710 return create(builder, builder.getLoc(), std::forward<
decltype(resultTypes)>(resultTypes), std::forward<
decltype(operands)>(operands), std::forward<
decltype(attributes)>(attributes));
1713void ReturnOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands,
const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
1714 odsState.addOperands(operands);
1715 odsState.useProperties(
const_cast<Properties&
>(properties));
1716 odsState.addAttributes(discardableAttributes);
1717 assert(resultTypes.size() == 0u &&
"mismatched number of return types");
1718 odsState.addTypes(resultTypes);
1721ReturnOp ReturnOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands,
const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
1723 build(builder, __state__, std::forward<
decltype(resultTypes)>(resultTypes), std::forward<
decltype(operands)>(operands), std::forward<
decltype(properties)>(properties), std::forward<
decltype(discardableAttributes)>(discardableAttributes));
1724 auto __res__ = ::llvm::dyn_cast<ReturnOp>(builder.create(__state__));
1725 assert(__res__ &&
"builder didn't return the right type");
1729ReturnOp ReturnOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands,
const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
1730 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));
1735 unsigned index = 0; (void)index;
1738 for (
auto v : valueGroup0) {
1739 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops1(*
this, v.getType(),
"operand", index++)))
1740 return ::mlir::failure();
1743 return ::mlir::success();
1748 return ::mlir::success();
1749 return ::mlir::failure();
1752::mlir::ParseResult
ReturnOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
1753 ::llvm::SmallVector<::mlir::OpAsmParser::UnresolvedOperand, 4> operandsOperands;
1754 ::llvm::SMLoc operandsOperandsLoc;
1755 (void)operandsOperandsLoc;
1756 ::llvm::SmallVector<::mlir::Type, 1> operandsTypes;
1758 auto loc = parser.getCurrentLocation();(void)loc;
1759 if (parser.parseOptionalAttrDict(result.attributes))
1760 return ::mlir::failure();
1762 return parser.emitError(loc) <<
"'" << result.name.getStringRef() <<
"' op ";
1764 return ::mlir::failure();
1767 operandsOperandsLoc = parser.getCurrentLocation();
1768 if (parser.parseOperandList(operandsOperands))
1769 return ::mlir::failure();
1770 if (!operandsOperands.empty()) {
1771 if (parser.parseColon())
1772 return ::mlir::failure();
1774 if (parser.parseTypeList(operandsTypes))
1775 return ::mlir::failure();
1777 if (parser.resolveOperands(operandsOperands, operandsTypes, operandsOperandsLoc, result.operands))
1778 return ::mlir::failure();
1779 return ::mlir::success();
1783 ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
1784 _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
1788 _odsPrinter <<
' ' <<
":";
1794void ReturnOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
::llvm::LogicalResult verify(::mlir::Location loc)
CallOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
::mlir::ValueRange getOperands()
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::SymbolRefAttr callee, ::mlir::ValueRange argOperands={}, ::llvm::ArrayRef<::mlir::Attribute > templateParams={})
void setNumDimsPerMap(::llvm::ArrayRef< int32_t > attrValue)
::mlir::SymbolRefAttr getCalleeAttr()
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)
static llvm::hash_code computePropertiesHash(const Properties &prop)
static void populateDefaultProperties(::mlir::OperationName opName, Properties &properties)
::mlir::StringAttr getResAttrsAttrName()
::std::optional< ::mlir::ArrayAttr > getArgAttrs()
::mlir::SymbolRefAttr getCallee()
std::pair< unsigned, unsigned > getODSResultIndexAndLength(unsigned index)
static std::optional< mlir::Attribute > getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name)
::llvm::LogicalResult setPropertiesFromParsedAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
::mlir::ArrayAttr getArgAttrsAttr()
::mlir::StringAttr getArgAttrsAttrName()
void setMapOpGroupSizes(::llvm::ArrayRef< int32_t > attrValue)
::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
::mlir::StringAttr getTemplateParamsAttrName()
static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value)
::llvm::ArrayRef< int32_t > getMapOpGroupSizes()
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index)
::mlir::MutableOperandRange getArgOperandsMutable()
::llvm::ArrayRef< int32_t > getNumDimsPerMap()
::mlir::Operation::operand_range getArgOperands()
static CallOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::SymbolRefAttr callee, ::mlir::ValueRange argOperands={}, ::llvm::ArrayRef<::mlir::Attribute > templateParams={})
::llvm::LogicalResult verifyInvariants()
::mlir::StringAttr getMapOpGroupSizesAttrName()
::mlir::ArrayAttr getTemplateParamsAttr()
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
void print(::mlir::OpAsmPrinter &_odsPrinter)
static constexpr ::llvm::StringLiteral getOperationName()
::mlir::OperandRangeRange getMapOperands()
::mlir::ArrayAttr getResAttrsAttr()
FoldAdaptor::Properties Properties
::mlir::DenseI32ArrayAttr getMapOpGroupSizesAttr()
::std::optional< ::mlir::ArrayAttr > getTemplateParams()
::mlir::StringAttr getNumDimsPerMapAttrName()
::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop)
::mlir::MutableOperandRangeRange getMapOperandsMutable()
::llvm::LogicalResult verifyInvariantsImpl()
::mlir::Operation::result_range getODSResults(unsigned index)
::mlir::StringAttr getCalleeAttrName()
::std::optional< ::mlir::ArrayAttr > getResAttrs()
::mlir::DenseI32ArrayAttr getNumDimsPerMapAttr()
::mlir::Operation::operand_range getODSOperands(unsigned index)
FuncDefOpAdaptor(FuncDefOp op)
FuncDefOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
::llvm::LogicalResult verify(::mlir::Location loc)
::mlir::ValueRange getOperands()
static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value)
static FuncDefOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::llvm::StringRef name, ::mlir::FunctionType type, ::llvm::ArrayRef<::mlir::NamedAttribute > attrs={}, ::llvm::ArrayRef<::mlir::DictionaryAttr > argAttrs={})
static llvm::hash_code computePropertiesHash(const Properties &prop)
FoldAdaptor::Properties Properties
::mlir::FunctionType getFunctionType()
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::llvm::StringRef name, ::mlir::FunctionType type, ::llvm::ArrayRef<::mlir::NamedAttribute > attrs={}, ::llvm::ArrayRef<::mlir::DictionaryAttr > argAttrs={})
::mlir::StringAttr getSymNameAttrName()
::mlir::StringAttr getFunctionTypeAttrName()
::llvm::LogicalResult verifyInvariants()
static std::optional< mlir::Attribute > getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name)
::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state)
::llvm::LogicalResult setPropertiesFromParsedAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
::mlir::StringAttr getResAttrsAttrName()
::std::optional< ::mlir::ArrayAttr > getResAttrs()
::std::optional< ::mlir::ArrayAttr > getArgAttrs()
::mlir::ArrayAttr getArgAttrsAttr()
::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop)
static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs)
void writeProperties(::mlir::DialectBytecodeWriter &writer)
::llvm::StringRef getSymName()
void setFunctionType(::mlir::FunctionType attrValue)
::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
::llvm::ArrayRef<::mlir::Type > getResultTypes()
Required by FunctionOpInterface.
static constexpr ::llvm::StringLiteral getOperationName()
void setSymName(::llvm::StringRef attrValue)
::mlir::SymbolRefAttr getFullyQualifiedName(bool requireParent=true)
Return the full name for this function from the root module, including all surrounding symbol table n...
::mlir::TypeAttr getFunctionTypeAttr()
::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
::llvm::LogicalResult verify()
::mlir::StringAttr getSymNameAttr()
::mlir::ArrayAttr getResAttrsAttr()
::llvm::LogicalResult verifyInvariantsImpl()
::mlir::StringAttr getArgAttrsAttrName()
ReturnOpAdaptor(ReturnOp op)
::llvm::LogicalResult verify(::mlir::Location loc)
ReturnOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
::mlir::ValueRange getOperands()
void print(::mlir::OpAsmPrinter &_odsPrinter)
static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs)
FoldAdaptor::Properties Properties
static ReturnOp create(::mlir::OpBuilder &builder, ::mlir::Location location)
::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index)
::llvm::LogicalResult verifyInvariantsImpl()
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState)
static llvm::hash_code computePropertiesHash(const Properties &prop)
::mlir::Operation::operand_range getODSOperands(unsigned index)
::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)
::llvm::LogicalResult verify()
static constexpr ::llvm::StringLiteral getOperationName()
static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value)
static std::optional< mlir::Attribute > getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name)
::mlir::MutableOperandRange getOperandsMutable()
::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop)
::mlir::Operation::operand_range getOperands()
::llvm::LogicalResult verifyInvariants()
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
CallOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
::mlir::SymbolRefAttr getCallee()
::mlir::DenseI32ArrayAttr getMapOpGroupSizesAttr()
::mlir::DictionaryAttr odsAttrs
::std::optional< ::mlir::ArrayAttr > getArgAttrs()
::llvm::ArrayRef< int32_t > getMapOpGroupSizes()
::mlir::ArrayAttr getResAttrsAttr()
::std::optional< ::mlir::ArrayAttr > getTemplateParams()
::mlir::DenseI32ArrayAttr getNumDimsPerMapAttr()
::mlir::SymbolRefAttr getCalleeAttr()
::std::optional<::mlir::OperationName > odsOpName
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize)
::mlir::ArrayAttr getArgAttrsAttr()
::llvm::ArrayRef< int32_t > getNumDimsPerMap()
::std::optional< ::mlir::ArrayAttr > getResAttrs()
::mlir::RegionRange odsRegions
const Properties & getProperties()
::mlir::ArrayAttr getTemplateParamsAttr()
::std::optional< ::mlir::ArrayAttr > getResAttrs()
::std::optional< ::mlir::ArrayAttr > getArgAttrs()
::mlir::ArrayAttr getArgAttrsAttr()
::mlir::StringAttr getSymNameAttr()
::mlir::RegionRange getRegions()
::mlir::TypeAttr getFunctionTypeAttr()
::mlir::DictionaryAttr odsAttrs
const Properties & getProperties()
FuncDefOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
::mlir::FunctionType getFunctionType()
::std::optional<::mlir::OperationName > odsOpName
::llvm::StringRef getSymName()
::mlir::RegionRange odsRegions
::mlir::ArrayAttr getResAttrsAttr()
const Properties & getProperties()
::mlir::DictionaryAttr odsAttrs
ReturnOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
::std::optional<::mlir::OperationName > odsOpName
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize)
::mlir::RegionRange odsRegions
Common interface for constant parameter-like symbol operations that can be defined within a TemplateO...
void printTemplateParams(mlir::AsmPrinter &printer, mlir::ArrayAttr value)
mlir::ParseResult parseAttrDictWithWarnings(mlir::OpAsmParser &parser, mlir::NamedAttrList &extraAttrs, mlir::OperationState &state)
bool isValidType(Type type)
void printMultiDimAndSymbolList(mlir::OpAsmPrinter &printer, mlir::Operation *op, mlir::OperandRangeRange multiMapOperands, mlir::DenseI32ArrayAttr numDimsPerMap)
void printAttrDictWithWarnings(mlir::OpAsmPrinter &printer, ConcreteOp op, mlir::DictionaryAttr extraAttrs, typename mlir::PropertiesSelector< ConcreteOp >::type state)
mlir::ParseResult parseTemplateParams(mlir::AsmParser &parser, mlir::ArrayAttr &value)
mlir::ParseResult parseMultiDimAndSymbolList(mlir::OpAsmParser &parser, mlir::SmallVector< mlir::SmallVector< mlir::OpAsmParser::UnresolvedOperand > > &multiMapOperands, mlir::DenseI32ArrayAttr &numDimsPerMap)
operandSegmentSizesTy operandSegmentSizes
numDimsPerMapTy numDimsPerMap
mapOpGroupSizesTy mapOpGroupSizes
templateParamsTy templateParams
function_typeTy function_type