LLZK 2.0.0
An open-source IR for Zero Knowledge (ZK) circuits
Loading...
Searching...
No Matches
Ops.cpp.inc
Go to the documentation of this file.
1/*===- TableGen'erated file -------------------------------------*- C++ -*-===*\
2|* *|
3|* Op Definitions *|
4|* *|
5|* Automatically generated file, do not edit! *|
6|* From: Ops.td *|
7|* *|
8\*===----------------------------------------------------------------------===*/
9
10#ifdef GET_OP_LIST
11#undef GET_OP_LIST
12
16#endif // GET_OP_LIST
17
18#ifdef GET_OP_CLASSES
19#undef GET_OP_CLASSES
20
21
22//===----------------------------------------------------------------------===//
23// Local Utility Method Definitions
24//===----------------------------------------------------------------------===//
25
26namespace llzk {
27namespace function {
28
29static ::llvm::LogicalResult __mlir_ods_local_type_constraint_Ops1(
30 ::mlir::Operation *op, ::mlir::Type type, ::llvm::StringRef valueKind,
31 unsigned valueIndex) {
32 if (!((::llzk::isValidType(type)))) {
33 return op->emitOpError(valueKind) << " #" << valueIndex
34 << " must be variadic of a valid LLZK type, but got " << type;
35 }
36 return ::mlir::success();
37}
38
39static ::llvm::LogicalResult __mlir_ods_local_type_constraint_Ops2(
40 ::mlir::Operation *op, ::mlir::Type type, ::llvm::StringRef valueKind,
41 unsigned valueIndex) {
42 if (!((::llvm::isa<::mlir::IndexType>(type)))) {
43 return op->emitOpError(valueKind) << " #" << valueIndex
44 << " must be variadic of index, but got " << type;
45 }
46 return ::mlir::success();
47}
48
49static ::llvm::LogicalResult __mlir_ods_local_attr_constraint_Ops1(
50 ::mlir::Attribute attr, ::llvm::StringRef attrName, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
51 if (attr && !((::llvm::isa<::mlir::SymbolRefAttr>(attr))))
52 return emitError() << "attribute '" << attrName
53 << "' failed to satisfy constraint: symbol reference attribute";
54 return ::mlir::success();
55}
56static ::llvm::LogicalResult __mlir_ods_local_attr_constraint_Ops1(
57 ::mlir::Operation *op, ::mlir::Attribute attr, ::llvm::StringRef attrName) {
58 return __mlir_ods_local_attr_constraint_Ops1(attr, attrName, [op]() {
59 return op->emitOpError();
60 });
61}
62
63static ::llvm::LogicalResult __mlir_ods_local_attr_constraint_Ops2(
64 ::mlir::Attribute attr, ::llvm::StringRef attrName, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
65 if (attr && !((::llvm::isa<::mlir::ArrayAttr>(attr))))
66 return emitError() << "attribute '" << attrName
67 << "' failed to satisfy constraint: array attribute";
68 return ::mlir::success();
69}
70static ::llvm::LogicalResult __mlir_ods_local_attr_constraint_Ops2(
71 ::mlir::Operation *op, ::mlir::Attribute attr, ::llvm::StringRef attrName) {
72 return __mlir_ods_local_attr_constraint_Ops2(attr, attrName, [op]() {
73 return op->emitOpError();
74 });
75}
76
77static ::llvm::LogicalResult __mlir_ods_local_attr_constraint_Ops3(
78 ::mlir::Attribute attr, ::llvm::StringRef attrName, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
79 if (attr && !((::llvm::isa<::mlir::DenseI32ArrayAttr>(attr))))
80 return emitError() << "attribute '" << attrName
81 << "' failed to satisfy constraint: i32 dense array attribute";
82 return ::mlir::success();
83}
84static ::llvm::LogicalResult __mlir_ods_local_attr_constraint_Ops3(
85 ::mlir::Operation *op, ::mlir::Attribute attr, ::llvm::StringRef attrName) {
86 return __mlir_ods_local_attr_constraint_Ops3(attr, attrName, [op]() {
87 return op->emitOpError();
88 });
89}
90
91static ::llvm::LogicalResult __mlir_ods_local_attr_constraint_Ops4(
92 ::mlir::Attribute attr, ::llvm::StringRef attrName, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
93 if (attr && !((::llvm::isa<::mlir::StringAttr>(attr))))
94 return emitError() << "attribute '" << attrName
95 << "' failed to satisfy constraint: string attribute";
96 return ::mlir::success();
97}
98static ::llvm::LogicalResult __mlir_ods_local_attr_constraint_Ops4(
99 ::mlir::Operation *op, ::mlir::Attribute attr, ::llvm::StringRef attrName) {
100 return __mlir_ods_local_attr_constraint_Ops4(attr, attrName, [op]() {
101 return op->emitOpError();
102 });
103}
104
105static ::llvm::LogicalResult __mlir_ods_local_attr_constraint_Ops5(
106 ::mlir::Attribute attr, ::llvm::StringRef attrName, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
107 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())))))
108 return emitError() << "attribute '" << attrName
109 << "' failed to satisfy constraint: type attribute of function type";
110 return ::mlir::success();
111}
112static ::llvm::LogicalResult __mlir_ods_local_attr_constraint_Ops5(
113 ::mlir::Operation *op, ::mlir::Attribute attr, ::llvm::StringRef attrName) {
114 return __mlir_ods_local_attr_constraint_Ops5(attr, attrName, [op]() {
115 return op->emitOpError();
116 });
117}
118
119static ::llvm::LogicalResult __mlir_ods_local_attr_constraint_Ops6(
120 ::mlir::Attribute attr, ::llvm::StringRef attrName, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
121 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))); }))))
122 return emitError() << "attribute '" << attrName
123 << "' failed to satisfy constraint: Array of dictionary attributes";
124 return ::mlir::success();
125}
126static ::llvm::LogicalResult __mlir_ods_local_attr_constraint_Ops6(
127 ::mlir::Operation *op, ::mlir::Attribute attr, ::llvm::StringRef attrName) {
128 return __mlir_ods_local_attr_constraint_Ops6(attr, attrName, [op]() {
129 return op->emitOpError();
130 });
131}
132
133static ::llvm::LogicalResult __mlir_ods_local_region_constraint_Ops1(
134 ::mlir::Operation *op, ::mlir::Region &region, ::llvm::StringRef regionName,
135 unsigned regionIndex) {
136 if (!((true))) {
137 return op->emitOpError("region #") << regionIndex
138 << (regionName.empty() ? " " : " ('" + regionName + "') ")
139 << "failed to verify constraint: any region";
140 }
141 return ::mlir::success();
142}
143} // namespace function
144} // namespace llzk
145namespace llzk {
146namespace function {
147
148//===----------------------------------------------------------------------===//
149// ::llzk::function::CallOp definitions
150//===----------------------------------------------------------------------===//
151
152namespace detail {
153CallOpGenericAdaptorBase::CallOpGenericAdaptorBase(CallOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
154
155std::pair<unsigned, unsigned> CallOpGenericAdaptorBase::getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize) {
156 ::llvm::ArrayRef<int32_t> sizeAttr = getProperties().operandSegmentSizes;
157
158 unsigned start = 0;
159 for (unsigned i = 0; i < index; ++i)
160 start += sizeAttr[i];
161 return {start, sizeAttr[index]};
162}
163
164::mlir::SymbolRefAttr CallOpGenericAdaptorBase::getCallee() {
165 auto attr = getCalleeAttr();
166 return attr;
167}
168
169::std::optional< ::mlir::ArrayAttr > CallOpGenericAdaptorBase::getTemplateParams() {
170 auto attr = getTemplateParamsAttr();
171 return attr ? ::std::optional< ::mlir::ArrayAttr >(attr) : (::std::nullopt);
172}
173
175 auto attr = ::llvm::dyn_cast_or_null<::mlir::DenseI32ArrayAttr>(getProperties().numDimsPerMap);
176 return attr;
177}
178
180 auto attr = getNumDimsPerMapAttr();
181 return attr;
182}
183
185 auto attr = getMapOpGroupSizesAttr();
186 return attr;
187}
188
189} // namespace detail
191
192::llvm::LogicalResult CallOpAdaptor::verify(::mlir::Location loc) {
193 auto tblgen_callee = getProperties().callee; (void)tblgen_callee;
194 if (!tblgen_callee) return emitError(loc, "'function.call' op ""requires attribute 'callee'");
195 auto tblgen_mapOpGroupSizes = getProperties().mapOpGroupSizes; (void)tblgen_mapOpGroupSizes;
196 if (!tblgen_mapOpGroupSizes) return emitError(loc, "'function.call' op ""requires attribute 'mapOpGroupSizes'");
197 auto tblgen_numDimsPerMap = getProperties().numDimsPerMap; (void)tblgen_numDimsPerMap;
198 auto tblgen_templateParams = getProperties().templateParams; (void)tblgen_templateParams;
199
200 if (tblgen_callee && !((::llvm::isa<::mlir::SymbolRefAttr>(tblgen_callee))))
201 return emitError(loc, "'function.call' op ""attribute 'callee' failed to satisfy constraint: symbol reference attribute");
202
203 if (tblgen_templateParams && !((::llvm::isa<::mlir::ArrayAttr>(tblgen_templateParams))))
204 return emitError(loc, "'function.call' op ""attribute 'templateParams' failed to satisfy constraint: array attribute");
205
206 if (tblgen_numDimsPerMap && !((::llvm::isa<::mlir::DenseI32ArrayAttr>(tblgen_numDimsPerMap))))
207 return emitError(loc, "'function.call' op ""attribute 'numDimsPerMap' failed to satisfy constraint: i32 dense array attribute");
208
209 if (tblgen_mapOpGroupSizes && !((::llvm::isa<::mlir::DenseI32ArrayAttr>(tblgen_mapOpGroupSizes))))
210 return emitError(loc, "'function.call' op ""attribute 'mapOpGroupSizes' failed to satisfy constraint: i32 dense array attribute");
211 return ::mlir::success();
212}
213
214std::pair<unsigned, unsigned> CallOp::getODSOperandIndexAndLength(unsigned index) {
215 ::llvm::ArrayRef<int32_t> sizeAttr = getProperties().operandSegmentSizes;
216
217 unsigned start = 0;
218 for (unsigned i = 0; i < index; ++i)
219 start += sizeAttr[i];
220 return {start, sizeAttr[index]};
221}
222
223::mlir::MutableOperandRange CallOp::getArgOperandsMutable() {
224 auto range = getODSOperandIndexAndLength(0);
225 auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second, ::mlir::MutableOperandRange::OperandSegment(0u, {getOperandSegmentSizesAttrName(), ::mlir::DenseI32ArrayAttr::get(getContext(), getProperties().operandSegmentSizes)}));
226 return mutableRange;
227}
228
229::mlir::MutableOperandRangeRange CallOp::getMapOperandsMutable() {
230 auto range = getODSOperandIndexAndLength(1);
231 auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second, ::mlir::MutableOperandRange::OperandSegment(1u, {getOperandSegmentSizesAttrName(), ::mlir::DenseI32ArrayAttr::get(getContext(), getProperties().operandSegmentSizes)}));
232 return mutableRange.split(*(*this)->getAttrDictionary().getNamed(getMapOpGroupSizesAttrName()));
233}
234
235std::pair<unsigned, unsigned> CallOp::getODSResultIndexAndLength(unsigned index) {
236 bool isVariadic[] = {true};
237 int prevVariadicCount = 0;
238 for (unsigned i = 0; i < index; ++i)
239 if (isVariadic[i]) ++prevVariadicCount;
240
241 // Calculate how many dynamic values a static variadic operand corresponds to.
242 // This assumes all static variadic operands have the same dynamic value count.
243 int variadicSize = (getOperation()->getNumResults() - 0) / 1;
244 // `index` passed in as the parameter is the static index which counts each
245 // operand (variadic or not) as size 1. So here for each previous static variadic
246 // operand, we need to offset by (variadicSize - 1) to get where the dynamic
247 // value pack for this static operand starts.
248 int start = index + (variadicSize - 1) * prevVariadicCount;
249 int size = isVariadic[index] ? variadicSize : 1;
250 return {start, size};
251}
252
253::llvm::LogicalResult CallOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
254 ::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
255 if (!dict) {
256 emitError() << "expected DictionaryAttr to set properties";
257 return ::mlir::failure();
258 }
259
260 {
261 auto &propStorage = prop.callee;
262 auto attr = dict.get("callee");
263 if (attr) {
264 auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
265 if (convertedAttr) {
266 propStorage = convertedAttr;
267 } else {
268 emitError() << "Invalid attribute `callee` in property conversion: " << attr;
269 return ::mlir::failure();
270 }
271 }
272 }
273
274 {
275 auto &propStorage = prop.mapOpGroupSizes;
276 auto attr = dict.get("mapOpGroupSizes");
277 if (attr) {
278 auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
279 if (convertedAttr) {
280 propStorage = convertedAttr;
281 } else {
282 emitError() << "Invalid attribute `mapOpGroupSizes` in property conversion: " << attr;
283 return ::mlir::failure();
284 }
285 }
286 }
287
288 {
289 auto &propStorage = prop.numDimsPerMap;
290 auto attr = dict.get("numDimsPerMap");
291 if (attr) {
292 auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
293 if (convertedAttr) {
294 propStorage = convertedAttr;
295 } else {
296 emitError() << "Invalid attribute `numDimsPerMap` in property conversion: " << attr;
297 return ::mlir::failure();
298 }
299 }
300 }
301
302 {
303 auto &propStorage = prop.templateParams;
304 auto attr = dict.get("templateParams");
305 if (attr) {
306 auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
307 if (convertedAttr) {
308 propStorage = convertedAttr;
309 } else {
310 emitError() << "Invalid attribute `templateParams` in property conversion: " << attr;
311 return ::mlir::failure();
312 }
313 }
314 }
315{
316
317 auto setFromAttr = [] (auto &propStorage, ::mlir::Attribute propAttr,
318 ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) -> ::mlir::LogicalResult {
319 return convertFromAttribute(propStorage, propAttr, emitError);
320 };
321 auto attr = dict.get("operandSegmentSizes"); if (!attr) attr = dict.get("operand_segment_sizes");;
322;
323 if (attr && ::mlir::failed(setFromAttr(prop.operandSegmentSizes, attr, emitError)))
324 return ::mlir::failure();
325 }
326 return ::mlir::success();
327}
328
329::mlir::Attribute CallOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
330 ::mlir::SmallVector<::mlir::NamedAttribute> attrs;
331 ::mlir::Builder odsBuilder{ctx};
332
333 {
334 const auto &propStorage = prop.callee;
335 if (propStorage)
336 attrs.push_back(odsBuilder.getNamedAttr("callee",
337 propStorage));
338 }
339
340 {
341 const auto &propStorage = prop.mapOpGroupSizes;
342 if (propStorage)
343 attrs.push_back(odsBuilder.getNamedAttr("mapOpGroupSizes",
344 propStorage));
345 }
346
347 {
348 const auto &propStorage = prop.numDimsPerMap;
349 if (propStorage)
350 attrs.push_back(odsBuilder.getNamedAttr("numDimsPerMap",
351 propStorage));
352 }
353
354 {
355 const auto &propStorage = prop.templateParams;
356 if (propStorage)
357 attrs.push_back(odsBuilder.getNamedAttr("templateParams",
358 propStorage));
359 }
360
361 {
362 const auto &propStorage = prop.operandSegmentSizes;
363 auto attr = [&]() -> ::mlir::Attribute {
364 return ::mlir::DenseI32ArrayAttr::get(ctx, propStorage);
365 }();
366 attrs.push_back(odsBuilder.getNamedAttr("operandSegmentSizes", attr));
367 }
368
369 if (!attrs.empty())
370 return odsBuilder.getDictionaryAttr(attrs);
371 return {};
372}
373
374llvm::hash_code CallOp::computePropertiesHash(const Properties &prop) {
375 auto hash_operandSegmentSizes = [] (const auto &propStorage) -> llvm::hash_code {
376 return ::llvm::hash_combine_range(std::begin(propStorage), std::end(propStorage));;
377 };
378 return llvm::hash_combine(
379 llvm::hash_value(prop.callee.getAsOpaquePointer()),
380 llvm::hash_value(prop.mapOpGroupSizes.getAsOpaquePointer()),
381 llvm::hash_value(prop.numDimsPerMap.getAsOpaquePointer()),
382 llvm::hash_value(prop.templateParams.getAsOpaquePointer()),
383 hash_operandSegmentSizes(prop.operandSegmentSizes));
384}
385
386std::optional<mlir::Attribute> CallOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
387 if (name == "callee")
388 return prop.callee;
389
390 if (name == "mapOpGroupSizes")
391 return prop.mapOpGroupSizes;
392
393 if (name == "numDimsPerMap")
394 return prop.numDimsPerMap;
395
396 if (name == "templateParams")
397 return prop.templateParams;
398 if (name == "operand_segment_sizes" || name == "operandSegmentSizes") return [&]() -> ::mlir::Attribute { return ::mlir::DenseI32ArrayAttr::get(ctx, prop.operandSegmentSizes); }();
399 return std::nullopt;
400}
401
402void CallOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
403 if (name == "callee") {
404 prop.callee = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.callee)>>(value);
405 return;
406 }
407
408 if (name == "mapOpGroupSizes") {
409 prop.mapOpGroupSizes = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.mapOpGroupSizes)>>(value);
410 return;
411 }
412
413 if (name == "numDimsPerMap") {
414 prop.numDimsPerMap = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.numDimsPerMap)>>(value);
415 return;
416 }
417
418 if (name == "templateParams") {
419 prop.templateParams = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.templateParams)>>(value);
420 return;
421 }
422 if (name == "operand_segment_sizes" || name == "operandSegmentSizes") {
423 auto arrAttr = ::llvm::dyn_cast_or_null<::mlir::DenseI32ArrayAttr>(value);
424 if (!arrAttr) return;
425 if (arrAttr.size() != sizeof(prop.operandSegmentSizes) / sizeof(int32_t))
426 return;
427 llvm::copy(arrAttr.asArrayRef(), prop.operandSegmentSizes.begin());
428 return;
429 }
430}
431
432void CallOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
433 if (prop.callee) attrs.append("callee", prop.callee);
434
435 if (prop.mapOpGroupSizes) attrs.append("mapOpGroupSizes", prop.mapOpGroupSizes);
436
437 if (prop.numDimsPerMap) attrs.append("numDimsPerMap", prop.numDimsPerMap);
438
439 if (prop.templateParams) attrs.append("templateParams", prop.templateParams);
440 attrs.append("operandSegmentSizes", [&]() -> ::mlir::Attribute { return ::mlir::DenseI32ArrayAttr::get(ctx, prop.operandSegmentSizes); }());
441}
442
443::llvm::LogicalResult CallOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
444 {
445 ::mlir::Attribute attr = attrs.get(getCalleeAttrName(opName));
446 if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_Ops1(attr, "callee", emitError)))
447 return ::mlir::failure();
448 }
449
450 {
451 ::mlir::Attribute attr = attrs.get(getMapOpGroupSizesAttrName(opName));
452 if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_Ops3(attr, "mapOpGroupSizes", emitError)))
453 return ::mlir::failure();
454 }
455
456 {
457 ::mlir::Attribute attr = attrs.get(getNumDimsPerMapAttrName(opName));
458 if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_Ops3(attr, "numDimsPerMap", emitError)))
459 return ::mlir::failure();
460 }
461
462 {
463 ::mlir::Attribute attr = attrs.get(getTemplateParamsAttrName(opName));
464 if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_Ops2(attr, "templateParams", emitError)))
465 return ::mlir::failure();
466 }
467 return ::mlir::success();
468}
469
470::mlir::SymbolRefAttr CallOp::getCallee() {
471 auto attr = getCalleeAttr();
472 return attr;
473}
474
475::std::optional< ::mlir::ArrayAttr > CallOp::getTemplateParams() {
476 auto attr = getTemplateParamsAttr();
477 return attr ? ::std::optional< ::mlir::ArrayAttr >(attr) : (::std::nullopt);
478}
479
480::llvm::ArrayRef<int32_t> CallOp::getNumDimsPerMap() {
481 auto attr = getNumDimsPerMapAttr();
482 return attr;
483}
484
485::llvm::ArrayRef<int32_t> CallOp::getMapOpGroupSizes() {
486 auto attr = getMapOpGroupSizesAttr();
487 return attr;
488}
489
490void CallOp::setNumDimsPerMap(::llvm::ArrayRef<int32_t> attrValue) {
491 getProperties().numDimsPerMap = ::mlir::Builder((*this)->getContext()).getDenseI32ArrayAttr(attrValue);
492}
493
494void CallOp::setMapOpGroupSizes(::llvm::ArrayRef<int32_t> attrValue) {
495 getProperties().mapOpGroupSizes = ::mlir::Builder((*this)->getContext()).getDenseI32ArrayAttr(attrValue);
496}
497
498void 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) {
499 build(odsBuilder, odsState, resultTypes, callee, mapOperands,
500 odsBuilder.getDenseI32ArrayAttr(numDimsPerMap),
501 argOperands, templateParams);
502
503}
504
505void CallOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::llzk::function::FuncDefOp callee, ::mlir::ValueRange argOperands, ::llvm::ArrayRef<::mlir::Attribute> templateParams) {
506 build(odsBuilder, odsState, callee.getResultTypes(),
507 callee.getFullyQualifiedName(false),
508 argOperands, templateParams);
509
510}
511
512void 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) {
513 build(odsBuilder, odsState, callee.getResultTypes(),
514 callee.getFullyQualifiedName(false), mapOperands, numDimsPerMap,
515 argOperands, templateParams);
516
517}
518
519void 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) {
520 build(odsBuilder, odsState, callee, mapOperands,
521 odsBuilder.getDenseI32ArrayAttr(numDimsPerMap),
522 argOperands, templateParams);
523
524}
525
526void CallOp::populateDefaultProperties(::mlir::OperationName opName, Properties &properties) {
527 ::mlir::Builder odsBuilder(opName.getContext());
528 if (!properties.numDimsPerMap)
529 properties.numDimsPerMap = odsBuilder.getDenseI32ArrayAttr({});
530}
531
532::llvm::LogicalResult CallOp::verifyInvariantsImpl() {
533 auto tblgen_callee = getProperties().callee; (void)tblgen_callee;
534 if (!tblgen_callee) return emitOpError("requires attribute 'callee'");
535 auto tblgen_mapOpGroupSizes = getProperties().mapOpGroupSizes; (void)tblgen_mapOpGroupSizes;
536 if (!tblgen_mapOpGroupSizes) return emitOpError("requires attribute 'mapOpGroupSizes'");
537 auto tblgen_numDimsPerMap = getProperties().numDimsPerMap; (void)tblgen_numDimsPerMap;
538 auto tblgen_templateParams = getProperties().templateParams; (void)tblgen_templateParams;
539
540 if (::mlir::failed(__mlir_ods_local_attr_constraint_Ops1(*this, tblgen_callee, "callee")))
541 return ::mlir::failure();
542
543 if (::mlir::failed(__mlir_ods_local_attr_constraint_Ops2(*this, tblgen_templateParams, "templateParams")))
544 return ::mlir::failure();
545
546 if (::mlir::failed(__mlir_ods_local_attr_constraint_Ops3(*this, tblgen_numDimsPerMap, "numDimsPerMap")))
547 return ::mlir::failure();
548
549 if (::mlir::failed(__mlir_ods_local_attr_constraint_Ops3(*this, tblgen_mapOpGroupSizes, "mapOpGroupSizes")))
550 return ::mlir::failure();
551 {
552 unsigned index = 0; (void)index;
553 auto valueGroup0 = getODSOperands(0);
554
555 for (auto v : valueGroup0) {
556 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops1(*this, v.getType(), "operand", index++)))
557 return ::mlir::failure();
558 }
559 auto valueGroup1 = getODSOperands(1);
560 if (::mlir::failed(::mlir::OpTrait::impl::verifyValueSizeAttr(*this, "mapOpGroupSizes", "mapOperands", valueGroup1.size())))
561 return ::mlir::failure();
562
563 for (auto v : valueGroup1) {
564 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops2(*this, v.getType(), "operand", index++)))
565 return ::mlir::failure();
566 }
567 }
568 {
569 unsigned index = 0; (void)index;
570 auto valueGroup0 = getODSResults(0);
571
572 for (auto v : valueGroup0) {
573 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops1(*this, v.getType(), "result", index++)))
574 return ::mlir::failure();
575 }
576 }
577 return ::mlir::success();
578}
579
580::llvm::LogicalResult CallOp::verifyInvariants() {
581 return verifyInvariantsImpl();
582}
583
584::mlir::ParseResult CallOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
585 ::mlir::SymbolRefAttr calleeAttr;
586 ::mlir::ArrayAttr templateParamsAttr;
587 ::llvm::SmallVector<::mlir::OpAsmParser::UnresolvedOperand, 4> argOperandsOperands;
588 ::llvm::SMLoc argOperandsOperandsLoc;
589 (void)argOperandsOperandsLoc;
590 ::llvm::SmallVector<::mlir::OpAsmParser::UnresolvedOperand, 4> mapOperandsOperands;
591 llvm::SmallVector<int32_t> mapOperandsOperandGroupSizes;
592 ::llvm::SMLoc mapOperandsOperandsLoc;
593 (void)mapOperandsOperandsLoc;
594 ::mlir::DenseI32ArrayAttr numDimsPerMapAttr;
595 ::llvm::ArrayRef<::mlir::Type> argOperandsTypes;
596 ::llvm::ArrayRef<::mlir::Type> allResultTypes;
597
598 if (parser.parseCustomAttributeWithFallback(calleeAttr, parser.getBuilder().getType<::mlir::NoneType>())) {
599 return ::mlir::failure();
600 }
601 if (calleeAttr) result.getOrAddProperties<CallOp::Properties>().callee = calleeAttr;
602 if (::mlir::succeeded(parser.parseOptionalLess())) {
603 {
604 auto odsResult = parseTemplateParams(parser, templateParamsAttr);
605 if (odsResult) return ::mlir::failure();
606 if (templateParamsAttr)
607 result.getOrAddProperties<CallOp::Properties>().templateParams = templateParamsAttr;
608 }
609 if (parser.parseGreater())
610 return ::mlir::failure();
611 }
612 if (parser.parseLParen())
613 return ::mlir::failure();
614
615 argOperandsOperandsLoc = parser.getCurrentLocation();
616 if (parser.parseOperandList(argOperandsOperands))
617 return ::mlir::failure();
618 if (parser.parseRParen())
619 return ::mlir::failure();
620 if (::mlir::succeeded(parser.parseOptionalLBrace())) {
621 {
622 mapOperandsOperandsLoc = parser.getCurrentLocation();
623 ::llvm::SmallVector<::llvm::SmallVector<::mlir::OpAsmParser::UnresolvedOperand>> mapOperandsOperandGroups;
624 auto odsResult = parseMultiDimAndSymbolList(parser, mapOperandsOperandGroups, numDimsPerMapAttr);
625 if (odsResult) return ::mlir::failure();
626 for (const auto &subRange : mapOperandsOperandGroups) {
627 mapOperandsOperands.append(subRange.begin(), subRange.end());
628 mapOperandsOperandGroupSizes.push_back(subRange.size());
629 }
630 if (numDimsPerMapAttr)
631 result.getOrAddProperties<CallOp::Properties>().numDimsPerMap = numDimsPerMapAttr;
632 }
633 if (parser.parseRBrace())
634 return ::mlir::failure();
635 }
636 if (parser.parseColon())
637 return ::mlir::failure();
638
639 ::mlir::FunctionType argOperands__allResult_functionType;
640 if (parser.parseType(argOperands__allResult_functionType))
641 return ::mlir::failure();
642 argOperandsTypes = argOperands__allResult_functionType.getInputs();
643 allResultTypes = argOperands__allResult_functionType.getResults();
644 {
645 auto odsResult = parseAttrDictWithWarnings(parser, result.attributes, result);
646 if (odsResult) return ::mlir::failure();
647 }
648::llvm::copy(::llvm::ArrayRef<int32_t>({static_cast<int32_t>(argOperandsOperands.size()), static_cast<int32_t>(mapOperandsOperands.size())}), result.getOrAddProperties<CallOp::Properties>().operandSegmentSizes.begin());
649 result.getOrAddProperties<CallOp::Properties>().mapOpGroupSizes = parser.getBuilder().getDenseI32ArrayAttr(mapOperandsOperandGroupSizes);
650 ::mlir::Type odsBuildableType0 = parser.getBuilder().getIndexType();
651 result.addTypes(allResultTypes);
652 if (parser.resolveOperands(argOperandsOperands, argOperandsTypes, argOperandsOperandsLoc, result.operands))
653 return ::mlir::failure();
654 if (parser.resolveOperands(mapOperandsOperands, odsBuildableType0, mapOperandsOperandsLoc, result.operands))
655 return ::mlir::failure();
656 return ::mlir::success();
657}
658
659::llvm::LogicalResult CallOp::setPropertiesFromParsedAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
660 ::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
661 if (!dict) {
662 emitError() << "expected DictionaryAttr to set properties";
663 return ::mlir::failure();
664 }
665 {
666
667 auto &propStorage = prop.mapOpGroupSizes;
668 auto attr = dict.get("mapOpGroupSizes");
669 if (attr || /*isRequired=*/true) {
670 if (!attr) {
671 emitError() << "expected key entry for mapOpGroupSizes in DictionaryAttr to set "
672 "Properties.";
673 return ::mlir::failure();
674 }
675 auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
676 if (convertedAttr) {
677 propStorage = convertedAttr;
678 } else {
679 emitError() << "Invalid attribute `mapOpGroupSizes` in property conversion: " << attr;
680 return ::mlir::failure();
681 }
682 }
683 }
684 return ::mlir::success();
685}
686
687void CallOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
688 _odsPrinter << ' ';
689 _odsPrinter.printAttributeWithoutType(getCalleeAttr());
690 if (((getTemplateParamsAttr()))) {
691 _odsPrinter << "<";
692 printTemplateParams(_odsPrinter, *this, getTemplateParamsAttr());
693 _odsPrinter << ">";
694 }
695 _odsPrinter << "(";
696 _odsPrinter << getArgOperands();
697 _odsPrinter << ")";
698 if (((!getMapOperands().empty()) || (getNumDimsPerMapAttr() != ::mlir::OpBuilder((*this)->getContext()).getDenseI32ArrayAttr({})))) {
699 _odsPrinter << ' ' << "{";
701 _odsPrinter << "}";
702 }
703 _odsPrinter << ' ' << ":";
704 _odsPrinter << ' ';
705 _odsPrinter.printFunctionalType(getArgOperands().getTypes(), getOperation()->getResultTypes());
706 _odsPrinter << ' ';
707 printAttrDictWithWarnings(_odsPrinter, *this, getOperation()->getAttrDictionary(), getProperties());
708}
709
710} // namespace function
711} // namespace llzk
712MLIR_DEFINE_EXPLICIT_TYPE_ID(::llzk::function::CallOp)
713
714namespace llzk {
715namespace function {
716
717//===----------------------------------------------------------------------===//
718// ::llzk::function::FuncDefOp definitions
719//===----------------------------------------------------------------------===//
720
721namespace detail {
723
725 auto attr = getSymNameAttr();
726 return attr.getValue();
727}
728
730 auto attr = getFunctionTypeAttr();
731 return ::llvm::cast<::mlir::FunctionType>(attr.getValue());
732}
733
734::std::optional< ::mlir::ArrayAttr > FuncDefOpGenericAdaptorBase::getArgAttrs() {
735 auto attr = getArgAttrsAttr();
736 return attr ? ::std::optional< ::mlir::ArrayAttr >(attr) : (::std::nullopt);
737}
738
739::std::optional< ::mlir::ArrayAttr > FuncDefOpGenericAdaptorBase::getResAttrs() {
740 auto attr = getResAttrsAttr();
741 return attr ? ::std::optional< ::mlir::ArrayAttr >(attr) : (::std::nullopt);
742}
743
744} // namespace detail
746
747::llvm::LogicalResult FuncDefOpAdaptor::verify(::mlir::Location loc) {
748 auto tblgen_arg_attrs = getProperties().arg_attrs; (void)tblgen_arg_attrs;
749 auto tblgen_function_type = getProperties().function_type; (void)tblgen_function_type;
750 if (!tblgen_function_type) return emitError(loc, "'function.def' op ""requires attribute 'function_type'");
751 auto tblgen_res_attrs = getProperties().res_attrs; (void)tblgen_res_attrs;
752 auto tblgen_sym_name = getProperties().sym_name; (void)tblgen_sym_name;
753 if (!tblgen_sym_name) return emitError(loc, "'function.def' op ""requires attribute 'sym_name'");
754
755 if (tblgen_sym_name && !((::llvm::isa<::mlir::StringAttr>(tblgen_sym_name))))
756 return emitError(loc, "'function.def' op ""attribute 'sym_name' failed to satisfy constraint: string attribute");
757
758 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())))))
759 return emitError(loc, "'function.def' op ""attribute 'function_type' failed to satisfy constraint: type attribute of function type");
760
761 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))); }))))
762 return emitError(loc, "'function.def' op ""attribute 'arg_attrs' failed to satisfy constraint: Array of dictionary attributes");
763
764 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))); }))))
765 return emitError(loc, "'function.def' op ""attribute 'res_attrs' failed to satisfy constraint: Array of dictionary attributes");
766 return ::mlir::success();
767}
768
769::llvm::LogicalResult FuncDefOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
770 ::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
771 if (!dict) {
772 emitError() << "expected DictionaryAttr to set properties";
773 return ::mlir::failure();
774 }
775
776 {
777 auto &propStorage = prop.arg_attrs;
778 auto attr = dict.get("arg_attrs");
779 if (attr) {
780 auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
781 if (convertedAttr) {
782 propStorage = convertedAttr;
783 } else {
784 emitError() << "Invalid attribute `arg_attrs` in property conversion: " << attr;
785 return ::mlir::failure();
786 }
787 }
788 }
789
790 {
791 auto &propStorage = prop.function_type;
792 auto attr = dict.get("function_type");
793 if (attr) {
794 auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
795 if (convertedAttr) {
796 propStorage = convertedAttr;
797 } else {
798 emitError() << "Invalid attribute `function_type` in property conversion: " << attr;
799 return ::mlir::failure();
800 }
801 }
802 }
803
804 {
805 auto &propStorage = prop.res_attrs;
806 auto attr = dict.get("res_attrs");
807 if (attr) {
808 auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
809 if (convertedAttr) {
810 propStorage = convertedAttr;
811 } else {
812 emitError() << "Invalid attribute `res_attrs` in property conversion: " << attr;
813 return ::mlir::failure();
814 }
815 }
816 }
817
818 {
819 auto &propStorage = prop.sym_name;
820 auto attr = dict.get("sym_name");
821 if (attr) {
822 auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
823 if (convertedAttr) {
824 propStorage = convertedAttr;
825 } else {
826 emitError() << "Invalid attribute `sym_name` in property conversion: " << attr;
827 return ::mlir::failure();
828 }
829 }
830 }
831 return ::mlir::success();
832}
833
834::mlir::Attribute FuncDefOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
835 ::mlir::SmallVector<::mlir::NamedAttribute> attrs;
836 ::mlir::Builder odsBuilder{ctx};
837
838 {
839 const auto &propStorage = prop.arg_attrs;
840 if (propStorage)
841 attrs.push_back(odsBuilder.getNamedAttr("arg_attrs",
842 propStorage));
843 }
844
845 {
846 const auto &propStorage = prop.function_type;
847 if (propStorage)
848 attrs.push_back(odsBuilder.getNamedAttr("function_type",
849 propStorage));
850 }
851
852 {
853 const auto &propStorage = prop.res_attrs;
854 if (propStorage)
855 attrs.push_back(odsBuilder.getNamedAttr("res_attrs",
856 propStorage));
857 }
858
859 {
860 const auto &propStorage = prop.sym_name;
861 if (propStorage)
862 attrs.push_back(odsBuilder.getNamedAttr("sym_name",
863 propStorage));
864 }
865
866 if (!attrs.empty())
867 return odsBuilder.getDictionaryAttr(attrs);
868 return {};
869}
870
871llvm::hash_code FuncDefOp::computePropertiesHash(const Properties &prop) {
872 return llvm::hash_combine(
873 llvm::hash_value(prop.arg_attrs.getAsOpaquePointer()),
874 llvm::hash_value(prop.function_type.getAsOpaquePointer()),
875 llvm::hash_value(prop.res_attrs.getAsOpaquePointer()),
876 llvm::hash_value(prop.sym_name.getAsOpaquePointer()));
877}
878
879std::optional<mlir::Attribute> FuncDefOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
880 if (name == "arg_attrs")
881 return prop.arg_attrs;
882
883 if (name == "function_type")
884 return prop.function_type;
885
886 if (name == "res_attrs")
887 return prop.res_attrs;
888
889 if (name == "sym_name")
890 return prop.sym_name;
891 return std::nullopt;
892}
893
894void FuncDefOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
895 if (name == "arg_attrs") {
896 prop.arg_attrs = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.arg_attrs)>>(value);
897 return;
898 }
899
900 if (name == "function_type") {
901 prop.function_type = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.function_type)>>(value);
902 return;
903 }
904
905 if (name == "res_attrs") {
906 prop.res_attrs = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.res_attrs)>>(value);
907 return;
908 }
909
910 if (name == "sym_name") {
911 prop.sym_name = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.sym_name)>>(value);
912 return;
913 }
914}
915
916void FuncDefOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
917 if (prop.arg_attrs) attrs.append("arg_attrs", prop.arg_attrs);
918
919 if (prop.function_type) attrs.append("function_type", prop.function_type);
920
921 if (prop.res_attrs) attrs.append("res_attrs", prop.res_attrs);
922
923 if (prop.sym_name) attrs.append("sym_name", prop.sym_name);
924}
925
926::llvm::LogicalResult FuncDefOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
927 {
928 ::mlir::Attribute attr = attrs.get(getArgAttrsAttrName(opName));
929 if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_Ops6(attr, "arg_attrs", emitError)))
930 return ::mlir::failure();
931 }
932
933 {
934 ::mlir::Attribute attr = attrs.get(getFunctionTypeAttrName(opName));
935 if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_Ops5(attr, "function_type", emitError)))
936 return ::mlir::failure();
937 }
938
939 {
940 ::mlir::Attribute attr = attrs.get(getResAttrsAttrName(opName));
941 if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_Ops6(attr, "res_attrs", emitError)))
942 return ::mlir::failure();
943 }
944
945 {
946 ::mlir::Attribute attr = attrs.get(getSymNameAttrName(opName));
947 if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_Ops4(attr, "sym_name", emitError)))
948 return ::mlir::failure();
949 }
950 return ::mlir::success();
951}
952
953::llvm::LogicalResult FuncDefOp::readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state) {
954 auto &prop = state.getOrAddProperties<Properties>(); (void)prop;
955 if (::mlir::failed(reader.readOptionalAttribute(prop.arg_attrs)))
956 return ::mlir::failure();
957
958 if (::mlir::failed(reader.readAttribute(prop.function_type)))
959 return ::mlir::failure();
960
961 if (::mlir::failed(reader.readOptionalAttribute(prop.res_attrs)))
962 return ::mlir::failure();
963
964 if (::mlir::failed(reader.readAttribute(prop.sym_name)))
965 return ::mlir::failure();
966 return ::mlir::success();
967}
968
969void FuncDefOp::writeProperties(::mlir::DialectBytecodeWriter &writer) {
970 auto &prop = getProperties(); (void)prop;
971
972 writer.writeOptionalAttribute(prop.arg_attrs);
973 writer.writeAttribute(prop.function_type);
974
975 writer.writeOptionalAttribute(prop.res_attrs);
976 writer.writeAttribute(prop.sym_name);
977}
978
979::llvm::StringRef FuncDefOp::getSymName() {
980 auto attr = getSymNameAttr();
981 return attr.getValue();
982}
983
984::mlir::FunctionType FuncDefOp::getFunctionType() {
985 auto attr = getFunctionTypeAttr();
986 return ::llvm::cast<::mlir::FunctionType>(attr.getValue());
987}
988
989::std::optional< ::mlir::ArrayAttr > FuncDefOp::getArgAttrs() {
990 auto attr = getArgAttrsAttr();
991 return attr ? ::std::optional< ::mlir::ArrayAttr >(attr) : (::std::nullopt);
992}
993
994::std::optional< ::mlir::ArrayAttr > FuncDefOp::getResAttrs() {
995 auto attr = getResAttrsAttr();
996 return attr ? ::std::optional< ::mlir::ArrayAttr >(attr) : (::std::nullopt);
997}
998
999void FuncDefOp::setSymName(::llvm::StringRef attrValue) {
1000 getProperties().sym_name = ::mlir::Builder((*this)->getContext()).getStringAttr(attrValue);
1001}
1002
1003void FuncDefOp::setFunctionType(::mlir::FunctionType attrValue) {
1004 getProperties().function_type = ::mlir::TypeAttr::get(attrValue);
1005}
1006
1007void FuncDefOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::StringAttr sym_name, ::mlir::TypeAttr function_type, /*optional*/::mlir::ArrayAttr arg_attrs, /*optional*/::mlir::ArrayAttr res_attrs) {
1008 odsState.getOrAddProperties<Properties>().sym_name = sym_name;
1009 odsState.getOrAddProperties<Properties>().function_type = function_type;
1010 if (arg_attrs) {
1011 odsState.getOrAddProperties<Properties>().arg_attrs = arg_attrs;
1012 }
1013 if (res_attrs) {
1014 odsState.getOrAddProperties<Properties>().res_attrs = res_attrs;
1015 }
1016 (void)odsState.addRegion();
1017}
1018
1019void FuncDefOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::StringAttr sym_name, ::mlir::TypeAttr function_type, /*optional*/::mlir::ArrayAttr arg_attrs, /*optional*/::mlir::ArrayAttr res_attrs) {
1020 odsState.getOrAddProperties<Properties>().sym_name = sym_name;
1021 odsState.getOrAddProperties<Properties>().function_type = function_type;
1022 if (arg_attrs) {
1023 odsState.getOrAddProperties<Properties>().arg_attrs = arg_attrs;
1024 }
1025 if (res_attrs) {
1026 odsState.getOrAddProperties<Properties>().res_attrs = res_attrs;
1027 }
1028 (void)odsState.addRegion();
1029 assert(resultTypes.size() == 0u && "mismatched number of results");
1030 odsState.addTypes(resultTypes);
1031}
1032
1033void FuncDefOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::llvm::StringRef sym_name, ::mlir::FunctionType function_type, /*optional*/::mlir::ArrayAttr arg_attrs, /*optional*/::mlir::ArrayAttr res_attrs) {
1034 odsState.getOrAddProperties<Properties>().sym_name = odsBuilder.getStringAttr(sym_name);
1035 odsState.getOrAddProperties<Properties>().function_type = ::mlir::TypeAttr::get(function_type);
1036 if (arg_attrs) {
1037 odsState.getOrAddProperties<Properties>().arg_attrs = arg_attrs;
1038 }
1039 if (res_attrs) {
1040 odsState.getOrAddProperties<Properties>().res_attrs = res_attrs;
1041 }
1042 (void)odsState.addRegion();
1043}
1044
1045void FuncDefOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::llvm::StringRef sym_name, ::mlir::FunctionType function_type, /*optional*/::mlir::ArrayAttr arg_attrs, /*optional*/::mlir::ArrayAttr res_attrs) {
1046 odsState.getOrAddProperties<Properties>().sym_name = odsBuilder.getStringAttr(sym_name);
1047 odsState.getOrAddProperties<Properties>().function_type = ::mlir::TypeAttr::get(function_type);
1048 if (arg_attrs) {
1049 odsState.getOrAddProperties<Properties>().arg_attrs = arg_attrs;
1050 }
1051 if (res_attrs) {
1052 odsState.getOrAddProperties<Properties>().res_attrs = res_attrs;
1053 }
1054 (void)odsState.addRegion();
1055 assert(resultTypes.size() == 0u && "mismatched number of results");
1056 odsState.addTypes(resultTypes);
1057}
1058
1059void FuncDefOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
1060 assert(operands.size() == 0u && "mismatched number of parameters");
1061 odsState.addOperands(operands);
1062 odsState.addAttributes(attributes);
1063 for (unsigned i = 0; i != 1; ++i)
1064 (void)odsState.addRegion();
1065 assert(resultTypes.size() == 0u && "mismatched number of return types");
1066 odsState.addTypes(resultTypes);
1067
1068 if (!attributes.empty()) {
1069 ::mlir::OpaqueProperties properties =
1070 &odsState.getOrAddProperties<FuncDefOp::Properties>();
1071 std::optional<::mlir::RegisteredOperationName> info =
1072 odsState.name.getRegisteredInfo();
1073 if (failed(info->setOpPropertiesFromAttribute(odsState.name, properties,
1074 odsState.attributes.getDictionary(odsState.getContext()), nullptr)))
1075 ::llvm::report_fatal_error("Property conversion failed.");
1076 }
1077}
1078
1079::llvm::LogicalResult FuncDefOp::verifyInvariantsImpl() {
1080 auto tblgen_arg_attrs = getProperties().arg_attrs; (void)tblgen_arg_attrs;
1081 auto tblgen_function_type = getProperties().function_type; (void)tblgen_function_type;
1082 if (!tblgen_function_type) return emitOpError("requires attribute 'function_type'");
1083 auto tblgen_res_attrs = getProperties().res_attrs; (void)tblgen_res_attrs;
1084 auto tblgen_sym_name = getProperties().sym_name; (void)tblgen_sym_name;
1085 if (!tblgen_sym_name) return emitOpError("requires attribute 'sym_name'");
1086
1087 if (::mlir::failed(__mlir_ods_local_attr_constraint_Ops4(*this, tblgen_sym_name, "sym_name")))
1088 return ::mlir::failure();
1089
1090 if (::mlir::failed(__mlir_ods_local_attr_constraint_Ops5(*this, tblgen_function_type, "function_type")))
1091 return ::mlir::failure();
1092
1093 if (::mlir::failed(__mlir_ods_local_attr_constraint_Ops6(*this, tblgen_arg_attrs, "arg_attrs")))
1094 return ::mlir::failure();
1095
1096 if (::mlir::failed(__mlir_ods_local_attr_constraint_Ops6(*this, tblgen_res_attrs, "res_attrs")))
1097 return ::mlir::failure();
1098 {
1099 unsigned index = 0; (void)index;
1100
1101 for (auto &region : ::llvm::MutableArrayRef((*this)->getRegion(0)))
1102 if (::mlir::failed(__mlir_ods_local_region_constraint_Ops1(*this, region, "body", index++)))
1103 return ::mlir::failure();
1104 }
1105 return ::mlir::success();
1106}
1107
1108::llvm::LogicalResult FuncDefOp::verifyInvariants() {
1109 if(::mlir::succeeded(verifyInvariantsImpl()) && ::mlir::succeeded(verify()))
1110 return ::mlir::success();
1111 return ::mlir::failure();
1112}
1113
1114} // namespace function
1115} // namespace llzk
1116MLIR_DEFINE_EXPLICIT_TYPE_ID(::llzk::function::FuncDefOp)
1117
1118namespace llzk {
1119namespace function {
1120
1121//===----------------------------------------------------------------------===//
1122// ::llzk::function::ReturnOp definitions
1123//===----------------------------------------------------------------------===//
1124
1125namespace detail {
1126std::pair<unsigned, unsigned> ReturnOpGenericAdaptorBase::getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize) {
1127 bool isVariadic[] = {true};
1128 int prevVariadicCount = 0;
1129 for (unsigned i = 0; i < index; ++i)
1130 if (isVariadic[i]) ++prevVariadicCount;
1131
1132 // Calculate how many dynamic values a static variadic operand corresponds to.
1133 // This assumes all static variadic operands have the same dynamic value count.
1134 int variadicSize = (odsOperandsSize - 0) / 1;
1135 // `index` passed in as the parameter is the static index which counts each
1136 // operand (variadic or not) as size 1. So here for each previous static variadic
1137 // operand, we need to offset by (variadicSize - 1) to get where the dynamic
1138 // value pack for this static operand starts.
1139 int start = index + (variadicSize - 1) * prevVariadicCount;
1140 int size = isVariadic[index] ? variadicSize : 1;
1141 return {start, size};
1142}
1143
1144} // namespace detail
1146
1147::llvm::LogicalResult ReturnOpAdaptor::verify(::mlir::Location loc) {
1148 return ::mlir::success();
1149}
1150
1151std::pair<unsigned, unsigned> ReturnOp::getODSOperandIndexAndLength(unsigned index) {
1152 bool isVariadic[] = {true};
1153 int prevVariadicCount = 0;
1154 for (unsigned i = 0; i < index; ++i)
1155 if (isVariadic[i]) ++prevVariadicCount;
1156
1157 // Calculate how many dynamic values a static variadic operand corresponds to.
1158 // This assumes all static variadic operands have the same dynamic value count.
1159 int variadicSize = (getOperation()->getNumOperands() - 0) / 1;
1160 // `index` passed in as the parameter is the static index which counts each
1161 // operand (variadic or not) as size 1. So here for each previous static variadic
1162 // operand, we need to offset by (variadicSize - 1) to get where the dynamic
1163 // value pack for this static operand starts.
1164 int start = index + (variadicSize - 1) * prevVariadicCount;
1165 int size = isVariadic[index] ? variadicSize : 1;
1166 return {start, size};
1167}
1168
1169::mlir::MutableOperandRange ReturnOp::getOperandsMutable() {
1170 auto range = getODSOperandIndexAndLength(0);
1171 auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
1172 return mutableRange;
1173}
1174
1175void ReturnOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState) {
1176 build(odsBuilder, odsState, std::nullopt);
1177
1178}
1179
1180void ReturnOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands) {
1181 odsState.addOperands(operands);
1182}
1183
1184void ReturnOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
1185 odsState.addOperands(operands);
1186 odsState.addAttributes(attributes);
1187 assert(resultTypes.size() == 0u && "mismatched number of return types");
1188 odsState.addTypes(resultTypes);
1189}
1190
1191::llvm::LogicalResult ReturnOp::verifyInvariantsImpl() {
1192 {
1193 unsigned index = 0; (void)index;
1194 auto valueGroup0 = getODSOperands(0);
1195
1196 for (auto v : valueGroup0) {
1197 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops1(*this, v.getType(), "operand", index++)))
1198 return ::mlir::failure();
1199 }
1200 }
1201 return ::mlir::success();
1202}
1203
1204::llvm::LogicalResult ReturnOp::verifyInvariants() {
1205 if(::mlir::succeeded(verifyInvariantsImpl()) && ::mlir::succeeded(verify()))
1206 return ::mlir::success();
1207 return ::mlir::failure();
1208}
1209
1210::mlir::ParseResult ReturnOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
1211 ::llvm::SmallVector<::mlir::OpAsmParser::UnresolvedOperand, 4> operandsOperands;
1212 ::llvm::SMLoc operandsOperandsLoc;
1213 (void)operandsOperandsLoc;
1214 ::llvm::SmallVector<::mlir::Type, 1> operandsTypes;
1215 {
1216 auto loc = parser.getCurrentLocation();(void)loc;
1217 if (parser.parseOptionalAttrDict(result.attributes))
1218 return ::mlir::failure();
1219 }
1220
1221 operandsOperandsLoc = parser.getCurrentLocation();
1222 if (parser.parseOperandList(operandsOperands))
1223 return ::mlir::failure();
1224 if (!operandsOperands.empty()) {
1225 if (parser.parseColon())
1226 return ::mlir::failure();
1227
1228 if (parser.parseTypeList(operandsTypes))
1229 return ::mlir::failure();
1230 }
1231 if (parser.resolveOperands(operandsOperands, operandsTypes, operandsOperandsLoc, result.operands))
1232 return ::mlir::failure();
1233 return ::mlir::success();
1234}
1235
1236void ReturnOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
1237 ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
1238 _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
1239 if (!getOperands().empty()) {
1240 _odsPrinter << ' ';
1241 _odsPrinter << getOperands();
1242 _odsPrinter << ' ' << ":";
1243 _odsPrinter << ' ';
1244 _odsPrinter << getOperands().getTypes();
1245 }
1246}
1247
1248void ReturnOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
1249}
1250
1251::mlir::MutableOperandRange ReturnOp::getMutableSuccessorOperands(
1252 ::mlir::RegionBranchPoint point) {
1253 return ::mlir::MutableOperandRange(*this);
1254}
1255
1256} // namespace function
1257} // namespace llzk
1258MLIR_DEFINE_EXPLICIT_TYPE_ID(::llzk::function::ReturnOp)
1259
1260
1261#endif // GET_OP_CLASSES
1262
::llvm::LogicalResult verify(::mlir::Location loc)
Definition Ops.cpp.inc:192
CallOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:150
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)
Definition Ops.cpp.inc:490
::mlir::SymbolRefAttr getCalleeAttr()
Definition Ops.h.inc:292
static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs)
Definition Ops.cpp.inc:432
::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:443
static llvm::hash_code computePropertiesHash(const Properties &prop)
Definition Ops.cpp.inc:374
static void populateDefaultProperties(::mlir::OperationName opName, Properties &properties)
Definition Ops.cpp.inc:526
::mlir::SymbolRefAttr getCallee()
Definition Ops.cpp.inc:470
std::pair< unsigned, unsigned > getODSResultIndexAndLength(unsigned index)
Definition Ops.cpp.inc:235
static std::optional< mlir::Attribute > getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name)
Definition Ops.cpp.inc:386
::llvm::LogicalResult setPropertiesFromParsedAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:659
void setMapOpGroupSizes(::llvm::ArrayRef< int32_t > attrValue)
Definition Ops.cpp.inc:494
::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:253
::mlir::StringAttr getTemplateParamsAttrName()
Definition Ops.h.inc:239
static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value)
Definition Ops.cpp.inc:402
::llvm::ArrayRef< int32_t > getMapOpGroupSizes()
Definition Ops.cpp.inc:485
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index)
Definition Ops.cpp.inc:214
::mlir::MutableOperandRange getArgOperandsMutable()
Definition Ops.cpp.inc:223
::llvm::ArrayRef< int32_t > getNumDimsPerMap()
Definition Ops.cpp.inc:480
::mlir::Operation::operand_range getArgOperands()
Definition Ops.h.inc:266
::llvm::LogicalResult verifyInvariants()
Definition Ops.cpp.inc:580
::mlir::StringAttr getMapOpGroupSizesAttrName()
Definition Ops.h.inc:223
::mlir::ArrayAttr getTemplateParamsAttr()
Definition Ops.h.inc:297
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
Definition Ops.cpp.inc:584
void print(::mlir::OpAsmPrinter &_odsPrinter)
Definition Ops.cpp.inc:687
::mlir::OperandRangeRange getMapOperands()
Definition Ops.h.inc:270
FoldAdaptor::Properties Properties
Definition Ops.h.inc:209
::mlir::DenseI32ArrayAttr getMapOpGroupSizesAttr()
Definition Ops.h.inc:307
::std::optional< ::mlir::ArrayAttr > getTemplateParams()
Definition Ops.cpp.inc:475
::mlir::StringAttr getNumDimsPerMapAttrName()
Definition Ops.h.inc:231
::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop)
Definition Ops.cpp.inc:329
::mlir::MutableOperandRangeRange getMapOperandsMutable()
Definition Ops.cpp.inc:229
::llvm::LogicalResult verifyInvariantsImpl()
Definition Ops.cpp.inc:532
::mlir::Operation::result_range getODSResults(unsigned index)
Definition Ops.h.inc:277
::mlir::StringAttr getCalleeAttrName()
Definition Ops.h.inc:215
::mlir::DenseI32ArrayAttr getNumDimsPerMapAttr()
Definition Ops.h.inc:302
::mlir::Operation::operand_range getODSOperands(unsigned index)
Definition Ops.h.inc:260
FuncDefOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:585
::llvm::LogicalResult verify(::mlir::Location loc)
Definition Ops.cpp.inc:747
static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value)
Definition Ops.cpp.inc:894
static llvm::hash_code computePropertiesHash(const Properties &prop)
Definition Ops.cpp.inc:871
FoldAdaptor::Properties Properties
Definition Ops.h.inc:628
::mlir::FunctionType getFunctionType()
Definition Ops.cpp.inc:984
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()
Definition Ops.h.inc:658
::mlir::StringAttr getFunctionTypeAttrName()
Definition Ops.h.inc:642
::llvm::LogicalResult verifyInvariants()
Definition Ops.cpp.inc:1108
static std::optional< mlir::Attribute > getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name)
Definition Ops.cpp.inc:879
::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state)
Definition Ops.cpp.inc:953
::mlir::StringAttr getResAttrsAttrName()
Definition Ops.h.inc:650
::std::optional< ::mlir::ArrayAttr > getResAttrs()
Definition Ops.cpp.inc:994
::std::optional< ::mlir::ArrayAttr > getArgAttrs()
Definition Ops.cpp.inc:989
::mlir::ArrayAttr getArgAttrsAttr()
Definition Ops.h.inc:713
::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop)
Definition Ops.cpp.inc:834
static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs)
Definition Ops.cpp.inc:916
void writeProperties(::mlir::DialectBytecodeWriter &writer)
Definition Ops.cpp.inc:969
::llvm::StringRef getSymName()
Definition Ops.cpp.inc:979
void setFunctionType(::mlir::FunctionType attrValue)
Definition Ops.cpp.inc:1003
::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:769
::llvm::ArrayRef<::mlir::Type > getResultTypes()
Required by FunctionOpInterface.
Definition Ops.h.inc:842
void setSymName(::llvm::StringRef attrValue)
Definition Ops.cpp.inc:999
::mlir::SymbolRefAttr getFullyQualifiedName(bool requireParent=true)
Return the full name for this function from the root module, including all surrounding symbol table n...
Definition Ops.cpp:353
::mlir::TypeAttr getFunctionTypeAttr()
Definition Ops.h.inc:708
::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:926
::llvm::LogicalResult verify()
Definition Ops.cpp:244
::mlir::StringAttr getSymNameAttr()
Definition Ops.h.inc:703
::mlir::ArrayAttr getResAttrsAttr()
Definition Ops.h.inc:718
::llvm::LogicalResult verifyInvariantsImpl()
Definition Ops.cpp.inc:1079
::mlir::StringAttr getArgAttrsAttrName()
Definition Ops.h.inc:634
ReturnOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs={}, const ::mlir::EmptyProperties &properties={}, ::mlir::RegionRange regions={})
Definition Ops.h.inc:923
::llvm::LogicalResult verify(::mlir::Location loc)
Definition Ops.cpp.inc:1147
void print(::mlir::OpAsmPrinter &_odsPrinter)
Definition Ops.cpp.inc:1236
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index)
Definition Ops.cpp.inc:1151
::llvm::LogicalResult verifyInvariantsImpl()
Definition Ops.cpp.inc:1191
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState)
Definition Ops.cpp.inc:1175
::mlir::Operation::operand_range getODSOperands(unsigned index)
Definition Ops.h.inc:973
::mlir::MutableOperandRange getMutableSuccessorOperands(::mlir::RegionBranchPoint point)
Definition Ops.cpp.inc:1251
void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect > > &effects)
Definition Ops.cpp.inc:1248
::llvm::LogicalResult verify()
Definition Ops.cpp:396
::mlir::MutableOperandRange getOperandsMutable()
Definition Ops.cpp.inc:1169
::mlir::Operation::operand_range getOperands()
Definition Ops.h.inc:979
::llvm::LogicalResult verifyInvariants()
Definition Ops.cpp.inc:1204
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
Definition Ops.cpp.inc:1210
CallOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:108
::mlir::DenseI32ArrayAttr getMapOpGroupSizesAttr()
Definition Ops.h.inc:137
::llvm::ArrayRef< int32_t > getMapOpGroupSizes()
Definition Ops.cpp.inc:184
::std::optional< ::mlir::ArrayAttr > getTemplateParams()
Definition Ops.cpp.inc:169
::mlir::DenseI32ArrayAttr getNumDimsPerMapAttr()
Definition Ops.cpp.inc:174
::std::optional<::mlir::OperationName > odsOpName
Definition Ops.h.inc:104
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize)
Definition Ops.cpp.inc:155
::llvm::ArrayRef< int32_t > getNumDimsPerMap()
Definition Ops.cpp.inc:179
::std::optional< ::mlir::ArrayAttr > getResAttrs()
Definition Ops.cpp.inc:739
::std::optional< ::mlir::ArrayAttr > getArgAttrs()
Definition Ops.cpp.inc:734
FuncDefOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:528
::std::optional<::mlir::OperationName > odsOpName
Definition Ops.h.inc:524
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize)
Definition Ops.cpp.inc:1126
void printTemplateParams(mlir::AsmPrinter &printer, mlir::ArrayAttr value)
Definition OpHelpers.h:179
mlir::ParseResult parseAttrDictWithWarnings(mlir::OpAsmParser &parser, mlir::NamedAttrList &extraAttrs, mlir::OperationState &state)
Definition OpHelpers.h:147
bool isValidType(Type type)
void printMultiDimAndSymbolList(mlir::OpAsmPrinter &printer, mlir::Operation *op, mlir::OperandRangeRange multiMapOperands, mlir::DenseI32ArrayAttr numDimsPerMap)
Definition OpHelpers.h:140
void printAttrDictWithWarnings(mlir::OpAsmPrinter &printer, ConcreteOp op, mlir::DictionaryAttr extraAttrs, typename mlir::PropertiesSelector< ConcreteOp >::type state)
Definition OpHelpers.h:154
mlir::ParseResult parseTemplateParams(mlir::AsmParser &parser, mlir::ArrayAttr &value)
Definition OpHelpers.h:161
mlir::ParseResult parseMultiDimAndSymbolList(mlir::OpAsmParser &parser, mlir::SmallVector< mlir::SmallVector< mlir::OpAsmParser::UnresolvedOperand > > &multiMapOperands, mlir::DenseI32ArrayAttr &numDimsPerMap)
Definition OpHelpers.h:132