LLZK 3.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
30
31static ::llvm::LogicalResult __mlir_ods_local_type_constraint_Ops1(
32 ::mlir::Operation *op, ::mlir::Type type, ::llvm::StringRef valueKind,
33 unsigned valueIndex) {
34 if (!((::llvm::isa<::mlir::IndexType>(type)))) {
35 return op->emitOpError(valueKind) << " #" << valueIndex
36 << " must be variadic of index, but got " << type;
37 }
38 return ::mlir::success();
39}
40
41static ::llvm::LogicalResult __mlir_ods_local_type_constraint_Ops2(
42 ::mlir::Operation *op, ::mlir::Type type, ::llvm::StringRef valueKind,
43 unsigned valueIndex) {
44 if (!((::llvm::isa<::mlir::IndexType>(type)))) {
45 return op->emitOpError(valueKind) << " #" << valueIndex
46 << " must be index, but got " << type;
47 }
48 return ::mlir::success();
49}
50
51static ::llvm::LogicalResult __mlir_ods_local_type_constraint_Ops3(
52 ::mlir::Operation *op, ::mlir::Type type, ::llvm::StringRef valueKind,
53 unsigned valueIndex) {
54 if (!((::llzk::isValidConstReadType(type)))) {
55 return op->emitOpError(valueKind) << " #" << valueIndex
56 << " must be integral, felt, or typevar type, but got " << type;
57 }
58 return ::mlir::success();
59}
60
61static ::llvm::LogicalResult __mlir_ods_local_type_constraint_Ops4(
62 ::mlir::Operation *op, ::mlir::Type type, ::llvm::StringRef valueKind,
63 unsigned valueIndex) {
64 if (!((::llzk::isValidType(type)))) {
65 return op->emitOpError(valueKind) << " #" << valueIndex
66 << " must be a valid LLZK type, but got " << type;
67 }
68 return ::mlir::success();
69}
70
71static ::llvm::LogicalResult __mlir_ods_local_attr_constraint_Ops1(
72 ::mlir::Attribute attr, ::llvm::StringRef attrName, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
73 if (attr && !((::llvm::isa<::mlir::AffineMapAttr>(attr))))
74 return emitError() << "attribute '" << attrName
75 << "' failed to satisfy constraint: AffineMap attribute";
76 return ::mlir::success();
77}
78static ::llvm::LogicalResult __mlir_ods_local_attr_constraint_Ops1(
79 ::mlir::Operation *op, ::mlir::Attribute attr, ::llvm::StringRef attrName) {
80 return __mlir_ods_local_attr_constraint_Ops1(attr, attrName, [op]() {
81 return op->emitOpError();
82 });
83}
84
85static ::llvm::LogicalResult __mlir_ods_local_attr_constraint_Ops2(
86 ::mlir::Attribute attr, ::llvm::StringRef attrName, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
87 if (attr && !(((::llvm::isa<::mlir::IntegerAttr>(attr))) && ((::llvm::isa<::mlir::IndexType>(::llvm::cast<::mlir::IntegerAttr>(attr).getType())))))
88 return emitError() << "attribute '" << attrName
89 << "' failed to satisfy constraint: index attribute";
90 return ::mlir::success();
91}
92static ::llvm::LogicalResult __mlir_ods_local_attr_constraint_Ops2(
93 ::mlir::Operation *op, ::mlir::Attribute attr, ::llvm::StringRef attrName) {
94 return __mlir_ods_local_attr_constraint_Ops2(attr, attrName, [op]() {
95 return op->emitOpError();
96 });
97}
98
99static ::llvm::LogicalResult __mlir_ods_local_attr_constraint_Ops3(
100 ::mlir::Attribute attr, ::llvm::StringRef attrName, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
101 if (attr && !((::llvm::isa<::mlir::FlatSymbolRefAttr>(attr))))
102 return emitError() << "attribute '" << attrName
103 << "' failed to satisfy constraint: flat symbol reference attribute";
104 return ::mlir::success();
105}
106static ::llvm::LogicalResult __mlir_ods_local_attr_constraint_Ops3(
107 ::mlir::Operation *op, ::mlir::Attribute attr, ::llvm::StringRef attrName) {
108 return __mlir_ods_local_attr_constraint_Ops3(attr, attrName, [op]() {
109 return op->emitOpError();
110 });
111}
112
113static ::llvm::LogicalResult __mlir_ods_local_attr_constraint_Ops4(
114 ::mlir::Attribute attr, ::llvm::StringRef attrName, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
115 if (attr && !((::llvm::isa<::mlir::StringAttr>(attr))))
116 return emitError() << "attribute '" << attrName
117 << "' failed to satisfy constraint: string attribute";
118 return ::mlir::success();
119}
120static ::llvm::LogicalResult __mlir_ods_local_attr_constraint_Ops4(
121 ::mlir::Operation *op, ::mlir::Attribute attr, ::llvm::StringRef attrName) {
122 return __mlir_ods_local_attr_constraint_Ops4(attr, attrName, [op]() {
123 return op->emitOpError();
124 });
125}
126
127static ::llvm::LogicalResult __mlir_ods_local_attr_constraint_Ops5(
128 ::mlir::Attribute attr, ::llvm::StringRef attrName, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
129 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())))))
130 return emitError() << "attribute '" << attrName
131 << "' failed to satisfy constraint: type attribute of integral, felt, or typevar type";
132 return ::mlir::success();
133}
134static ::llvm::LogicalResult __mlir_ods_local_attr_constraint_Ops5(
135 ::mlir::Operation *op, ::mlir::Attribute attr, ::llvm::StringRef attrName) {
136 return __mlir_ods_local_attr_constraint_Ops5(attr, attrName, [op]() {
137 return op->emitOpError();
138 });
139}
140
141static ::llvm::LogicalResult __mlir_ods_local_region_constraint_Ops1(
142 ::mlir::Operation *op, ::mlir::Region &region, ::llvm::StringRef regionName,
143 unsigned regionIndex) {
144 if (!((::llvm::hasNItems(region, 1)))) {
145 return op->emitOpError("region #") << regionIndex
146 << (regionName.empty() ? " " : " ('" + regionName + "') ")
147 << "failed to verify constraint: region with 1 blocks";
148 }
149 return ::mlir::success();
150}
151namespace llzk::polymorphic {
152
153
154//===----------------------------------------------------------------------===//
155// ::llzk::polymorphic::ApplyMapOp definitions
156//===----------------------------------------------------------------------===//
157
158namespace detail {
159
160ApplyMapOpGenericAdaptorBase::ApplyMapOpGenericAdaptorBase(ApplyMapOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
161
162std::pair<unsigned, unsigned> ApplyMapOpGenericAdaptorBase::getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize) {
163 bool isVariadic[] = {true};
164 int prevVariadicCount = 0;
165 for (unsigned i = 0; i < index; ++i)
166 if (isVariadic[i]) ++prevVariadicCount;
167
168 // Calculate how many dynamic values a static variadic operand corresponds to.
169 // This assumes all static variadic operands have the same dynamic value count.
170 int variadicSize = (odsOperandsSize - 0) / 1;
171 // `index` passed in as the parameter is the static index which counts each
172 // operand (variadic or not) as size 1. So here for each previous static variadic
173 // operand, we need to offset by (variadicSize - 1) to get where the dynamic
174 // value pack for this static operand starts.
175 int start = index + (variadicSize - 1) * prevVariadicCount;
176 int size = isVariadic[index] ? variadicSize : 1;
177 return {start, size};
178}
179
181 auto attr = getMapAttr();
182 return attr.getValue();
183}
184
186 auto attr = getNumDimsAttr();
187 return attr.getValue();
188}
189
190
191} // namespace detail
193
194::llvm::LogicalResult ApplyMapOpAdaptor::verify(::mlir::Location loc) {
195 auto tblgen_map = getProperties().map; (void)tblgen_map;
196 if (!tblgen_map) return emitError(loc, "'poly.applymap' op requires attribute 'map'");
197 auto tblgen_numDims = getProperties().numDims; (void)tblgen_numDims;
198 if (!tblgen_numDims) return emitError(loc, "'poly.applymap' op requires attribute 'numDims'");
199
200 if (tblgen_map && !((::llvm::isa<::mlir::AffineMapAttr>(tblgen_map))))
201 return emitError(loc, "'poly.applymap' op attribute 'map' failed to satisfy constraint: AffineMap attribute");
202
203 if (tblgen_numDims && !(((::llvm::isa<::mlir::IntegerAttr>(tblgen_numDims))) && ((::llvm::isa<::mlir::IndexType>(::llvm::cast<::mlir::IntegerAttr>(tblgen_numDims).getType())))))
204 return emitError(loc, "'poly.applymap' op attribute 'numDims' failed to satisfy constraint: index attribute");
205 return ::mlir::success();
206}
207
208std::pair<unsigned, unsigned> ApplyMapOp::getODSOperandIndexAndLength(unsigned index) {
209 bool isVariadic[] = {true};
210 int prevVariadicCount = 0;
211 for (unsigned i = 0; i < index; ++i)
212 if (isVariadic[i]) ++prevVariadicCount;
213
214 // Calculate how many dynamic values a static variadic operand corresponds to.
215 // This assumes all static variadic operands have the same dynamic value count.
216 int variadicSize = (getOperation()->getNumOperands() - 0) / 1;
217 // `index` passed in as the parameter is the static index which counts each
218 // operand (variadic or not) as size 1. So here for each previous static variadic
219 // operand, we need to offset by (variadicSize - 1) to get where the dynamic
220 // value pack for this static operand starts.
221 int start = index + (variadicSize - 1) * prevVariadicCount;
222 int size = isVariadic[index] ? variadicSize : 1;
223 return {start, size};
224}
225
226::mlir::MutableOperandRange ApplyMapOp::getMapOperandsMutable() {
227 auto range = getODSOperandIndexAndLength(0);
228 auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
229 return mutableRange;
230}
231
232::llvm::LogicalResult ApplyMapOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
233 ::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
234 if (!dict) {
235 emitError() << "expected DictionaryAttr to set properties";
236 return ::mlir::failure();
237 }
238
239 {
240 auto &propStorage = prop.map;
241 auto attr = dict.get("map");
242 if (attr) {
243 auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
244 if (convertedAttr) {
245 propStorage = convertedAttr;
246 } else {
247 emitError() << "Invalid attribute `map` in property conversion: " << attr;
248 return ::mlir::failure();
249 }
250 }
251 }
252
253 {
254 auto &propStorage = prop.numDims;
255 auto attr = dict.get("numDims");
256 if (attr) {
257 auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
258 if (convertedAttr) {
259 propStorage = convertedAttr;
260 } else {
261 emitError() << "Invalid attribute `numDims` in property conversion: " << attr;
262 return ::mlir::failure();
263 }
264 }
265 }
266 return ::mlir::success();
267}
268
269::mlir::Attribute ApplyMapOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
270 ::mlir::SmallVector<::mlir::NamedAttribute> attrs;
271 ::mlir::Builder odsBuilder{ctx};
272
273 {
274 const auto &propStorage = prop.map;
275 if (propStorage)
276 attrs.push_back(odsBuilder.getNamedAttr("map",
277 propStorage));
278 }
279
280 {
281 const auto &propStorage = prop.numDims;
282 if (propStorage)
283 attrs.push_back(odsBuilder.getNamedAttr("numDims",
284 propStorage));
285 }
286
287 if (!attrs.empty())
288 return odsBuilder.getDictionaryAttr(attrs);
289 return {};
290}
291
292llvm::hash_code ApplyMapOp::computePropertiesHash(const Properties &prop) {
293 using llvm::hash_value;
294 return llvm::hash_combine(
295 llvm::hash_value(prop.map.getAsOpaquePointer()),
296 llvm::hash_value(prop.numDims.getAsOpaquePointer()));
297}
298
299std::optional<mlir::Attribute> ApplyMapOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
300 if (name == "map")
301 return prop.map;
302
303 if (name == "numDims")
304 return prop.numDims;
305 return std::nullopt;
306}
307
308void ApplyMapOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
309 if (name == "map") {
310 prop.map = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.map)>>(value);
311 return;
312 }
313
314 if (name == "numDims") {
315 prop.numDims = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.numDims)>>(value);
316 return;
317 }
318}
319
320void ApplyMapOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
321 if (prop.map) attrs.append("map", prop.map);
322
323 if (prop.numDims) attrs.append("numDims", prop.numDims);
324}
325
326::llvm::LogicalResult ApplyMapOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
327 {
328 ::mlir::Attribute attr = attrs.get(getMapAttrName(opName));
329 if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_Ops1(attr, "map", emitError)))
330 return ::mlir::failure();
331 }
332
333 {
334 ::mlir::Attribute attr = attrs.get(getNumDimsAttrName(opName));
335 if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_Ops2(attr, "numDims", emitError)))
336 return ::mlir::failure();
337 }
338 return ::mlir::success();
339}
340
341::llvm::LogicalResult ApplyMapOp::readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state) {
342 auto &prop = state.getOrAddProperties<Properties>(); (void)prop;
343 if (::mlir::failed(reader.readAttribute(prop.map)))
344 return ::mlir::failure();
345
346 if (::mlir::failed(reader.readAttribute(prop.numDims)))
347 return ::mlir::failure();
348 return ::mlir::success();
349}
350
351void ApplyMapOp::writeProperties(::mlir::DialectBytecodeWriter &writer) {
352 auto &prop = getProperties(); (void)prop;
353 writer.writeAttribute(prop.map);
354 writer.writeAttribute(prop.numDims);
355}
356
357::mlir::AffineMap ApplyMapOp::getMap() {
358 auto attr = getMapAttr();
359 return attr.getValue();
360}
361
362::llvm::APInt ApplyMapOp::getNumDims() {
363 auto attr = getNumDimsAttr();
364 return attr.getValue();
365}
366
367void ApplyMapOp::setMap(::mlir::AffineMap attrValue) {
368 getProperties().map = ::mlir::AffineMapAttr::get(attrValue);
369}
370
371void ApplyMapOp::setNumDims(::llvm::APInt attrValue) {
372 getProperties().numDims = ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIndexType(), attrValue);
373}
374
375void ApplyMapOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::AffineMapAttr map, ::mlir::ValueRange mapOperands) {
376 odsState.addOperands(mapOperands);
377 Properties &props = odsState.getOrAddProperties<Properties>();
378 props.setMap(map);
379 props.setNumDims(odsBuilder.getIntegerAttr(odsBuilder.getIndexType(),
380 map.getAffineMap().getNumDims()));
381 odsState.addTypes(odsBuilder.getIndexType());
382
383}
384
385ApplyMapOp ApplyMapOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::AffineMapAttr map, ::mlir::ValueRange mapOperands) {
386 ::mlir::OperationState __state__(location, getOperationName());
387 build(builder, __state__, std::forward<decltype(map)>(map), std::forward<decltype(mapOperands)>(mapOperands));
388 auto __res__ = ::llvm::dyn_cast<ApplyMapOp>(builder.create(__state__));
389 assert(__res__ && "builder didn't return the right type");
390 return __res__;
391}
392
393ApplyMapOp ApplyMapOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::AffineMapAttr map, ::mlir::ValueRange mapOperands) {
394 return create(builder, builder.getLoc(), std::forward<decltype(map)>(map), std::forward<decltype(mapOperands)>(mapOperands));
395}
396
397void ApplyMapOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::AffineMap map, ::mlir::ValueRange mapOperands) {
398 build(odsBuilder, odsState, ::mlir::AffineMapAttr::get(map), mapOperands);
399
400}
401
402ApplyMapOp ApplyMapOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::AffineMap map, ::mlir::ValueRange mapOperands) {
403 ::mlir::OperationState __state__(location, getOperationName());
404 build(builder, __state__, std::forward<decltype(map)>(map), std::forward<decltype(mapOperands)>(mapOperands));
405 auto __res__ = ::llvm::dyn_cast<ApplyMapOp>(builder.create(__state__));
406 assert(__res__ && "builder didn't return the right type");
407 return __res__;
408}
409
410ApplyMapOp ApplyMapOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::AffineMap map, ::mlir::ValueRange mapOperands) {
411 return create(builder, builder.getLoc(), std::forward<decltype(map)>(map), std::forward<decltype(mapOperands)>(mapOperands));
412}
413
414void ApplyMapOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::AffineExpr expr, ::mlir::ValueRange mapOperands) {
415 auto map = ::mlir::AffineMap::inferFromExprList({expr}, odsBuilder.getContext()).front();
416 build(odsBuilder, odsState, map, mapOperands);
417
418}
419
420ApplyMapOp ApplyMapOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::AffineExpr expr, ::mlir::ValueRange mapOperands) {
421 ::mlir::OperationState __state__(location, getOperationName());
422 build(builder, __state__, std::forward<decltype(expr)>(expr), std::forward<decltype(mapOperands)>(mapOperands));
423 auto __res__ = ::llvm::dyn_cast<ApplyMapOp>(builder.create(__state__));
424 assert(__res__ && "builder didn't return the right type");
425 return __res__;
426}
427
428ApplyMapOp ApplyMapOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::AffineExpr expr, ::mlir::ValueRange mapOperands) {
429 return create(builder, builder.getLoc(), std::forward<decltype(expr)>(expr), std::forward<decltype(mapOperands)>(mapOperands));
430}
431
432::llvm::LogicalResult ApplyMapOp::verifyInvariantsImpl() {
433 auto tblgen_map = getProperties().map; (void)tblgen_map;
434 if (!tblgen_map) return emitOpError("requires attribute 'map'");
435 auto tblgen_numDims = getProperties().numDims; (void)tblgen_numDims;
436 if (!tblgen_numDims) return emitOpError("requires attribute 'numDims'");
437
438 if (::mlir::failed(__mlir_ods_local_attr_constraint_Ops1(*this, tblgen_map, "map")))
439 return ::mlir::failure();
440
441 if (::mlir::failed(__mlir_ods_local_attr_constraint_Ops2(*this, tblgen_numDims, "numDims")))
442 return ::mlir::failure();
443 {
444 unsigned index = 0; (void)index;
445 auto valueGroup0 = getODSOperands(0);
446
447 for (auto v : valueGroup0) {
448 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops1(*this, v.getType(), "operand", index++)))
449 return ::mlir::failure();
450 }
451 }
452 {
453 unsigned index = 0; (void)index;
454 auto valueGroup0 = getODSResults(0);
455
456 for (auto v : valueGroup0) {
457 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops2(*this, v.getType(), "result", index++)))
458 return ::mlir::failure();
459 }
460 }
461 return ::mlir::success();
462}
463
464::llvm::LogicalResult ApplyMapOp::verifyInvariants() {
465 if(::mlir::succeeded(verifyInvariantsImpl()) && ::mlir::succeeded(verify()))
466 return ::mlir::success();
467 return ::mlir::failure();
468}
469
470::llvm::LogicalResult ApplyMapOp::inferReturnTypes(::mlir::MLIRContext *context, ::std::optional<::mlir::Location> location, ::mlir::ValueRange operands, ::mlir::DictionaryAttr attributes, ::mlir::PropertyRef properties, ::mlir::RegionRange regions, ::llvm::SmallVectorImpl<::mlir::Type>&inferredReturnTypes) {
471 inferredReturnTypes.resize(1);
472 ::mlir::Builder odsBuilder(context);
473 ::mlir::Type odsInferredType0 = odsBuilder.getIndexType();
474 inferredReturnTypes[0] = odsInferredType0;
475 return ::mlir::success();
476}
477
478::mlir::ParseResult ApplyMapOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
479 ::llvm::SmallVector<::mlir::OpAsmParser::UnresolvedOperand, 4> mapOperandsOperands;
480 ::llvm::SMLoc mapOperandsOperandsLoc;
481 (void)mapOperandsOperandsLoc;
482 ::mlir::IntegerAttr numDimsAttr;
483 ::mlir::AffineMapAttr mapAttr;
484 {
485 mapOperandsOperandsLoc = parser.getCurrentLocation();
486 auto odsResult = parseDimAndSymbolList(parser, mapOperandsOperands, numDimsAttr);
487 if (odsResult) return ::mlir::failure();
488 result.getOrAddProperties<ApplyMapOp::Properties>().numDims = numDimsAttr;
489 }
490
491 if (parser.parseCustomAttributeWithFallback(mapAttr, parser.getBuilder().getIndexType())) {
492 return ::mlir::failure();
493 }
494 if (mapAttr) result.getOrAddProperties<ApplyMapOp::Properties>().map = mapAttr;
495 {
496 auto loc = parser.getCurrentLocation();(void)loc;
497 if (parser.parseOptionalAttrDict(result.attributes))
498 return ::mlir::failure();
499 if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() {
500 return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op ";
501 })))
502 return ::mlir::failure();
503 }
504 ::mlir::Type odsBuildableType0 = parser.getBuilder().getIndexType();
505 result.addTypes(odsBuildableType0);
506 if (parser.resolveOperands(mapOperandsOperands, odsBuildableType0, mapOperandsOperandsLoc, result.operands))
507 return ::mlir::failure();
508 return ::mlir::success();
509}
510
511void ApplyMapOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
512 _odsPrinter << ' ';
513 printDimAndSymbolList(_odsPrinter, *this, getMapOperands(), getNumDimsAttr());
514 _odsPrinter << ' ';
515 _odsPrinter.printAttributeWithoutType(getMapAttr());
516 ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
517 elidedAttrs.push_back("numDims");
518 elidedAttrs.push_back("map");
519 _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
520}
521
522void ApplyMapOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
523}
524
525
526} // namespace llzk::polymorphic
527MLIR_DEFINE_EXPLICIT_TYPE_ID(::llzk::polymorphic::ApplyMapOp)
529
530namespace llzk::polymorphic {
531
532
533//===----------------------------------------------------------------------===//
534// ::llzk::polymorphic::ConstReadOp definitions
535//===----------------------------------------------------------------------===//
536
537namespace detail {
538
539ConstReadOpGenericAdaptorBase::ConstReadOpGenericAdaptorBase(ConstReadOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
540
542 auto attr = getConstNameAttr();
543 return attr.getValue();
544}
545
546
547} // namespace detail
549
550::llvm::LogicalResult ConstReadOpAdaptor::verify(::mlir::Location loc) {
551 auto tblgen_const_name = getProperties().const_name; (void)tblgen_const_name;
552 if (!tblgen_const_name) return emitError(loc, "'poly.read_const' op requires attribute 'const_name'");
553
554 if (tblgen_const_name && !((::llvm::isa<::mlir::FlatSymbolRefAttr>(tblgen_const_name))))
555 return emitError(loc, "'poly.read_const' op attribute 'const_name' failed to satisfy constraint: flat symbol reference attribute");
556 return ::mlir::success();
557}
558
559::llvm::LogicalResult ConstReadOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
560 ::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
561 if (!dict) {
562 emitError() << "expected DictionaryAttr to set properties";
563 return ::mlir::failure();
564 }
565
566 {
567 auto &propStorage = prop.const_name;
568 auto attr = dict.get("const_name");
569 if (attr) {
570 auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
571 if (convertedAttr) {
572 propStorage = convertedAttr;
573 } else {
574 emitError() << "Invalid attribute `const_name` in property conversion: " << attr;
575 return ::mlir::failure();
576 }
577 }
578 }
579 return ::mlir::success();
580}
581
582::mlir::Attribute ConstReadOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
583 ::mlir::SmallVector<::mlir::NamedAttribute> attrs;
584 ::mlir::Builder odsBuilder{ctx};
585
586 {
587 const auto &propStorage = prop.const_name;
588 if (propStorage)
589 attrs.push_back(odsBuilder.getNamedAttr("const_name",
590 propStorage));
591 }
592
593 if (!attrs.empty())
594 return odsBuilder.getDictionaryAttr(attrs);
595 return {};
596}
597
598llvm::hash_code ConstReadOp::computePropertiesHash(const Properties &prop) {
599 using llvm::hash_value;
600 return llvm::hash_combine(
601 llvm::hash_value(prop.const_name.getAsOpaquePointer()));
602}
603
604std::optional<mlir::Attribute> ConstReadOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
605 if (name == "const_name")
606 return prop.const_name;
607 return std::nullopt;
608}
609
610void ConstReadOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
611 if (name == "const_name") {
612 prop.const_name = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.const_name)>>(value);
613 return;
614 }
615}
616
617void ConstReadOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
618 if (prop.const_name) attrs.append("const_name", prop.const_name);
619}
620
621::llvm::LogicalResult ConstReadOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
622 {
623 ::mlir::Attribute attr = attrs.get(getConstNameAttrName(opName));
624 if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_Ops3(attr, "const_name", emitError)))
625 return ::mlir::failure();
626 }
627 return ::mlir::success();
628}
629
630::llvm::LogicalResult ConstReadOp::readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state) {
631 auto &prop = state.getOrAddProperties<Properties>(); (void)prop;
632 if (::mlir::failed(reader.readAttribute(prop.const_name)))
633 return ::mlir::failure();
634 return ::mlir::success();
635}
636
637void ConstReadOp::writeProperties(::mlir::DialectBytecodeWriter &writer) {
638 auto &prop = getProperties(); (void)prop;
639 writer.writeAttribute(prop.const_name);
640}
641
642::llvm::StringRef ConstReadOp::getConstName() {
643 auto attr = getConstNameAttr();
644 return attr.getValue();
645}
646
647void ConstReadOp::setConstName(::llvm::StringRef attrValue) {
648 getProperties().const_name = ::mlir::SymbolRefAttr::get(::mlir::Builder((*this)->getContext()).getContext(), attrValue);
649}
650
651void ConstReadOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type val, ::mlir::FlatSymbolRefAttr const_name) {
652 odsState.getOrAddProperties<Properties>().const_name = const_name;
653 odsState.addTypes(val);
654}
655
656ConstReadOp ConstReadOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type val, ::mlir::FlatSymbolRefAttr const_name) {
657 ::mlir::OperationState __state__(location, getOperationName());
658 build(builder, __state__, std::forward<decltype(val)>(val), std::forward<decltype(const_name)>(const_name));
659 auto __res__ = ::llvm::dyn_cast<ConstReadOp>(builder.create(__state__));
660 assert(__res__ && "builder didn't return the right type");
661 return __res__;
662}
663
664ConstReadOp ConstReadOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type val, ::mlir::FlatSymbolRefAttr const_name) {
665 return create(builder, builder.getLoc(), std::forward<decltype(val)>(val), std::forward<decltype(const_name)>(const_name));
666}
667
668void ConstReadOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::FlatSymbolRefAttr const_name) {
669 odsState.getOrAddProperties<Properties>().const_name = const_name;
670 assert(resultTypes.size() == 1u && "mismatched number of results");
671 odsState.addTypes(resultTypes);
672}
673
674ConstReadOp ConstReadOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::FlatSymbolRefAttr const_name) {
675 ::mlir::OperationState __state__(location, getOperationName());
676 build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(const_name)>(const_name));
677 auto __res__ = ::llvm::dyn_cast<ConstReadOp>(builder.create(__state__));
678 assert(__res__ && "builder didn't return the right type");
679 return __res__;
680}
681
682ConstReadOp ConstReadOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::FlatSymbolRefAttr const_name) {
683 return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(const_name)>(const_name));
684}
685
686void ConstReadOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type val, ::llvm::StringRef const_name) {
687 odsState.getOrAddProperties<Properties>().const_name = ::mlir::SymbolRefAttr::get(odsBuilder.getContext(), const_name);
688 odsState.addTypes(val);
689}
690
691ConstReadOp ConstReadOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type val, ::llvm::StringRef const_name) {
692 ::mlir::OperationState __state__(location, getOperationName());
693 build(builder, __state__, std::forward<decltype(val)>(val), std::forward<decltype(const_name)>(const_name));
694 auto __res__ = ::llvm::dyn_cast<ConstReadOp>(builder.create(__state__));
695 assert(__res__ && "builder didn't return the right type");
696 return __res__;
697}
698
699ConstReadOp ConstReadOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type val, ::llvm::StringRef const_name) {
700 return create(builder, builder.getLoc(), std::forward<decltype(val)>(val), std::forward<decltype(const_name)>(const_name));
701}
702
703void ConstReadOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::llvm::StringRef const_name) {
704 odsState.getOrAddProperties<Properties>().const_name = ::mlir::SymbolRefAttr::get(odsBuilder.getContext(), const_name);
705 assert(resultTypes.size() == 1u && "mismatched number of results");
706 odsState.addTypes(resultTypes);
707}
708
709ConstReadOp ConstReadOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::llvm::StringRef const_name) {
710 ::mlir::OperationState __state__(location, getOperationName());
711 build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(const_name)>(const_name));
712 auto __res__ = ::llvm::dyn_cast<ConstReadOp>(builder.create(__state__));
713 assert(__res__ && "builder didn't return the right type");
714 return __res__;
715}
716
717ConstReadOp ConstReadOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::llvm::StringRef const_name) {
718 return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(const_name)>(const_name));
719}
720
721void ConstReadOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
722 assert(operands.size() == 0u && "mismatched number of parameters");
723 odsState.addOperands(operands);
724 odsState.addAttributes(attributes);
725 assert(resultTypes.size() == 1u && "mismatched number of return types");
726 odsState.addTypes(resultTypes);
727
728 if (!attributes.empty()) {
729 (void)odsState.getOrAddProperties<ConstReadOp::Properties>();
730 ::mlir::PropertyRef properties = odsState.getRawProperties();
731 std::optional<::mlir::RegisteredOperationName> info =
732 odsState.name.getRegisteredInfo();
733 if (failed(info->setOpPropertiesFromAttribute(odsState.name, properties,
734 odsState.attributes.getDictionary(odsState.getContext()), nullptr)))
735 ::llvm::report_fatal_error("Property conversion failed.");
736 }
737}
738
739ConstReadOp ConstReadOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
740 ::mlir::OperationState __state__(location, getOperationName());
741 build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
742 auto __res__ = ::llvm::dyn_cast<ConstReadOp>(builder.create(__state__));
743 assert(__res__ && "builder didn't return the right type");
744 return __res__;
745}
746
747ConstReadOp ConstReadOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
748 return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
749}
750
751void ConstReadOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
752 assert(operands.size() == 0u && "mismatched number of parameters");
753 odsState.addOperands(operands);
754 odsState.useProperties(const_cast<Properties&>(properties));
755 odsState.addAttributes(discardableAttributes);
756 assert(resultTypes.size() == 1u && "mismatched number of return types");
757 odsState.addTypes(resultTypes);
758}
759
760ConstReadOp ConstReadOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
761 ::mlir::OperationState __state__(location, getOperationName());
762 build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
763 auto __res__ = ::llvm::dyn_cast<ConstReadOp>(builder.create(__state__));
764 assert(__res__ && "builder didn't return the right type");
765 return __res__;
766}
767
768ConstReadOp ConstReadOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
769 return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
770}
771
772::llvm::LogicalResult ConstReadOp::verifyInvariantsImpl() {
773 auto tblgen_const_name = getProperties().const_name; (void)tblgen_const_name;
774 if (!tblgen_const_name) return emitOpError("requires attribute 'const_name'");
775
776 if (::mlir::failed(__mlir_ods_local_attr_constraint_Ops3(*this, tblgen_const_name, "const_name")))
777 return ::mlir::failure();
778 {
779 unsigned index = 0; (void)index;
780 auto valueGroup0 = getODSResults(0);
781
782 for (auto v : valueGroup0) {
783 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops3(*this, v.getType(), "result", index++)))
784 return ::mlir::failure();
785 }
786 }
787 return ::mlir::success();
788}
789
790::llvm::LogicalResult ConstReadOp::verifyInvariants() {
791 return verifyInvariantsImpl();
792}
793
794::mlir::ParseResult ConstReadOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
795 ::mlir::FlatSymbolRefAttr const_nameAttr;
796 ::mlir::Type valRawType{};
797 ::llvm::ArrayRef<::mlir::Type> valTypes(&valRawType, 1);
798
799 if (parser.parseCustomAttributeWithFallback(const_nameAttr, parser.getBuilder().getType<::mlir::NoneType>())) {
800 return ::mlir::failure();
801 }
802 if (const_nameAttr) result.getOrAddProperties<ConstReadOp::Properties>().const_name = const_nameAttr;
803 if (parser.parseColon())
804 return ::mlir::failure();
805
806 {
807 ::mlir::Type type;
808 if (parser.parseCustomTypeWithFallback(type))
809 return ::mlir::failure();
810 valRawType = type;
811 }
812 {
813 auto loc = parser.getCurrentLocation();(void)loc;
814 if (parser.parseOptionalAttrDict(result.attributes))
815 return ::mlir::failure();
816 if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() {
817 return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op ";
818 })))
819 return ::mlir::failure();
820 }
821 result.addTypes(valTypes);
822 return ::mlir::success();
823}
824
825void ConstReadOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
826 _odsPrinter << ' ';
827 _odsPrinter.printAttributeWithoutType(getConstNameAttr());
828 _odsPrinter << ' ' << ":";
829 _odsPrinter << ' ';
830 {
831 auto type = getVal().getType();
832 if (auto validType = ::llvm::dyn_cast<::mlir::Type>(type))
833 _odsPrinter.printStrippedAttrOrType(validType);
834 else
835 _odsPrinter << type;
836 }
837 ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
838 elidedAttrs.push_back("const_name");
839 _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
840}
841
842void ConstReadOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
843}
844
845
846} // namespace llzk::polymorphic
847MLIR_DEFINE_EXPLICIT_TYPE_ID(::llzk::polymorphic::ConstReadOp)
849
850namespace llzk::polymorphic {
851
852
853//===----------------------------------------------------------------------===//
854// ::llzk::polymorphic::TemplateExprOp definitions
855//===----------------------------------------------------------------------===//
856
857namespace detail {
858
860
862 auto attr = getSymNameAttr();
863 return attr.getValue();
864}
865
866
867} // namespace detail
869
870::llvm::LogicalResult TemplateExprOpAdaptor::verify(::mlir::Location loc) {
871 auto tblgen_sym_name = getProperties().sym_name; (void)tblgen_sym_name;
872 if (!tblgen_sym_name) return emitError(loc, "'poly.expr' op requires attribute 'sym_name'");
873
874 if (tblgen_sym_name && !((::llvm::isa<::mlir::StringAttr>(tblgen_sym_name))))
875 return emitError(loc, "'poly.expr' op attribute 'sym_name' failed to satisfy constraint: string attribute");
876 return ::mlir::success();
877}
878
879::llvm::LogicalResult TemplateExprOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
880 ::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
881 if (!dict) {
882 emitError() << "expected DictionaryAttr to set properties";
883 return ::mlir::failure();
884 }
885
886 {
887 auto &propStorage = prop.sym_name;
888 auto attr = dict.get("sym_name");
889 if (attr) {
890 auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
891 if (convertedAttr) {
892 propStorage = convertedAttr;
893 } else {
894 emitError() << "Invalid attribute `sym_name` in property conversion: " << attr;
895 return ::mlir::failure();
896 }
897 }
898 }
899 return ::mlir::success();
900}
901
902::mlir::Attribute TemplateExprOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
903 ::mlir::SmallVector<::mlir::NamedAttribute> attrs;
904 ::mlir::Builder odsBuilder{ctx};
905
906 {
907 const auto &propStorage = prop.sym_name;
908 if (propStorage)
909 attrs.push_back(odsBuilder.getNamedAttr("sym_name",
910 propStorage));
911 }
912
913 if (!attrs.empty())
914 return odsBuilder.getDictionaryAttr(attrs);
915 return {};
916}
917
919 using llvm::hash_value;
920 return llvm::hash_combine(
921 llvm::hash_value(prop.sym_name.getAsOpaquePointer()));
922}
923
924std::optional<mlir::Attribute> TemplateExprOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
925 if (name == "sym_name")
926 return prop.sym_name;
927 return std::nullopt;
928}
929
930void TemplateExprOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
931 if (name == "sym_name") {
932 prop.sym_name = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.sym_name)>>(value);
933 return;
934 }
935}
936
937void TemplateExprOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
938 if (prop.sym_name) attrs.append("sym_name", prop.sym_name);
939}
940
941::llvm::LogicalResult TemplateExprOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
942 {
943 ::mlir::Attribute attr = attrs.get(getSymNameAttrName(opName));
944 if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_Ops4(attr, "sym_name", emitError)))
945 return ::mlir::failure();
946 }
947 return ::mlir::success();
948}
949
950::llvm::LogicalResult TemplateExprOp::readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state) {
951 auto &prop = state.getOrAddProperties<Properties>(); (void)prop;
952 if (::mlir::failed(reader.readAttribute(prop.sym_name)))
953 return ::mlir::failure();
954 return ::mlir::success();
955}
956
957void TemplateExprOp::writeProperties(::mlir::DialectBytecodeWriter &writer) {
958 auto &prop = getProperties(); (void)prop;
959 writer.writeAttribute(prop.sym_name);
960}
961
962::llvm::StringRef TemplateExprOp::getSymName() {
963 auto attr = getSymNameAttr();
964 return attr.getValue();
965}
966
967void TemplateExprOp::setSymName(::llvm::StringRef attrValue) {
968 getProperties().sym_name = ::mlir::Builder((*this)->getContext()).getStringAttr(attrValue);
969}
970
971void TemplateExprOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::StringAttr sym_name) {
972 odsState.getOrAddProperties<Properties>().sym_name = sym_name;
973 (void)odsState.addRegion();
974}
975
976TemplateExprOp TemplateExprOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::StringAttr sym_name) {
977 ::mlir::OperationState __state__(location, getOperationName());
978 build(builder, __state__, std::forward<decltype(sym_name)>(sym_name));
979 auto __res__ = ::llvm::dyn_cast<TemplateExprOp>(builder.create(__state__));
980 assert(__res__ && "builder didn't return the right type");
981 return __res__;
982}
983
984TemplateExprOp TemplateExprOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::StringAttr sym_name) {
985 return create(builder, builder.getLoc(), std::forward<decltype(sym_name)>(sym_name));
986}
987
988void TemplateExprOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::StringAttr sym_name) {
989 odsState.getOrAddProperties<Properties>().sym_name = sym_name;
990 (void)odsState.addRegion();
991 assert(resultTypes.size() == 0u && "mismatched number of results");
992 odsState.addTypes(resultTypes);
993}
994
995TemplateExprOp TemplateExprOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::StringAttr sym_name) {
996 ::mlir::OperationState __state__(location, getOperationName());
997 build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(sym_name)>(sym_name));
998 auto __res__ = ::llvm::dyn_cast<TemplateExprOp>(builder.create(__state__));
999 assert(__res__ && "builder didn't return the right type");
1000 return __res__;
1001}
1002
1003TemplateExprOp TemplateExprOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::StringAttr sym_name) {
1004 return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(sym_name)>(sym_name));
1005}
1006
1007void TemplateExprOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::llvm::StringRef sym_name) {
1008 odsState.getOrAddProperties<Properties>().sym_name = odsBuilder.getStringAttr(sym_name);
1009 (void)odsState.addRegion();
1010}
1011
1012TemplateExprOp TemplateExprOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::llvm::StringRef sym_name) {
1013 ::mlir::OperationState __state__(location, getOperationName());
1014 build(builder, __state__, std::forward<decltype(sym_name)>(sym_name));
1015 auto __res__ = ::llvm::dyn_cast<TemplateExprOp>(builder.create(__state__));
1016 assert(__res__ && "builder didn't return the right type");
1017 return __res__;
1018}
1019
1020TemplateExprOp TemplateExprOp::create(::mlir::ImplicitLocOpBuilder &builder, ::llvm::StringRef sym_name) {
1021 return create(builder, builder.getLoc(), std::forward<decltype(sym_name)>(sym_name));
1022}
1023
1024void TemplateExprOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::llvm::StringRef sym_name) {
1025 odsState.getOrAddProperties<Properties>().sym_name = odsBuilder.getStringAttr(sym_name);
1026 (void)odsState.addRegion();
1027 assert(resultTypes.size() == 0u && "mismatched number of results");
1028 odsState.addTypes(resultTypes);
1029}
1030
1031TemplateExprOp TemplateExprOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::llvm::StringRef sym_name) {
1032 ::mlir::OperationState __state__(location, getOperationName());
1033 build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(sym_name)>(sym_name));
1034 auto __res__ = ::llvm::dyn_cast<TemplateExprOp>(builder.create(__state__));
1035 assert(__res__ && "builder didn't return the right type");
1036 return __res__;
1037}
1038
1039TemplateExprOp TemplateExprOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::llvm::StringRef sym_name) {
1040 return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(sym_name)>(sym_name));
1041}
1042
1043void TemplateExprOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
1044 assert(operands.size() == 0u && "mismatched number of parameters");
1045 odsState.addOperands(operands);
1046 odsState.addAttributes(attributes);
1047 for (unsigned i = 0; i != 1; ++i)
1048 (void)odsState.addRegion();
1049 assert(resultTypes.size() == 0u && "mismatched number of return types");
1050 odsState.addTypes(resultTypes);
1051
1052 if (!attributes.empty()) {
1053 (void)odsState.getOrAddProperties<TemplateExprOp::Properties>();
1054 ::mlir::PropertyRef properties = odsState.getRawProperties();
1055 std::optional<::mlir::RegisteredOperationName> info =
1056 odsState.name.getRegisteredInfo();
1057 if (failed(info->setOpPropertiesFromAttribute(odsState.name, properties,
1058 odsState.attributes.getDictionary(odsState.getContext()), nullptr)))
1059 ::llvm::report_fatal_error("Property conversion failed.");
1060 }
1061}
1062
1063TemplateExprOp TemplateExprOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
1064 ::mlir::OperationState __state__(location, getOperationName());
1065 build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
1066 auto __res__ = ::llvm::dyn_cast<TemplateExprOp>(builder.create(__state__));
1067 assert(__res__ && "builder didn't return the right type");
1068 return __res__;
1069}
1070
1071TemplateExprOp TemplateExprOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
1072 return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
1073}
1074
1075void TemplateExprOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
1076 assert(operands.size() == 0u && "mismatched number of parameters");
1077 odsState.addOperands(operands);
1078 odsState.useProperties(const_cast<Properties&>(properties));
1079 odsState.addAttributes(discardableAttributes);
1080 for (unsigned i = 0; i != 1; ++i)
1081 (void)odsState.addRegion();
1082 assert(resultTypes.size() == 0u && "mismatched number of return types");
1083 odsState.addTypes(resultTypes);
1084}
1085
1086TemplateExprOp TemplateExprOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
1087 ::mlir::OperationState __state__(location, getOperationName());
1088 build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
1089 auto __res__ = ::llvm::dyn_cast<TemplateExprOp>(builder.create(__state__));
1090 assert(__res__ && "builder didn't return the right type");
1091 return __res__;
1092}
1093
1094TemplateExprOp TemplateExprOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
1095 return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
1096}
1097
1099 auto tblgen_sym_name = getProperties().sym_name; (void)tblgen_sym_name;
1100 if (!tblgen_sym_name) return emitOpError("requires attribute 'sym_name'");
1101
1102 if (::mlir::failed(__mlir_ods_local_attr_constraint_Ops4(*this, tblgen_sym_name, "sym_name")))
1103 return ::mlir::failure();
1104 {
1105 unsigned index = 0; (void)index;
1106
1107 for (auto &region : ::llvm::MutableArrayRef((*this)->getRegion(0)))
1108 if (::mlir::failed(__mlir_ods_local_region_constraint_Ops1(*this, region, "initializerRegion", index++)))
1109 return ::mlir::failure();
1110 }
1111 return ::mlir::success();
1112}
1113
1114::llvm::LogicalResult TemplateExprOp::verifyInvariants() {
1115 return verifyInvariantsImpl();
1116}
1117
1118::mlir::ParseResult TemplateExprOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
1119 ::mlir::StringAttr sym_nameAttr;
1120 std::unique_ptr<::mlir::Region> initializerRegionRegion = std::make_unique<::mlir::Region>();
1121
1122 if (parser.parseSymbolName(sym_nameAttr))
1123 return ::mlir::failure();
1124 if (sym_nameAttr) result.getOrAddProperties<TemplateExprOp::Properties>().sym_name = sym_nameAttr;
1125
1126 if (parser.parseRegion(*initializerRegionRegion))
1127 return ::mlir::failure();
1128
1129 if (initializerRegionRegion->empty()) initializerRegionRegion->emplaceBlock();
1130 {
1131 auto loc = parser.getCurrentLocation();(void)loc;
1132 if (parser.parseOptionalAttrDict(result.attributes))
1133 return ::mlir::failure();
1134 if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() {
1135 return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op ";
1136 })))
1137 return ::mlir::failure();
1138 }
1139 result.addRegion(std::move(initializerRegionRegion));
1140 return ::mlir::success();
1141}
1142
1143void TemplateExprOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
1144 _odsPrinter << ' ';
1145 _odsPrinter.printSymbolName(getSymNameAttr().getValue());
1146 _odsPrinter << ' ';
1147 _odsPrinter.printRegion(getInitializerRegion());
1148 ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
1149 elidedAttrs.push_back("sym_name");
1150 _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
1151}
1152
1153
1154} // namespace llzk::polymorphic
1155MLIR_DEFINE_EXPLICIT_TYPE_ID(::llzk::polymorphic::TemplateExprOp)
1157
1158namespace llzk::polymorphic {
1159
1160
1161//===----------------------------------------------------------------------===//
1162// ::llzk::polymorphic::TemplateOp definitions
1163//===----------------------------------------------------------------------===//
1164
1165namespace detail {
1166
1168
1170 auto attr = getSymNameAttr();
1171 return attr.getValue();
1172}
1173
1174
1175} // namespace detail
1177
1178::llvm::LogicalResult TemplateOpAdaptor::verify(::mlir::Location loc) {
1179 auto tblgen_sym_name = getProperties().sym_name; (void)tblgen_sym_name;
1180 if (!tblgen_sym_name) return emitError(loc, "'poly.template' op requires attribute 'sym_name'");
1181
1182 if (tblgen_sym_name && !((::llvm::isa<::mlir::StringAttr>(tblgen_sym_name))))
1183 return emitError(loc, "'poly.template' op attribute 'sym_name' failed to satisfy constraint: string attribute");
1184 return ::mlir::success();
1185}
1186
1187::llvm::LogicalResult TemplateOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
1188 ::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
1189 if (!dict) {
1190 emitError() << "expected DictionaryAttr to set properties";
1191 return ::mlir::failure();
1192 }
1193
1194 {
1195 auto &propStorage = prop.sym_name;
1196 auto attr = dict.get("sym_name");
1197 if (attr) {
1198 auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
1199 if (convertedAttr) {
1200 propStorage = convertedAttr;
1201 } else {
1202 emitError() << "Invalid attribute `sym_name` in property conversion: " << attr;
1203 return ::mlir::failure();
1204 }
1205 }
1206 }
1207 return ::mlir::success();
1208}
1209
1210::mlir::Attribute TemplateOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
1211 ::mlir::SmallVector<::mlir::NamedAttribute> attrs;
1212 ::mlir::Builder odsBuilder{ctx};
1213
1214 {
1215 const auto &propStorage = prop.sym_name;
1216 if (propStorage)
1217 attrs.push_back(odsBuilder.getNamedAttr("sym_name",
1218 propStorage));
1219 }
1220
1221 if (!attrs.empty())
1222 return odsBuilder.getDictionaryAttr(attrs);
1223 return {};
1224}
1225
1226llvm::hash_code TemplateOp::computePropertiesHash(const Properties &prop) {
1227 using llvm::hash_value;
1228 return llvm::hash_combine(
1229 llvm::hash_value(prop.sym_name.getAsOpaquePointer()));
1230}
1231
1232std::optional<mlir::Attribute> TemplateOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
1233 if (name == "sym_name")
1234 return prop.sym_name;
1235 return std::nullopt;
1236}
1237
1238void TemplateOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
1239 if (name == "sym_name") {
1240 prop.sym_name = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.sym_name)>>(value);
1241 return;
1242 }
1243}
1244
1245void TemplateOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
1246 if (prop.sym_name) attrs.append("sym_name", prop.sym_name);
1247}
1248
1249::llvm::LogicalResult TemplateOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
1250 {
1251 ::mlir::Attribute attr = attrs.get(getSymNameAttrName(opName));
1252 if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_Ops4(attr, "sym_name", emitError)))
1253 return ::mlir::failure();
1254 }
1255 return ::mlir::success();
1256}
1257
1258::llvm::LogicalResult TemplateOp::readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state) {
1259 auto &prop = state.getOrAddProperties<Properties>(); (void)prop;
1260 if (::mlir::failed(reader.readAttribute(prop.sym_name)))
1261 return ::mlir::failure();
1262 return ::mlir::success();
1263}
1264
1265void TemplateOp::writeProperties(::mlir::DialectBytecodeWriter &writer) {
1266 auto &prop = getProperties(); (void)prop;
1267 writer.writeAttribute(prop.sym_name);
1268}
1269
1270::llvm::StringRef TemplateOp::getSymName() {
1271 auto attr = getSymNameAttr();
1272 return attr.getValue();
1273}
1274
1275void TemplateOp::setSymName(::llvm::StringRef attrValue) {
1276 getProperties().sym_name = ::mlir::Builder((*this)->getContext()).getStringAttr(attrValue);
1277}
1278
1279void TemplateOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::StringAttr sym_name) {
1280 odsState.getOrAddProperties<Properties>().sym_name = sym_name;
1281 (void)odsState.addRegion();
1282}
1283
1284TemplateOp TemplateOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::StringAttr sym_name) {
1285 ::mlir::OperationState __state__(location, getOperationName());
1286 build(builder, __state__, std::forward<decltype(sym_name)>(sym_name));
1287 auto __res__ = ::llvm::dyn_cast<TemplateOp>(builder.create(__state__));
1288 assert(__res__ && "builder didn't return the right type");
1289 return __res__;
1290}
1291
1292TemplateOp TemplateOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::StringAttr sym_name) {
1293 return create(builder, builder.getLoc(), std::forward<decltype(sym_name)>(sym_name));
1294}
1295
1296void TemplateOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::StringAttr sym_name) {
1297 odsState.getOrAddProperties<Properties>().sym_name = sym_name;
1298 (void)odsState.addRegion();
1299 assert(resultTypes.size() == 0u && "mismatched number of results");
1300 odsState.addTypes(resultTypes);
1301}
1302
1303TemplateOp TemplateOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::StringAttr sym_name) {
1304 ::mlir::OperationState __state__(location, getOperationName());
1305 build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(sym_name)>(sym_name));
1306 auto __res__ = ::llvm::dyn_cast<TemplateOp>(builder.create(__state__));
1307 assert(__res__ && "builder didn't return the right type");
1308 return __res__;
1309}
1310
1311TemplateOp TemplateOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::StringAttr sym_name) {
1312 return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(sym_name)>(sym_name));
1313}
1314
1315void TemplateOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::llvm::StringRef sym_name) {
1316 odsState.getOrAddProperties<Properties>().sym_name = odsBuilder.getStringAttr(sym_name);
1317 (void)odsState.addRegion();
1318}
1319
1320TemplateOp TemplateOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::llvm::StringRef sym_name) {
1321 ::mlir::OperationState __state__(location, getOperationName());
1322 build(builder, __state__, std::forward<decltype(sym_name)>(sym_name));
1323 auto __res__ = ::llvm::dyn_cast<TemplateOp>(builder.create(__state__));
1324 assert(__res__ && "builder didn't return the right type");
1325 return __res__;
1326}
1327
1328TemplateOp TemplateOp::create(::mlir::ImplicitLocOpBuilder &builder, ::llvm::StringRef sym_name) {
1329 return create(builder, builder.getLoc(), std::forward<decltype(sym_name)>(sym_name));
1330}
1331
1332void TemplateOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::llvm::StringRef sym_name) {
1333 odsState.getOrAddProperties<Properties>().sym_name = odsBuilder.getStringAttr(sym_name);
1334 (void)odsState.addRegion();
1335 assert(resultTypes.size() == 0u && "mismatched number of results");
1336 odsState.addTypes(resultTypes);
1337}
1338
1339TemplateOp TemplateOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::llvm::StringRef sym_name) {
1340 ::mlir::OperationState __state__(location, getOperationName());
1341 build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(sym_name)>(sym_name));
1342 auto __res__ = ::llvm::dyn_cast<TemplateOp>(builder.create(__state__));
1343 assert(__res__ && "builder didn't return the right type");
1344 return __res__;
1345}
1346
1347TemplateOp TemplateOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::llvm::StringRef sym_name) {
1348 return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(sym_name)>(sym_name));
1349}
1350
1351void TemplateOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
1352 assert(operands.size() == 0u && "mismatched number of parameters");
1353 odsState.addOperands(operands);
1354 odsState.addAttributes(attributes);
1355 for (unsigned i = 0; i != 1; ++i)
1356 (void)odsState.addRegion();
1357 assert(resultTypes.size() == 0u && "mismatched number of return types");
1358 odsState.addTypes(resultTypes);
1359
1360 if (!attributes.empty()) {
1361 (void)odsState.getOrAddProperties<TemplateOp::Properties>();
1362 ::mlir::PropertyRef properties = odsState.getRawProperties();
1363 std::optional<::mlir::RegisteredOperationName> info =
1364 odsState.name.getRegisteredInfo();
1365 if (failed(info->setOpPropertiesFromAttribute(odsState.name, properties,
1366 odsState.attributes.getDictionary(odsState.getContext()), nullptr)))
1367 ::llvm::report_fatal_error("Property conversion failed.");
1368 }
1369}
1370
1371TemplateOp TemplateOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
1372 ::mlir::OperationState __state__(location, getOperationName());
1373 build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
1374 auto __res__ = ::llvm::dyn_cast<TemplateOp>(builder.create(__state__));
1375 assert(__res__ && "builder didn't return the right type");
1376 return __res__;
1377}
1378
1379TemplateOp TemplateOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
1380 return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
1381}
1382
1383void TemplateOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
1384 assert(operands.size() == 0u && "mismatched number of parameters");
1385 odsState.addOperands(operands);
1386 odsState.useProperties(const_cast<Properties&>(properties));
1387 odsState.addAttributes(discardableAttributes);
1388 for (unsigned i = 0; i != 1; ++i)
1389 (void)odsState.addRegion();
1390 assert(resultTypes.size() == 0u && "mismatched number of return types");
1391 odsState.addTypes(resultTypes);
1392}
1393
1394TemplateOp TemplateOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
1395 ::mlir::OperationState __state__(location, getOperationName());
1396 build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
1397 auto __res__ = ::llvm::dyn_cast<TemplateOp>(builder.create(__state__));
1398 assert(__res__ && "builder didn't return the right type");
1399 return __res__;
1400}
1401
1402TemplateOp TemplateOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
1403 return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
1404}
1405
1406::llvm::LogicalResult TemplateOp::verifyInvariantsImpl() {
1407 auto tblgen_sym_name = getProperties().sym_name; (void)tblgen_sym_name;
1408 if (!tblgen_sym_name) return emitOpError("requires attribute 'sym_name'");
1409
1410 if (::mlir::failed(__mlir_ods_local_attr_constraint_Ops4(*this, tblgen_sym_name, "sym_name")))
1411 return ::mlir::failure();
1412 {
1413 unsigned index = 0; (void)index;
1414
1415 for (auto &region : ::llvm::MutableArrayRef((*this)->getRegion(0)))
1416 if (::mlir::failed(__mlir_ods_local_region_constraint_Ops1(*this, region, "bodyRegion", index++)))
1417 return ::mlir::failure();
1418 }
1419 return ::mlir::success();
1420}
1421
1422::llvm::LogicalResult TemplateOp::verifyInvariants() {
1423 if(::mlir::succeeded(verifyInvariantsImpl()) && ::mlir::succeeded(verify()))
1424 return ::mlir::success();
1425 return ::mlir::failure();
1426}
1427
1428::mlir::ParseResult TemplateOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
1429 ::mlir::StringAttr sym_nameAttr;
1430 std::unique_ptr<::mlir::Region> bodyRegionRegion = std::make_unique<::mlir::Region>();
1431
1432 if (parser.parseSymbolName(sym_nameAttr))
1433 return ::mlir::failure();
1434 if (sym_nameAttr) result.getOrAddProperties<TemplateOp::Properties>().sym_name = sym_nameAttr;
1435
1436 if (parser.parseRegion(*bodyRegionRegion))
1437 return ::mlir::failure();
1438
1439 if (bodyRegionRegion->empty()) bodyRegionRegion->emplaceBlock();
1440 {
1441 auto loc = parser.getCurrentLocation();(void)loc;
1442 if (parser.parseOptionalAttrDict(result.attributes))
1443 return ::mlir::failure();
1444 if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() {
1445 return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op ";
1446 })))
1447 return ::mlir::failure();
1448 }
1449 result.addRegion(std::move(bodyRegionRegion));
1450 return ::mlir::success();
1451}
1452
1453void TemplateOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
1454 _odsPrinter << ' ';
1455 _odsPrinter.printSymbolName(getSymNameAttr().getValue());
1456 _odsPrinter << ' ';
1457 _odsPrinter.printRegion(getBodyRegion());
1458 ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
1459 elidedAttrs.push_back("sym_name");
1460 _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
1461}
1462
1463
1464} // namespace llzk::polymorphic
1465MLIR_DEFINE_EXPLICIT_TYPE_ID(::llzk::polymorphic::TemplateOp)
1467
1468namespace llzk::polymorphic {
1469
1470
1471//===----------------------------------------------------------------------===//
1472// ::llzk::polymorphic::TemplateParamOp definitions
1473//===----------------------------------------------------------------------===//
1474
1475namespace detail {
1476
1478
1480 auto attr = getSymNameAttr();
1481 return attr.getValue();
1482}
1483
1484::std::optional<::mlir::Type> TemplateParamOpGenericAdaptorBase::getTypeOpt() {
1485 auto attr = getTypeOptAttr();
1486 return attr ? ::std::optional<::mlir::Type>(::llvm::cast<::mlir::Type>(attr.getValue())) : (::std::nullopt);
1487}
1488
1489
1490} // namespace detail
1492
1493::llvm::LogicalResult TemplateParamOpAdaptor::verify(::mlir::Location loc) {
1494 auto tblgen_sym_name = getProperties().sym_name; (void)tblgen_sym_name;
1495 if (!tblgen_sym_name) return emitError(loc, "'poly.param' op requires attribute 'sym_name'");
1496 auto tblgen_type_opt = getProperties().type_opt; (void)tblgen_type_opt;
1497
1498 if (tblgen_sym_name && !((::llvm::isa<::mlir::StringAttr>(tblgen_sym_name))))
1499 return emitError(loc, "'poly.param' op attribute 'sym_name' failed to satisfy constraint: string attribute");
1500
1501 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())))))
1502 return emitError(loc, "'poly.param' op attribute 'type_opt' failed to satisfy constraint: type attribute of integral, felt, or typevar type");
1503 return ::mlir::success();
1504}
1505
1506::llvm::LogicalResult TemplateParamOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
1507 ::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
1508 if (!dict) {
1509 emitError() << "expected DictionaryAttr to set properties";
1510 return ::mlir::failure();
1511 }
1512
1513 {
1514 auto &propStorage = prop.sym_name;
1515 auto attr = dict.get("sym_name");
1516 if (attr) {
1517 auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
1518 if (convertedAttr) {
1519 propStorage = convertedAttr;
1520 } else {
1521 emitError() << "Invalid attribute `sym_name` in property conversion: " << attr;
1522 return ::mlir::failure();
1523 }
1524 }
1525 }
1526
1527 {
1528 auto &propStorage = prop.type_opt;
1529 auto attr = dict.get("type_opt");
1530 if (attr) {
1531 auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
1532 if (convertedAttr) {
1533 propStorage = convertedAttr;
1534 } else {
1535 emitError() << "Invalid attribute `type_opt` in property conversion: " << attr;
1536 return ::mlir::failure();
1537 }
1538 }
1539 }
1540 return ::mlir::success();
1541}
1542
1543::mlir::Attribute TemplateParamOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
1544 ::mlir::SmallVector<::mlir::NamedAttribute> attrs;
1545 ::mlir::Builder odsBuilder{ctx};
1546
1547 {
1548 const auto &propStorage = prop.sym_name;
1549 if (propStorage)
1550 attrs.push_back(odsBuilder.getNamedAttr("sym_name",
1551 propStorage));
1552 }
1553
1554 {
1555 const auto &propStorage = prop.type_opt;
1556 if (propStorage)
1557 attrs.push_back(odsBuilder.getNamedAttr("type_opt",
1558 propStorage));
1559 }
1560
1561 if (!attrs.empty())
1562 return odsBuilder.getDictionaryAttr(attrs);
1563 return {};
1564}
1565
1567 using llvm::hash_value;
1568 return llvm::hash_combine(
1569 llvm::hash_value(prop.sym_name.getAsOpaquePointer()),
1570 llvm::hash_value(prop.type_opt.getAsOpaquePointer()));
1571}
1572
1573std::optional<mlir::Attribute> TemplateParamOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
1574 if (name == "sym_name")
1575 return prop.sym_name;
1576
1577 if (name == "type_opt")
1578 return prop.type_opt;
1579 return std::nullopt;
1580}
1581
1582void TemplateParamOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
1583 if (name == "sym_name") {
1584 prop.sym_name = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.sym_name)>>(value);
1585 return;
1586 }
1587
1588 if (name == "type_opt") {
1589 prop.type_opt = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.type_opt)>>(value);
1590 return;
1591 }
1592}
1593
1594void TemplateParamOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
1595 if (prop.sym_name) attrs.append("sym_name", prop.sym_name);
1596
1597 if (prop.type_opt) attrs.append("type_opt", prop.type_opt);
1598}
1599
1600::llvm::LogicalResult TemplateParamOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
1601 {
1602 ::mlir::Attribute attr = attrs.get(getSymNameAttrName(opName));
1603 if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_Ops4(attr, "sym_name", emitError)))
1604 return ::mlir::failure();
1605 }
1606
1607 {
1608 ::mlir::Attribute attr = attrs.get(getTypeOptAttrName(opName));
1609 if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_Ops5(attr, "type_opt", emitError)))
1610 return ::mlir::failure();
1611 }
1612 return ::mlir::success();
1613}
1614
1615::llvm::LogicalResult TemplateParamOp::readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state) {
1616 auto &prop = state.getOrAddProperties<Properties>(); (void)prop;
1617 if (::mlir::failed(reader.readAttribute(prop.sym_name)))
1618 return ::mlir::failure();
1619
1620 if (::mlir::failed(reader.readOptionalAttribute(prop.type_opt)))
1621 return ::mlir::failure();
1622 return ::mlir::success();
1623}
1624
1625void TemplateParamOp::writeProperties(::mlir::DialectBytecodeWriter &writer) {
1626 auto &prop = getProperties(); (void)prop;
1627 writer.writeAttribute(prop.sym_name);
1628
1629 writer.writeOptionalAttribute(prop.type_opt);
1630}
1631
1632::llvm::StringRef TemplateParamOp::getSymName() {
1633 auto attr = getSymNameAttr();
1634 return attr.getValue();
1635}
1636
1637::std::optional<::mlir::Type> TemplateParamOp::getTypeOpt() {
1638 auto attr = getTypeOptAttr();
1639 return attr ? ::std::optional<::mlir::Type>(::llvm::cast<::mlir::Type>(attr.getValue())) : (::std::nullopt);
1640}
1641
1642void TemplateParamOp::setSymName(::llvm::StringRef attrValue) {
1643 getProperties().sym_name = ::mlir::Builder((*this)->getContext()).getStringAttr(attrValue);
1644}
1645
1646void TemplateParamOp::setTypeOpt(::std::optional<::mlir::Type> attrValue) {
1647 auto &odsProp = getProperties().type_opt;
1648 if (attrValue)
1649 odsProp = ::mlir::TypeAttr::get(*attrValue);
1650 else
1651 odsProp = nullptr;
1652}
1653
1654void TemplateParamOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::StringAttr sym_name, /*optional*/::mlir::TypeAttr type_opt) {
1655 odsState.getOrAddProperties<Properties>().sym_name = sym_name;
1656 if (type_opt) {
1657 odsState.getOrAddProperties<Properties>().type_opt = type_opt;
1658 }
1659}
1660
1661TemplateParamOp TemplateParamOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::StringAttr sym_name, /*optional*/::mlir::TypeAttr type_opt) {
1662 ::mlir::OperationState __state__(location, getOperationName());
1663 build(builder, __state__, std::forward<decltype(sym_name)>(sym_name), std::forward<decltype(type_opt)>(type_opt));
1664 auto __res__ = ::llvm::dyn_cast<TemplateParamOp>(builder.create(__state__));
1665 assert(__res__ && "builder didn't return the right type");
1666 return __res__;
1667}
1668
1669TemplateParamOp TemplateParamOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::StringAttr sym_name, /*optional*/::mlir::TypeAttr type_opt) {
1670 return create(builder, builder.getLoc(), std::forward<decltype(sym_name)>(sym_name), std::forward<decltype(type_opt)>(type_opt));
1671}
1672
1673void TemplateParamOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::StringAttr sym_name, /*optional*/::mlir::TypeAttr type_opt) {
1674 odsState.getOrAddProperties<Properties>().sym_name = sym_name;
1675 if (type_opt) {
1676 odsState.getOrAddProperties<Properties>().type_opt = type_opt;
1677 }
1678 assert(resultTypes.size() == 0u && "mismatched number of results");
1679 odsState.addTypes(resultTypes);
1680}
1681
1682TemplateParamOp TemplateParamOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::StringAttr sym_name, /*optional*/::mlir::TypeAttr type_opt) {
1683 ::mlir::OperationState __state__(location, getOperationName());
1684 build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(sym_name)>(sym_name), std::forward<decltype(type_opt)>(type_opt));
1685 auto __res__ = ::llvm::dyn_cast<TemplateParamOp>(builder.create(__state__));
1686 assert(__res__ && "builder didn't return the right type");
1687 return __res__;
1688}
1689
1690TemplateParamOp TemplateParamOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::StringAttr sym_name, /*optional*/::mlir::TypeAttr type_opt) {
1691 return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(sym_name)>(sym_name), std::forward<decltype(type_opt)>(type_opt));
1692}
1693
1694void TemplateParamOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::llvm::StringRef sym_name, /*optional*/::mlir::TypeAttr type_opt) {
1695 odsState.getOrAddProperties<Properties>().sym_name = odsBuilder.getStringAttr(sym_name);
1696 if (type_opt) {
1697 odsState.getOrAddProperties<Properties>().type_opt = type_opt;
1698 }
1699}
1700
1701TemplateParamOp TemplateParamOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::llvm::StringRef sym_name, /*optional*/::mlir::TypeAttr type_opt) {
1702 ::mlir::OperationState __state__(location, getOperationName());
1703 build(builder, __state__, std::forward<decltype(sym_name)>(sym_name), std::forward<decltype(type_opt)>(type_opt));
1704 auto __res__ = ::llvm::dyn_cast<TemplateParamOp>(builder.create(__state__));
1705 assert(__res__ && "builder didn't return the right type");
1706 return __res__;
1707}
1708
1709TemplateParamOp TemplateParamOp::create(::mlir::ImplicitLocOpBuilder &builder, ::llvm::StringRef sym_name, /*optional*/::mlir::TypeAttr type_opt) {
1710 return create(builder, builder.getLoc(), std::forward<decltype(sym_name)>(sym_name), std::forward<decltype(type_opt)>(type_opt));
1711}
1712
1713void TemplateParamOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::llvm::StringRef sym_name, /*optional*/::mlir::TypeAttr type_opt) {
1714 odsState.getOrAddProperties<Properties>().sym_name = odsBuilder.getStringAttr(sym_name);
1715 if (type_opt) {
1716 odsState.getOrAddProperties<Properties>().type_opt = type_opt;
1717 }
1718 assert(resultTypes.size() == 0u && "mismatched number of results");
1719 odsState.addTypes(resultTypes);
1720}
1721
1722TemplateParamOp TemplateParamOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::llvm::StringRef sym_name, /*optional*/::mlir::TypeAttr type_opt) {
1723 ::mlir::OperationState __state__(location, getOperationName());
1724 build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(sym_name)>(sym_name), std::forward<decltype(type_opt)>(type_opt));
1725 auto __res__ = ::llvm::dyn_cast<TemplateParamOp>(builder.create(__state__));
1726 assert(__res__ && "builder didn't return the right type");
1727 return __res__;
1728}
1729
1730TemplateParamOp TemplateParamOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::llvm::StringRef sym_name, /*optional*/::mlir::TypeAttr type_opt) {
1731 return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(sym_name)>(sym_name), std::forward<decltype(type_opt)>(type_opt));
1732}
1733
1734void TemplateParamOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
1735 assert(operands.size() == 0u && "mismatched number of parameters");
1736 odsState.addOperands(operands);
1737 odsState.addAttributes(attributes);
1738 assert(resultTypes.size() == 0u && "mismatched number of return types");
1739 odsState.addTypes(resultTypes);
1740
1741 if (!attributes.empty()) {
1742 (void)odsState.getOrAddProperties<TemplateParamOp::Properties>();
1743 ::mlir::PropertyRef properties = odsState.getRawProperties();
1744 std::optional<::mlir::RegisteredOperationName> info =
1745 odsState.name.getRegisteredInfo();
1746 if (failed(info->setOpPropertiesFromAttribute(odsState.name, properties,
1747 odsState.attributes.getDictionary(odsState.getContext()), nullptr)))
1748 ::llvm::report_fatal_error("Property conversion failed.");
1749 }
1750}
1751
1752TemplateParamOp TemplateParamOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
1753 ::mlir::OperationState __state__(location, getOperationName());
1754 build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
1755 auto __res__ = ::llvm::dyn_cast<TemplateParamOp>(builder.create(__state__));
1756 assert(__res__ && "builder didn't return the right type");
1757 return __res__;
1758}
1759
1760TemplateParamOp TemplateParamOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
1761 return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
1762}
1763
1764void TemplateParamOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
1765 assert(operands.size() == 0u && "mismatched number of parameters");
1766 odsState.addOperands(operands);
1767 odsState.useProperties(const_cast<Properties&>(properties));
1768 odsState.addAttributes(discardableAttributes);
1769 assert(resultTypes.size() == 0u && "mismatched number of return types");
1770 odsState.addTypes(resultTypes);
1771}
1772
1773TemplateParamOp TemplateParamOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
1774 ::mlir::OperationState __state__(location, getOperationName());
1775 build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
1776 auto __res__ = ::llvm::dyn_cast<TemplateParamOp>(builder.create(__state__));
1777 assert(__res__ && "builder didn't return the right type");
1778 return __res__;
1779}
1780
1781TemplateParamOp TemplateParamOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
1782 return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
1783}
1784
1786 auto tblgen_sym_name = getProperties().sym_name; (void)tblgen_sym_name;
1787 if (!tblgen_sym_name) return emitOpError("requires attribute 'sym_name'");
1788 auto tblgen_type_opt = getProperties().type_opt; (void)tblgen_type_opt;
1789
1790 if (::mlir::failed(__mlir_ods_local_attr_constraint_Ops4(*this, tblgen_sym_name, "sym_name")))
1791 return ::mlir::failure();
1792
1793 if (::mlir::failed(__mlir_ods_local_attr_constraint_Ops5(*this, tblgen_type_opt, "type_opt")))
1794 return ::mlir::failure();
1795 return ::mlir::success();
1796}
1797
1798::llvm::LogicalResult TemplateParamOp::verifyInvariants() {
1799 return verifyInvariantsImpl();
1800}
1801
1802::mlir::ParseResult TemplateParamOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
1803 ::mlir::StringAttr sym_nameAttr;
1804 ::mlir::TypeAttr type_optAttr;
1805
1806 if (parser.parseSymbolName(sym_nameAttr))
1807 return ::mlir::failure();
1808 if (sym_nameAttr) result.getOrAddProperties<TemplateParamOp::Properties>().sym_name = sym_nameAttr;
1809 if (::mlir::succeeded(parser.parseOptionalColon())) {
1810
1811 if (parser.parseCustomAttributeWithFallback(type_optAttr, parser.getBuilder().getType<::mlir::NoneType>())) {
1812 return ::mlir::failure();
1813 }
1814 if (type_optAttr) result.getOrAddProperties<TemplateParamOp::Properties>().type_opt = type_optAttr;
1815 }
1816 {
1817 auto loc = parser.getCurrentLocation();(void)loc;
1818 if (parser.parseOptionalAttrDict(result.attributes))
1819 return ::mlir::failure();
1820 if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() {
1821 return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op ";
1822 })))
1823 return ::mlir::failure();
1824 }
1825 return ::mlir::success();
1826}
1827
1828void TemplateParamOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
1829 _odsPrinter << ' ';
1830 _odsPrinter.printSymbolName(getSymNameAttr().getValue());
1831 if (getTypeOptAttr()) {
1832 _odsPrinter << ' ' << ":";
1833 _odsPrinter << ' ';
1834 _odsPrinter.printAttributeWithoutType(getTypeOptAttr());
1835 }
1836 ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
1837 elidedAttrs.push_back("sym_name");
1838 elidedAttrs.push_back("type_opt");
1839 _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
1840}
1841
1842
1843} // namespace llzk::polymorphic
1844MLIR_DEFINE_EXPLICIT_TYPE_ID(::llzk::polymorphic::TemplateParamOp)
1846
1847namespace llzk::polymorphic {
1848
1849
1850//===----------------------------------------------------------------------===//
1851// ::llzk::polymorphic::UnifiableCastOp definitions
1852//===----------------------------------------------------------------------===//
1853
1854namespace detail {
1855
1857
1858
1859} // namespace detail
1861
1862::llvm::LogicalResult UnifiableCastOpAdaptor::verify(::mlir::Location loc) {
1863 return ::mlir::success();
1864}
1865
1866::llvm::LogicalResult UnifiableCastOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
1867 ::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
1868 if (!dict) {
1869 emitError() << "expected DictionaryAttr to set properties";
1870 return ::mlir::failure();
1871 }
1872 return ::mlir::success();
1873}
1874
1875::mlir::Attribute UnifiableCastOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
1876 ::mlir::SmallVector<::mlir::NamedAttribute> attrs;
1877 ::mlir::Builder odsBuilder{ctx};
1878
1879 if (!attrs.empty())
1880 return odsBuilder.getDictionaryAttr(attrs);
1881 return {};
1882}
1883
1885 using llvm::hash_value;
1886 return llvm::hash_combine();
1887}
1888
1889std::optional<mlir::Attribute> UnifiableCastOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
1890 return std::nullopt;
1891}
1892
1893void UnifiableCastOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
1894}
1895
1896void UnifiableCastOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
1897}
1898
1899::llvm::LogicalResult UnifiableCastOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
1900 return ::mlir::success();
1901}
1902
1903void UnifiableCastOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value input) {
1904 odsState.addOperands(input);
1905 odsState.addTypes(result);
1906}
1907
1908UnifiableCastOp UnifiableCastOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value input) {
1909 ::mlir::OperationState __state__(location, getOperationName());
1910 build(builder, __state__, std::forward<decltype(result)>(result), std::forward<decltype(input)>(input));
1911 auto __res__ = ::llvm::dyn_cast<UnifiableCastOp>(builder.create(__state__));
1912 assert(__res__ && "builder didn't return the right type");
1913 return __res__;
1914}
1915
1916UnifiableCastOp UnifiableCastOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::Value input) {
1917 return create(builder, builder.getLoc(), std::forward<decltype(result)>(result), std::forward<decltype(input)>(input));
1918}
1919
1920void UnifiableCastOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input) {
1921 odsState.addOperands(input);
1922 assert(resultTypes.size() == 1u && "mismatched number of results");
1923 odsState.addTypes(resultTypes);
1924}
1925
1926UnifiableCastOp UnifiableCastOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value input) {
1927 ::mlir::OperationState __state__(location, getOperationName());
1928 build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(input)>(input));
1929 auto __res__ = ::llvm::dyn_cast<UnifiableCastOp>(builder.create(__state__));
1930 assert(__res__ && "builder didn't return the right type");
1931 return __res__;
1932}
1933
1934UnifiableCastOp UnifiableCastOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value input) {
1935 return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(input)>(input));
1936}
1937
1938void UnifiableCastOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
1939 assert(operands.size() == 1u && "mismatched number of parameters");
1940 odsState.addOperands(operands);
1941 odsState.addAttributes(attributes);
1942 assert(resultTypes.size() == 1u && "mismatched number of return types");
1943 odsState.addTypes(resultTypes);
1944}
1945
1946UnifiableCastOp UnifiableCastOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
1947 ::mlir::OperationState __state__(location, getOperationName());
1948 build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
1949 auto __res__ = ::llvm::dyn_cast<UnifiableCastOp>(builder.create(__state__));
1950 assert(__res__ && "builder didn't return the right type");
1951 return __res__;
1952}
1953
1954UnifiableCastOp UnifiableCastOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
1955 return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
1956}
1957
1958void UnifiableCastOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
1959 assert(operands.size() == 1u && "mismatched number of parameters");
1960 odsState.addOperands(operands);
1961 odsState.useProperties(const_cast<Properties&>(properties));
1962 odsState.addAttributes(discardableAttributes);
1963 assert(resultTypes.size() == 1u && "mismatched number of return types");
1964 odsState.addTypes(resultTypes);
1965}
1966
1967UnifiableCastOp UnifiableCastOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
1968 ::mlir::OperationState __state__(location, getOperationName());
1969 build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
1970 auto __res__ = ::llvm::dyn_cast<UnifiableCastOp>(builder.create(__state__));
1971 assert(__res__ && "builder didn't return the right type");
1972 return __res__;
1973}
1974
1975UnifiableCastOp UnifiableCastOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
1976 return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
1977}
1978
1980 {
1981 unsigned index = 0; (void)index;
1982 auto valueGroup0 = getODSOperands(0);
1983
1984 for (auto v : valueGroup0) {
1985 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops4(*this, v.getType(), "operand", index++)))
1986 return ::mlir::failure();
1987 }
1988 }
1989 {
1990 unsigned index = 0; (void)index;
1991 auto valueGroup0 = getODSResults(0);
1992
1993 for (auto v : valueGroup0) {
1994 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops4(*this, v.getType(), "result", index++)))
1995 return ::mlir::failure();
1996 }
1997 }
1998 return ::mlir::success();
1999}
2000
2001::llvm::LogicalResult UnifiableCastOp::verifyInvariants() {
2002 if(::mlir::succeeded(verifyInvariantsImpl()) && ::mlir::succeeded(verify()))
2003 return ::mlir::success();
2004 return ::mlir::failure();
2005}
2006
2007::mlir::ParseResult UnifiableCastOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
2008 ::mlir::OpAsmParser::UnresolvedOperand inputRawOperand{};
2009 ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> inputOperands(&inputRawOperand, 1); ::llvm::SMLoc inputOperandsLoc;
2010 (void)inputOperandsLoc;
2011 ::llvm::ArrayRef<::mlir::Type> inputTypes;
2012 ::llvm::ArrayRef<::mlir::Type> allResultTypes;
2013
2014 inputOperandsLoc = parser.getCurrentLocation();
2015 if (parser.parseOperand(inputRawOperand))
2016 return ::mlir::failure();
2017 if (parser.parseColon())
2018 return ::mlir::failure();
2019
2020 ::mlir::FunctionType input__allResult_functionType;
2021 if (parser.parseType(input__allResult_functionType))
2022 return ::mlir::failure();
2023 inputTypes = input__allResult_functionType.getInputs();
2024 allResultTypes = input__allResult_functionType.getResults();
2025 {
2026 auto loc = parser.getCurrentLocation();(void)loc;
2027 if (parser.parseOptionalAttrDict(result.attributes))
2028 return ::mlir::failure();
2029 if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() {
2030 return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op ";
2031 })))
2032 return ::mlir::failure();
2033 }
2034 result.addTypes(allResultTypes);
2035 if (parser.resolveOperands(inputOperands, inputTypes, inputOperandsLoc, result.operands))
2036 return ::mlir::failure();
2037 return ::mlir::success();
2038}
2039
2040void UnifiableCastOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
2041 _odsPrinter << ' ';
2042 _odsPrinter << getInput();
2043 _odsPrinter << ' ' << ":";
2044 _odsPrinter << ' ';
2045 _odsPrinter.printFunctionalType(::llvm::ArrayRef<::mlir::Type>(getInput().getType()), getOperation()->getResultTypes());
2046 ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
2047 _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
2048}
2049
2050void UnifiableCastOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
2051}
2052
2053
2054} // namespace llzk::polymorphic
2055MLIR_DEFINE_EXPLICIT_TYPE_ID(::llzk::polymorphic::UnifiableCastOp)
2056
2057namespace llzk::polymorphic {
2058
2059
2060//===----------------------------------------------------------------------===//
2061// ::llzk::polymorphic::YieldOp definitions
2062//===----------------------------------------------------------------------===//
2063
2064namespace detail {
2065
2066YieldOpGenericAdaptorBase::YieldOpGenericAdaptorBase(YieldOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
2067
2068
2069} // namespace detail
2071
2072::llvm::LogicalResult YieldOpAdaptor::verify(::mlir::Location loc) {
2073 return ::mlir::success();
2074}
2075
2076::llvm::LogicalResult YieldOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
2077 ::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
2078 if (!dict) {
2079 emitError() << "expected DictionaryAttr to set properties";
2080 return ::mlir::failure();
2081 }
2082 return ::mlir::success();
2083}
2084
2085::mlir::Attribute YieldOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
2086 ::mlir::SmallVector<::mlir::NamedAttribute> attrs;
2087 ::mlir::Builder odsBuilder{ctx};
2088
2089 if (!attrs.empty())
2090 return odsBuilder.getDictionaryAttr(attrs);
2091 return {};
2092}
2093
2094llvm::hash_code YieldOp::computePropertiesHash(const Properties &prop) {
2095 using llvm::hash_value;
2096 return llvm::hash_combine();
2097}
2098
2099std::optional<mlir::Attribute> YieldOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
2100 return std::nullopt;
2101}
2102
2103void YieldOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
2104}
2105
2106void YieldOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
2107}
2108
2109::llvm::LogicalResult YieldOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
2110 return ::mlir::success();
2111}
2112
2113void YieldOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value val) {
2114 odsState.addOperands(val);
2115}
2116
2117YieldOp YieldOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value val) {
2118 ::mlir::OperationState __state__(location, getOperationName());
2119 build(builder, __state__, std::forward<decltype(val)>(val));
2120 auto __res__ = ::llvm::dyn_cast<YieldOp>(builder.create(__state__));
2121 assert(__res__ && "builder didn't return the right type");
2122 return __res__;
2123}
2124
2125YieldOp YieldOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value val) {
2126 return create(builder, builder.getLoc(), std::forward<decltype(val)>(val));
2127}
2128
2129void YieldOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value val) {
2130 odsState.addOperands(val);
2131 assert(resultTypes.size() == 0u && "mismatched number of results");
2132 odsState.addTypes(resultTypes);
2133}
2134
2135YieldOp YieldOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value val) {
2136 ::mlir::OperationState __state__(location, getOperationName());
2137 build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(val)>(val));
2138 auto __res__ = ::llvm::dyn_cast<YieldOp>(builder.create(__state__));
2139 assert(__res__ && "builder didn't return the right type");
2140 return __res__;
2141}
2142
2143YieldOp YieldOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value val) {
2144 return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(val)>(val));
2145}
2146
2147void YieldOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
2148 assert(operands.size() == 1u && "mismatched number of parameters");
2149 odsState.addOperands(operands);
2150 odsState.addAttributes(attributes);
2151 assert(resultTypes.size() == 0u && "mismatched number of return types");
2152 odsState.addTypes(resultTypes);
2153}
2154
2155YieldOp YieldOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
2156 ::mlir::OperationState __state__(location, getOperationName());
2157 build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
2158 auto __res__ = ::llvm::dyn_cast<YieldOp>(builder.create(__state__));
2159 assert(__res__ && "builder didn't return the right type");
2160 return __res__;
2161}
2162
2163YieldOp YieldOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
2164 return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
2165}
2166
2167void YieldOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
2168 assert(operands.size() == 1u && "mismatched number of parameters");
2169 odsState.addOperands(operands);
2170 odsState.useProperties(const_cast<Properties&>(properties));
2171 odsState.addAttributes(discardableAttributes);
2172 assert(resultTypes.size() == 0u && "mismatched number of return types");
2173 odsState.addTypes(resultTypes);
2174}
2175
2176YieldOp YieldOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
2177 ::mlir::OperationState __state__(location, getOperationName());
2178 build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
2179 auto __res__ = ::llvm::dyn_cast<YieldOp>(builder.create(__state__));
2180 assert(__res__ && "builder didn't return the right type");
2181 return __res__;
2182}
2183
2184YieldOp YieldOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
2185 return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
2186}
2187
2188::llvm::LogicalResult YieldOp::verifyInvariantsImpl() {
2189 {
2190 unsigned index = 0; (void)index;
2191 auto valueGroup0 = getODSOperands(0);
2192
2193 for (auto v : valueGroup0) {
2194 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops3(*this, v.getType(), "operand", index++)))
2195 return ::mlir::failure();
2196 }
2197 }
2198 return ::mlir::success();
2199}
2200
2201::llvm::LogicalResult YieldOp::verifyInvariants() {
2202 return verifyInvariantsImpl();
2203}
2204
2205::mlir::ParseResult YieldOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
2206 ::mlir::OpAsmParser::UnresolvedOperand valRawOperand{};
2207 ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> valOperands(&valRawOperand, 1); ::llvm::SMLoc valOperandsLoc;
2208 (void)valOperandsLoc;
2209 ::mlir::Type valRawType{};
2210 ::llvm::ArrayRef<::mlir::Type> valTypes(&valRawType, 1);
2211
2212 valOperandsLoc = parser.getCurrentLocation();
2213 if (parser.parseOperand(valRawOperand))
2214 return ::mlir::failure();
2215 if (parser.parseColon())
2216 return ::mlir::failure();
2217
2218 {
2219 ::mlir::Type type;
2220 if (parser.parseCustomTypeWithFallback(type))
2221 return ::mlir::failure();
2222 valRawType = type;
2223 }
2224 {
2225 auto loc = parser.getCurrentLocation();(void)loc;
2226 if (parser.parseOptionalAttrDict(result.attributes))
2227 return ::mlir::failure();
2228 if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() {
2229 return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op ";
2230 })))
2231 return ::mlir::failure();
2232 }
2233 if (parser.resolveOperands(valOperands, valTypes, valOperandsLoc, result.operands))
2234 return ::mlir::failure();
2235 return ::mlir::success();
2236}
2237
2238void YieldOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
2239 _odsPrinter << ' ';
2240 _odsPrinter << getVal();
2241 _odsPrinter << ' ' << ":";
2242 _odsPrinter << ' ';
2243 {
2244 auto type = getVal().getType();
2245 if (auto validType = ::llvm::dyn_cast<::mlir::Type>(type))
2246 _odsPrinter.printStrippedAttrOrType(validType);
2247 else
2248 _odsPrinter << type;
2249 }
2250 ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
2251 _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
2252}
2253
2254
2255} // namespace llzk::polymorphic
2256MLIR_DEFINE_EXPLICIT_TYPE_ID(::llzk::polymorphic::YieldOp)
2257
2258
2259#endif // GET_OP_CLASSES
2260
::llvm::LogicalResult verify(::mlir::Location loc)
Definition Ops.cpp.inc:194
ApplyMapOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:253
::mlir::AffineMapAttr getMapAttr()
Definition Ops.h.inc:358
::mlir::IntegerAttr getNumDimsAttr()
Definition Ops.h.inc:363
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index)
Definition Ops.cpp.inc:208
::mlir::Operation::result_range getODSResults(unsigned index)
Definition Ops.h.inc:343
::mlir::Operation::operand_range getMapOperands()
Definition Ops.h.inc:334
::llvm::LogicalResult verify()
Definition Ops.cpp:242
void print(::mlir::OpAsmPrinter &_odsPrinter)
Definition Ops.cpp.inc:511
static constexpr ::llvm::StringLiteral getOperationName()
Definition Ops.h.inc:323
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
Definition Ops.cpp.inc:478
::llvm::LogicalResult verifyInvariants()
Definition Ops.cpp.inc:464
static llvm::hash_code computePropertiesHash(const Properties &prop)
Definition Ops.cpp.inc:292
static ApplyMapOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::AffineMapAttr map, ::mlir::ValueRange mapOperands={})
Definition Ops.cpp.inc:385
FoldAdaptor::Properties Properties
Definition Ops.h.inc:301
::llvm::LogicalResult inferReturnTypes(::mlir::MLIRContext *context, ::std::optional<::mlir::Location > location, ::mlir::ValueRange operands, ::mlir::DictionaryAttr attributes, ::mlir::PropertyRef properties, ::mlir::RegionRange regions, ::llvm::SmallVectorImpl<::mlir::Type > &inferredReturnTypes)
Definition Ops.cpp.inc:470
::mlir::Operation::operand_range getODSOperands(unsigned index)
Definition Ops.h.inc:328
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::AffineMapAttr map, ::mlir::ValueRange mapOperands={})
Definition Ops.cpp.inc:375
::mlir::StringAttr getMapAttrName()
Definition Ops.h.inc:307
::mlir::AffineMap getMap()
Definition Ops.cpp.inc:357
static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs)
Definition Ops.cpp.inc:320
void writeProperties(::mlir::DialectBytecodeWriter &writer)
Definition Ops.cpp.inc:351
void setMap(::mlir::AffineMap attrValue)
Definition Ops.cpp.inc:367
::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop)
Definition Ops.cpp.inc:269
::mlir::StringAttr getNumDimsAttrName()
Definition Ops.h.inc:315
::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:326
::mlir::MutableOperandRange getMapOperandsMutable()
Definition Ops.cpp.inc:226
::llvm::LogicalResult verifyInvariantsImpl()
Definition Ops.cpp.inc:432
static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value)
Definition Ops.cpp.inc:308
::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state)
Definition Ops.cpp.inc:341
::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:232
void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect > > &effects)
Definition Ops.cpp.inc:522
static std::optional< mlir::Attribute > getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name)
Definition Ops.cpp.inc:299
void setNumDims(::llvm::APInt attrValue)
Definition Ops.cpp.inc:371
::llvm::LogicalResult verify(::mlir::Location loc)
Definition Ops.cpp.inc:550
ConstReadOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:505
void writeProperties(::mlir::DialectBytecodeWriter &writer)
Definition Ops.cpp.inc:637
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
Definition Ops.cpp.inc:794
static constexpr ::llvm::StringLiteral getOperationName()
Definition Ops.h.inc:562
void print(::mlir::OpAsmPrinter &_odsPrinter)
Definition Ops.cpp.inc:825
FoldAdaptor::Properties Properties
Definition Ops.h.inc:548
::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:621
::mlir::TypedValue<::mlir::Type > getVal()
Definition Ops.h.inc:586
::mlir::StringAttr getConstNameAttrName()
Definition Ops.h.inc:554
::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop)
Definition Ops.cpp.inc:582
static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value)
Definition Ops.cpp.inc:610
::mlir::Operation::result_range getODSResults(unsigned index)
Definition Ops.h.inc:580
::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:559
static llvm::hash_code computePropertiesHash(const Properties &prop)
Definition Ops.cpp.inc:598
void setConstName(::llvm::StringRef attrValue)
Definition Ops.cpp.inc:647
::llvm::LogicalResult verifyInvariantsImpl()
Definition Ops.cpp.inc:772
void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect > > &effects)
Definition Ops.cpp.inc:842
::mlir::FlatSymbolRefAttr getConstNameAttr()
Definition Ops.h.inc:599
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type val, ::mlir::FlatSymbolRefAttr const_name)
Definition Ops.cpp.inc:651
static std::optional< mlir::Attribute > getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name)
Definition Ops.cpp.inc:604
static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs)
Definition Ops.cpp.inc:617
::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state)
Definition Ops.cpp.inc:630
::llvm::LogicalResult verifyInvariants()
Definition Ops.cpp.inc:790
static ConstReadOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type val, ::mlir::FlatSymbolRefAttr const_name)
Definition Ops.cpp.inc:656
::llvm::StringRef getConstName()
Definition Ops.cpp.inc:642
::llvm::LogicalResult verify(::mlir::Location loc)
Definition Ops.cpp.inc:870
TemplateExprOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:730
::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:941
static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value)
Definition Ops.cpp.inc:930
::mlir::StringAttr getSymNameAttr()
Definition Ops.h.inc:824
static std::optional< mlir::Attribute > getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name)
Definition Ops.cpp.inc:924
::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop)
Definition Ops.cpp.inc:902
static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs)
Definition Ops.cpp.inc:937
::mlir::Region & getInitializerRegion()
Definition Ops.h.inc:811
static llvm::hash_code computePropertiesHash(const Properties &prop)
Definition Ops.cpp.inc:918
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
Definition Ops.cpp.inc:1118
::llvm::LogicalResult verifyInvariantsImpl()
Definition Ops.cpp.inc:1098
::llvm::StringRef getSymName()
Definition Ops.cpp.inc:962
void setSymName(::llvm::StringRef attrValue)
Definition Ops.cpp.inc:967
void writeProperties(::mlir::DialectBytecodeWriter &writer)
Definition Ops.cpp.inc:957
::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:879
::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state)
Definition Ops.cpp.inc:950
FoldAdaptor::Properties Properties
Definition Ops.h.inc:773
static TemplateExprOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::StringAttr sym_name)
Definition Ops.cpp.inc:976
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::StringAttr sym_name)
Definition Ops.cpp.inc:971
static constexpr ::llvm::StringLiteral getOperationName()
Definition Ops.h.inc:787
::mlir::StringAttr getSymNameAttrName()
Definition Ops.h.inc:779
::llvm::LogicalResult verifyInvariants()
Definition Ops.cpp.inc:1114
void print(::mlir::OpAsmPrinter &_odsPrinter)
Definition Ops.cpp.inc:1143
TemplateOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:958
::llvm::LogicalResult verify(::mlir::Location loc)
Definition Ops.cpp.inc:1178
::mlir::Region & getBodyRegion()
Definition Ops.h.inc:1039
::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:1249
::mlir::StringAttr getSymNameAttrName()
Definition Ops.h.inc:1007
static llvm::hash_code computePropertiesHash(const Properties &prop)
Definition Ops.cpp.inc:1226
::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop)
Definition Ops.cpp.inc:1210
void writeProperties(::mlir::DialectBytecodeWriter &writer)
Definition Ops.cpp.inc:1265
void print(::mlir::OpAsmPrinter &_odsPrinter)
Definition Ops.cpp.inc:1453
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
Definition Ops.cpp.inc:1428
static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs)
Definition Ops.cpp.inc:1245
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::StringAttr sym_name)
Definition Ops.cpp.inc:1279
static std::optional< mlir::Attribute > getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name)
Definition Ops.cpp.inc:1232
FoldAdaptor::Properties Properties
Definition Ops.h.inc:1001
::mlir::StringAttr getSymNameAttr()
Definition Ops.h.inc:1052
::llvm::LogicalResult verifyInvariantsImpl()
Definition Ops.cpp.inc:1406
::llvm::LogicalResult verify()
Verify the optional transform-carried name pattern against current parameters.
Definition Ops.cpp:48
void setSymName(::llvm::StringRef attrValue)
Definition Ops.cpp.inc:1275
static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value)
Definition Ops.cpp.inc:1238
::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state)
Definition Ops.cpp.inc:1258
static constexpr ::llvm::StringLiteral getOperationName()
Definition Ops.h.inc:1015
::llvm::StringRef getSymName()
Definition Ops.cpp.inc:1270
::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:1187
::llvm::LogicalResult verifyInvariants()
Definition Ops.cpp.inc:1422
static TemplateOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::StringAttr sym_name)
Definition Ops.cpp.inc:1284
::llvm::LogicalResult verify(::mlir::Location loc)
Definition Ops.cpp.inc:1493
TemplateParamOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:1259
::llvm::LogicalResult verifyInvariants()
Definition Ops.cpp.inc:1798
::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:1600
void setSymName(::llvm::StringRef attrValue)
Definition Ops.cpp.inc:1642
::mlir::StringAttr getTypeOptAttrName()
Definition Ops.h.inc:1316
void setTypeOpt(::std::optional<::mlir::Type > attrValue)
Definition Ops.cpp.inc:1646
::mlir::TypeAttr getTypeOptAttr()
Definition Ops.h.inc:1362
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::StringAttr sym_name, ::mlir::TypeAttr type_opt)
Definition Ops.cpp.inc:1654
::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop)
Definition Ops.cpp.inc:1543
static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value)
Definition Ops.cpp.inc:1582
static TemplateParamOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::StringAttr sym_name, ::mlir::TypeAttr type_opt)
Definition Ops.cpp.inc:1661
FoldAdaptor::Properties Properties
Definition Ops.h.inc:1302
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
Definition Ops.cpp.inc:1802
void writeProperties(::mlir::DialectBytecodeWriter &writer)
Definition Ops.cpp.inc:1625
::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state)
Definition Ops.cpp.inc:1615
void print(::mlir::OpAsmPrinter &_odsPrinter)
Definition Ops.cpp.inc:1828
::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:1506
::mlir::StringAttr getSymNameAttrName()
Definition Ops.h.inc:1308
::mlir::StringAttr getSymNameAttr()
Definition Ops.h.inc:1357
static constexpr ::llvm::StringLiteral getOperationName()
Definition Ops.h.inc:1324
static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs)
Definition Ops.cpp.inc:1594
::llvm::LogicalResult verifyInvariantsImpl()
Definition Ops.cpp.inc:1785
::std::optional<::mlir::Type > getTypeOpt()
Definition Ops.cpp.inc:1637
static std::optional< mlir::Attribute > getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name)
Definition Ops.cpp.inc:1573
static llvm::hash_code computePropertiesHash(const Properties &prop)
Definition Ops.cpp.inc:1566
UnifiableCastOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:1471
::llvm::LogicalResult verify(::mlir::Location loc)
Definition Ops.cpp.inc:1862
::llvm::LogicalResult verify()
Definition Ops.cpp:285
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value input)
Definition Ops.cpp.inc:1903
void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect > > &effects)
Definition Ops.cpp.inc:2050
::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:1899
::mlir::Operation::operand_range getODSOperands(unsigned index)
Definition Ops.h.inc:1532
static constexpr ::llvm::StringLiteral getOperationName()
Definition Ops.h.inc:1524
::mlir::TypedValue<::mlir::Type > getInput()
Definition Ops.h.inc:1538
::llvm::LogicalResult verifyInvariantsImpl()
Definition Ops.cpp.inc:1979
::llvm::LogicalResult verifyInvariants()
Definition Ops.cpp.inc:2001
FoldAdaptor::Properties Properties
Definition Ops.h.inc:1519
static std::optional< mlir::Attribute > getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name)
Definition Ops.cpp.inc:1889
::mlir::Operation::result_range getODSResults(unsigned index)
Definition Ops.h.inc:1551
::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:1866
static llvm::hash_code computePropertiesHash(const Properties &prop)
Definition Ops.cpp.inc:1884
static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value)
Definition Ops.cpp.inc:1893
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
Definition Ops.cpp.inc:2007
static UnifiableCastOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value input)
Definition Ops.cpp.inc:1908
::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop)
Definition Ops.cpp.inc:1875
void print(::mlir::OpAsmPrinter &_odsPrinter)
Definition Ops.cpp.inc:2040
static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs)
Definition Ops.cpp.inc:1896
YieldOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:1637
::llvm::LogicalResult verify(::mlir::Location loc)
Definition Ops.cpp.inc:2072
::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:2076
::llvm::LogicalResult verifyInvariantsImpl()
Definition Ops.cpp.inc:2188
static llvm::hash_code computePropertiesHash(const Properties &prop)
Definition Ops.cpp.inc:2094
void print(::mlir::OpAsmPrinter &_odsPrinter)
Definition Ops.cpp.inc:2238
::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop)
Definition Ops.cpp.inc:2085
static constexpr ::llvm::StringLiteral getOperationName()
Definition Ops.h.inc:1692
::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:2109
FoldAdaptor::Properties Properties
Definition Ops.h.inc:1685
static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs)
Definition Ops.cpp.inc:2106
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
Definition Ops.cpp.inc:2205
static YieldOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value val)
Definition Ops.cpp.inc:2117
::llvm::LogicalResult verifyInvariants()
Definition Ops.cpp.inc:2201
static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value)
Definition Ops.cpp.inc:2103
::mlir::Operation::operand_range getODSOperands(unsigned index)
Definition Ops.h.inc:1700
::mlir::TypedValue<::mlir::Type > getVal()
Definition Ops.h.inc:1706
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value val)
Definition Ops.cpp.inc:2113
static std::optional< mlir::Attribute > getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name)
Definition Ops.cpp.inc:2099
ApplyMapOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:217
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize)
Definition Ops.cpp.inc:162
::std::optional<::mlir::OperationName > odsOpName
Definition Ops.h.inc:213
ConstReadOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:473
::std::optional<::mlir::OperationName > odsOpName
Definition Ops.h.inc:469
TemplateExprOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:690
::std::optional<::mlir::OperationName > odsOpName
Definition Ops.h.inc:686
TemplateOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:918
::std::optional<::mlir::OperationName > odsOpName
Definition Ops.h.inc:914
::std::optional<::mlir::OperationName > odsOpName
Definition Ops.h.inc:1217
TemplateParamOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:1221
::std::optional<::mlir::OperationName > odsOpName
Definition Ops.h.inc:1440
UnifiableCastOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:1444
YieldOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:1610
::std::optional<::mlir::OperationName > odsOpName
Definition Ops.h.inc:1606
Common interface for constant parameter-like symbol operations that can be defined within a TemplateO...
void printDimAndSymbolList(mlir::OpAsmPrinter &printer, mlir::Operation *op, mlir::OperandRange mapOperands, mlir::IntegerAttr numDims)
Definition OpHelpers.h:129
bool isValidType(Type type)
mlir::ParseResult parseDimAndSymbolList(mlir::OpAsmParser &parser, mlir::SmallVector< mlir::OpAsmParser::UnresolvedOperand, N > &mapOperands, mlir::IntegerAttr &numDims)
Definition OpHelpers.h:121
bool isValidConstReadType(Type type)
void setMap(const ::mlir::AffineMapAttr &propValue)
Definition Ops.h.inc:188
void setNumDims(const ::mlir::IntegerAttr &propValue)
Definition Ops.h.inc:198