LLZK 0.1.0
Veridise's ZK Language IR
Loading...
Searching...
No Matches
Ops.cpp.inc
Go to the documentation of this file.
1/*===- TableGen'erated file -------------------------------------*- C++ -*-===*\
2|* *|
3|* Op Definitions *|
4|* *|
5|* Automatically generated file, do not edit! *|
6|* From: Ops.td *|
7|* *|
8\*===----------------------------------------------------------------------===*/
9
10#ifdef GET_OP_LIST
11#undef GET_OP_LIST
12
16#endif // GET_OP_LIST
17
18#ifdef GET_OP_CLASSES
19#undef GET_OP_CLASSES
20
21
22//===----------------------------------------------------------------------===//
23// Local Utility Method Definitions
24//===----------------------------------------------------------------------===//
25
26namespace llzk {
27namespace polymorphic {
28
29static ::mlir::LogicalResult __mlir_ods_local_type_constraint_Ops0(
30 ::mlir::Operation *op, ::mlir::Type type, ::llvm::StringRef valueKind,
31 unsigned valueIndex) {
32 if (!((::llvm::isa<::mlir::IndexType>(type)))) {
33 return op->emitOpError(valueKind) << " #" << valueIndex
34 << " must be variadic of index, but got " << type;
35 }
36 return ::mlir::success();
37}
38
39static ::mlir::LogicalResult __mlir_ods_local_type_constraint_Ops1(
40 ::mlir::Operation *op, ::mlir::Type type, ::llvm::StringRef valueKind,
41 unsigned valueIndex) {
42 if (!((::llvm::isa<::mlir::IndexType>(type)))) {
43 return op->emitOpError(valueKind) << " #" << valueIndex
44 << " must be index, but got " << type;
45 }
46 return ::mlir::success();
47}
48
49static ::mlir::LogicalResult __mlir_ods_local_type_constraint_Ops2(
50 ::mlir::Operation *op, ::mlir::Type type, ::llvm::StringRef valueKind,
51 unsigned valueIndex) {
52 if (!((::llzk::isValidConstReadType(type)))) {
53 return op->emitOpError(valueKind) << " #" << valueIndex
54 << " must be integral, felt, or typevar type, but got " << type;
55 }
56 return ::mlir::success();
57}
58
59static ::mlir::LogicalResult __mlir_ods_local_type_constraint_Ops3(
60 ::mlir::Operation *op, ::mlir::Type type, ::llvm::StringRef valueKind,
61 unsigned valueIndex) {
62 if (!((::llzk::isValidType(type)))) {
63 return op->emitOpError(valueKind) << " #" << valueIndex
64 << " must be a valid LLZK type, but got " << type;
65 }
66 return ::mlir::success();
67}
68
69static ::mlir::LogicalResult __mlir_ods_local_attr_constraint_Ops0(
70 ::mlir::Attribute attr, ::llvm::StringRef attrName, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
71 if (attr && !((::llvm::isa<::mlir::AffineMapAttr>(attr))))
72 return emitError() << "attribute '" << attrName
73 << "' failed to satisfy constraint: AffineMap attribute";
74 return ::mlir::success();
75}
76static ::mlir::LogicalResult __mlir_ods_local_attr_constraint_Ops0(
77 ::mlir::Operation *op, ::mlir::Attribute attr, ::llvm::StringRef attrName) {
78 return __mlir_ods_local_attr_constraint_Ops0(attr, attrName, [op]() {
79 return op->emitOpError();
80 });
81}
82
83static ::mlir::LogicalResult __mlir_ods_local_attr_constraint_Ops1(
84 ::mlir::Attribute attr, ::llvm::StringRef attrName, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
85 if (attr && !(((::llvm::isa<::mlir::IntegerAttr>(attr))) && ((::llvm::isa<::mlir::IndexType>(::llvm::cast<::mlir::IntegerAttr>(attr).getType())))))
86 return emitError() << "attribute '" << attrName
87 << "' failed to satisfy constraint: index attribute";
88 return ::mlir::success();
89}
90static ::mlir::LogicalResult __mlir_ods_local_attr_constraint_Ops1(
91 ::mlir::Operation *op, ::mlir::Attribute attr, ::llvm::StringRef attrName) {
92 return __mlir_ods_local_attr_constraint_Ops1(attr, attrName, [op]() {
93 return op->emitOpError();
94 });
95}
96
97static ::mlir::LogicalResult __mlir_ods_local_attr_constraint_Ops2(
98 ::mlir::Attribute attr, ::llvm::StringRef attrName, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
99 if (attr && !((::llvm::isa<::mlir::FlatSymbolRefAttr>(attr))))
100 return emitError() << "attribute '" << attrName
101 << "' failed to satisfy constraint: flat symbol reference attribute";
102 return ::mlir::success();
103}
104static ::mlir::LogicalResult __mlir_ods_local_attr_constraint_Ops2(
105 ::mlir::Operation *op, ::mlir::Attribute attr, ::llvm::StringRef attrName) {
106 return __mlir_ods_local_attr_constraint_Ops2(attr, attrName, [op]() {
107 return op->emitOpError();
108 });
109}
110} // namespace polymorphic
111} // namespace llzk
112namespace llzk {
113namespace polymorphic {
114
115//===----------------------------------------------------------------------===//
116// ::llzk::polymorphic::ApplyMapOp definitions
117//===----------------------------------------------------------------------===//
118
119namespace detail {
120ApplyMapOpGenericAdaptorBase::ApplyMapOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs)
121 odsOpName.emplace("poly.applymap", odsAttrs.getContext());
122}
123
125
126std::pair<unsigned, unsigned> ApplyMapOpGenericAdaptorBase::getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize) {
127 bool isVariadic[] = {true};
128 int prevVariadicCount = 0;
129 for (unsigned i = 0; i < index; ++i)
130 if (isVariadic[i]) ++prevVariadicCount;
131
132 // Calculate how many dynamic values a static variadic operand corresponds to.
133 // This assumes all static variadic operands have the same dynamic value count.
134 int variadicSize = (odsOperandsSize - 0) / 1;
135 // `index` passed in as the parameter is the static index which counts each
136 // operand (variadic or not) as size 1. So here for each previous static variadic
137 // operand, we need to offset by (variadicSize - 1) to get where the dynamic
138 // value pack for this static operand starts.
139 int start = index + (variadicSize - 1) * prevVariadicCount;
140 int size = isVariadic[index] ? variadicSize : 1;
141 return {start, size};
142}
143
145 return odsAttrs;
146}
147
149 auto attr = ::llvm::cast<::mlir::AffineMapAttr>(getProperties().map);
150 return attr;
151}
152
154 auto attr = getMapAttr();
155 return attr.getValue();
156}
157
159 auto attr = ::llvm::cast<::mlir::IntegerAttr>(getProperties().numDims);
160 return attr;
161}
162
164 auto attr = getNumDimsAttr();
165 return attr.getValue();
166}
167
168} // namespace detail
170
171::mlir::LogicalResult ApplyMapOpAdaptor::verify(::mlir::Location loc) {
172 auto tblgen_map = getProperties().map; (void)tblgen_map;
173 if (!tblgen_map) return emitError(loc, "'poly.applymap' op ""requires attribute 'map'");
174 auto tblgen_numDims = getProperties().numDims; (void)tblgen_numDims;
175 if (!tblgen_numDims) return emitError(loc, "'poly.applymap' op ""requires attribute 'numDims'");
176
177 if (tblgen_map && !((::llvm::isa<::mlir::AffineMapAttr>(tblgen_map))))
178 return emitError(loc, "'poly.applymap' op ""attribute 'map' failed to satisfy constraint: AffineMap attribute");
179
180 if (tblgen_numDims && !(((::llvm::isa<::mlir::IntegerAttr>(tblgen_numDims))) && ((::llvm::isa<::mlir::IndexType>(::llvm::cast<::mlir::IntegerAttr>(tblgen_numDims).getType())))))
181 return emitError(loc, "'poly.applymap' op ""attribute 'numDims' failed to satisfy constraint: index attribute");
182 return ::mlir::success();
183}
184
185std::pair<unsigned, unsigned> ApplyMapOp::getODSOperandIndexAndLength(unsigned index) {
186 bool isVariadic[] = {true};
187 int prevVariadicCount = 0;
188 for (unsigned i = 0; i < index; ++i)
189 if (isVariadic[i]) ++prevVariadicCount;
190
191 // Calculate how many dynamic values a static variadic operand corresponds to.
192 // This assumes all static variadic operands have the same dynamic value count.
193 int variadicSize = (getOperation()->getNumOperands() - 0) / 1;
194 // `index` passed in as the parameter is the static index which counts each
195 // operand (variadic or not) as size 1. So here for each previous static variadic
196 // operand, we need to offset by (variadicSize - 1) to get where the dynamic
197 // value pack for this static operand starts.
198 int start = index + (variadicSize - 1) * prevVariadicCount;
199 int size = isVariadic[index] ? variadicSize : 1;
200 return {start, size};
201}
202
203::mlir::Operation::operand_range ApplyMapOp::getODSOperands(unsigned index) {
204 auto valueRange = getODSOperandIndexAndLength(index);
205 return {std::next(getOperation()->operand_begin(), valueRange.first),
206 std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
207}
208
209::mlir::Operation::operand_range ApplyMapOp::getMapOperands() {
210 return getODSOperands(0);
211}
212
213::mlir::MutableOperandRange ApplyMapOp::getMapOperandsMutable() {
214 auto range = getODSOperandIndexAndLength(0);
215 auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
216 return mutableRange;
217}
218
219std::pair<unsigned, unsigned> ApplyMapOp::getODSResultIndexAndLength(unsigned index) {
220 return {index, 1};
221}
222
223::mlir::Operation::result_range ApplyMapOp::getODSResults(unsigned index) {
224 auto valueRange = getODSResultIndexAndLength(index);
225 return {std::next(getOperation()->result_begin(), valueRange.first),
226 std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
227}
228
229::mlir::LogicalResult ApplyMapOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
230 ::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
231 if (!dict) {
232 emitError() << "expected DictionaryAttr to set properties";
233 return ::mlir::failure();
234 }
235
236 {
237 auto &propStorage = prop.map;
238 auto attr = dict.get("map");
239 if (attr || /*isRequired=*/true) {
240 if (!attr) {
241 emitError() << "expected key entry for map in DictionaryAttr to set "
242 "Properties.";
243 return ::mlir::failure();
244 }
245 auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
246 if (convertedAttr) {
247 propStorage = convertedAttr;
248 } else {
249 emitError() << "Invalid attribute `map` in property conversion: " << attr;
250 return ::mlir::failure();
251 }
252 }
253 }
254
255 {
256 auto &propStorage = prop.numDims;
257 auto attr = dict.get("numDims");
258 if (attr || /*isRequired=*/true) {
259 if (!attr) {
260 emitError() << "expected key entry for numDims in DictionaryAttr to set "
261 "Properties.";
262 return ::mlir::failure();
263 }
264 auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
265 if (convertedAttr) {
266 propStorage = convertedAttr;
267 } else {
268 emitError() << "Invalid attribute `numDims` in property conversion: " << attr;
269 return ::mlir::failure();
270 }
271 }
272 }
273 return ::mlir::success();
274}
275
276::mlir::Attribute ApplyMapOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
277 ::mlir::SmallVector<::mlir::NamedAttribute> attrs;
278 ::mlir::Builder odsBuilder{ctx};
279
280 {
281 const auto &propStorage = prop.map;
282 if (propStorage)
283 attrs.push_back(odsBuilder.getNamedAttr("map",
284 propStorage));
285 }
286
287 {
288 const auto &propStorage = prop.numDims;
289 if (propStorage)
290 attrs.push_back(odsBuilder.getNamedAttr("numDims",
291 propStorage));
292 }
293
294 if (!attrs.empty())
295 return odsBuilder.getDictionaryAttr(attrs);
296 return {};
297}
298
299llvm::hash_code ApplyMapOp::computePropertiesHash(const Properties &prop) {
300 return llvm::hash_combine(
301 llvm::hash_value(prop.map.getAsOpaquePointer()),
302 llvm::hash_value(prop.numDims.getAsOpaquePointer()));
303}
304
305std::optional<mlir::Attribute> ApplyMapOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
306 if (name == "map")
307 return prop.map;
308
309 if (name == "numDims")
310 return prop.numDims;
311 return std::nullopt;
312}
313
314void ApplyMapOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
315 if (name == "map") {
316 prop.map = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.map)>>(value);
317 return;
318 }
319
320 if (name == "numDims") {
321 prop.numDims = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.numDims)>>(value);
322 return;
323 }
324}
325
326void ApplyMapOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
327 if (prop.map) attrs.append("map", prop.map);
328
329 if (prop.numDims) attrs.append("numDims", prop.numDims);
330}
331
332::mlir::LogicalResult ApplyMapOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
333 {
334 ::mlir::Attribute attr = attrs.get(getMapAttrName(opName));
335 if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_Ops0(attr, "map", emitError)))
336 return ::mlir::failure();
337 }
338
339 {
340 ::mlir::Attribute attr = attrs.get(getNumDimsAttrName(opName));
341 if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_Ops1(attr, "numDims", emitError)))
342 return ::mlir::failure();
343 }
344 return ::mlir::success();
345}
346
347::mlir::LogicalResult ApplyMapOp::readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state) {
348 auto &prop = state.getOrAddProperties<Properties>(); (void)prop;
349 if (::mlir::failed(reader.readAttribute(prop.map)))
350 return ::mlir::failure();
351
352 if (::mlir::failed(reader.readAttribute(prop.numDims)))
353 return ::mlir::failure();
354 return ::mlir::success();
355}
356
357void ApplyMapOp::writeProperties(::mlir::DialectBytecodeWriter &writer) {
358 auto &prop = getProperties(); (void)prop;
359 writer.writeAttribute(prop.map);
360 writer.writeAttribute(prop.numDims);
361}
362
363::mlir::AffineMapAttr ApplyMapOp::getMapAttr() {
364 return ::llvm::cast<::mlir::AffineMapAttr>(getProperties().map);
365}
366
367::mlir::AffineMap ApplyMapOp::getMap() {
368 auto attr = getMapAttr();
369 return attr.getValue();
370}
371
372::mlir::IntegerAttr ApplyMapOp::getNumDimsAttr() {
373 return ::llvm::cast<::mlir::IntegerAttr>(getProperties().numDims);
374}
375
376::llvm::APInt ApplyMapOp::getNumDims() {
377 auto attr = getNumDimsAttr();
378 return attr.getValue();
379}
380
381void ApplyMapOp::setMapAttr(::mlir::AffineMapAttr attr) {
382 (*this)->setAttr(getMapAttrName(), attr);
383}
384
385void ApplyMapOp::setMap(::mlir::AffineMap attrValue) {
386 (*this)->setAttr(getMapAttrName(), ::mlir::AffineMapAttr::get(attrValue));
387}
388
389void ApplyMapOp::setNumDimsAttr(::mlir::IntegerAttr attr) {
390 (*this)->setAttr(getNumDimsAttrName(), attr);
391}
392
393void ApplyMapOp::setNumDims(::llvm::APInt attrValue) {
394 (*this)->setAttr(getNumDimsAttrName(), ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIndexType(), attrValue));
395}
396
397void ApplyMapOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::AffineMapAttr map, ::mlir::ValueRange mapOperands) {
398 odsState.addOperands(mapOperands);
399 Properties &props = odsState.getOrAddProperties<Properties>();
400 props.setMap(map);
401 props.setNumDims(odsBuilder.getIntegerAttr(odsBuilder.getIndexType(),
402 map.getAffineMap().getNumDims()));
403 odsState.addTypes(odsBuilder.getIndexType());
404
405}
406
407void ApplyMapOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::AffineMap map, ::mlir::ValueRange mapOperands) {
408 build(odsBuilder, odsState, ::mlir::AffineMapAttr::get(map), mapOperands);
409
410}
411
412void ApplyMapOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::AffineExpr expr, ::mlir::ValueRange mapOperands) {
413 auto map = ::mlir::AffineMap::inferFromExprList({expr}).front();
414 build(odsBuilder, odsState, map, mapOperands);
415
416}
417
418::mlir::LogicalResult ApplyMapOp::verifyInvariantsImpl() {
419 auto tblgen_map = getProperties().map; (void)tblgen_map;
420 if (!tblgen_map) return emitOpError("requires attribute 'map'");
421 auto tblgen_numDims = getProperties().numDims; (void)tblgen_numDims;
422 if (!tblgen_numDims) return emitOpError("requires attribute 'numDims'");
423
424 if (::mlir::failed(__mlir_ods_local_attr_constraint_Ops0(*this, tblgen_map, "map")))
425 return ::mlir::failure();
426
427 if (::mlir::failed(__mlir_ods_local_attr_constraint_Ops1(*this, tblgen_numDims, "numDims")))
428 return ::mlir::failure();
429 {
430 unsigned index = 0; (void)index;
431 auto valueGroup0 = getODSOperands(0);
432
433 for (auto v : valueGroup0) {
434 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops0(*this, v.getType(), "operand", index++)))
435 return ::mlir::failure();
436 }
437 }
438 {
439 unsigned index = 0; (void)index;
440 auto valueGroup0 = getODSResults(0);
441
442 for (auto v : valueGroup0) {
443 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops1(*this, v.getType(), "result", index++)))
444 return ::mlir::failure();
445 }
446 }
447 return ::mlir::success();
448}
449
450::mlir::LogicalResult ApplyMapOp::verifyInvariants() {
451 if(::mlir::succeeded(verifyInvariantsImpl()) && ::mlir::succeeded(verify()))
452 return ::mlir::success();
453 return ::mlir::failure();
454}
455
456::mlir::ParseResult ApplyMapOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
457 ::llvm::SmallVector<::mlir::OpAsmParser::UnresolvedOperand, 4> mapOperandsOperands;
458 ::llvm::SMLoc mapOperandsOperandsLoc;
459 (void)mapOperandsOperandsLoc;
460 ::mlir::IntegerAttr numDimsAttr;
461 ::mlir::AffineMapAttr mapAttr;
462 {
463 mapOperandsOperandsLoc = parser.getCurrentLocation();
464 auto odsResult = parseDimAndSymbolList(parser, mapOperandsOperands, numDimsAttr);
465 if (odsResult) return ::mlir::failure();
466 result.getOrAddProperties<ApplyMapOp::Properties>().numDims = numDimsAttr;
467 }
468
469 if (parser.parseCustomAttributeWithFallback(mapAttr, parser.getBuilder().getIndexType())) {
470 return ::mlir::failure();
471 }
472 if (mapAttr) result.getOrAddProperties<ApplyMapOp::Properties>().map = mapAttr;
473 {
474 auto loc = parser.getCurrentLocation();(void)loc;
475 if (parser.parseOptionalAttrDict(result.attributes))
476 return ::mlir::failure();
477 if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() {
478 return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op ";
479 })))
480 return ::mlir::failure();
481 }
482 ::mlir::Type odsBuildableType0 = parser.getBuilder().getIndexType();
483 result.addTypes(odsBuildableType0);
484 if (parser.resolveOperands(mapOperandsOperands, odsBuildableType0, mapOperandsOperandsLoc, result.operands))
485 return ::mlir::failure();
486 return ::mlir::success();
487}
488
489void ApplyMapOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
490 _odsPrinter << ' ';
491 printDimAndSymbolList(_odsPrinter, *this, getMapOperands(), getNumDimsAttr());
492 _odsPrinter << ' ';
493 _odsPrinter.printAttributeWithoutType(getMapAttr());
494 ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
495 elidedAttrs.push_back("numDims");
496 elidedAttrs.push_back("map");
497 _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
498}
499
500void ApplyMapOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
501}
502
503} // namespace polymorphic
504} // namespace llzk
505MLIR_DEFINE_EXPLICIT_TYPE_ID(::llzk::polymorphic::ApplyMapOp)
506
507namespace llzk {
508namespace polymorphic {
509
510//===----------------------------------------------------------------------===//
511// ::llzk::polymorphic::ConstReadOp definitions
512//===----------------------------------------------------------------------===//
513
514namespace detail {
515ConstReadOpGenericAdaptorBase::ConstReadOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs)
516 odsOpName.emplace("poly.read_const", odsAttrs.getContext());
517}
518
520
521std::pair<unsigned, unsigned> ConstReadOpGenericAdaptorBase::getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize) {
522 return {index, 1};
523}
524
526 return odsAttrs;
527}
528
530 auto attr = ::llvm::cast<::mlir::FlatSymbolRefAttr>(getProperties().const_name);
531 return attr;
532}
533
535 auto attr = getConstNameAttr();
536 return attr.getValue();
537}
538
539} // namespace detail
541
542::mlir::LogicalResult ConstReadOpAdaptor::verify(::mlir::Location loc) {
543 auto tblgen_const_name = getProperties().const_name; (void)tblgen_const_name;
544 if (!tblgen_const_name) return emitError(loc, "'poly.read_const' op ""requires attribute 'const_name'");
545
546 if (tblgen_const_name && !((::llvm::isa<::mlir::FlatSymbolRefAttr>(tblgen_const_name))))
547 return emitError(loc, "'poly.read_const' op ""attribute 'const_name' failed to satisfy constraint: flat symbol reference attribute");
548 return ::mlir::success();
549}
550
551std::pair<unsigned, unsigned> ConstReadOp::getODSOperandIndexAndLength(unsigned index) {
552 return {index, 1};
553}
554
555::mlir::Operation::operand_range ConstReadOp::getODSOperands(unsigned index) {
556 auto valueRange = getODSOperandIndexAndLength(index);
557 return {std::next(getOperation()->operand_begin(), valueRange.first),
558 std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
559}
560
561std::pair<unsigned, unsigned> ConstReadOp::getODSResultIndexAndLength(unsigned index) {
562 return {index, 1};
563}
564
565::mlir::Operation::result_range ConstReadOp::getODSResults(unsigned index) {
566 auto valueRange = getODSResultIndexAndLength(index);
567 return {std::next(getOperation()->result_begin(), valueRange.first),
568 std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
569}
570
571::mlir::Value ConstReadOp::getVal() {
572 return ::llvm::cast<::mlir::Value>(*getODSResults(0).begin());
573}
574
575::mlir::LogicalResult ConstReadOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
576 ::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
577 if (!dict) {
578 emitError() << "expected DictionaryAttr to set properties";
579 return ::mlir::failure();
580 }
581
582 {
583 auto &propStorage = prop.const_name;
584 auto attr = dict.get("const_name");
585 if (attr || /*isRequired=*/true) {
586 if (!attr) {
587 emitError() << "expected key entry for const_name in DictionaryAttr to set "
588 "Properties.";
589 return ::mlir::failure();
590 }
591 auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
592 if (convertedAttr) {
593 propStorage = convertedAttr;
594 } else {
595 emitError() << "Invalid attribute `const_name` in property conversion: " << attr;
596 return ::mlir::failure();
597 }
598 }
599 }
600 return ::mlir::success();
601}
602
603::mlir::Attribute ConstReadOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
604 ::mlir::SmallVector<::mlir::NamedAttribute> attrs;
605 ::mlir::Builder odsBuilder{ctx};
606
607 {
608 const auto &propStorage = prop.const_name;
609 if (propStorage)
610 attrs.push_back(odsBuilder.getNamedAttr("const_name",
611 propStorage));
612 }
613
614 if (!attrs.empty())
615 return odsBuilder.getDictionaryAttr(attrs);
616 return {};
617}
618
619llvm::hash_code ConstReadOp::computePropertiesHash(const Properties &prop) {
620 return llvm::hash_combine(
621 llvm::hash_value(prop.const_name.getAsOpaquePointer()));
622}
623
624std::optional<mlir::Attribute> ConstReadOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
625 if (name == "const_name")
626 return prop.const_name;
627 return std::nullopt;
628}
629
630void ConstReadOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
631 if (name == "const_name") {
632 prop.const_name = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.const_name)>>(value);
633 return;
634 }
635}
636
637void ConstReadOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
638 if (prop.const_name) attrs.append("const_name", prop.const_name);
639}
640
641::mlir::LogicalResult ConstReadOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
642 {
643 ::mlir::Attribute attr = attrs.get(getConstNameAttrName(opName));
644 if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_Ops2(attr, "const_name", emitError)))
645 return ::mlir::failure();
646 }
647 return ::mlir::success();
648}
649
650::mlir::LogicalResult ConstReadOp::readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state) {
651 auto &prop = state.getOrAddProperties<Properties>(); (void)prop;
652 if (::mlir::failed(reader.readAttribute(prop.const_name)))
653 return ::mlir::failure();
654 return ::mlir::success();
655}
656
657void ConstReadOp::writeProperties(::mlir::DialectBytecodeWriter &writer) {
658 auto &prop = getProperties(); (void)prop;
659 writer.writeAttribute(prop.const_name);
660}
661
662::mlir::FlatSymbolRefAttr ConstReadOp::getConstNameAttr() {
663 return ::llvm::cast<::mlir::FlatSymbolRefAttr>(getProperties().const_name);
664}
665
666::llvm::StringRef ConstReadOp::getConstName() {
667 auto attr = getConstNameAttr();
668 return attr.getValue();
669}
670
671void ConstReadOp::setConstNameAttr(::mlir::FlatSymbolRefAttr attr) {
672 (*this)->setAttr(getConstNameAttrName(), attr);
673}
674
675void ConstReadOp::setConstName(::llvm::StringRef attrValue) {
676 (*this)->setAttr(getConstNameAttrName(), ::mlir::SymbolRefAttr::get(::mlir::Builder((*this)->getContext()).getContext(), attrValue));
677}
678
679void ConstReadOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type val, ::mlir::FlatSymbolRefAttr const_name) {
680 odsState.getOrAddProperties<Properties>().const_name = const_name;
681 odsState.addTypes(val);
682}
683
684void ConstReadOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::FlatSymbolRefAttr const_name) {
685 odsState.getOrAddProperties<Properties>().const_name = const_name;
686 assert(resultTypes.size() == 1u && "mismatched number of results");
687 odsState.addTypes(resultTypes);
688}
689
690void ConstReadOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type val, ::llvm::StringRef const_name) {
691 odsState.getOrAddProperties<Properties>().const_name = ::mlir::SymbolRefAttr::get(odsBuilder.getContext(), const_name);
692 odsState.addTypes(val);
693}
694
695void ConstReadOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::llvm::StringRef const_name) {
696 odsState.getOrAddProperties<Properties>().const_name = ::mlir::SymbolRefAttr::get(odsBuilder.getContext(), const_name);
697 assert(resultTypes.size() == 1u && "mismatched number of results");
698 odsState.addTypes(resultTypes);
699}
700
701void ConstReadOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
702 assert(operands.size() == 0u && "mismatched number of parameters");
703 odsState.addOperands(operands);
704 odsState.addAttributes(attributes);
705 assert(resultTypes.size() == 1u && "mismatched number of return types");
706 odsState.addTypes(resultTypes);
707}
708
709::mlir::LogicalResult ConstReadOp::verifyInvariantsImpl() {
710 auto tblgen_const_name = getProperties().const_name; (void)tblgen_const_name;
711 if (!tblgen_const_name) return emitOpError("requires attribute 'const_name'");
712
713 if (::mlir::failed(__mlir_ods_local_attr_constraint_Ops2(*this, tblgen_const_name, "const_name")))
714 return ::mlir::failure();
715 {
716 unsigned index = 0; (void)index;
717 auto valueGroup0 = getODSResults(0);
718
719 for (auto v : valueGroup0) {
720 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops2(*this, v.getType(), "result", index++)))
721 return ::mlir::failure();
722 }
723 }
724 return ::mlir::success();
725}
726
727::mlir::LogicalResult ConstReadOp::verifyInvariants() {
728 return verifyInvariantsImpl();
729}
730
731::mlir::ParseResult ConstReadOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
732 ::mlir::FlatSymbolRefAttr const_nameAttr;
733 ::mlir::Type valRawTypes[1];
734 ::llvm::ArrayRef<::mlir::Type> valTypes(valRawTypes);
735
736 if (parser.parseCustomAttributeWithFallback(const_nameAttr, parser.getBuilder().getType<::mlir::NoneType>())) {
737 return ::mlir::failure();
738 }
739 if (const_nameAttr) result.getOrAddProperties<ConstReadOp::Properties>().const_name = const_nameAttr;
740 if (parser.parseColon())
741 return ::mlir::failure();
742
743 {
744 ::mlir::Type type;
745 if (parser.parseCustomTypeWithFallback(type))
746 return ::mlir::failure();
747 valRawTypes[0] = type;
748 }
749 {
750 auto loc = parser.getCurrentLocation();(void)loc;
751 if (parser.parseOptionalAttrDict(result.attributes))
752 return ::mlir::failure();
753 if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() {
754 return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op ";
755 })))
756 return ::mlir::failure();
757 }
758 result.addTypes(valTypes);
759 return ::mlir::success();
760}
761
762void ConstReadOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
763 _odsPrinter << ' ';
764 _odsPrinter.printAttributeWithoutType(getConstNameAttr());
765 _odsPrinter << ' ' << ":";
766 _odsPrinter << ' ';
767 {
768 auto type = getVal().getType();
769 if (auto validType = ::llvm::dyn_cast<::mlir::Type>(type))
770 _odsPrinter.printStrippedAttrOrType(validType);
771 else
772 _odsPrinter << type;
773 }
774 ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
775 elidedAttrs.push_back("const_name");
776 _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
777}
778
779} // namespace polymorphic
780} // namespace llzk
781MLIR_DEFINE_EXPLICIT_TYPE_ID(::llzk::polymorphic::ConstReadOp)
782
783namespace llzk {
784namespace polymorphic {
785
786//===----------------------------------------------------------------------===//
787// ::llzk::polymorphic::UnifiableCastOp definitions
788//===----------------------------------------------------------------------===//
789
790namespace detail {
791UnifiableCastOpGenericAdaptorBase::UnifiableCastOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const ::mlir::EmptyProperties &properties, ::mlir::RegionRange regions) : odsAttrs(attrs), odsRegions(regions) { if (odsAttrs)
792 odsOpName.emplace("poly.unifiable_cast", odsAttrs.getContext());
793}
794
796
797std::pair<unsigned, unsigned> UnifiableCastOpGenericAdaptorBase::getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize) {
798 return {index, 1};
799}
800
802 return odsAttrs;
803}
804
805} // namespace detail
807
808::mlir::LogicalResult UnifiableCastOpAdaptor::verify(::mlir::Location loc) {
809 return ::mlir::success();
810}
811
812std::pair<unsigned, unsigned> UnifiableCastOp::getODSOperandIndexAndLength(unsigned index) {
813 return {index, 1};
814}
815
816::mlir::Operation::operand_range UnifiableCastOp::getODSOperands(unsigned index) {
817 auto valueRange = getODSOperandIndexAndLength(index);
818 return {std::next(getOperation()->operand_begin(), valueRange.first),
819 std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
820}
821
823 return ::llvm::cast<::mlir::Value>(*getODSOperands(0).begin());
824}
825
827 auto range = getODSOperandIndexAndLength(0);
828 return getOperation()->getOpOperand(range.first);
829}
830
831std::pair<unsigned, unsigned> UnifiableCastOp::getODSResultIndexAndLength(unsigned index) {
832 return {index, 1};
833}
834
835::mlir::Operation::result_range UnifiableCastOp::getODSResults(unsigned index) {
836 auto valueRange = getODSResultIndexAndLength(index);
837 return {std::next(getOperation()->result_begin(), valueRange.first),
838 std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
839}
840
842 return ::llvm::cast<::mlir::Value>(*getODSResults(0).begin());
843}
844
845void UnifiableCastOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value input) {
846 odsState.addOperands(input);
847 odsState.addTypes(result);
848}
849
850void UnifiableCastOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input) {
851 odsState.addOperands(input);
852 assert(resultTypes.size() == 1u && "mismatched number of results");
853 odsState.addTypes(resultTypes);
854}
855
856void UnifiableCastOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
857 assert(operands.size() == 1u && "mismatched number of parameters");
858 odsState.addOperands(operands);
859 odsState.addAttributes(attributes);
860 assert(resultTypes.size() == 1u && "mismatched number of return types");
861 odsState.addTypes(resultTypes);
862}
863
865 {
866 unsigned index = 0; (void)index;
867 auto valueGroup0 = getODSOperands(0);
868
869 for (auto v : valueGroup0) {
870 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops3(*this, v.getType(), "operand", index++)))
871 return ::mlir::failure();
872 }
873 }
874 {
875 unsigned index = 0; (void)index;
876 auto valueGroup0 = getODSResults(0);
877
878 for (auto v : valueGroup0) {
879 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops3(*this, v.getType(), "result", index++)))
880 return ::mlir::failure();
881 }
882 }
883 return ::mlir::success();
884}
885
886::mlir::LogicalResult UnifiableCastOp::verifyInvariants() {
887 if(::mlir::succeeded(verifyInvariantsImpl()) && ::mlir::succeeded(verify()))
888 return ::mlir::success();
889 return ::mlir::failure();
890}
891
892::mlir::ParseResult UnifiableCastOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
893 ::mlir::OpAsmParser::UnresolvedOperand inputRawOperands[1];
894 ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> inputOperands(inputRawOperands); ::llvm::SMLoc inputOperandsLoc;
895 (void)inputOperandsLoc;
896 ::llvm::ArrayRef<::mlir::Type> inputTypes;
897 ::llvm::ArrayRef<::mlir::Type> allResultTypes;
898
899 inputOperandsLoc = parser.getCurrentLocation();
900 if (parser.parseOperand(inputRawOperands[0]))
901 return ::mlir::failure();
902 if (parser.parseColon())
903 return ::mlir::failure();
904
905 ::mlir::FunctionType input__allResult_functionType;
906 if (parser.parseType(input__allResult_functionType))
907 return ::mlir::failure();
908 inputTypes = input__allResult_functionType.getInputs();
909 allResultTypes = input__allResult_functionType.getResults();
910 {
911 auto loc = parser.getCurrentLocation();(void)loc;
912 if (parser.parseOptionalAttrDict(result.attributes))
913 return ::mlir::failure();
914 }
915 result.addTypes(allResultTypes);
916 if (parser.resolveOperands(inputOperands, inputTypes, inputOperandsLoc, result.operands))
917 return ::mlir::failure();
918 return ::mlir::success();
919}
920
921void UnifiableCastOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
922 _odsPrinter << ' ';
923 _odsPrinter << getInput();
924 _odsPrinter << ' ' << ":";
925 _odsPrinter << ' ';
926 _odsPrinter.printFunctionalType(::llvm::ArrayRef<::mlir::Type>(getInput().getType()), getOperation()->getResultTypes());
927 ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
928 _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
929}
930
931void UnifiableCastOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
932}
933
934} // namespace polymorphic
935} // namespace llzk
936MLIR_DEFINE_EXPLICIT_TYPE_ID(::llzk::polymorphic::UnifiableCastOp)
937
938
939#endif // GET_OP_CLASSES
940
::mlir::LogicalResult verify(::mlir::Location loc)
Definition Ops.cpp.inc:171
ApplyMapOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs=nullptr, const Properties &properties={}, ::mlir::RegionRange regions={})
Definition Ops.h.inc:105
::mlir::LogicalResult verifyInvariants()
Definition Ops.cpp.inc:450
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index)
Definition Ops.cpp.inc:185
::mlir::LogicalResult verify()
Definition Ops.cpp:48
void print(::mlir::OpAsmPrinter &_odsPrinter)
Definition Ops.cpp.inc:489
::mlir::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:332
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
Definition Ops.cpp.inc:456
static llvm::hash_code computePropertiesHash(const Properties &prop)
Definition Ops.cpp.inc:299
FoldAdaptor::Properties Properties
Definition Ops.h.inc:148
::mlir::Operation::result_range getODSResults(unsigned index)
Definition Ops.cpp.inc:223
::mlir::LogicalResult verifyInvariantsImpl()
Definition Ops.cpp.inc:418
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::AffineMapAttr map, ::mlir::ValueRange mapOperands={})
Definition Ops.cpp.inc:397
::mlir::StringAttr getMapAttrName()
Definition Ops.h.inc:154
::mlir::Operation::operand_range getMapOperands()
Definition Ops.cpp.inc:209
::mlir::AffineMap getMap()
Definition Ops.cpp.inc:367
::mlir::Operation::operand_range getODSOperands(unsigned index)
Definition Ops.cpp.inc:203
static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs)
Definition Ops.cpp.inc:326
::mlir::AffineMapAttr getMapAttr()
Definition Ops.cpp.inc:363
void writeProperties(::mlir::DialectBytecodeWriter &writer)
Definition Ops.cpp.inc:357
void setMap(::mlir::AffineMap attrValue)
Definition Ops.cpp.inc:385
void setNumDimsAttr(::mlir::IntegerAttr attr)
Definition Ops.cpp.inc:389
::mlir::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:229
::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop)
Definition Ops.cpp.inc:276
::mlir::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state)
Definition Ops.cpp.inc:347
::mlir::StringAttr getNumDimsAttrName()
Definition Ops.h.inc:162
::mlir::MutableOperandRange getMapOperandsMutable()
Definition Ops.cpp.inc:213
void setMapAttr(::mlir::AffineMapAttr attr)
Definition Ops.cpp.inc:381
static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value)
Definition Ops.cpp.inc:314
void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect > > &effects)
Definition Ops.cpp.inc:500
static std::optional< mlir::Attribute > getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name)
Definition Ops.cpp.inc:305
std::pair< unsigned, unsigned > getODSResultIndexAndLength(unsigned index)
Definition Ops.cpp.inc:219
::mlir::IntegerAttr getNumDimsAttr()
Definition Ops.cpp.inc:372
void setNumDims(::llvm::APInt attrValue)
Definition Ops.cpp.inc:393
::mlir::LogicalResult verify(::mlir::Location loc)
Definition Ops.cpp.inc:542
ConstReadOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs=nullptr, const Properties &properties={}, ::mlir::RegionRange regions={})
Definition Ops.h.inc:301
void writeProperties(::mlir::DialectBytecodeWriter &writer)
Definition Ops.cpp.inc:657
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index)
Definition Ops.cpp.inc:551
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
Definition Ops.cpp.inc:731
::mlir::FlatSymbolRefAttr getConstNameAttr()
Definition Ops.cpp.inc:662
void print(::mlir::OpAsmPrinter &_odsPrinter)
Definition Ops.cpp.inc:762
FoldAdaptor::Properties Properties
Definition Ops.h.inc:340
::mlir::LogicalResult verifyInvariantsImpl()
Definition Ops.cpp.inc:709
::mlir::StringAttr getConstNameAttrName()
Definition Ops.h.inc:346
::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop)
Definition Ops.cpp.inc:603
static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value)
Definition Ops.cpp.inc:630
::mlir::Operation::operand_range getODSOperands(unsigned index)
Definition Ops.cpp.inc:555
static llvm::hash_code computePropertiesHash(const Properties &prop)
Definition Ops.cpp.inc:619
std::pair< unsigned, unsigned > getODSResultIndexAndLength(unsigned index)
Definition Ops.cpp.inc:561
void setConstName(::llvm::StringRef attrValue)
Definition Ops.cpp.inc:675
::mlir::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:575
void setConstNameAttr(::mlir::FlatSymbolRefAttr attr)
Definition Ops.cpp.inc:671
::mlir::LogicalResult verifyInvariants()
Definition Ops.cpp.inc:727
::mlir::Operation::result_range getODSResults(unsigned index)
Definition Ops.cpp.inc:565
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type val, ::mlir::FlatSymbolRefAttr const_name)
Definition Ops.cpp.inc:679
static std::optional< mlir::Attribute > getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name)
Definition Ops.cpp.inc:624
static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs)
Definition Ops.cpp.inc:637
::mlir::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state)
Definition Ops.cpp.inc:650
::mlir::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:641
::llvm::StringRef getConstName()
Definition Ops.cpp.inc:666
UnifiableCastOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs=nullptr, const ::mlir::EmptyProperties &properties={}, ::mlir::RegionRange regions={})
Definition Ops.h.inc:433
::mlir::LogicalResult verify(::mlir::Location loc)
Definition Ops.cpp.inc:808
::mlir::LogicalResult verify()
Definition Ops.cpp:72
std::pair< unsigned, unsigned > getODSResultIndexAndLength(unsigned index)
Definition Ops.cpp.inc:831
::mlir::LogicalResult verifyInvariantsImpl()
Definition Ops.cpp.inc:864
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value input)
Definition Ops.cpp.inc:845
void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect > > &effects)
Definition Ops.cpp.inc:931
::mlir::OpOperand & getInputMutable()
Definition Ops.cpp.inc:826
::mlir::Operation::operand_range getODSOperands(unsigned index)
Definition Ops.cpp.inc:816
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index)
Definition Ops.cpp.inc:812
::mlir::LogicalResult verifyInvariants()
Definition Ops.cpp.inc:886
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
Definition Ops.cpp.inc:892
::mlir::Operation::result_range getODSResults(unsigned index)
Definition Ops.cpp.inc:835
void print(::mlir::OpAsmPrinter &_odsPrinter)
Definition Ops.cpp.inc:921
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize)
Definition Ops.cpp.inc:126
ApplyMapOpGenericAdaptorBase(::mlir::DictionaryAttr attrs=nullptr, const Properties &properties={}, ::mlir::RegionRange regions={})
Definition Ops.cpp.inc:120
::std::optional<::mlir::OperationName > odsOpName
Definition Ops.h.inc:80
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize)
Definition Ops.cpp.inc:521
ConstReadOpGenericAdaptorBase(::mlir::DictionaryAttr attrs=nullptr, const Properties &properties={}, ::mlir::RegionRange regions={})
Definition Ops.cpp.inc:515
::std::optional<::mlir::OperationName > odsOpName
Definition Ops.h.inc:278
::std::optional<::mlir::OperationName > odsOpName
Definition Ops.h.inc:417
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize)
Definition Ops.cpp.inc:797
UnifiableCastOpGenericAdaptorBase(::mlir::DictionaryAttr attrs=nullptr, const ::mlir::EmptyProperties &properties={}, ::mlir::RegionRange regions={})
Definition Ops.cpp.inc:791
void printDimAndSymbolList(mlir::OpAsmPrinter &printer, mlir::Operation *op, mlir::OperandRange mapOperands, mlir::IntegerAttr numDims)
Definition OpHelpers.h:87
bool isValidType(Type type)
mlir::ParseResult parseDimAndSymbolList(mlir::OpAsmParser &parser, mlir::SmallVector< mlir::OpAsmParser::UnresolvedOperand, N > &mapOperands, mlir::IntegerAttr &numDims)
Definition OpHelpers.h:79
bool isValidConstReadType(Type type)
void setMap(const ::mlir::AffineMapAttr &propValue)
Definition Ops.h.inc:55
void setNumDims(const ::mlir::IntegerAttr &propValue)
Definition Ops.h.inc:65