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
20#endif // GET_OP_LIST
21
22#ifdef GET_OP_CLASSES
23#undef GET_OP_CLASSES
24
25
26//===----------------------------------------------------------------------===//
27// Local Utility Method Definitions
28//===----------------------------------------------------------------------===//
29
30namespace llzk {
31namespace polymorphic {
32
33static ::llvm::LogicalResult __mlir_ods_local_type_constraint_Ops1(
34 ::mlir::Operation *op, ::mlir::Type type, ::llvm::StringRef valueKind,
35 unsigned valueIndex) {
36 if (!((::llvm::isa<::mlir::IndexType>(type)))) {
37 return op->emitOpError(valueKind) << " #" << valueIndex
38 << " must be variadic of index, but got " << type;
39 }
40 return ::mlir::success();
41}
42
43static ::llvm::LogicalResult __mlir_ods_local_type_constraint_Ops2(
44 ::mlir::Operation *op, ::mlir::Type type, ::llvm::StringRef valueKind,
45 unsigned valueIndex) {
46 if (!((::llvm::isa<::mlir::IndexType>(type)))) {
47 return op->emitOpError(valueKind) << " #" << valueIndex
48 << " must be index, but got " << type;
49 }
50 return ::mlir::success();
51}
52
53static ::llvm::LogicalResult __mlir_ods_local_type_constraint_Ops3(
54 ::mlir::Operation *op, ::mlir::Type type, ::llvm::StringRef valueKind,
55 unsigned valueIndex) {
56 if (!((::llzk::isValidConstReadType(type)))) {
57 return op->emitOpError(valueKind) << " #" << valueIndex
58 << " must be integral, felt, or typevar type, but got " << type;
59 }
60 return ::mlir::success();
61}
62
63static ::llvm::LogicalResult __mlir_ods_local_type_constraint_Ops4(
64 ::mlir::Operation *op, ::mlir::Type type, ::llvm::StringRef valueKind,
65 unsigned valueIndex) {
66 if (!((::llzk::isValidType(type)))) {
67 return op->emitOpError(valueKind) << " #" << valueIndex
68 << " must be a valid LLZK type, but got " << type;
69 }
70 return ::mlir::success();
71}
72
73static ::llvm::LogicalResult __mlir_ods_local_attr_constraint_Ops1(
74 ::mlir::Attribute attr, ::llvm::StringRef attrName, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
75 if (attr && !((::llvm::isa<::mlir::AffineMapAttr>(attr))))
76 return emitError() << "attribute '" << attrName
77 << "' failed to satisfy constraint: AffineMap attribute";
78 return ::mlir::success();
79}
80static ::llvm::LogicalResult __mlir_ods_local_attr_constraint_Ops1(
81 ::mlir::Operation *op, ::mlir::Attribute attr, ::llvm::StringRef attrName) {
82 return __mlir_ods_local_attr_constraint_Ops1(attr, attrName, [op]() {
83 return op->emitOpError();
84 });
85}
86
87static ::llvm::LogicalResult __mlir_ods_local_attr_constraint_Ops2(
88 ::mlir::Attribute attr, ::llvm::StringRef attrName, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
89 if (attr && !(((::llvm::isa<::mlir::IntegerAttr>(attr))) && ((::llvm::isa<::mlir::IndexType>(::llvm::cast<::mlir::IntegerAttr>(attr).getType())))))
90 return emitError() << "attribute '" << attrName
91 << "' failed to satisfy constraint: index attribute";
92 return ::mlir::success();
93}
94static ::llvm::LogicalResult __mlir_ods_local_attr_constraint_Ops2(
95 ::mlir::Operation *op, ::mlir::Attribute attr, ::llvm::StringRef attrName) {
96 return __mlir_ods_local_attr_constraint_Ops2(attr, attrName, [op]() {
97 return op->emitOpError();
98 });
99}
100
101static ::llvm::LogicalResult __mlir_ods_local_attr_constraint_Ops3(
102 ::mlir::Attribute attr, ::llvm::StringRef attrName, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
103 if (attr && !((::llvm::isa<::mlir::FlatSymbolRefAttr>(attr))))
104 return emitError() << "attribute '" << attrName
105 << "' failed to satisfy constraint: flat symbol reference attribute";
106 return ::mlir::success();
107}
108static ::llvm::LogicalResult __mlir_ods_local_attr_constraint_Ops3(
109 ::mlir::Operation *op, ::mlir::Attribute attr, ::llvm::StringRef attrName) {
110 return __mlir_ods_local_attr_constraint_Ops3(attr, attrName, [op]() {
111 return op->emitOpError();
112 });
113}
114
115static ::llvm::LogicalResult __mlir_ods_local_attr_constraint_Ops4(
116 ::mlir::Attribute attr, ::llvm::StringRef attrName, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
117 if (attr && !((::llvm::isa<::mlir::StringAttr>(attr))))
118 return emitError() << "attribute '" << attrName
119 << "' failed to satisfy constraint: string attribute";
120 return ::mlir::success();
121}
122static ::llvm::LogicalResult __mlir_ods_local_attr_constraint_Ops4(
123 ::mlir::Operation *op, ::mlir::Attribute attr, ::llvm::StringRef attrName) {
124 return __mlir_ods_local_attr_constraint_Ops4(attr, attrName, [op]() {
125 return op->emitOpError();
126 });
127}
128
129static ::llvm::LogicalResult __mlir_ods_local_attr_constraint_Ops5(
130 ::mlir::Attribute attr, ::llvm::StringRef attrName, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
131 if (attr && !(((::llvm::isa<::mlir::TypeAttr>(attr))) && ((::llvm::isa<::mlir::Type>(::llvm::cast<::mlir::TypeAttr>(attr).getValue()))) && ((::llzk::isValidConstReadType(::llvm::cast<::mlir::TypeAttr>(attr).getValue())))))
132 return emitError() << "attribute '" << attrName
133 << "' failed to satisfy constraint: type attribute of integral, felt, or typevar type";
134 return ::mlir::success();
135}
136static ::llvm::LogicalResult __mlir_ods_local_attr_constraint_Ops5(
137 ::mlir::Operation *op, ::mlir::Attribute attr, ::llvm::StringRef attrName) {
138 return __mlir_ods_local_attr_constraint_Ops5(attr, attrName, [op]() {
139 return op->emitOpError();
140 });
141}
142
143static ::llvm::LogicalResult __mlir_ods_local_region_constraint_Ops1(
144 ::mlir::Operation *op, ::mlir::Region &region, ::llvm::StringRef regionName,
145 unsigned regionIndex) {
146 if (!((::llvm::hasNItems(region, 1)))) {
147 return op->emitOpError("region #") << regionIndex
148 << (regionName.empty() ? " " : " ('" + regionName + "') ")
149 << "failed to verify constraint: region with 1 blocks";
150 }
151 return ::mlir::success();
152}
153} // namespace polymorphic
154} // namespace llzk
155namespace llzk {
156namespace polymorphic {
157
158//===----------------------------------------------------------------------===//
159// ::llzk::polymorphic::ApplyMapOp definitions
160//===----------------------------------------------------------------------===//
161
162namespace detail {
163ApplyMapOpGenericAdaptorBase::ApplyMapOpGenericAdaptorBase(ApplyMapOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
164
165std::pair<unsigned, unsigned> ApplyMapOpGenericAdaptorBase::getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize) {
166 bool isVariadic[] = {true};
167 int prevVariadicCount = 0;
168 for (unsigned i = 0; i < index; ++i)
169 if (isVariadic[i]) ++prevVariadicCount;
170
171 // Calculate how many dynamic values a static variadic operand corresponds to.
172 // This assumes all static variadic operands have the same dynamic value count.
173 int variadicSize = (odsOperandsSize - 0) / 1;
174 // `index` passed in as the parameter is the static index which counts each
175 // operand (variadic or not) as size 1. So here for each previous static variadic
176 // operand, we need to offset by (variadicSize - 1) to get where the dynamic
177 // value pack for this static operand starts.
178 int start = index + (variadicSize - 1) * prevVariadicCount;
179 int size = isVariadic[index] ? variadicSize : 1;
180 return {start, size};
181}
182
184 auto attr = getMapAttr();
185 return attr.getValue();
186}
187
189 auto attr = getNumDimsAttr();
190 return attr.getValue();
191}
192
193} // namespace detail
195
196::llvm::LogicalResult ApplyMapOpAdaptor::verify(::mlir::Location loc) {
197 auto tblgen_map = getProperties().map; (void)tblgen_map;
198 if (!tblgen_map) return emitError(loc, "'poly.applymap' op ""requires attribute 'map'");
199 auto tblgen_numDims = getProperties().numDims; (void)tblgen_numDims;
200 if (!tblgen_numDims) return emitError(loc, "'poly.applymap' op ""requires attribute 'numDims'");
201
202 if (tblgen_map && !((::llvm::isa<::mlir::AffineMapAttr>(tblgen_map))))
203 return emitError(loc, "'poly.applymap' op ""attribute 'map' failed to satisfy constraint: AffineMap attribute");
204
205 if (tblgen_numDims && !(((::llvm::isa<::mlir::IntegerAttr>(tblgen_numDims))) && ((::llvm::isa<::mlir::IndexType>(::llvm::cast<::mlir::IntegerAttr>(tblgen_numDims).getType())))))
206 return emitError(loc, "'poly.applymap' op ""attribute 'numDims' failed to satisfy constraint: index attribute");
207 return ::mlir::success();
208}
209
210std::pair<unsigned, unsigned> ApplyMapOp::getODSOperandIndexAndLength(unsigned index) {
211 bool isVariadic[] = {true};
212 int prevVariadicCount = 0;
213 for (unsigned i = 0; i < index; ++i)
214 if (isVariadic[i]) ++prevVariadicCount;
215
216 // Calculate how many dynamic values a static variadic operand corresponds to.
217 // This assumes all static variadic operands have the same dynamic value count.
218 int variadicSize = (getOperation()->getNumOperands() - 0) / 1;
219 // `index` passed in as the parameter is the static index which counts each
220 // operand (variadic or not) as size 1. So here for each previous static variadic
221 // operand, we need to offset by (variadicSize - 1) to get where the dynamic
222 // value pack for this static operand starts.
223 int start = index + (variadicSize - 1) * prevVariadicCount;
224 int size = isVariadic[index] ? variadicSize : 1;
225 return {start, size};
226}
227
228::mlir::MutableOperandRange ApplyMapOp::getMapOperandsMutable() {
229 auto range = getODSOperandIndexAndLength(0);
230 auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
231 return mutableRange;
232}
233
234::llvm::LogicalResult ApplyMapOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
235 ::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
236 if (!dict) {
237 emitError() << "expected DictionaryAttr to set properties";
238 return ::mlir::failure();
239 }
240
241 {
242 auto &propStorage = prop.map;
243 auto attr = dict.get("map");
244 if (attr) {
245 auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
246 if (convertedAttr) {
247 propStorage = convertedAttr;
248 } else {
249 emitError() << "Invalid attribute `map` in property conversion: " << attr;
250 return ::mlir::failure();
251 }
252 }
253 }
254
255 {
256 auto &propStorage = prop.numDims;
257 auto attr = dict.get("numDims");
258 if (attr) {
259 auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
260 if (convertedAttr) {
261 propStorage = convertedAttr;
262 } else {
263 emitError() << "Invalid attribute `numDims` in property conversion: " << attr;
264 return ::mlir::failure();
265 }
266 }
267 }
268 return ::mlir::success();
269}
270
271::mlir::Attribute ApplyMapOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
272 ::mlir::SmallVector<::mlir::NamedAttribute> attrs;
273 ::mlir::Builder odsBuilder{ctx};
274
275 {
276 const auto &propStorage = prop.map;
277 if (propStorage)
278 attrs.push_back(odsBuilder.getNamedAttr("map",
279 propStorage));
280 }
281
282 {
283 const auto &propStorage = prop.numDims;
284 if (propStorage)
285 attrs.push_back(odsBuilder.getNamedAttr("numDims",
286 propStorage));
287 }
288
289 if (!attrs.empty())
290 return odsBuilder.getDictionaryAttr(attrs);
291 return {};
292}
293
294llvm::hash_code ApplyMapOp::computePropertiesHash(const Properties &prop) {
295 return llvm::hash_combine(
296 llvm::hash_value(prop.map.getAsOpaquePointer()),
297 llvm::hash_value(prop.numDims.getAsOpaquePointer()));
298}
299
300std::optional<mlir::Attribute> ApplyMapOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
301 if (name == "map")
302 return prop.map;
303
304 if (name == "numDims")
305 return prop.numDims;
306 return std::nullopt;
307}
308
309void ApplyMapOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
310 if (name == "map") {
311 prop.map = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.map)>>(value);
312 return;
313 }
314
315 if (name == "numDims") {
316 prop.numDims = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.numDims)>>(value);
317 return;
318 }
319}
320
321void ApplyMapOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
322 if (prop.map) attrs.append("map", prop.map);
323
324 if (prop.numDims) attrs.append("numDims", prop.numDims);
325}
326
327::llvm::LogicalResult ApplyMapOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
328 {
329 ::mlir::Attribute attr = attrs.get(getMapAttrName(opName));
330 if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_Ops1(attr, "map", emitError)))
331 return ::mlir::failure();
332 }
333
334 {
335 ::mlir::Attribute attr = attrs.get(getNumDimsAttrName(opName));
336 if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_Ops2(attr, "numDims", emitError)))
337 return ::mlir::failure();
338 }
339 return ::mlir::success();
340}
341
342::llvm::LogicalResult ApplyMapOp::readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state) {
343 auto &prop = state.getOrAddProperties<Properties>(); (void)prop;
344 if (::mlir::failed(reader.readAttribute(prop.map)))
345 return ::mlir::failure();
346
347 if (::mlir::failed(reader.readAttribute(prop.numDims)))
348 return ::mlir::failure();
349 return ::mlir::success();
350}
351
352void ApplyMapOp::writeProperties(::mlir::DialectBytecodeWriter &writer) {
353 auto &prop = getProperties(); (void)prop;
354 writer.writeAttribute(prop.map);
355 writer.writeAttribute(prop.numDims);
356}
357
358::mlir::AffineMap ApplyMapOp::getMap() {
359 auto attr = getMapAttr();
360 return attr.getValue();
361}
362
363::llvm::APInt ApplyMapOp::getNumDims() {
364 auto attr = getNumDimsAttr();
365 return attr.getValue();
366}
367
368void ApplyMapOp::setMap(::mlir::AffineMap attrValue) {
369 getProperties().map = ::mlir::AffineMapAttr::get(attrValue);
370}
371
372void ApplyMapOp::setNumDims(::llvm::APInt attrValue) {
373 getProperties().numDims = ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIndexType(), attrValue);
374}
375
376void ApplyMapOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::AffineMapAttr map, ::mlir::ValueRange mapOperands) {
377 odsState.addOperands(mapOperands);
378 Properties &props = odsState.getOrAddProperties<Properties>();
379 props.setMap(map);
380 props.setNumDims(odsBuilder.getIntegerAttr(odsBuilder.getIndexType(),
381 map.getAffineMap().getNumDims()));
382 odsState.addTypes(odsBuilder.getIndexType());
383
384}
385
386void ApplyMapOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::AffineMap map, ::mlir::ValueRange mapOperands) {
387 build(odsBuilder, odsState, ::mlir::AffineMapAttr::get(map), mapOperands);
388
389}
390
391void ApplyMapOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::AffineExpr expr, ::mlir::ValueRange mapOperands) {
392 auto map = ::mlir::AffineMap::inferFromExprList({expr}, odsBuilder.getContext()).front();
393 build(odsBuilder, odsState, map, mapOperands);
394
395}
396
397::llvm::LogicalResult ApplyMapOp::verifyInvariantsImpl() {
398 auto tblgen_map = getProperties().map; (void)tblgen_map;
399 if (!tblgen_map) return emitOpError("requires attribute 'map'");
400 auto tblgen_numDims = getProperties().numDims; (void)tblgen_numDims;
401 if (!tblgen_numDims) return emitOpError("requires attribute 'numDims'");
402
403 if (::mlir::failed(__mlir_ods_local_attr_constraint_Ops1(*this, tblgen_map, "map")))
404 return ::mlir::failure();
405
406 if (::mlir::failed(__mlir_ods_local_attr_constraint_Ops2(*this, tblgen_numDims, "numDims")))
407 return ::mlir::failure();
408 {
409 unsigned index = 0; (void)index;
410 auto valueGroup0 = getODSOperands(0);
411
412 for (auto v : valueGroup0) {
413 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops1(*this, v.getType(), "operand", index++)))
414 return ::mlir::failure();
415 }
416 }
417 {
418 unsigned index = 0; (void)index;
419 auto valueGroup0 = getODSResults(0);
420
421 for (auto v : valueGroup0) {
422 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops2(*this, v.getType(), "result", index++)))
423 return ::mlir::failure();
424 }
425 }
426 return ::mlir::success();
427}
428
429::llvm::LogicalResult ApplyMapOp::verifyInvariants() {
430 if(::mlir::succeeded(verifyInvariantsImpl()) && ::mlir::succeeded(verify()))
431 return ::mlir::success();
432 return ::mlir::failure();
433}
434
435::llvm::LogicalResult ApplyMapOp::inferReturnTypes(::mlir::MLIRContext *context, ::std::optional<::mlir::Location> location, ::mlir::ValueRange operands, ::mlir::DictionaryAttr attributes, ::mlir::OpaqueProperties properties, ::mlir::RegionRange regions, ::llvm::SmallVectorImpl<::mlir::Type>&inferredReturnTypes) {
436 inferredReturnTypes.resize(1);
437 ::mlir::Builder odsBuilder(context);
438 ::mlir::Type odsInferredType0 = odsBuilder.getIndexType();
439 inferredReturnTypes[0] = odsInferredType0;
440 return ::mlir::success();
441}
442
443::mlir::ParseResult ApplyMapOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
444 ::llvm::SmallVector<::mlir::OpAsmParser::UnresolvedOperand, 4> mapOperandsOperands;
445 ::llvm::SMLoc mapOperandsOperandsLoc;
446 (void)mapOperandsOperandsLoc;
447 ::mlir::IntegerAttr numDimsAttr;
448 ::mlir::AffineMapAttr mapAttr;
449 {
450 mapOperandsOperandsLoc = parser.getCurrentLocation();
451 auto odsResult = parseDimAndSymbolList(parser, mapOperandsOperands, numDimsAttr);
452 if (odsResult) return ::mlir::failure();
453 result.getOrAddProperties<ApplyMapOp::Properties>().numDims = numDimsAttr;
454 }
455
456 if (parser.parseCustomAttributeWithFallback(mapAttr, parser.getBuilder().getIndexType())) {
457 return ::mlir::failure();
458 }
459 if (mapAttr) result.getOrAddProperties<ApplyMapOp::Properties>().map = mapAttr;
460 {
461 auto loc = parser.getCurrentLocation();(void)loc;
462 if (parser.parseOptionalAttrDict(result.attributes))
463 return ::mlir::failure();
464 if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() {
465 return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op ";
466 })))
467 return ::mlir::failure();
468 }
469 ::mlir::Type odsBuildableType0 = parser.getBuilder().getIndexType();
470 result.addTypes(odsBuildableType0);
471 if (parser.resolveOperands(mapOperandsOperands, odsBuildableType0, mapOperandsOperandsLoc, result.operands))
472 return ::mlir::failure();
473 return ::mlir::success();
474}
475
476void ApplyMapOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
477 _odsPrinter << ' ';
478 printDimAndSymbolList(_odsPrinter, *this, getMapOperands(), getNumDimsAttr());
479 _odsPrinter << ' ';
480 _odsPrinter.printAttributeWithoutType(getMapAttr());
481 ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
482 elidedAttrs.push_back("numDims");
483 elidedAttrs.push_back("map");
484 _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
485}
486
487void ApplyMapOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
488}
489
490} // namespace polymorphic
491} // namespace llzk
492MLIR_DEFINE_EXPLICIT_TYPE_ID(::llzk::polymorphic::ApplyMapOp)
493
494namespace llzk {
495namespace polymorphic {
496
497//===----------------------------------------------------------------------===//
498// ::llzk::polymorphic::ConstReadOp definitions
499//===----------------------------------------------------------------------===//
500
501namespace detail {
502ConstReadOpGenericAdaptorBase::ConstReadOpGenericAdaptorBase(ConstReadOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
503
505 auto attr = getConstNameAttr();
506 return attr.getValue();
507}
508
509} // namespace detail
511
512::llvm::LogicalResult ConstReadOpAdaptor::verify(::mlir::Location loc) {
513 auto tblgen_const_name = getProperties().const_name; (void)tblgen_const_name;
514 if (!tblgen_const_name) return emitError(loc, "'poly.read_const' op ""requires attribute 'const_name'");
515
516 if (tblgen_const_name && !((::llvm::isa<::mlir::FlatSymbolRefAttr>(tblgen_const_name))))
517 return emitError(loc, "'poly.read_const' op ""attribute 'const_name' failed to satisfy constraint: flat symbol reference attribute");
518 return ::mlir::success();
519}
520
521::llvm::LogicalResult ConstReadOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
522 ::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
523 if (!dict) {
524 emitError() << "expected DictionaryAttr to set properties";
525 return ::mlir::failure();
526 }
527
528 {
529 auto &propStorage = prop.const_name;
530 auto attr = dict.get("const_name");
531 if (attr) {
532 auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
533 if (convertedAttr) {
534 propStorage = convertedAttr;
535 } else {
536 emitError() << "Invalid attribute `const_name` in property conversion: " << attr;
537 return ::mlir::failure();
538 }
539 }
540 }
541 return ::mlir::success();
542}
543
544::mlir::Attribute ConstReadOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
545 ::mlir::SmallVector<::mlir::NamedAttribute> attrs;
546 ::mlir::Builder odsBuilder{ctx};
547
548 {
549 const auto &propStorage = prop.const_name;
550 if (propStorage)
551 attrs.push_back(odsBuilder.getNamedAttr("const_name",
552 propStorage));
553 }
554
555 if (!attrs.empty())
556 return odsBuilder.getDictionaryAttr(attrs);
557 return {};
558}
559
560llvm::hash_code ConstReadOp::computePropertiesHash(const Properties &prop) {
561 return llvm::hash_combine(
562 llvm::hash_value(prop.const_name.getAsOpaquePointer()));
563}
564
565std::optional<mlir::Attribute> ConstReadOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
566 if (name == "const_name")
567 return prop.const_name;
568 return std::nullopt;
569}
570
571void ConstReadOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
572 if (name == "const_name") {
573 prop.const_name = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.const_name)>>(value);
574 return;
575 }
576}
577
578void ConstReadOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
579 if (prop.const_name) attrs.append("const_name", prop.const_name);
580}
581
582::llvm::LogicalResult ConstReadOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
583 {
584 ::mlir::Attribute attr = attrs.get(getConstNameAttrName(opName));
585 if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_Ops3(attr, "const_name", emitError)))
586 return ::mlir::failure();
587 }
588 return ::mlir::success();
589}
590
591::llvm::LogicalResult ConstReadOp::readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state) {
592 auto &prop = state.getOrAddProperties<Properties>(); (void)prop;
593 if (::mlir::failed(reader.readAttribute(prop.const_name)))
594 return ::mlir::failure();
595 return ::mlir::success();
596}
597
598void ConstReadOp::writeProperties(::mlir::DialectBytecodeWriter &writer) {
599 auto &prop = getProperties(); (void)prop;
600 writer.writeAttribute(prop.const_name);
601}
602
603::llvm::StringRef ConstReadOp::getConstName() {
604 auto attr = getConstNameAttr();
605 return attr.getValue();
606}
607
608void ConstReadOp::setConstName(::llvm::StringRef attrValue) {
609 getProperties().const_name = ::mlir::SymbolRefAttr::get(::mlir::Builder((*this)->getContext()).getContext(), attrValue);
610}
611
612void ConstReadOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type val, ::mlir::FlatSymbolRefAttr const_name) {
613 odsState.getOrAddProperties<Properties>().const_name = const_name;
614 odsState.addTypes(val);
615}
616
617void ConstReadOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::FlatSymbolRefAttr const_name) {
618 odsState.getOrAddProperties<Properties>().const_name = const_name;
619 assert(resultTypes.size() == 1u && "mismatched number of results");
620 odsState.addTypes(resultTypes);
621}
622
623void ConstReadOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type val, ::llvm::StringRef const_name) {
624 odsState.getOrAddProperties<Properties>().const_name = ::mlir::SymbolRefAttr::get(odsBuilder.getContext(), const_name);
625 odsState.addTypes(val);
626}
627
628void ConstReadOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::llvm::StringRef const_name) {
629 odsState.getOrAddProperties<Properties>().const_name = ::mlir::SymbolRefAttr::get(odsBuilder.getContext(), const_name);
630 assert(resultTypes.size() == 1u && "mismatched number of results");
631 odsState.addTypes(resultTypes);
632}
633
634void ConstReadOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
635 assert(operands.size() == 0u && "mismatched number of parameters");
636 odsState.addOperands(operands);
637 odsState.addAttributes(attributes);
638 assert(resultTypes.size() == 1u && "mismatched number of return types");
639 odsState.addTypes(resultTypes);
640
641 if (!attributes.empty()) {
642 ::mlir::OpaqueProperties properties =
643 &odsState.getOrAddProperties<ConstReadOp::Properties>();
644 std::optional<::mlir::RegisteredOperationName> info =
645 odsState.name.getRegisteredInfo();
646 if (failed(info->setOpPropertiesFromAttribute(odsState.name, properties,
647 odsState.attributes.getDictionary(odsState.getContext()), nullptr)))
648 ::llvm::report_fatal_error("Property conversion failed.");
649 }
650}
651
652::llvm::LogicalResult ConstReadOp::verifyInvariantsImpl() {
653 auto tblgen_const_name = getProperties().const_name; (void)tblgen_const_name;
654 if (!tblgen_const_name) return emitOpError("requires attribute 'const_name'");
655
656 if (::mlir::failed(__mlir_ods_local_attr_constraint_Ops3(*this, tblgen_const_name, "const_name")))
657 return ::mlir::failure();
658 {
659 unsigned index = 0; (void)index;
660 auto valueGroup0 = getODSResults(0);
661
662 for (auto v : valueGroup0) {
663 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops3(*this, v.getType(), "result", index++)))
664 return ::mlir::failure();
665 }
666 }
667 return ::mlir::success();
668}
669
670::llvm::LogicalResult ConstReadOp::verifyInvariants() {
671 return verifyInvariantsImpl();
672}
673
674::mlir::ParseResult ConstReadOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
675 ::mlir::FlatSymbolRefAttr const_nameAttr;
676 ::mlir::Type valRawType{};
677 ::llvm::ArrayRef<::mlir::Type> valTypes(&valRawType, 1);
678
679 if (parser.parseCustomAttributeWithFallback(const_nameAttr, parser.getBuilder().getType<::mlir::NoneType>())) {
680 return ::mlir::failure();
681 }
682 if (const_nameAttr) result.getOrAddProperties<ConstReadOp::Properties>().const_name = const_nameAttr;
683 if (parser.parseColon())
684 return ::mlir::failure();
685
686 {
687 ::mlir::Type type;
688 if (parser.parseCustomTypeWithFallback(type))
689 return ::mlir::failure();
690 valRawType = type;
691 }
692 {
693 auto loc = parser.getCurrentLocation();(void)loc;
694 if (parser.parseOptionalAttrDict(result.attributes))
695 return ::mlir::failure();
696 if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() {
697 return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op ";
698 })))
699 return ::mlir::failure();
700 }
701 result.addTypes(valTypes);
702 return ::mlir::success();
703}
704
705void ConstReadOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
706 _odsPrinter << ' ';
707 _odsPrinter.printAttributeWithoutType(getConstNameAttr());
708 _odsPrinter << ' ' << ":";
709 _odsPrinter << ' ';
710 {
711 auto type = getVal().getType();
712 if (auto validType = ::llvm::dyn_cast<::mlir::Type>(type))
713 _odsPrinter.printStrippedAttrOrType(validType);
714 else
715 _odsPrinter << type;
716 }
717 ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
718 elidedAttrs.push_back("const_name");
719 _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
720}
721
722void ConstReadOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
723}
724
725} // namespace polymorphic
726} // namespace llzk
727MLIR_DEFINE_EXPLICIT_TYPE_ID(::llzk::polymorphic::ConstReadOp)
728
729namespace llzk {
730namespace polymorphic {
731
732//===----------------------------------------------------------------------===//
733// ::llzk::polymorphic::TemplateExprOp definitions
734//===----------------------------------------------------------------------===//
735
736namespace detail {
738
740 auto attr = getSymNameAttr();
741 return attr.getValue();
742}
743
744} // namespace detail
746
747::llvm::LogicalResult TemplateExprOpAdaptor::verify(::mlir::Location loc) {
748 auto tblgen_sym_name = getProperties().sym_name; (void)tblgen_sym_name;
749 if (!tblgen_sym_name) return emitError(loc, "'poly.expr' op ""requires attribute 'sym_name'");
750
751 if (tblgen_sym_name && !((::llvm::isa<::mlir::StringAttr>(tblgen_sym_name))))
752 return emitError(loc, "'poly.expr' op ""attribute 'sym_name' failed to satisfy constraint: string attribute");
753 return ::mlir::success();
754}
755
756::llvm::LogicalResult TemplateExprOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
757 ::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
758 if (!dict) {
759 emitError() << "expected DictionaryAttr to set properties";
760 return ::mlir::failure();
761 }
762
763 {
764 auto &propStorage = prop.sym_name;
765 auto attr = dict.get("sym_name");
766 if (attr) {
767 auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
768 if (convertedAttr) {
769 propStorage = convertedAttr;
770 } else {
771 emitError() << "Invalid attribute `sym_name` in property conversion: " << attr;
772 return ::mlir::failure();
773 }
774 }
775 }
776 return ::mlir::success();
777}
778
779::mlir::Attribute TemplateExprOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
780 ::mlir::SmallVector<::mlir::NamedAttribute> attrs;
781 ::mlir::Builder odsBuilder{ctx};
782
783 {
784 const auto &propStorage = prop.sym_name;
785 if (propStorage)
786 attrs.push_back(odsBuilder.getNamedAttr("sym_name",
787 propStorage));
788 }
789
790 if (!attrs.empty())
791 return odsBuilder.getDictionaryAttr(attrs);
792 return {};
793}
794
796 return llvm::hash_combine(
797 llvm::hash_value(prop.sym_name.getAsOpaquePointer()));
798}
799
800std::optional<mlir::Attribute> TemplateExprOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
801 if (name == "sym_name")
802 return prop.sym_name;
803 return std::nullopt;
804}
805
806void TemplateExprOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
807 if (name == "sym_name") {
808 prop.sym_name = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.sym_name)>>(value);
809 return;
810 }
811}
812
813void TemplateExprOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
814 if (prop.sym_name) attrs.append("sym_name", prop.sym_name);
815}
816
817::llvm::LogicalResult TemplateExprOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
818 {
819 ::mlir::Attribute attr = attrs.get(getSymNameAttrName(opName));
820 if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_Ops4(attr, "sym_name", emitError)))
821 return ::mlir::failure();
822 }
823 return ::mlir::success();
824}
825
826::llvm::LogicalResult TemplateExprOp::readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state) {
827 auto &prop = state.getOrAddProperties<Properties>(); (void)prop;
828 if (::mlir::failed(reader.readAttribute(prop.sym_name)))
829 return ::mlir::failure();
830 return ::mlir::success();
831}
832
833void TemplateExprOp::writeProperties(::mlir::DialectBytecodeWriter &writer) {
834 auto &prop = getProperties(); (void)prop;
835 writer.writeAttribute(prop.sym_name);
836}
837
838::llvm::StringRef TemplateExprOp::getSymName() {
839 auto attr = getSymNameAttr();
840 return attr.getValue();
841}
842
843void TemplateExprOp::setSymName(::llvm::StringRef attrValue) {
844 getProperties().sym_name = ::mlir::Builder((*this)->getContext()).getStringAttr(attrValue);
845}
846
847void TemplateExprOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::StringAttr sym_name) {
848 odsState.getOrAddProperties<Properties>().sym_name = sym_name;
849 (void)odsState.addRegion();
850}
851
852void TemplateExprOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::StringAttr sym_name) {
853 odsState.getOrAddProperties<Properties>().sym_name = sym_name;
854 (void)odsState.addRegion();
855 assert(resultTypes.size() == 0u && "mismatched number of results");
856 odsState.addTypes(resultTypes);
857}
858
859void TemplateExprOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::llvm::StringRef sym_name) {
860 odsState.getOrAddProperties<Properties>().sym_name = odsBuilder.getStringAttr(sym_name);
861 (void)odsState.addRegion();
862}
863
864void TemplateExprOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::llvm::StringRef sym_name) {
865 odsState.getOrAddProperties<Properties>().sym_name = odsBuilder.getStringAttr(sym_name);
866 (void)odsState.addRegion();
867 assert(resultTypes.size() == 0u && "mismatched number of results");
868 odsState.addTypes(resultTypes);
869}
870
871void TemplateExprOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
872 assert(operands.size() == 0u && "mismatched number of parameters");
873 odsState.addOperands(operands);
874 odsState.addAttributes(attributes);
875 for (unsigned i = 0; i != 1; ++i)
876 (void)odsState.addRegion();
877 assert(resultTypes.size() == 0u && "mismatched number of return types");
878 odsState.addTypes(resultTypes);
879
880 if (!attributes.empty()) {
881 ::mlir::OpaqueProperties properties =
882 &odsState.getOrAddProperties<TemplateExprOp::Properties>();
883 std::optional<::mlir::RegisteredOperationName> info =
884 odsState.name.getRegisteredInfo();
885 if (failed(info->setOpPropertiesFromAttribute(odsState.name, properties,
886 odsState.attributes.getDictionary(odsState.getContext()), nullptr)))
887 ::llvm::report_fatal_error("Property conversion failed.");
888 }
889}
890
892 auto tblgen_sym_name = getProperties().sym_name; (void)tblgen_sym_name;
893 if (!tblgen_sym_name) return emitOpError("requires attribute 'sym_name'");
894
895 if (::mlir::failed(__mlir_ods_local_attr_constraint_Ops4(*this, tblgen_sym_name, "sym_name")))
896 return ::mlir::failure();
897 {
898 unsigned index = 0; (void)index;
899
900 for (auto &region : ::llvm::MutableArrayRef((*this)->getRegion(0)))
901 if (::mlir::failed(__mlir_ods_local_region_constraint_Ops1(*this, region, "initializerRegion", index++)))
902 return ::mlir::failure();
903 }
904 return ::mlir::success();
905}
906
907::llvm::LogicalResult TemplateExprOp::verifyInvariants() {
908 return verifyInvariantsImpl();
909}
910
911::mlir::ParseResult TemplateExprOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
912 ::mlir::StringAttr sym_nameAttr;
913 std::unique_ptr<::mlir::Region> initializerRegionRegion = std::make_unique<::mlir::Region>();
914
915 if (parser.parseSymbolName(sym_nameAttr))
916 return ::mlir::failure();
917 if (sym_nameAttr) result.getOrAddProperties<TemplateExprOp::Properties>().sym_name = sym_nameAttr;
918
919 if (parser.parseRegion(*initializerRegionRegion))
920 return ::mlir::failure();
921
922 if (initializerRegionRegion->empty()) initializerRegionRegion->emplaceBlock();
923 {
924 auto loc = parser.getCurrentLocation();(void)loc;
925 if (parser.parseOptionalAttrDict(result.attributes))
926 return ::mlir::failure();
927 if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() {
928 return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op ";
929 })))
930 return ::mlir::failure();
931 }
932 result.addRegion(std::move(initializerRegionRegion));
933 return ::mlir::success();
934}
935
936void TemplateExprOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
937 _odsPrinter << ' ';
938 _odsPrinter.printSymbolName(getSymNameAttr().getValue());
939 _odsPrinter << ' ';
940 _odsPrinter.printRegion(getInitializerRegion());
941 ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
942 elidedAttrs.push_back("sym_name");
943 _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
944}
945
946} // namespace polymorphic
947} // namespace llzk
948MLIR_DEFINE_EXPLICIT_TYPE_ID(::llzk::polymorphic::TemplateExprOp)
949
950namespace llzk {
951namespace polymorphic {
952
953//===----------------------------------------------------------------------===//
954// ::llzk::polymorphic::TemplateOp definitions
955//===----------------------------------------------------------------------===//
956
957namespace detail {
959
961 auto attr = getSymNameAttr();
962 return attr.getValue();
963}
964
965} // namespace detail
967
968::llvm::LogicalResult TemplateOpAdaptor::verify(::mlir::Location loc) {
969 auto tblgen_sym_name = getProperties().sym_name; (void)tblgen_sym_name;
970 if (!tblgen_sym_name) return emitError(loc, "'poly.template' op ""requires attribute 'sym_name'");
971
972 if (tblgen_sym_name && !((::llvm::isa<::mlir::StringAttr>(tblgen_sym_name))))
973 return emitError(loc, "'poly.template' op ""attribute 'sym_name' failed to satisfy constraint: string attribute");
974 return ::mlir::success();
975}
976
977::llvm::LogicalResult TemplateOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
978 ::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
979 if (!dict) {
980 emitError() << "expected DictionaryAttr to set properties";
981 return ::mlir::failure();
982 }
983
984 {
985 auto &propStorage = prop.sym_name;
986 auto attr = dict.get("sym_name");
987 if (attr) {
988 auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
989 if (convertedAttr) {
990 propStorage = convertedAttr;
991 } else {
992 emitError() << "Invalid attribute `sym_name` in property conversion: " << attr;
993 return ::mlir::failure();
994 }
995 }
996 }
997 return ::mlir::success();
998}
999
1000::mlir::Attribute TemplateOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
1001 ::mlir::SmallVector<::mlir::NamedAttribute> attrs;
1002 ::mlir::Builder odsBuilder{ctx};
1003
1004 {
1005 const auto &propStorage = prop.sym_name;
1006 if (propStorage)
1007 attrs.push_back(odsBuilder.getNamedAttr("sym_name",
1008 propStorage));
1009 }
1010
1011 if (!attrs.empty())
1012 return odsBuilder.getDictionaryAttr(attrs);
1013 return {};
1014}
1015
1016llvm::hash_code TemplateOp::computePropertiesHash(const Properties &prop) {
1017 return llvm::hash_combine(
1018 llvm::hash_value(prop.sym_name.getAsOpaquePointer()));
1019}
1020
1021std::optional<mlir::Attribute> TemplateOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
1022 if (name == "sym_name")
1023 return prop.sym_name;
1024 return std::nullopt;
1025}
1026
1027void TemplateOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
1028 if (name == "sym_name") {
1029 prop.sym_name = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.sym_name)>>(value);
1030 return;
1031 }
1032}
1033
1034void TemplateOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
1035 if (prop.sym_name) attrs.append("sym_name", prop.sym_name);
1036}
1037
1038::llvm::LogicalResult TemplateOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
1039 {
1040 ::mlir::Attribute attr = attrs.get(getSymNameAttrName(opName));
1041 if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_Ops4(attr, "sym_name", emitError)))
1042 return ::mlir::failure();
1043 }
1044 return ::mlir::success();
1045}
1046
1047::llvm::LogicalResult TemplateOp::readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state) {
1048 auto &prop = state.getOrAddProperties<Properties>(); (void)prop;
1049 if (::mlir::failed(reader.readAttribute(prop.sym_name)))
1050 return ::mlir::failure();
1051 return ::mlir::success();
1052}
1053
1054void TemplateOp::writeProperties(::mlir::DialectBytecodeWriter &writer) {
1055 auto &prop = getProperties(); (void)prop;
1056 writer.writeAttribute(prop.sym_name);
1057}
1058
1059::llvm::StringRef TemplateOp::getSymName() {
1060 auto attr = getSymNameAttr();
1061 return attr.getValue();
1062}
1063
1064void TemplateOp::setSymName(::llvm::StringRef attrValue) {
1065 getProperties().sym_name = ::mlir::Builder((*this)->getContext()).getStringAttr(attrValue);
1066}
1067
1068void TemplateOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::StringAttr sym_name) {
1069 odsState.getOrAddProperties<Properties>().sym_name = sym_name;
1070 (void)odsState.addRegion();
1071}
1072
1073void TemplateOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::StringAttr sym_name) {
1074 odsState.getOrAddProperties<Properties>().sym_name = sym_name;
1075 (void)odsState.addRegion();
1076 assert(resultTypes.size() == 0u && "mismatched number of results");
1077 odsState.addTypes(resultTypes);
1078}
1079
1080void TemplateOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::llvm::StringRef sym_name) {
1081 odsState.getOrAddProperties<Properties>().sym_name = odsBuilder.getStringAttr(sym_name);
1082 (void)odsState.addRegion();
1083}
1084
1085void TemplateOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::llvm::StringRef sym_name) {
1086 odsState.getOrAddProperties<Properties>().sym_name = odsBuilder.getStringAttr(sym_name);
1087 (void)odsState.addRegion();
1088 assert(resultTypes.size() == 0u && "mismatched number of results");
1089 odsState.addTypes(resultTypes);
1090}
1091
1092void TemplateOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
1093 assert(operands.size() == 0u && "mismatched number of parameters");
1094 odsState.addOperands(operands);
1095 odsState.addAttributes(attributes);
1096 for (unsigned i = 0; i != 1; ++i)
1097 (void)odsState.addRegion();
1098 assert(resultTypes.size() == 0u && "mismatched number of return types");
1099 odsState.addTypes(resultTypes);
1100
1101 if (!attributes.empty()) {
1102 ::mlir::OpaqueProperties properties =
1103 &odsState.getOrAddProperties<TemplateOp::Properties>();
1104 std::optional<::mlir::RegisteredOperationName> info =
1105 odsState.name.getRegisteredInfo();
1106 if (failed(info->setOpPropertiesFromAttribute(odsState.name, properties,
1107 odsState.attributes.getDictionary(odsState.getContext()), nullptr)))
1108 ::llvm::report_fatal_error("Property conversion failed.");
1109 }
1110}
1111
1112::llvm::LogicalResult TemplateOp::verifyInvariantsImpl() {
1113 auto tblgen_sym_name = getProperties().sym_name; (void)tblgen_sym_name;
1114 if (!tblgen_sym_name) return emitOpError("requires attribute 'sym_name'");
1115
1116 if (::mlir::failed(__mlir_ods_local_attr_constraint_Ops4(*this, tblgen_sym_name, "sym_name")))
1117 return ::mlir::failure();
1118 {
1119 unsigned index = 0; (void)index;
1120
1121 for (auto &region : ::llvm::MutableArrayRef((*this)->getRegion(0)))
1122 if (::mlir::failed(__mlir_ods_local_region_constraint_Ops1(*this, region, "bodyRegion", index++)))
1123 return ::mlir::failure();
1124 }
1125 return ::mlir::success();
1126}
1127
1128::llvm::LogicalResult TemplateOp::verifyInvariants() {
1129 return verifyInvariantsImpl();
1130}
1131
1132::mlir::ParseResult TemplateOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
1133 ::mlir::StringAttr sym_nameAttr;
1134 std::unique_ptr<::mlir::Region> bodyRegionRegion = std::make_unique<::mlir::Region>();
1135
1136 if (parser.parseSymbolName(sym_nameAttr))
1137 return ::mlir::failure();
1138 if (sym_nameAttr) result.getOrAddProperties<TemplateOp::Properties>().sym_name = sym_nameAttr;
1139
1140 if (parser.parseRegion(*bodyRegionRegion))
1141 return ::mlir::failure();
1142
1143 if (bodyRegionRegion->empty()) bodyRegionRegion->emplaceBlock();
1144 {
1145 auto loc = parser.getCurrentLocation();(void)loc;
1146 if (parser.parseOptionalAttrDict(result.attributes))
1147 return ::mlir::failure();
1148 if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() {
1149 return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op ";
1150 })))
1151 return ::mlir::failure();
1152 }
1153 result.addRegion(std::move(bodyRegionRegion));
1154 return ::mlir::success();
1155}
1156
1157void TemplateOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
1158 _odsPrinter << ' ';
1159 _odsPrinter.printSymbolName(getSymNameAttr().getValue());
1160 _odsPrinter << ' ';
1161 _odsPrinter.printRegion(getBodyRegion());
1162 ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
1163 elidedAttrs.push_back("sym_name");
1164 _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
1165}
1166
1167} // namespace polymorphic
1168} // namespace llzk
1169MLIR_DEFINE_EXPLICIT_TYPE_ID(::llzk::polymorphic::TemplateOp)
1170
1171namespace llzk {
1172namespace polymorphic {
1173
1174//===----------------------------------------------------------------------===//
1175// ::llzk::polymorphic::TemplateParamOp definitions
1176//===----------------------------------------------------------------------===//
1177
1178namespace detail {
1180
1182 auto attr = getSymNameAttr();
1183 return attr.getValue();
1184}
1185
1186::std::optional<::mlir::Type> TemplateParamOpGenericAdaptorBase::getTypeOpt() {
1187 auto attr = getTypeOptAttr();
1188 return attr ? ::std::optional<::mlir::Type>(::llvm::cast<::mlir::Type>(attr.getValue())) : (::std::nullopt);
1189}
1190
1191} // namespace detail
1193
1194::llvm::LogicalResult TemplateParamOpAdaptor::verify(::mlir::Location loc) {
1195 auto tblgen_sym_name = getProperties().sym_name; (void)tblgen_sym_name;
1196 if (!tblgen_sym_name) return emitError(loc, "'poly.param' op ""requires attribute 'sym_name'");
1197 auto tblgen_type_opt = getProperties().type_opt; (void)tblgen_type_opt;
1198
1199 if (tblgen_sym_name && !((::llvm::isa<::mlir::StringAttr>(tblgen_sym_name))))
1200 return emitError(loc, "'poly.param' op ""attribute 'sym_name' failed to satisfy constraint: string attribute");
1201
1202 if (tblgen_type_opt && !(((::llvm::isa<::mlir::TypeAttr>(tblgen_type_opt))) && ((::llvm::isa<::mlir::Type>(::llvm::cast<::mlir::TypeAttr>(tblgen_type_opt).getValue()))) && ((::llzk::isValidConstReadType(::llvm::cast<::mlir::TypeAttr>(tblgen_type_opt).getValue())))))
1203 return emitError(loc, "'poly.param' op ""attribute 'type_opt' failed to satisfy constraint: type attribute of integral, felt, or typevar type");
1204 return ::mlir::success();
1205}
1206
1207::llvm::LogicalResult TemplateParamOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
1208 ::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
1209 if (!dict) {
1210 emitError() << "expected DictionaryAttr to set properties";
1211 return ::mlir::failure();
1212 }
1213
1214 {
1215 auto &propStorage = prop.sym_name;
1216 auto attr = dict.get("sym_name");
1217 if (attr) {
1218 auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
1219 if (convertedAttr) {
1220 propStorage = convertedAttr;
1221 } else {
1222 emitError() << "Invalid attribute `sym_name` in property conversion: " << attr;
1223 return ::mlir::failure();
1224 }
1225 }
1226 }
1227
1228 {
1229 auto &propStorage = prop.type_opt;
1230 auto attr = dict.get("type_opt");
1231 if (attr) {
1232 auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
1233 if (convertedAttr) {
1234 propStorage = convertedAttr;
1235 } else {
1236 emitError() << "Invalid attribute `type_opt` in property conversion: " << attr;
1237 return ::mlir::failure();
1238 }
1239 }
1240 }
1241 return ::mlir::success();
1242}
1243
1244::mlir::Attribute TemplateParamOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
1245 ::mlir::SmallVector<::mlir::NamedAttribute> attrs;
1246 ::mlir::Builder odsBuilder{ctx};
1247
1248 {
1249 const auto &propStorage = prop.sym_name;
1250 if (propStorage)
1251 attrs.push_back(odsBuilder.getNamedAttr("sym_name",
1252 propStorage));
1253 }
1254
1255 {
1256 const auto &propStorage = prop.type_opt;
1257 if (propStorage)
1258 attrs.push_back(odsBuilder.getNamedAttr("type_opt",
1259 propStorage));
1260 }
1261
1262 if (!attrs.empty())
1263 return odsBuilder.getDictionaryAttr(attrs);
1264 return {};
1265}
1266
1268 return llvm::hash_combine(
1269 llvm::hash_value(prop.sym_name.getAsOpaquePointer()),
1270 llvm::hash_value(prop.type_opt.getAsOpaquePointer()));
1271}
1272
1273std::optional<mlir::Attribute> TemplateParamOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
1274 if (name == "sym_name")
1275 return prop.sym_name;
1276
1277 if (name == "type_opt")
1278 return prop.type_opt;
1279 return std::nullopt;
1280}
1281
1282void TemplateParamOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
1283 if (name == "sym_name") {
1284 prop.sym_name = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.sym_name)>>(value);
1285 return;
1286 }
1287
1288 if (name == "type_opt") {
1289 prop.type_opt = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.type_opt)>>(value);
1290 return;
1291 }
1292}
1293
1294void TemplateParamOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
1295 if (prop.sym_name) attrs.append("sym_name", prop.sym_name);
1296
1297 if (prop.type_opt) attrs.append("type_opt", prop.type_opt);
1298}
1299
1300::llvm::LogicalResult TemplateParamOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
1301 {
1302 ::mlir::Attribute attr = attrs.get(getSymNameAttrName(opName));
1303 if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_Ops4(attr, "sym_name", emitError)))
1304 return ::mlir::failure();
1305 }
1306
1307 {
1308 ::mlir::Attribute attr = attrs.get(getTypeOptAttrName(opName));
1309 if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_Ops5(attr, "type_opt", emitError)))
1310 return ::mlir::failure();
1311 }
1312 return ::mlir::success();
1313}
1314
1315::llvm::LogicalResult TemplateParamOp::readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state) {
1316 auto &prop = state.getOrAddProperties<Properties>(); (void)prop;
1317 if (::mlir::failed(reader.readAttribute(prop.sym_name)))
1318 return ::mlir::failure();
1319
1320 if (::mlir::failed(reader.readOptionalAttribute(prop.type_opt)))
1321 return ::mlir::failure();
1322 return ::mlir::success();
1323}
1324
1325void TemplateParamOp::writeProperties(::mlir::DialectBytecodeWriter &writer) {
1326 auto &prop = getProperties(); (void)prop;
1327 writer.writeAttribute(prop.sym_name);
1328
1329 writer.writeOptionalAttribute(prop.type_opt);
1330}
1331
1332::llvm::StringRef TemplateParamOp::getSymName() {
1333 auto attr = getSymNameAttr();
1334 return attr.getValue();
1335}
1336
1337::std::optional<::mlir::Type> TemplateParamOp::getTypeOpt() {
1338 auto attr = getTypeOptAttr();
1339 return attr ? ::std::optional<::mlir::Type>(::llvm::cast<::mlir::Type>(attr.getValue())) : (::std::nullopt);
1340}
1341
1342void TemplateParamOp::setSymName(::llvm::StringRef attrValue) {
1343 getProperties().sym_name = ::mlir::Builder((*this)->getContext()).getStringAttr(attrValue);
1344}
1345
1346void TemplateParamOp::setTypeOpt(::std::optional<::mlir::Type> attrValue) {
1347 auto &odsProp = getProperties().type_opt;
1348 if (attrValue)
1349 odsProp = ::mlir::TypeAttr::get(*attrValue);
1350 else
1351 odsProp = nullptr;
1352}
1353
1354void TemplateParamOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::StringAttr sym_name, /*optional*/::mlir::TypeAttr type_opt) {
1355 odsState.getOrAddProperties<Properties>().sym_name = sym_name;
1356 if (type_opt) {
1357 odsState.getOrAddProperties<Properties>().type_opt = type_opt;
1358 }
1359}
1360
1361void TemplateParamOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::StringAttr sym_name, /*optional*/::mlir::TypeAttr type_opt) {
1362 odsState.getOrAddProperties<Properties>().sym_name = sym_name;
1363 if (type_opt) {
1364 odsState.getOrAddProperties<Properties>().type_opt = type_opt;
1365 }
1366 assert(resultTypes.size() == 0u && "mismatched number of results");
1367 odsState.addTypes(resultTypes);
1368}
1369
1370void TemplateParamOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::llvm::StringRef sym_name, /*optional*/::mlir::TypeAttr type_opt) {
1371 odsState.getOrAddProperties<Properties>().sym_name = odsBuilder.getStringAttr(sym_name);
1372 if (type_opt) {
1373 odsState.getOrAddProperties<Properties>().type_opt = type_opt;
1374 }
1375}
1376
1377void TemplateParamOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::llvm::StringRef sym_name, /*optional*/::mlir::TypeAttr type_opt) {
1378 odsState.getOrAddProperties<Properties>().sym_name = odsBuilder.getStringAttr(sym_name);
1379 if (type_opt) {
1380 odsState.getOrAddProperties<Properties>().type_opt = type_opt;
1381 }
1382 assert(resultTypes.size() == 0u && "mismatched number of results");
1383 odsState.addTypes(resultTypes);
1384}
1385
1386void TemplateParamOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
1387 assert(operands.size() == 0u && "mismatched number of parameters");
1388 odsState.addOperands(operands);
1389 odsState.addAttributes(attributes);
1390 assert(resultTypes.size() == 0u && "mismatched number of return types");
1391 odsState.addTypes(resultTypes);
1392
1393 if (!attributes.empty()) {
1394 ::mlir::OpaqueProperties properties =
1395 &odsState.getOrAddProperties<TemplateParamOp::Properties>();
1396 std::optional<::mlir::RegisteredOperationName> info =
1397 odsState.name.getRegisteredInfo();
1398 if (failed(info->setOpPropertiesFromAttribute(odsState.name, properties,
1399 odsState.attributes.getDictionary(odsState.getContext()), nullptr)))
1400 ::llvm::report_fatal_error("Property conversion failed.");
1401 }
1402}
1403
1405 auto tblgen_sym_name = getProperties().sym_name; (void)tblgen_sym_name;
1406 if (!tblgen_sym_name) return emitOpError("requires attribute 'sym_name'");
1407 auto tblgen_type_opt = getProperties().type_opt; (void)tblgen_type_opt;
1408
1409 if (::mlir::failed(__mlir_ods_local_attr_constraint_Ops4(*this, tblgen_sym_name, "sym_name")))
1410 return ::mlir::failure();
1411
1412 if (::mlir::failed(__mlir_ods_local_attr_constraint_Ops5(*this, tblgen_type_opt, "type_opt")))
1413 return ::mlir::failure();
1414 return ::mlir::success();
1415}
1416
1417::llvm::LogicalResult TemplateParamOp::verifyInvariants() {
1418 return verifyInvariantsImpl();
1419}
1420
1421::mlir::ParseResult TemplateParamOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
1422 ::mlir::StringAttr sym_nameAttr;
1423 ::mlir::TypeAttr type_optAttr;
1424
1425 if (parser.parseSymbolName(sym_nameAttr))
1426 return ::mlir::failure();
1427 if (sym_nameAttr) result.getOrAddProperties<TemplateParamOp::Properties>().sym_name = sym_nameAttr;
1428 if (::mlir::succeeded(parser.parseOptionalColon())) {
1429
1430 if (parser.parseCustomAttributeWithFallback(type_optAttr, parser.getBuilder().getType<::mlir::NoneType>())) {
1431 return ::mlir::failure();
1432 }
1433 if (type_optAttr) result.getOrAddProperties<TemplateParamOp::Properties>().type_opt = type_optAttr;
1434 }
1435 {
1436 auto loc = parser.getCurrentLocation();(void)loc;
1437 if (parser.parseOptionalAttrDict(result.attributes))
1438 return ::mlir::failure();
1439 if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() {
1440 return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op ";
1441 })))
1442 return ::mlir::failure();
1443 }
1444 return ::mlir::success();
1445}
1446
1447void TemplateParamOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
1448 _odsPrinter << ' ';
1449 _odsPrinter.printSymbolName(getSymNameAttr().getValue());
1450 if (getTypeOptAttr()) {
1451 _odsPrinter << ' ' << ":";
1452 _odsPrinter << ' ';
1453 _odsPrinter.printAttributeWithoutType(getTypeOptAttr());
1454 }
1455 ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
1456 elidedAttrs.push_back("sym_name");
1457 elidedAttrs.push_back("type_opt");
1458 _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
1459}
1460
1461} // namespace polymorphic
1462} // namespace llzk
1463MLIR_DEFINE_EXPLICIT_TYPE_ID(::llzk::polymorphic::TemplateParamOp)
1464
1465namespace llzk {
1466namespace polymorphic {
1467
1468//===----------------------------------------------------------------------===//
1469// ::llzk::polymorphic::UnifiableCastOp definitions
1470//===----------------------------------------------------------------------===//
1471
1472namespace detail {
1473} // namespace detail
1475
1476::llvm::LogicalResult UnifiableCastOpAdaptor::verify(::mlir::Location loc) {
1477 return ::mlir::success();
1478}
1479
1480void UnifiableCastOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value input) {
1481 odsState.addOperands(input);
1482 odsState.addTypes(result);
1483}
1484
1485void UnifiableCastOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input) {
1486 odsState.addOperands(input);
1487 assert(resultTypes.size() == 1u && "mismatched number of results");
1488 odsState.addTypes(resultTypes);
1489}
1490
1491void UnifiableCastOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
1492 assert(operands.size() == 1u && "mismatched number of parameters");
1493 odsState.addOperands(operands);
1494 odsState.addAttributes(attributes);
1495 assert(resultTypes.size() == 1u && "mismatched number of return types");
1496 odsState.addTypes(resultTypes);
1497}
1498
1500 {
1501 unsigned index = 0; (void)index;
1502 auto valueGroup0 = getODSOperands(0);
1503
1504 for (auto v : valueGroup0) {
1505 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops4(*this, v.getType(), "operand", index++)))
1506 return ::mlir::failure();
1507 }
1508 }
1509 {
1510 unsigned index = 0; (void)index;
1511 auto valueGroup0 = getODSResults(0);
1512
1513 for (auto v : valueGroup0) {
1514 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops4(*this, v.getType(), "result", index++)))
1515 return ::mlir::failure();
1516 }
1517 }
1518 return ::mlir::success();
1519}
1520
1521::llvm::LogicalResult UnifiableCastOp::verifyInvariants() {
1522 if(::mlir::succeeded(verifyInvariantsImpl()) && ::mlir::succeeded(verify()))
1523 return ::mlir::success();
1524 return ::mlir::failure();
1525}
1526
1527::mlir::ParseResult UnifiableCastOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
1528 ::mlir::OpAsmParser::UnresolvedOperand inputRawOperand{};
1529 ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> inputOperands(&inputRawOperand, 1); ::llvm::SMLoc inputOperandsLoc;
1530 (void)inputOperandsLoc;
1531 ::llvm::ArrayRef<::mlir::Type> inputTypes;
1532 ::llvm::ArrayRef<::mlir::Type> allResultTypes;
1533
1534 inputOperandsLoc = parser.getCurrentLocation();
1535 if (parser.parseOperand(inputRawOperand))
1536 return ::mlir::failure();
1537 if (parser.parseColon())
1538 return ::mlir::failure();
1539
1540 ::mlir::FunctionType input__allResult_functionType;
1541 if (parser.parseType(input__allResult_functionType))
1542 return ::mlir::failure();
1543 inputTypes = input__allResult_functionType.getInputs();
1544 allResultTypes = input__allResult_functionType.getResults();
1545 {
1546 auto loc = parser.getCurrentLocation();(void)loc;
1547 if (parser.parseOptionalAttrDict(result.attributes))
1548 return ::mlir::failure();
1549 }
1550 result.addTypes(allResultTypes);
1551 if (parser.resolveOperands(inputOperands, inputTypes, inputOperandsLoc, result.operands))
1552 return ::mlir::failure();
1553 return ::mlir::success();
1554}
1555
1556void UnifiableCastOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
1557 _odsPrinter << ' ';
1558 _odsPrinter << getInput();
1559 _odsPrinter << ' ' << ":";
1560 _odsPrinter << ' ';
1561 _odsPrinter.printFunctionalType(::llvm::ArrayRef<::mlir::Type>(getInput().getType()), getOperation()->getResultTypes());
1562 ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
1563 _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
1564}
1565
1566void UnifiableCastOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
1567}
1568
1569} // namespace polymorphic
1570} // namespace llzk
1571MLIR_DEFINE_EXPLICIT_TYPE_ID(::llzk::polymorphic::UnifiableCastOp)
1572
1573namespace llzk {
1574namespace polymorphic {
1575
1576//===----------------------------------------------------------------------===//
1577// ::llzk::polymorphic::YieldOp definitions
1578//===----------------------------------------------------------------------===//
1579
1580namespace detail {
1581} // namespace detail
1583
1584::llvm::LogicalResult YieldOpAdaptor::verify(::mlir::Location loc) {
1585 return ::mlir::success();
1586}
1587
1588void YieldOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value val) {
1589 odsState.addOperands(val);
1590}
1591
1592void YieldOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value val) {
1593 odsState.addOperands(val);
1594 assert(resultTypes.size() == 0u && "mismatched number of results");
1595 odsState.addTypes(resultTypes);
1596}
1597
1598void YieldOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
1599 assert(operands.size() == 1u && "mismatched number of parameters");
1600 odsState.addOperands(operands);
1601 odsState.addAttributes(attributes);
1602 assert(resultTypes.size() == 0u && "mismatched number of return types");
1603 odsState.addTypes(resultTypes);
1604}
1605
1606::llvm::LogicalResult YieldOp::verifyInvariantsImpl() {
1607 {
1608 unsigned index = 0; (void)index;
1609 auto valueGroup0 = getODSOperands(0);
1610
1611 for (auto v : valueGroup0) {
1612 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops3(*this, v.getType(), "operand", index++)))
1613 return ::mlir::failure();
1614 }
1615 }
1616 return ::mlir::success();
1617}
1618
1619::llvm::LogicalResult YieldOp::verifyInvariants() {
1620 return verifyInvariantsImpl();
1621}
1622
1623::mlir::ParseResult YieldOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
1624 ::mlir::OpAsmParser::UnresolvedOperand valRawOperand{};
1625 ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> valOperands(&valRawOperand, 1); ::llvm::SMLoc valOperandsLoc;
1626 (void)valOperandsLoc;
1627 ::mlir::Type valRawType{};
1628 ::llvm::ArrayRef<::mlir::Type> valTypes(&valRawType, 1);
1629
1630 valOperandsLoc = parser.getCurrentLocation();
1631 if (parser.parseOperand(valRawOperand))
1632 return ::mlir::failure();
1633 if (parser.parseColon())
1634 return ::mlir::failure();
1635
1636 {
1637 ::mlir::Type type;
1638 if (parser.parseCustomTypeWithFallback(type))
1639 return ::mlir::failure();
1640 valRawType = type;
1641 }
1642 {
1643 auto loc = parser.getCurrentLocation();(void)loc;
1644 if (parser.parseOptionalAttrDict(result.attributes))
1645 return ::mlir::failure();
1646 }
1647 if (parser.resolveOperands(valOperands, valTypes, valOperandsLoc, result.operands))
1648 return ::mlir::failure();
1649 return ::mlir::success();
1650}
1651
1652void YieldOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
1653 _odsPrinter << ' ';
1654 _odsPrinter << getVal();
1655 _odsPrinter << ' ' << ":";
1656 _odsPrinter << ' ';
1657 {
1658 auto type = getVal().getType();
1659 if (auto validType = ::llvm::dyn_cast<::mlir::Type>(type))
1660 _odsPrinter.printStrippedAttrOrType(validType);
1661 else
1662 _odsPrinter << type;
1663 }
1664 ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
1665 _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
1666}
1667
1668::mlir::MutableOperandRange YieldOp::getMutableSuccessorOperands(
1669 ::mlir::RegionBranchPoint point) {
1670 return ::mlir::MutableOperandRange(*this);
1671}
1672
1673} // namespace polymorphic
1674} // namespace llzk
1675MLIR_DEFINE_EXPLICIT_TYPE_ID(::llzk::polymorphic::YieldOp)
1676
1677
1678#endif // GET_OP_CLASSES
1679
::llvm::LogicalResult verify(::mlir::Location loc)
Definition Ops.cpp.inc:196
ApplyMapOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:129
::mlir::AffineMapAttr getMapAttr()
Definition Ops.h.inc:233
::mlir::IntegerAttr getNumDimsAttr()
Definition Ops.h.inc:238
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index)
Definition Ops.cpp.inc:210
::mlir::Operation::result_range getODSResults(unsigned index)
Definition Ops.h.inc:218
::mlir::Operation::operand_range getMapOperands()
Definition Ops.h.inc:209
::llvm::LogicalResult verify()
Definition Ops.cpp:183
void print(::mlir::OpAsmPrinter &_odsPrinter)
Definition Ops.cpp.inc:476
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
Definition Ops.cpp.inc:443
::llvm::LogicalResult inferReturnTypes(::mlir::MLIRContext *context, ::std::optional<::mlir::Location > location, ::mlir::ValueRange operands, ::mlir::DictionaryAttr attributes, ::mlir::OpaqueProperties properties, ::mlir::RegionRange regions, ::llvm::SmallVectorImpl<::mlir::Type > &inferredReturnTypes)
Definition Ops.cpp.inc:435
::llvm::LogicalResult verifyInvariants()
Definition Ops.cpp.inc:429
static llvm::hash_code computePropertiesHash(const Properties &prop)
Definition Ops.cpp.inc:294
FoldAdaptor::Properties Properties
Definition Ops.h.inc:176
::mlir::Operation::operand_range getODSOperands(unsigned index)
Definition Ops.h.inc:203
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::AffineMapAttr map, ::mlir::ValueRange mapOperands={})
Definition Ops.cpp.inc:376
::mlir::StringAttr getMapAttrName()
Definition Ops.h.inc:182
::mlir::AffineMap getMap()
Definition Ops.cpp.inc:358
static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs)
Definition Ops.cpp.inc:321
void writeProperties(::mlir::DialectBytecodeWriter &writer)
Definition Ops.cpp.inc:352
void setMap(::mlir::AffineMap attrValue)
Definition Ops.cpp.inc:368
::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop)
Definition Ops.cpp.inc:271
::mlir::StringAttr getNumDimsAttrName()
Definition Ops.h.inc:190
::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:327
::mlir::MutableOperandRange getMapOperandsMutable()
Definition Ops.cpp.inc:228
::llvm::LogicalResult verifyInvariantsImpl()
Definition Ops.cpp.inc:397
static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value)
Definition Ops.cpp.inc:309
::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state)
Definition Ops.cpp.inc:342
::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:234
void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect > > &effects)
Definition Ops.cpp.inc:487
static std::optional< mlir::Attribute > getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name)
Definition Ops.cpp.inc:300
void setNumDims(::llvm::APInt attrValue)
Definition Ops.cpp.inc:372
::llvm::LogicalResult verify(::mlir::Location loc)
Definition Ops.cpp.inc:512
ConstReadOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:370
void writeProperties(::mlir::DialectBytecodeWriter &writer)
Definition Ops.cpp.inc:598
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
Definition Ops.cpp.inc:674
void print(::mlir::OpAsmPrinter &_odsPrinter)
Definition Ops.cpp.inc:705
FoldAdaptor::Properties Properties
Definition Ops.h.inc:413
::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:582
::mlir::TypedValue<::mlir::Type > getVal()
Definition Ops.h.inc:451
::mlir::StringAttr getConstNameAttrName()
Definition Ops.h.inc:419
::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop)
Definition Ops.cpp.inc:544
static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value)
Definition Ops.cpp.inc:571
::mlir::Operation::result_range getODSResults(unsigned index)
Definition Ops.h.inc:445
::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:521
static llvm::hash_code computePropertiesHash(const Properties &prop)
Definition Ops.cpp.inc:560
void setConstName(::llvm::StringRef attrValue)
Definition Ops.cpp.inc:608
::llvm::LogicalResult verifyInvariantsImpl()
Definition Ops.cpp.inc:652
void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect > > &effects)
Definition Ops.cpp.inc:722
::mlir::FlatSymbolRefAttr getConstNameAttr()
Definition Ops.h.inc:464
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type val, ::mlir::FlatSymbolRefAttr const_name)
Definition Ops.cpp.inc:612
static std::optional< mlir::Attribute > getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name)
Definition Ops.cpp.inc:565
static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs)
Definition Ops.cpp.inc:578
::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state)
Definition Ops.cpp.inc:591
::llvm::LogicalResult verifyInvariants()
Definition Ops.cpp.inc:670
::llvm::StringRef getConstName()
Definition Ops.cpp.inc:603
::llvm::LogicalResult verify(::mlir::Location loc)
Definition Ops.cpp.inc:747
TemplateExprOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:579
::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:817
static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value)
Definition Ops.cpp.inc:806
::mlir::StringAttr getSymNameAttr()
Definition Ops.h.inc:673
static std::optional< mlir::Attribute > getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name)
Definition Ops.cpp.inc:800
::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop)
Definition Ops.cpp.inc:779
static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs)
Definition Ops.cpp.inc:813
::mlir::Region & getInitializerRegion()
Definition Ops.h.inc:660
static llvm::hash_code computePropertiesHash(const Properties &prop)
Definition Ops.cpp.inc:795
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
Definition Ops.cpp.inc:911
::llvm::LogicalResult verifyInvariantsImpl()
Definition Ops.cpp.inc:891
::llvm::StringRef getSymName()
Definition Ops.cpp.inc:838
void setSymName(::llvm::StringRef attrValue)
Definition Ops.cpp.inc:843
void writeProperties(::mlir::DialectBytecodeWriter &writer)
Definition Ops.cpp.inc:833
::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:756
::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state)
Definition Ops.cpp.inc:826
FoldAdaptor::Properties Properties
Definition Ops.h.inc:622
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::StringAttr sym_name)
Definition Ops.cpp.inc:847
::mlir::StringAttr getSymNameAttrName()
Definition Ops.h.inc:628
::llvm::LogicalResult verifyInvariants()
Definition Ops.cpp.inc:907
void print(::mlir::OpAsmPrinter &_odsPrinter)
Definition Ops.cpp.inc:936
TemplateOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:791
::llvm::LogicalResult verify(::mlir::Location loc)
Definition Ops.cpp.inc:968
::mlir::Region & getBodyRegion()
Definition Ops.h.inc:872
::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:1038
::mlir::StringAttr getSymNameAttrName()
Definition Ops.h.inc:840
static llvm::hash_code computePropertiesHash(const Properties &prop)
Definition Ops.cpp.inc:1016
::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop)
Definition Ops.cpp.inc:1000
void writeProperties(::mlir::DialectBytecodeWriter &writer)
Definition Ops.cpp.inc:1054
void print(::mlir::OpAsmPrinter &_odsPrinter)
Definition Ops.cpp.inc:1157
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
Definition Ops.cpp.inc:1132
static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs)
Definition Ops.cpp.inc:1034
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::StringAttr sym_name)
Definition Ops.cpp.inc:1068
static std::optional< mlir::Attribute > getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name)
Definition Ops.cpp.inc:1021
FoldAdaptor::Properties Properties
Definition Ops.h.inc:834
::mlir::StringAttr getSymNameAttr()
Definition Ops.h.inc:885
::llvm::LogicalResult verifyInvariantsImpl()
Definition Ops.cpp.inc:1112
void setSymName(::llvm::StringRef attrValue)
Definition Ops.cpp.inc:1064
static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value)
Definition Ops.cpp.inc:1027
::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state)
Definition Ops.cpp.inc:1047
::llvm::StringRef getSymName()
Definition Ops.cpp.inc:1059
::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:977
::llvm::LogicalResult verifyInvariants()
Definition Ops.cpp.inc:1128
::llvm::LogicalResult verify(::mlir::Location loc)
Definition Ops.cpp.inc:1194
TemplateParamOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:1075
::llvm::LogicalResult verifyInvariants()
Definition Ops.cpp.inc:1417
::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:1300
void setSymName(::llvm::StringRef attrValue)
Definition Ops.cpp.inc:1342
::mlir::StringAttr getTypeOptAttrName()
Definition Ops.h.inc:1132
void setTypeOpt(::std::optional<::mlir::Type > attrValue)
Definition Ops.cpp.inc:1346
::mlir::TypeAttr getTypeOptAttr()
Definition Ops.h.inc:1178
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::StringAttr sym_name, ::mlir::TypeAttr type_opt)
Definition Ops.cpp.inc:1354
::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop)
Definition Ops.cpp.inc:1244
static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value)
Definition Ops.cpp.inc:1282
FoldAdaptor::Properties Properties
Definition Ops.h.inc:1118
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
Definition Ops.cpp.inc:1421
void writeProperties(::mlir::DialectBytecodeWriter &writer)
Definition Ops.cpp.inc:1325
::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state)
Definition Ops.cpp.inc:1315
void print(::mlir::OpAsmPrinter &_odsPrinter)
Definition Ops.cpp.inc:1447
::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:1207
::mlir::StringAttr getSymNameAttrName()
Definition Ops.h.inc:1124
::mlir::StringAttr getSymNameAttr()
Definition Ops.h.inc:1173
static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs)
Definition Ops.cpp.inc:1294
::llvm::LogicalResult verifyInvariantsImpl()
Definition Ops.cpp.inc:1404
::std::optional<::mlir::Type > getTypeOpt()
Definition Ops.cpp.inc:1337
static std::optional< mlir::Attribute > getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name)
Definition Ops.cpp.inc:1273
static llvm::hash_code computePropertiesHash(const Properties &prop)
Definition Ops.cpp.inc:1267
UnifiableCastOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs={}, const ::mlir::EmptyProperties &properties={}, ::mlir::RegionRange regions={})
Definition Ops.h.inc:1264
::llvm::LogicalResult verify(::mlir::Location loc)
Definition Ops.cpp.inc:1476
::llvm::LogicalResult verify()
Definition Ops.cpp:207
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value input)
Definition Ops.cpp.inc:1480
void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect > > &effects)
Definition Ops.cpp.inc:1566
::mlir::Operation::operand_range getODSOperands(unsigned index)
Definition Ops.h.inc:1321
::mlir::TypedValue<::mlir::Type > getInput()
Definition Ops.h.inc:1327
::llvm::LogicalResult verifyInvariantsImpl()
Definition Ops.cpp.inc:1499
::llvm::LogicalResult verifyInvariants()
Definition Ops.cpp.inc:1521
::mlir::Operation::result_range getODSResults(unsigned index)
Definition Ops.h.inc:1340
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
Definition Ops.cpp.inc:1527
void print(::mlir::OpAsmPrinter &_odsPrinter)
Definition Ops.cpp.inc:1556
::llvm::LogicalResult verify(::mlir::Location loc)
Definition Ops.cpp.inc:1584
YieldOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs={}, const ::mlir::EmptyProperties &properties={}, ::mlir::RegionRange regions={})
Definition Ops.h.inc:1401
::mlir::MutableOperandRange getMutableSuccessorOperands(::mlir::RegionBranchPoint point)
Definition Ops.cpp.inc:1668
::llvm::LogicalResult verifyInvariantsImpl()
Definition Ops.cpp.inc:1606
void print(::mlir::OpAsmPrinter &_odsPrinter)
Definition Ops.cpp.inc:1652
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
Definition Ops.cpp.inc:1623
::llvm::LogicalResult verifyInvariants()
Definition Ops.cpp.inc:1619
::mlir::Operation::operand_range getODSOperands(unsigned index)
Definition Ops.h.inc:1458
::mlir::TypedValue<::mlir::Type > getVal()
Definition Ops.h.inc:1464
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value val)
Definition Ops.cpp.inc:1588
ApplyMapOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:95
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize)
Definition Ops.cpp.inc:165
::std::optional<::mlir::OperationName > odsOpName
Definition Ops.h.inc:91
ConstReadOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:339
::std::optional<::mlir::OperationName > odsOpName
Definition Ops.h.inc:335
TemplateExprOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:540
::std::optional<::mlir::OperationName > odsOpName
Definition Ops.h.inc:536
TemplateOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:752
::std::optional<::mlir::OperationName > odsOpName
Definition Ops.h.inc:748
::std::optional<::mlir::OperationName > odsOpName
Definition Ops.h.inc:1034
TemplateParamOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:1038
void printDimAndSymbolList(mlir::OpAsmPrinter &printer, mlir::Operation *op, mlir::OperandRange mapOperands, mlir::IntegerAttr numDims)
Definition OpHelpers.h:125
bool isValidType(Type type)
mlir::ParseResult parseDimAndSymbolList(mlir::OpAsmParser &parser, mlir::SmallVector< mlir::OpAsmParser::UnresolvedOperand, N > &mapOperands, mlir::IntegerAttr &numDims)
Definition OpHelpers.h:117
bool isValidConstReadType(Type type)
void setMap(const ::mlir::AffineMapAttr &propValue)
Definition Ops.h.inc:66
void setNumDims(const ::mlir::IntegerAttr &propValue)
Definition Ops.h.inc:76