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
31#endif // GET_OP_LIST
32
33#ifdef GET_OP_CLASSES
34#undef GET_OP_CLASSES
35
36
37//===----------------------------------------------------------------------===//
38// Local Utility Method Definitions
39//===----------------------------------------------------------------------===//
40
41namespace llzk {
42namespace verif {
43
44static ::llvm::LogicalResult __mlir_ods_local_type_constraint_Ops1(
45 ::mlir::Operation *op, ::mlir::Type type, ::llvm::StringRef valueKind,
46 unsigned valueIndex) {
47 if (!((::llzk::isValidEmitEqType(type)))) {
48 return op->emitOpError(valueKind) << " #" << valueIndex
49 << " must be any LLZK type, excluding struct and string types, but got " << type;
50 }
51 return ::mlir::success();
52}
53
54static ::llvm::LogicalResult __mlir_ods_local_type_constraint_Ops2(
55 ::mlir::Operation *op, ::mlir::Type type, ::llvm::StringRef valueKind,
56 unsigned valueIndex) {
57 if (!((::llvm::isa<::llzk::felt::FeltType>(type)))) {
58 return op->emitOpError(valueKind) << " #" << valueIndex
59 << " must be finite field element, but got " << type;
60 }
61 return ::mlir::success();
62}
63
64static ::llvm::LogicalResult __mlir_ods_local_type_constraint_Ops3(
65 ::mlir::Operation *op, ::mlir::Type type, ::llvm::StringRef valueKind,
66 unsigned valueIndex) {
67 if (!((type.isSignlessInteger(1)))) {
68 return op->emitOpError(valueKind) << " #" << valueIndex
69 << " must be 1-bit signless integer, but got " << type;
70 }
71 return ::mlir::success();
72}
73
74static ::llvm::LogicalResult __mlir_ods_local_type_constraint_Ops4(
75 ::mlir::Operation *op, ::mlir::Type type, ::llvm::StringRef valueKind,
76 unsigned valueIndex) {
77 if (!((::llzk::isValidType(type)))) {
78 return op->emitOpError(valueKind) << " #" << valueIndex
79 << " must be variadic of a valid LLZK type, but got " << type;
80 }
81 return ::mlir::success();
82}
83
84static ::llvm::LogicalResult __mlir_ods_local_type_constraint_Ops5(
85 ::mlir::Operation *op, ::mlir::Type type, ::llvm::StringRef valueKind,
86 unsigned valueIndex) {
87 if (!((::llvm::isa<::mlir::IndexType>(type)))) {
88 return op->emitOpError(valueKind) << " #" << valueIndex
89 << " must be variadic of index, but got " << type;
90 }
91 return ::mlir::success();
92}
93
94static ::llvm::LogicalResult __mlir_ods_local_type_constraint_Ops6(
95 ::mlir::Operation *op, ::mlir::Type type, ::llvm::StringRef valueKind,
96 unsigned valueIndex) {
97 if (!((::llzk::isValidType(type)))) {
98 return op->emitOpError(valueKind) << " #" << valueIndex
99 << " must be a valid LLZK type, but got " << type;
100 }
101 return ::mlir::success();
102}
103
104static ::llvm::LogicalResult __mlir_ods_local_type_constraint_Ops7(
105 ::mlir::Operation *op, ::mlir::Type type, ::llvm::StringRef valueKind,
106 unsigned valueIndex) {
107 if (!((::llvm::isa<::llzk::smt::BoolType>(type)))) {
108 return op->emitOpError(valueKind) << " #" << valueIndex
109 << " must be , but got " << type;
110 }
111 return ::mlir::success();
112}
113
114static ::llvm::LogicalResult __mlir_ods_local_attr_constraint_Ops1(
115 ::mlir::Attribute attr, ::llvm::StringRef attrName, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
116 if (attr && !((::llvm::isa<::mlir::StringAttr>(attr))))
117 return emitError() << "attribute '" << attrName
118 << "' failed to satisfy constraint: string attribute";
119 return ::mlir::success();
120}
121static ::llvm::LogicalResult __mlir_ods_local_attr_constraint_Ops1(
122 ::mlir::Operation *op, ::mlir::Attribute attr, ::llvm::StringRef attrName) {
123 return __mlir_ods_local_attr_constraint_Ops1(attr, attrName, [op]() {
124 return op->emitOpError();
125 });
126}
127
128static ::llvm::LogicalResult __mlir_ods_local_attr_constraint_Ops2(
129 ::mlir::Attribute attr, ::llvm::StringRef attrName, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
130 if (attr && !((::llvm::isa<::mlir::SymbolRefAttr>(attr))))
131 return emitError() << "attribute '" << attrName
132 << "' failed to satisfy constraint: symbol reference attribute";
133 return ::mlir::success();
134}
135static ::llvm::LogicalResult __mlir_ods_local_attr_constraint_Ops2(
136 ::mlir::Operation *op, ::mlir::Attribute attr, ::llvm::StringRef attrName) {
137 return __mlir_ods_local_attr_constraint_Ops2(attr, attrName, [op]() {
138 return op->emitOpError();
139 });
140}
141
142static ::llvm::LogicalResult __mlir_ods_local_attr_constraint_Ops3(
143 ::mlir::Attribute attr, ::llvm::StringRef attrName, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
144 if (attr && !(((::llvm::isa<::mlir::TypeAttr>(attr))) && ((::llvm::isa<::mlir::FunctionType>(::llvm::cast<::mlir::TypeAttr>(attr).getValue()))) && ((::llvm::isa<::mlir::FunctionType>(::llvm::cast<::mlir::TypeAttr>(attr).getValue())))))
145 return emitError() << "attribute '" << attrName
146 << "' failed to satisfy constraint: type attribute of function type";
147 return ::mlir::success();
148}
149static ::llvm::LogicalResult __mlir_ods_local_attr_constraint_Ops3(
150 ::mlir::Operation *op, ::mlir::Attribute attr, ::llvm::StringRef attrName) {
151 return __mlir_ods_local_attr_constraint_Ops3(attr, attrName, [op]() {
152 return op->emitOpError();
153 });
154}
155
156static ::llvm::LogicalResult __mlir_ods_local_attr_constraint_Ops4(
157 ::mlir::Attribute attr, ::llvm::StringRef attrName, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
158 if (attr && !(((::llvm::isa<::mlir::ArrayAttr>(attr))) && (::llvm::all_of(::llvm::cast<::mlir::ArrayAttr>(attr), [&](::mlir::Attribute attr) { return attr && ((::llvm::isa<::mlir::DictionaryAttr>(attr))); }))))
159 return emitError() << "attribute '" << attrName
160 << "' failed to satisfy constraint: Array of dictionary attributes";
161 return ::mlir::success();
162}
163static ::llvm::LogicalResult __mlir_ods_local_attr_constraint_Ops4(
164 ::mlir::Operation *op, ::mlir::Attribute attr, ::llvm::StringRef attrName) {
165 return __mlir_ods_local_attr_constraint_Ops4(attr, attrName, [op]() {
166 return op->emitOpError();
167 });
168}
169
170static ::llvm::LogicalResult __mlir_ods_local_attr_constraint_Ops5(
171 ::mlir::Attribute attr, ::llvm::StringRef attrName, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
172 if (attr && !((::llvm::isa<::mlir::ArrayAttr>(attr))))
173 return emitError() << "attribute '" << attrName
174 << "' failed to satisfy constraint: array attribute";
175 return ::mlir::success();
176}
177static ::llvm::LogicalResult __mlir_ods_local_attr_constraint_Ops5(
178 ::mlir::Operation *op, ::mlir::Attribute attr, ::llvm::StringRef attrName) {
179 return __mlir_ods_local_attr_constraint_Ops5(attr, attrName, [op]() {
180 return op->emitOpError();
181 });
182}
183
184static ::llvm::LogicalResult __mlir_ods_local_attr_constraint_Ops6(
185 ::mlir::Attribute attr, ::llvm::StringRef attrName, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
186 if (attr && !((::llvm::isa<::mlir::DenseI32ArrayAttr>(attr))))
187 return emitError() << "attribute '" << attrName
188 << "' failed to satisfy constraint: i32 dense array attribute";
189 return ::mlir::success();
190}
191static ::llvm::LogicalResult __mlir_ods_local_attr_constraint_Ops6(
192 ::mlir::Operation *op, ::mlir::Attribute attr, ::llvm::StringRef attrName) {
193 return __mlir_ods_local_attr_constraint_Ops6(attr, attrName, [op]() {
194 return op->emitOpError();
195 });
196}
197
198static ::llvm::LogicalResult __mlir_ods_local_attr_constraint_Ops7(
199 ::mlir::Attribute attr, ::llvm::StringRef attrName, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
200 if (attr && !(((::llvm::isa<::mlir::ArrayAttr>(attr))) && (::llvm::all_of(::llvm::cast<::mlir::ArrayAttr>(attr), [&](::mlir::Attribute attr) { return attr && (((::llvm::isa<::mlir::TypeAttr>(attr))) && ((::llvm::isa<::mlir::Type>(::llvm::cast<::mlir::TypeAttr>(attr).getValue()))) && ((true))); }))))
201 return emitError() << "attribute '" << attrName
202 << "' failed to satisfy constraint: type array attribute";
203 return ::mlir::success();
204}
205static ::llvm::LogicalResult __mlir_ods_local_attr_constraint_Ops7(
206 ::mlir::Operation *op, ::mlir::Attribute attr, ::llvm::StringRef attrName) {
207 return __mlir_ods_local_attr_constraint_Ops7(attr, attrName, [op]() {
208 return op->emitOpError();
209 });
210}
211
212static ::llvm::LogicalResult __mlir_ods_local_region_constraint_Ops1(
213 ::mlir::Operation *op, ::mlir::Region &region, ::llvm::StringRef regionName,
214 unsigned regionIndex) {
215 if (!((true))) {
216 return op->emitOpError("region #") << regionIndex
217 << (regionName.empty() ? " " : " ('" + regionName + "') ")
218 << "failed to verify constraint: any region";
219 }
220 return ::mlir::success();
221}
222
223static ::llvm::LogicalResult __mlir_ods_local_region_constraint_Ops2(
224 ::mlir::Operation *op, ::mlir::Region &region, ::llvm::StringRef regionName,
225 unsigned regionIndex) {
226 if (!((::llvm::hasNItems(region, 1)))) {
227 return op->emitOpError("region #") << regionIndex
228 << (regionName.empty() ? " " : " ('" + regionName + "') ")
229 << "failed to verify constraint: region with 1 blocks";
230 }
231 return ::mlir::success();
232}
233} // namespace verif
234} // namespace llzk
235namespace llzk {
236namespace verif {
237
238//===----------------------------------------------------------------------===//
239// ::llzk::verif::AssumeDetOp definitions
240//===----------------------------------------------------------------------===//
241
242namespace detail {
243} // namespace detail
245
246::llvm::LogicalResult AssumeDetOpAdaptor::verify(::mlir::Location loc) {
247 return ::mlir::success();
248}
249
250void AssumeDetOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value hint) {
251 odsState.addOperands(hint);
252}
253
254void AssumeDetOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value hint) {
255 odsState.addOperands(hint);
256 assert(resultTypes.size() == 0u && "mismatched number of results");
257 odsState.addTypes(resultTypes);
258}
259
260void AssumeDetOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
261 assert(operands.size() == 1u && "mismatched number of parameters");
262 odsState.addOperands(operands);
263 odsState.addAttributes(attributes);
264 assert(resultTypes.size() == 0u && "mismatched number of return types");
265 odsState.addTypes(resultTypes);
266}
267
268::llvm::LogicalResult AssumeDetOp::verifyInvariantsImpl() {
269 {
270 unsigned index = 0; (void)index;
271 auto valueGroup0 = getODSOperands(0);
272
273 for (auto v : valueGroup0) {
274 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops1(*this, v.getType(), "operand", index++)))
275 return ::mlir::failure();
276 }
277 }
278 return ::mlir::success();
279}
280
281::llvm::LogicalResult AssumeDetOp::verifyInvariants() {
282 return verifyInvariantsImpl();
283}
284
285::mlir::ParseResult AssumeDetOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
286 ::mlir::OpAsmParser::UnresolvedOperand hintRawOperand{};
287 ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> hintOperands(&hintRawOperand, 1); ::llvm::SMLoc hintOperandsLoc;
288 (void)hintOperandsLoc;
289 ::mlir::Type hintRawType{};
290 ::llvm::ArrayRef<::mlir::Type> hintTypes(&hintRawType, 1);
291
292 hintOperandsLoc = parser.getCurrentLocation();
293 if (parser.parseOperand(hintRawOperand))
294 return ::mlir::failure();
295 {
296 auto loc = parser.getCurrentLocation();(void)loc;
297 if (parser.parseOptionalAttrDict(result.attributes))
298 return ::mlir::failure();
299 }
300 if (parser.parseColon())
301 return ::mlir::failure();
302
303 {
304 ::mlir::Type type;
305 if (parser.parseCustomTypeWithFallback(type))
306 return ::mlir::failure();
307 hintRawType = type;
308 }
309 if (parser.resolveOperands(hintOperands, hintTypes, hintOperandsLoc, result.operands))
310 return ::mlir::failure();
311 return ::mlir::success();
312}
313
314void AssumeDetOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
315 _odsPrinter << ' ';
316 _odsPrinter << getHint();
317 ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
318 _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
319 _odsPrinter << ' ' << ":";
320 _odsPrinter << ' ';
321 {
322 auto type = getHint().getType();
323 if (auto validType = ::llvm::dyn_cast<::mlir::Type>(type))
324 _odsPrinter.printStrippedAttrOrType(validType);
325 else
326 _odsPrinter << type;
327 }
328}
329
330// This side effect models "program termination". Based on
331// https://github.com/llvm/llvm-project/blob/f325e4b2d836d6e65a4d0cf3efc6b0996ccf3765/mlir/lib/Dialect/ControlFlow/IR/ControlFlowOps.cpp#L92-L97
332static void getEffects(
333 ::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects
334) {
335 effects.emplace_back(::mlir::MemoryEffects::Write::get());
336}
337} // namespace verif
338} // namespace llzk
339MLIR_DEFINE_EXPLICIT_TYPE_ID(::llzk::verif::AssumeDetOp)
340
341namespace llzk {
342namespace verif {
343
344//===----------------------------------------------------------------------===//
345// ::llzk::verif::ContractEndOp definitions
346//===----------------------------------------------------------------------===//
347
348namespace detail {
349} // namespace detail
351
352::llvm::LogicalResult ContractEndOpAdaptor::verify(::mlir::Location loc) {
353 return ::mlir::success();
354}
355
356void ContractEndOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState) {
357}
358
359void ContractEndOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes) {
360 assert(resultTypes.size() == 0u && "mismatched number of results");
361 odsState.addTypes(resultTypes);
362}
363
364void ContractEndOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
365 assert(operands.size() == 0u && "mismatched number of parameters");
366 odsState.addOperands(operands);
367 odsState.addAttributes(attributes);
368 assert(resultTypes.size() == 0u && "mismatched number of return types");
369 odsState.addTypes(resultTypes);
370}
371
372::llvm::LogicalResult ContractEndOp::verifyInvariantsImpl() {
373 return ::mlir::success();
374}
375
376::llvm::LogicalResult ContractEndOp::verifyInvariants() {
377 return verifyInvariantsImpl();
378}
379
380::mlir::ParseResult ContractEndOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
381 {
382 auto loc = parser.getCurrentLocation();(void)loc;
383 if (parser.parseOptionalAttrDict(result.attributes))
384 return ::mlir::failure();
385 }
386 return ::mlir::success();
387}
388
389void ContractEndOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
390 ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
391 _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
392}
393
394void ContractEndOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
395}
396
397} // namespace verif
398} // namespace llzk
399MLIR_DEFINE_EXPLICIT_TYPE_ID(::llzk::verif::ContractEndOp)
400
401namespace llzk {
402namespace verif {
403
404//===----------------------------------------------------------------------===//
405// ::llzk::verif::ContractOp definitions
406//===----------------------------------------------------------------------===//
407
408namespace detail {
410
412 auto attr = getSymNameAttr();
413 return attr.getValue();
414}
415
417 auto attr = getTargetAttr();
418 return attr;
419}
420
422 auto attr = getFunctionTypeAttr();
423 return ::llvm::cast<::mlir::FunctionType>(attr.getValue());
424}
425
426::std::optional< ::mlir::ArrayAttr > ContractOpGenericAdaptorBase::getArgAttrs() {
427 auto attr = getArgAttrsAttr();
428 return attr ? ::std::optional< ::mlir::ArrayAttr >(attr) : (::std::nullopt);
429}
430
431} // namespace detail
433
434::llvm::LogicalResult ContractOpAdaptor::verify(::mlir::Location loc) {
435 auto tblgen_arg_attrs = getProperties().arg_attrs; (void)tblgen_arg_attrs;
436 auto tblgen_function_type = getProperties().function_type; (void)tblgen_function_type;
437 if (!tblgen_function_type) return emitError(loc, "'verif.contract' op ""requires attribute 'function_type'");
438 auto tblgen_sym_name = getProperties().sym_name; (void)tblgen_sym_name;
439 if (!tblgen_sym_name) return emitError(loc, "'verif.contract' op ""requires attribute 'sym_name'");
440 auto tblgen_target = getProperties().target; (void)tblgen_target;
441 if (!tblgen_target) return emitError(loc, "'verif.contract' op ""requires attribute 'target'");
442
443 if (tblgen_sym_name && !((::llvm::isa<::mlir::StringAttr>(tblgen_sym_name))))
444 return emitError(loc, "'verif.contract' op ""attribute 'sym_name' failed to satisfy constraint: string attribute");
445
446 if (tblgen_target && !((::llvm::isa<::mlir::SymbolRefAttr>(tblgen_target))))
447 return emitError(loc, "'verif.contract' op ""attribute 'target' failed to satisfy constraint: symbol reference attribute");
448
449 if (tblgen_function_type && !(((::llvm::isa<::mlir::TypeAttr>(tblgen_function_type))) && ((::llvm::isa<::mlir::FunctionType>(::llvm::cast<::mlir::TypeAttr>(tblgen_function_type).getValue()))) && ((::llvm::isa<::mlir::FunctionType>(::llvm::cast<::mlir::TypeAttr>(tblgen_function_type).getValue())))))
450 return emitError(loc, "'verif.contract' op ""attribute 'function_type' failed to satisfy constraint: type attribute of function type");
451
452 if (tblgen_arg_attrs && !(((::llvm::isa<::mlir::ArrayAttr>(tblgen_arg_attrs))) && (::llvm::all_of(::llvm::cast<::mlir::ArrayAttr>(tblgen_arg_attrs), [&](::mlir::Attribute attr) { return attr && ((::llvm::isa<::mlir::DictionaryAttr>(attr))); }))))
453 return emitError(loc, "'verif.contract' op ""attribute 'arg_attrs' failed to satisfy constraint: Array of dictionary attributes");
454 return ::mlir::success();
455}
456
457::llvm::LogicalResult ContractOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
458 ::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
459 if (!dict) {
460 emitError() << "expected DictionaryAttr to set properties";
461 return ::mlir::failure();
462 }
463
464 {
465 auto &propStorage = prop.arg_attrs;
466 auto attr = dict.get("arg_attrs");
467 if (attr) {
468 auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
469 if (convertedAttr) {
470 propStorage = convertedAttr;
471 } else {
472 emitError() << "Invalid attribute `arg_attrs` in property conversion: " << attr;
473 return ::mlir::failure();
474 }
475 }
476 }
477
478 {
479 auto &propStorage = prop.function_type;
480 auto attr = dict.get("function_type");
481 if (attr) {
482 auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
483 if (convertedAttr) {
484 propStorage = convertedAttr;
485 } else {
486 emitError() << "Invalid attribute `function_type` in property conversion: " << attr;
487 return ::mlir::failure();
488 }
489 }
490 }
491
492 {
493 auto &propStorage = prop.sym_name;
494 auto attr = dict.get("sym_name");
495 if (attr) {
496 auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
497 if (convertedAttr) {
498 propStorage = convertedAttr;
499 } else {
500 emitError() << "Invalid attribute `sym_name` in property conversion: " << attr;
501 return ::mlir::failure();
502 }
503 }
504 }
505
506 {
507 auto &propStorage = prop.target;
508 auto attr = dict.get("target");
509 if (attr) {
510 auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
511 if (convertedAttr) {
512 propStorage = convertedAttr;
513 } else {
514 emitError() << "Invalid attribute `target` in property conversion: " << attr;
515 return ::mlir::failure();
516 }
517 }
518 }
519 return ::mlir::success();
520}
521
522::mlir::Attribute ContractOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
523 ::mlir::SmallVector<::mlir::NamedAttribute> attrs;
524 ::mlir::Builder odsBuilder{ctx};
525
526 {
527 const auto &propStorage = prop.arg_attrs;
528 if (propStorage)
529 attrs.push_back(odsBuilder.getNamedAttr("arg_attrs",
530 propStorage));
531 }
532
533 {
534 const auto &propStorage = prop.function_type;
535 if (propStorage)
536 attrs.push_back(odsBuilder.getNamedAttr("function_type",
537 propStorage));
538 }
539
540 {
541 const auto &propStorage = prop.sym_name;
542 if (propStorage)
543 attrs.push_back(odsBuilder.getNamedAttr("sym_name",
544 propStorage));
545 }
546
547 {
548 const auto &propStorage = prop.target;
549 if (propStorage)
550 attrs.push_back(odsBuilder.getNamedAttr("target",
551 propStorage));
552 }
553
554 if (!attrs.empty())
555 return odsBuilder.getDictionaryAttr(attrs);
556 return {};
557}
558
559llvm::hash_code ContractOp::computePropertiesHash(const Properties &prop) {
560 return llvm::hash_combine(
561 llvm::hash_value(prop.arg_attrs.getAsOpaquePointer()),
562 llvm::hash_value(prop.function_type.getAsOpaquePointer()),
563 llvm::hash_value(prop.sym_name.getAsOpaquePointer()),
564 llvm::hash_value(prop.target.getAsOpaquePointer()));
565}
566
567std::optional<mlir::Attribute> ContractOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
568 if (name == "arg_attrs")
569 return prop.arg_attrs;
570
571 if (name == "function_type")
572 return prop.function_type;
573
574 if (name == "sym_name")
575 return prop.sym_name;
576
577 if (name == "target")
578 return prop.target;
579 return std::nullopt;
580}
581
582void ContractOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
583 if (name == "arg_attrs") {
584 prop.arg_attrs = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.arg_attrs)>>(value);
585 return;
586 }
587
588 if (name == "function_type") {
589 prop.function_type = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.function_type)>>(value);
590 return;
591 }
592
593 if (name == "sym_name") {
594 prop.sym_name = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.sym_name)>>(value);
595 return;
596 }
597
598 if (name == "target") {
599 prop.target = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.target)>>(value);
600 return;
601 }
602}
603
604void ContractOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
605 if (prop.arg_attrs) attrs.append("arg_attrs", prop.arg_attrs);
606
607 if (prop.function_type) attrs.append("function_type", prop.function_type);
608
609 if (prop.sym_name) attrs.append("sym_name", prop.sym_name);
610
611 if (prop.target) attrs.append("target", prop.target);
612}
613
614::llvm::LogicalResult ContractOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
615 {
616 ::mlir::Attribute attr = attrs.get(getArgAttrsAttrName(opName));
617 if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_Ops4(attr, "arg_attrs", emitError)))
618 return ::mlir::failure();
619 }
620
621 {
622 ::mlir::Attribute attr = attrs.get(getFunctionTypeAttrName(opName));
623 if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_Ops3(attr, "function_type", emitError)))
624 return ::mlir::failure();
625 }
626
627 {
628 ::mlir::Attribute attr = attrs.get(getSymNameAttrName(opName));
629 if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_Ops1(attr, "sym_name", emitError)))
630 return ::mlir::failure();
631 }
632
633 {
634 ::mlir::Attribute attr = attrs.get(getTargetAttrName(opName));
635 if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_Ops2(attr, "target", emitError)))
636 return ::mlir::failure();
637 }
638 return ::mlir::success();
639}
640
641::llvm::LogicalResult ContractOp::readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state) {
642 auto &prop = state.getOrAddProperties<Properties>(); (void)prop;
643 if (::mlir::failed(reader.readOptionalAttribute(prop.arg_attrs)))
644 return ::mlir::failure();
645
646 if (::mlir::failed(reader.readAttribute(prop.function_type)))
647 return ::mlir::failure();
648
649 if (::mlir::failed(reader.readAttribute(prop.sym_name)))
650 return ::mlir::failure();
651
652 if (::mlir::failed(reader.readAttribute(prop.target)))
653 return ::mlir::failure();
654 return ::mlir::success();
655}
656
657void ContractOp::writeProperties(::mlir::DialectBytecodeWriter &writer) {
658 auto &prop = getProperties(); (void)prop;
659
660 writer.writeOptionalAttribute(prop.arg_attrs);
661 writer.writeAttribute(prop.function_type);
662 writer.writeAttribute(prop.sym_name);
663 writer.writeAttribute(prop.target);
664}
665
666::llvm::StringRef ContractOp::getSymName() {
667 auto attr = getSymNameAttr();
668 return attr.getValue();
669}
670
671::mlir::SymbolRefAttr ContractOp::getTarget() {
672 auto attr = getTargetAttr();
673 return attr;
674}
675
676::mlir::FunctionType ContractOp::getFunctionType() {
677 auto attr = getFunctionTypeAttr();
678 return ::llvm::cast<::mlir::FunctionType>(attr.getValue());
679}
680
681::std::optional< ::mlir::ArrayAttr > ContractOp::getArgAttrs() {
682 auto attr = getArgAttrsAttr();
683 return attr ? ::std::optional< ::mlir::ArrayAttr >(attr) : (::std::nullopt);
684}
685
686void ContractOp::setSymName(::llvm::StringRef attrValue) {
687 getProperties().sym_name = ::mlir::Builder((*this)->getContext()).getStringAttr(attrValue);
688}
689
690void ContractOp::setFunctionType(::mlir::FunctionType attrValue) {
691 getProperties().function_type = ::mlir::TypeAttr::get(attrValue);
692}
693
694void ContractOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::StringAttr sym_name, ::mlir::SymbolRefAttr target, ::mlir::TypeAttr function_type, ::mlir::ArrayAttr arg_attrs) {
695 build(odsBuilder, odsState, ::mlir::TypeRange {}, sym_name, target, function_type, arg_attrs);
696
697}
698
699void ContractOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::StringAttr sym_name, ::mlir::SymbolRefAttr target, ::mlir::TypeAttr function_type, ::mlir::ArrayAttr arg_attrs) {
700 odsState.getOrAddProperties<Properties>().sym_name = sym_name;
701 odsState.getOrAddProperties<Properties>().target = target;
702 odsState.getOrAddProperties<Properties>().function_type = function_type;
703 if (arg_attrs) {
704 odsState.getOrAddProperties<Properties>().arg_attrs = arg_attrs;
705 }
706 initializeEmptyBody(
707 odsBuilder, odsState, ::llvm::cast<::mlir::FunctionType>(function_type.getValue())
708 );
709 assert(resultTypes.size() == 0u && "mismatched number of results");
710 odsState.addTypes(resultTypes);
711
712}
713
714void ContractOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::llvm::StringRef sym_name, ::mlir::SymbolRefAttr target, ::mlir::FunctionType function_type, ::mlir::ArrayAttr arg_attrs) {
715 build(odsBuilder, odsState, ::mlir::TypeRange {}, sym_name, target, function_type, arg_attrs);
716
717}
718
719void ContractOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::llvm::StringRef sym_name, ::mlir::SymbolRefAttr target, ::mlir::FunctionType function_type, ::mlir::ArrayAttr arg_attrs) {
720 odsState.getOrAddProperties<Properties>().sym_name = odsBuilder.getStringAttr(sym_name);
721 odsState.getOrAddProperties<Properties>().target = target;
722 odsState.getOrAddProperties<Properties>().function_type = ::mlir::TypeAttr::get(function_type);
723 if (arg_attrs) {
724 odsState.getOrAddProperties<Properties>().arg_attrs = arg_attrs;
725 }
726 initializeEmptyBody(odsBuilder, odsState, function_type);
727 assert(resultTypes.size() == 0u && "mismatched number of results");
728 odsState.addTypes(resultTypes);
729
730}
731
732::llvm::LogicalResult ContractOp::verifyInvariantsImpl() {
733 auto tblgen_arg_attrs = getProperties().arg_attrs; (void)tblgen_arg_attrs;
734 auto tblgen_function_type = getProperties().function_type; (void)tblgen_function_type;
735 if (!tblgen_function_type) return emitOpError("requires attribute 'function_type'");
736 auto tblgen_sym_name = getProperties().sym_name; (void)tblgen_sym_name;
737 if (!tblgen_sym_name) return emitOpError("requires attribute 'sym_name'");
738 auto tblgen_target = getProperties().target; (void)tblgen_target;
739 if (!tblgen_target) return emitOpError("requires attribute 'target'");
740
741 if (::mlir::failed(__mlir_ods_local_attr_constraint_Ops1(*this, tblgen_sym_name, "sym_name")))
742 return ::mlir::failure();
743
744 if (::mlir::failed(__mlir_ods_local_attr_constraint_Ops2(*this, tblgen_target, "target")))
745 return ::mlir::failure();
746
747 if (::mlir::failed(__mlir_ods_local_attr_constraint_Ops3(*this, tblgen_function_type, "function_type")))
748 return ::mlir::failure();
749
750 if (::mlir::failed(__mlir_ods_local_attr_constraint_Ops4(*this, tblgen_arg_attrs, "arg_attrs")))
751 return ::mlir::failure();
752 {
753 unsigned index = 0; (void)index;
754
755 for (auto &region : ::llvm::MutableArrayRef((*this)->getRegion(0)))
756 if (::mlir::failed(__mlir_ods_local_region_constraint_Ops1(*this, region, "body", index++)))
757 return ::mlir::failure();
758 }
759 return ::mlir::success();
760}
761
762::llvm::LogicalResult ContractOp::verifyInvariants() {
763 if(::mlir::succeeded(verifyInvariantsImpl()) && ::mlir::succeeded(verify()))
764 return ::mlir::success();
765 return ::mlir::failure();
766}
767
768} // namespace verif
769} // namespace llzk
770MLIR_DEFINE_EXPLICIT_TYPE_ID(::llzk::verif::ContractOp)
771
772namespace llzk {
773namespace verif {
774
775//===----------------------------------------------------------------------===//
776// ::llzk::verif::DecreasesOp definitions
777//===----------------------------------------------------------------------===//
778
779namespace detail {
780} // namespace detail
782
783::llvm::LogicalResult DecreasesOpAdaptor::verify(::mlir::Location loc) {
784 return ::mlir::success();
785}
786
787void DecreasesOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value value) {
788 odsState.addOperands(value);
789}
790
791void DecreasesOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value value) {
792 odsState.addOperands(value);
793 assert(resultTypes.size() == 0u && "mismatched number of results");
794 odsState.addTypes(resultTypes);
795}
796
797void DecreasesOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
798 assert(operands.size() == 1u && "mismatched number of parameters");
799 odsState.addOperands(operands);
800 odsState.addAttributes(attributes);
801 assert(resultTypes.size() == 0u && "mismatched number of return types");
802 odsState.addTypes(resultTypes);
803}
804
805::llvm::LogicalResult DecreasesOp::verifyInvariantsImpl() {
806 {
807 unsigned index = 0; (void)index;
808 auto valueGroup0 = getODSOperands(0);
809
810 for (auto v : valueGroup0) {
811 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops2(*this, v.getType(), "operand", index++)))
812 return ::mlir::failure();
813 }
814 }
815 return ::mlir::success();
816}
817
818::llvm::LogicalResult DecreasesOp::verifyInvariants() {
819 return verifyInvariantsImpl();
820}
821
822::mlir::ParseResult DecreasesOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
823 ::mlir::OpAsmParser::UnresolvedOperand valueRawOperand{};
824 ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> valueOperands(&valueRawOperand, 1); ::llvm::SMLoc valueOperandsLoc;
825 (void)valueOperandsLoc;
826
827 valueOperandsLoc = parser.getCurrentLocation();
828 if (parser.parseOperand(valueRawOperand))
829 return ::mlir::failure();
830 {
831 auto loc = parser.getCurrentLocation();(void)loc;
832 if (parser.parseOptionalAttrDict(result.attributes))
833 return ::mlir::failure();
834 }
835 ::mlir::Type odsBuildableType0 = ::llzk::felt::FeltType::get(parser.getBuilder().getContext());
836 if (parser.resolveOperands(valueOperands, odsBuildableType0, valueOperandsLoc, result.operands))
837 return ::mlir::failure();
838 return ::mlir::success();
839}
840
841void DecreasesOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
842 _odsPrinter << ' ';
843 _odsPrinter << getValue();
844 ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
845 _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
846}
847
848// This side effect models "program termination". Based on
849// https://github.com/llvm/llvm-project/blob/f325e4b2d836d6e65a4d0cf3efc6b0996ccf3765/mlir/lib/Dialect/ControlFlow/IR/ControlFlowOps.cpp#L92-L97
851 ::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects
852) {
853 effects.emplace_back(::mlir::MemoryEffects::Write::get());
854}
855} // namespace verif
856} // namespace llzk
857MLIR_DEFINE_EXPLICIT_TYPE_ID(::llzk::verif::DecreasesOp)
858
859namespace llzk {
860namespace verif {
861
862//===----------------------------------------------------------------------===//
863// ::llzk::verif::EnsureComputeOp definitions
864//===----------------------------------------------------------------------===//
865
866namespace detail {
867} // namespace detail
869
870::llvm::LogicalResult EnsureComputeOpAdaptor::verify(::mlir::Location loc) {
871 return ::mlir::success();
872}
873
874void EnsureComputeOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value condition) {
875 odsState.addOperands(condition);
876}
877
878void EnsureComputeOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value condition) {
879 odsState.addOperands(condition);
880 assert(resultTypes.size() == 0u && "mismatched number of results");
881 odsState.addTypes(resultTypes);
882}
883
884void EnsureComputeOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
885 assert(operands.size() == 1u && "mismatched number of parameters");
886 odsState.addOperands(operands);
887 odsState.addAttributes(attributes);
888 assert(resultTypes.size() == 0u && "mismatched number of return types");
889 odsState.addTypes(resultTypes);
890}
891
893 {
894 unsigned index = 0; (void)index;
895 auto valueGroup0 = getODSOperands(0);
896
897 for (auto v : valueGroup0) {
898 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops3(*this, v.getType(), "operand", index++)))
899 return ::mlir::failure();
900 }
901 }
902 return ::mlir::success();
903}
904
905::llvm::LogicalResult EnsureComputeOp::verifyInvariants() {
906 return verifyInvariantsImpl();
907}
908
909::mlir::ParseResult EnsureComputeOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
910 ::mlir::OpAsmParser::UnresolvedOperand conditionRawOperand{};
911 ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> conditionOperands(&conditionRawOperand, 1); ::llvm::SMLoc conditionOperandsLoc;
912 (void)conditionOperandsLoc;
913
914 conditionOperandsLoc = parser.getCurrentLocation();
915 if (parser.parseOperand(conditionRawOperand))
916 return ::mlir::failure();
917 {
918 auto loc = parser.getCurrentLocation();(void)loc;
919 if (parser.parseOptionalAttrDict(result.attributes))
920 return ::mlir::failure();
921 }
922 ::mlir::Type odsBuildableType0 = parser.getBuilder().getIntegerType(1);
923 if (parser.resolveOperands(conditionOperands, odsBuildableType0, conditionOperandsLoc, result.operands))
924 return ::mlir::failure();
925 return ::mlir::success();
926}
927
928void EnsureComputeOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
929 _odsPrinter << ' ';
930 _odsPrinter << getCondition();
931 ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
932 _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
933}
934
935// This side effect models "program termination". Based on
936// https://github.com/llvm/llvm-project/blob/f325e4b2d836d6e65a4d0cf3efc6b0996ccf3765/mlir/lib/Dialect/ControlFlow/IR/ControlFlowOps.cpp#L92-L97
938 ::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects
939) {
940 effects.emplace_back(::mlir::MemoryEffects::Write::get());
941}
942} // namespace verif
943} // namespace llzk
944MLIR_DEFINE_EXPLICIT_TYPE_ID(::llzk::verif::EnsureComputeOp)
945
946namespace llzk {
947namespace verif {
948
949//===----------------------------------------------------------------------===//
950// ::llzk::verif::EnsureConstrainOp definitions
951//===----------------------------------------------------------------------===//
952
953namespace detail {
954} // namespace detail
956
957::llvm::LogicalResult EnsureConstrainOpAdaptor::verify(::mlir::Location loc) {
958 return ::mlir::success();
959}
960
961void EnsureConstrainOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value condition) {
962 odsState.addOperands(condition);
963}
964
965void EnsureConstrainOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value condition) {
966 odsState.addOperands(condition);
967 assert(resultTypes.size() == 0u && "mismatched number of results");
968 odsState.addTypes(resultTypes);
969}
970
971void EnsureConstrainOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
972 assert(operands.size() == 1u && "mismatched number of parameters");
973 odsState.addOperands(operands);
974 odsState.addAttributes(attributes);
975 assert(resultTypes.size() == 0u && "mismatched number of return types");
976 odsState.addTypes(resultTypes);
977}
978
980 {
981 unsigned index = 0; (void)index;
982 auto valueGroup0 = getODSOperands(0);
983
984 for (auto v : valueGroup0) {
985 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops3(*this, v.getType(), "operand", index++)))
986 return ::mlir::failure();
987 }
988 }
989 return ::mlir::success();
990}
991
992::llvm::LogicalResult EnsureConstrainOp::verifyInvariants() {
993 return verifyInvariantsImpl();
994}
995
996::mlir::ParseResult EnsureConstrainOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
997 ::mlir::OpAsmParser::UnresolvedOperand conditionRawOperand{};
998 ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> conditionOperands(&conditionRawOperand, 1); ::llvm::SMLoc conditionOperandsLoc;
999 (void)conditionOperandsLoc;
1000
1001 conditionOperandsLoc = parser.getCurrentLocation();
1002 if (parser.parseOperand(conditionRawOperand))
1003 return ::mlir::failure();
1004 {
1005 auto loc = parser.getCurrentLocation();(void)loc;
1006 if (parser.parseOptionalAttrDict(result.attributes))
1007 return ::mlir::failure();
1008 }
1009 ::mlir::Type odsBuildableType0 = parser.getBuilder().getIntegerType(1);
1010 if (parser.resolveOperands(conditionOperands, odsBuildableType0, conditionOperandsLoc, result.operands))
1011 return ::mlir::failure();
1012 return ::mlir::success();
1013}
1014
1015void EnsureConstrainOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
1016 _odsPrinter << ' ';
1017 _odsPrinter << getCondition();
1018 ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
1019 _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
1020}
1021
1022// This side effect models "program termination". Based on
1023// https://github.com/llvm/llvm-project/blob/f325e4b2d836d6e65a4d0cf3efc6b0996ccf3765/mlir/lib/Dialect/ControlFlow/IR/ControlFlowOps.cpp#L92-L97
1025 ::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects
1026) {
1027 effects.emplace_back(::mlir::MemoryEffects::Write::get());
1028}
1029} // namespace verif
1030} // namespace llzk
1031MLIR_DEFINE_EXPLICIT_TYPE_ID(::llzk::verif::EnsureConstrainOp)
1032
1033namespace llzk {
1034namespace verif {
1035
1036//===----------------------------------------------------------------------===//
1037// ::llzk::verif::IncludeOp definitions
1038//===----------------------------------------------------------------------===//
1039
1040namespace detail {
1041IncludeOpGenericAdaptorBase::IncludeOpGenericAdaptorBase(IncludeOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
1042
1043std::pair<unsigned, unsigned> IncludeOpGenericAdaptorBase::getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize) {
1044 ::llvm::ArrayRef<int32_t> sizeAttr = getProperties().operandSegmentSizes;
1045
1046 unsigned start = 0;
1047 for (unsigned i = 0; i < index; ++i)
1048 start += sizeAttr[i];
1049 return {start, sizeAttr[index]};
1050}
1051
1053 auto attr = getCalleeAttr();
1054 return attr;
1055}
1056
1057::std::optional< ::mlir::ArrayAttr > IncludeOpGenericAdaptorBase::getTemplateParams() {
1058 auto attr = getTemplateParamsAttr();
1059 return attr ? ::std::optional< ::mlir::ArrayAttr >(attr) : (::std::nullopt);
1060}
1061
1063 auto attr = ::llvm::dyn_cast_or_null<::mlir::DenseI32ArrayAttr>(getProperties().numDimsPerMap);
1064 return attr;
1065}
1066
1068 auto attr = getNumDimsPerMapAttr();
1069 return attr;
1070}
1071
1073 auto attr = getMapOpGroupSizesAttr();
1074 return attr;
1075}
1076
1077} // namespace detail
1079
1080::llvm::LogicalResult IncludeOpAdaptor::verify(::mlir::Location loc) {
1081 auto tblgen_callee = getProperties().callee; (void)tblgen_callee;
1082 if (!tblgen_callee) return emitError(loc, "'verif.include' op ""requires attribute 'callee'");
1083 auto tblgen_mapOpGroupSizes = getProperties().mapOpGroupSizes; (void)tblgen_mapOpGroupSizes;
1084 if (!tblgen_mapOpGroupSizes) return emitError(loc, "'verif.include' op ""requires attribute 'mapOpGroupSizes'");
1085 auto tblgen_numDimsPerMap = getProperties().numDimsPerMap; (void)tblgen_numDimsPerMap;
1086 auto tblgen_templateParams = getProperties().templateParams; (void)tblgen_templateParams;
1087
1088 if (tblgen_callee && !((::llvm::isa<::mlir::SymbolRefAttr>(tblgen_callee))))
1089 return emitError(loc, "'verif.include' op ""attribute 'callee' failed to satisfy constraint: symbol reference attribute");
1090
1091 if (tblgen_templateParams && !((::llvm::isa<::mlir::ArrayAttr>(tblgen_templateParams))))
1092 return emitError(loc, "'verif.include' op ""attribute 'templateParams' failed to satisfy constraint: array attribute");
1093
1094 if (tblgen_numDimsPerMap && !((::llvm::isa<::mlir::DenseI32ArrayAttr>(tblgen_numDimsPerMap))))
1095 return emitError(loc, "'verif.include' op ""attribute 'numDimsPerMap' failed to satisfy constraint: i32 dense array attribute");
1096
1097 if (tblgen_mapOpGroupSizes && !((::llvm::isa<::mlir::DenseI32ArrayAttr>(tblgen_mapOpGroupSizes))))
1098 return emitError(loc, "'verif.include' op ""attribute 'mapOpGroupSizes' failed to satisfy constraint: i32 dense array attribute");
1099 return ::mlir::success();
1100}
1101
1102std::pair<unsigned, unsigned> IncludeOp::getODSOperandIndexAndLength(unsigned index) {
1103 ::llvm::ArrayRef<int32_t> sizeAttr = getProperties().operandSegmentSizes;
1104
1105 unsigned start = 0;
1106 for (unsigned i = 0; i < index; ++i)
1107 start += sizeAttr[i];
1108 return {start, sizeAttr[index]};
1109}
1110
1111::mlir::MutableOperandRange IncludeOp::getArgOperandsMutable() {
1112 auto range = getODSOperandIndexAndLength(0);
1113 auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second, ::mlir::MutableOperandRange::OperandSegment(0u, {getOperandSegmentSizesAttrName(), ::mlir::DenseI32ArrayAttr::get(getContext(), getProperties().operandSegmentSizes)}));
1114 return mutableRange;
1115}
1116
1117::mlir::MutableOperandRangeRange IncludeOp::getMapOperandsMutable() {
1118 auto range = getODSOperandIndexAndLength(1);
1119 auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second, ::mlir::MutableOperandRange::OperandSegment(1u, {getOperandSegmentSizesAttrName(), ::mlir::DenseI32ArrayAttr::get(getContext(), getProperties().operandSegmentSizes)}));
1120 return mutableRange.split(*(*this)->getAttrDictionary().getNamed(getMapOpGroupSizesAttrName()));
1121}
1122
1123::llvm::LogicalResult IncludeOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
1124 ::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
1125 if (!dict) {
1126 emitError() << "expected DictionaryAttr to set properties";
1127 return ::mlir::failure();
1128 }
1129
1130 {
1131 auto &propStorage = prop.callee;
1132 auto attr = dict.get("callee");
1133 if (attr) {
1134 auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
1135 if (convertedAttr) {
1136 propStorage = convertedAttr;
1137 } else {
1138 emitError() << "Invalid attribute `callee` in property conversion: " << attr;
1139 return ::mlir::failure();
1140 }
1141 }
1142 }
1143
1144 {
1145 auto &propStorage = prop.mapOpGroupSizes;
1146 auto attr = dict.get("mapOpGroupSizes");
1147 if (attr) {
1148 auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
1149 if (convertedAttr) {
1150 propStorage = convertedAttr;
1151 } else {
1152 emitError() << "Invalid attribute `mapOpGroupSizes` in property conversion: " << attr;
1153 return ::mlir::failure();
1154 }
1155 }
1156 }
1157
1158 {
1159 auto &propStorage = prop.numDimsPerMap;
1160 auto attr = dict.get("numDimsPerMap");
1161 if (attr) {
1162 auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
1163 if (convertedAttr) {
1164 propStorage = convertedAttr;
1165 } else {
1166 emitError() << "Invalid attribute `numDimsPerMap` in property conversion: " << attr;
1167 return ::mlir::failure();
1168 }
1169 }
1170 }
1171
1172 {
1173 auto &propStorage = prop.templateParams;
1174 auto attr = dict.get("templateParams");
1175 if (attr) {
1176 auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
1177 if (convertedAttr) {
1178 propStorage = convertedAttr;
1179 } else {
1180 emitError() << "Invalid attribute `templateParams` in property conversion: " << attr;
1181 return ::mlir::failure();
1182 }
1183 }
1184 }
1185{
1186
1187 auto setFromAttr = [] (auto &propStorage, ::mlir::Attribute propAttr,
1188 ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) -> ::mlir::LogicalResult {
1189 return convertFromAttribute(propStorage, propAttr, emitError);
1190 };
1191 auto attr = dict.get("operandSegmentSizes"); if (!attr) attr = dict.get("operand_segment_sizes");;
1192;
1193 if (attr && ::mlir::failed(setFromAttr(prop.operandSegmentSizes, attr, emitError)))
1194 return ::mlir::failure();
1195 }
1196 return ::mlir::success();
1197}
1198
1199::mlir::Attribute IncludeOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
1200 ::mlir::SmallVector<::mlir::NamedAttribute> attrs;
1201 ::mlir::Builder odsBuilder{ctx};
1202
1203 {
1204 const auto &propStorage = prop.callee;
1205 if (propStorage)
1206 attrs.push_back(odsBuilder.getNamedAttr("callee",
1207 propStorage));
1208 }
1209
1210 {
1211 const auto &propStorage = prop.mapOpGroupSizes;
1212 if (propStorage)
1213 attrs.push_back(odsBuilder.getNamedAttr("mapOpGroupSizes",
1214 propStorage));
1215 }
1216
1217 {
1218 const auto &propStorage = prop.numDimsPerMap;
1219 if (propStorage)
1220 attrs.push_back(odsBuilder.getNamedAttr("numDimsPerMap",
1221 propStorage));
1222 }
1223
1224 {
1225 const auto &propStorage = prop.templateParams;
1226 if (propStorage)
1227 attrs.push_back(odsBuilder.getNamedAttr("templateParams",
1228 propStorage));
1229 }
1230
1231 {
1232 const auto &propStorage = prop.operandSegmentSizes;
1233 auto attr = [&]() -> ::mlir::Attribute {
1234 return ::mlir::DenseI32ArrayAttr::get(ctx, propStorage);
1235 }();
1236 attrs.push_back(odsBuilder.getNamedAttr("operandSegmentSizes", attr));
1237 }
1238
1239 if (!attrs.empty())
1240 return odsBuilder.getDictionaryAttr(attrs);
1241 return {};
1242}
1243
1244llvm::hash_code IncludeOp::computePropertiesHash(const Properties &prop) {
1245 auto hash_operandSegmentSizes = [] (const auto &propStorage) -> llvm::hash_code {
1246 return ::llvm::hash_combine_range(std::begin(propStorage), std::end(propStorage));;
1247 };
1248 return llvm::hash_combine(
1249 llvm::hash_value(prop.callee.getAsOpaquePointer()),
1250 llvm::hash_value(prop.mapOpGroupSizes.getAsOpaquePointer()),
1251 llvm::hash_value(prop.numDimsPerMap.getAsOpaquePointer()),
1252 llvm::hash_value(prop.templateParams.getAsOpaquePointer()),
1253 hash_operandSegmentSizes(prop.operandSegmentSizes));
1254}
1255
1256std::optional<mlir::Attribute> IncludeOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
1257 if (name == "callee")
1258 return prop.callee;
1259
1260 if (name == "mapOpGroupSizes")
1261 return prop.mapOpGroupSizes;
1262
1263 if (name == "numDimsPerMap")
1264 return prop.numDimsPerMap;
1265
1266 if (name == "templateParams")
1267 return prop.templateParams;
1268 if (name == "operand_segment_sizes" || name == "operandSegmentSizes") return [&]() -> ::mlir::Attribute { return ::mlir::DenseI32ArrayAttr::get(ctx, prop.operandSegmentSizes); }();
1269 return std::nullopt;
1270}
1271
1272void IncludeOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
1273 if (name == "callee") {
1274 prop.callee = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.callee)>>(value);
1275 return;
1276 }
1277
1278 if (name == "mapOpGroupSizes") {
1279 prop.mapOpGroupSizes = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.mapOpGroupSizes)>>(value);
1280 return;
1281 }
1282
1283 if (name == "numDimsPerMap") {
1284 prop.numDimsPerMap = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.numDimsPerMap)>>(value);
1285 return;
1286 }
1287
1288 if (name == "templateParams") {
1289 prop.templateParams = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.templateParams)>>(value);
1290 return;
1291 }
1292 if (name == "operand_segment_sizes" || name == "operandSegmentSizes") {
1293 auto arrAttr = ::llvm::dyn_cast_or_null<::mlir::DenseI32ArrayAttr>(value);
1294 if (!arrAttr) return;
1295 if (arrAttr.size() != sizeof(prop.operandSegmentSizes) / sizeof(int32_t))
1296 return;
1297 llvm::copy(arrAttr.asArrayRef(), prop.operandSegmentSizes.begin());
1298 return;
1299 }
1300}
1301
1302void IncludeOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
1303 if (prop.callee) attrs.append("callee", prop.callee);
1304
1305 if (prop.mapOpGroupSizes) attrs.append("mapOpGroupSizes", prop.mapOpGroupSizes);
1306
1307 if (prop.numDimsPerMap) attrs.append("numDimsPerMap", prop.numDimsPerMap);
1308
1309 if (prop.templateParams) attrs.append("templateParams", prop.templateParams);
1310 attrs.append("operandSegmentSizes", [&]() -> ::mlir::Attribute { return ::mlir::DenseI32ArrayAttr::get(ctx, prop.operandSegmentSizes); }());
1311}
1312
1313::llvm::LogicalResult IncludeOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
1314 {
1315 ::mlir::Attribute attr = attrs.get(getCalleeAttrName(opName));
1316 if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_Ops2(attr, "callee", emitError)))
1317 return ::mlir::failure();
1318 }
1319
1320 {
1321 ::mlir::Attribute attr = attrs.get(getMapOpGroupSizesAttrName(opName));
1322 if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_Ops6(attr, "mapOpGroupSizes", emitError)))
1323 return ::mlir::failure();
1324 }
1325
1326 {
1327 ::mlir::Attribute attr = attrs.get(getNumDimsPerMapAttrName(opName));
1328 if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_Ops6(attr, "numDimsPerMap", emitError)))
1329 return ::mlir::failure();
1330 }
1331
1332 {
1333 ::mlir::Attribute attr = attrs.get(getTemplateParamsAttrName(opName));
1334 if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_Ops5(attr, "templateParams", emitError)))
1335 return ::mlir::failure();
1336 }
1337 return ::mlir::success();
1338}
1339
1340::llvm::LogicalResult IncludeOp::readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state) {
1341 auto &prop = state.getOrAddProperties<Properties>(); (void)prop;
1342 if (::mlir::failed(reader.readAttribute(prop.callee)))
1343 return ::mlir::failure();
1344
1345 if (::mlir::failed(reader.readAttribute(prop.mapOpGroupSizes)))
1346 return ::mlir::failure();
1347
1348 if (::mlir::failed(reader.readOptionalAttribute(prop.numDimsPerMap)))
1349 return ::mlir::failure();
1350
1351 if (reader.getBytecodeVersion() < /*kNativePropertiesODSSegmentSize=*/6) {
1352 auto &propStorage = prop.operandSegmentSizes;
1353 ::mlir::DenseI32ArrayAttr attr;
1354 if (::mlir::failed(reader.readAttribute(attr))) return ::mlir::failure();
1355 if (attr.size() > static_cast<int64_t>(sizeof(propStorage) / sizeof(int32_t))) {
1356 reader.emitError("size mismatch for operand/result_segment_size");
1357 return ::mlir::failure();
1358 }
1359 ::llvm::copy(::llvm::ArrayRef<int32_t>(attr), propStorage.begin());
1360 }
1361
1362 if (::mlir::failed(reader.readOptionalAttribute(prop.templateParams)))
1363 return ::mlir::failure();
1364
1365 {
1366 auto &propStorage = prop.operandSegmentSizes;
1367 auto readProp = [&]() {
1368
1369 if (reader.getBytecodeVersion() >= /*kNativePropertiesODSSegmentSize=*/6)
1370 return reader.readSparseArray(::llvm::MutableArrayRef(propStorage));
1371;
1372 return ::mlir::success();
1373 };
1374 if (::mlir::failed(readProp()))
1375 return ::mlir::failure();
1376 }
1377 return ::mlir::success();
1378}
1379
1380void IncludeOp::writeProperties(::mlir::DialectBytecodeWriter &writer) {
1381 auto &prop = getProperties(); (void)prop;
1382 writer.writeAttribute(prop.callee);
1383 writer.writeAttribute(prop.mapOpGroupSizes);
1384
1385 writer.writeOptionalAttribute(prop.numDimsPerMap);
1386
1387if (writer.getBytecodeVersion() < /*kNativePropertiesODSSegmentSize=*/6) {
1388 auto &propStorage = prop.operandSegmentSizes;
1389 writer.writeAttribute(::mlir::DenseI32ArrayAttr::get(this->getContext(), propStorage));
1390}
1391
1392 writer.writeOptionalAttribute(prop.templateParams);
1393
1394 {
1395 auto &propStorage = prop.operandSegmentSizes;
1396
1397 if (writer.getBytecodeVersion() >= /*kNativePropertiesODSSegmentSize=*/6)
1398 writer.writeSparseArray(::llvm::ArrayRef(propStorage));
1399;
1400 }
1401}
1402
1403::mlir::SymbolRefAttr IncludeOp::getCallee() {
1404 auto attr = getCalleeAttr();
1405 return attr;
1406}
1407
1408::std::optional< ::mlir::ArrayAttr > IncludeOp::getTemplateParams() {
1409 auto attr = getTemplateParamsAttr();
1410 return attr ? ::std::optional< ::mlir::ArrayAttr >(attr) : (::std::nullopt);
1411}
1412
1413::llvm::ArrayRef<int32_t> IncludeOp::getNumDimsPerMap() {
1414 auto attr = getNumDimsPerMapAttr();
1415 return attr;
1416}
1417
1418::llvm::ArrayRef<int32_t> IncludeOp::getMapOpGroupSizes() {
1419 auto attr = getMapOpGroupSizesAttr();
1420 return attr;
1421}
1422
1423void IncludeOp::setNumDimsPerMap(::llvm::ArrayRef<int32_t> attrValue) {
1424 getProperties().numDimsPerMap = ::mlir::Builder((*this)->getContext()).getDenseI32ArrayAttr(attrValue);
1425}
1426
1427void IncludeOp::setMapOpGroupSizes(::llvm::ArrayRef<int32_t> attrValue) {
1428 getProperties().mapOpGroupSizes = ::mlir::Builder((*this)->getContext()).getDenseI32ArrayAttr(attrValue);
1429}
1430
1431void IncludeOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::SymbolRefAttr callee, ::llvm::ArrayRef<::mlir::ValueRange> mapOperands, ::llvm::ArrayRef<int32_t> numDimsPerMap, ::mlir::ValueRange argOperands, ::llvm::ArrayRef<::mlir::Attribute> templateParams) {
1432 build(odsBuilder, odsState, callee, mapOperands,
1433 odsBuilder.getDenseI32ArrayAttr(numDimsPerMap),
1434 argOperands, templateParams);
1435
1436}
1437
1438void IncludeOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::llzk::verif::ContractOp callee, ::mlir::ValueRange argOperands, ::llvm::ArrayRef<::mlir::Attribute> templateParams) {
1439 build(odsBuilder, odsState,
1440 callee.getFullyQualifiedName(false),
1441 argOperands, templateParams);
1442
1443}
1444
1445void IncludeOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::llzk::verif::ContractOp callee, ::llvm::ArrayRef<::mlir::ValueRange> mapOperands, ::mlir::DenseI32ArrayAttr numDimsPerMap, ::mlir::ValueRange argOperands, ::llvm::ArrayRef<::mlir::Attribute> templateParams) {
1446 build(odsBuilder, odsState,
1447 callee.getFullyQualifiedName(false), mapOperands, numDimsPerMap,
1448 argOperands, templateParams);
1449
1450}
1451
1452void IncludeOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::llzk::verif::ContractOp callee, ::llvm::ArrayRef<::mlir::ValueRange> mapOperands, ::llvm::ArrayRef<int32_t> numDimsPerMap, ::mlir::ValueRange argOperands, ::llvm::ArrayRef<::mlir::Attribute> templateParams) {
1453 build(odsBuilder, odsState, callee, mapOperands,
1454 odsBuilder.getDenseI32ArrayAttr(numDimsPerMap),
1455 argOperands, templateParams);
1456
1457}
1458
1459void IncludeOp::populateDefaultProperties(::mlir::OperationName opName, Properties &properties) {
1460 ::mlir::Builder odsBuilder(opName.getContext());
1461 if (!properties.numDimsPerMap)
1462 properties.numDimsPerMap = odsBuilder.getDenseI32ArrayAttr({});
1463}
1464
1465::llvm::LogicalResult IncludeOp::verifyInvariantsImpl() {
1466 auto tblgen_callee = getProperties().callee; (void)tblgen_callee;
1467 if (!tblgen_callee) return emitOpError("requires attribute 'callee'");
1468 auto tblgen_mapOpGroupSizes = getProperties().mapOpGroupSizes; (void)tblgen_mapOpGroupSizes;
1469 if (!tblgen_mapOpGroupSizes) return emitOpError("requires attribute 'mapOpGroupSizes'");
1470 auto tblgen_numDimsPerMap = getProperties().numDimsPerMap; (void)tblgen_numDimsPerMap;
1471 auto tblgen_templateParams = getProperties().templateParams; (void)tblgen_templateParams;
1472
1473 if (::mlir::failed(__mlir_ods_local_attr_constraint_Ops2(*this, tblgen_callee, "callee")))
1474 return ::mlir::failure();
1475
1476 if (::mlir::failed(__mlir_ods_local_attr_constraint_Ops5(*this, tblgen_templateParams, "templateParams")))
1477 return ::mlir::failure();
1478
1479 if (::mlir::failed(__mlir_ods_local_attr_constraint_Ops6(*this, tblgen_numDimsPerMap, "numDimsPerMap")))
1480 return ::mlir::failure();
1481
1482 if (::mlir::failed(__mlir_ods_local_attr_constraint_Ops6(*this, tblgen_mapOpGroupSizes, "mapOpGroupSizes")))
1483 return ::mlir::failure();
1484 {
1485 unsigned index = 0; (void)index;
1486 auto valueGroup0 = getODSOperands(0);
1487
1488 for (auto v : valueGroup0) {
1489 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops4(*this, v.getType(), "operand", index++)))
1490 return ::mlir::failure();
1491 }
1492 auto valueGroup1 = getODSOperands(1);
1493 if (::mlir::failed(::mlir::OpTrait::impl::verifyValueSizeAttr(*this, "mapOpGroupSizes", "mapOperands", valueGroup1.size())))
1494 return ::mlir::failure();
1495
1496 for (auto v : valueGroup1) {
1497 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops5(*this, v.getType(), "operand", index++)))
1498 return ::mlir::failure();
1499 }
1500 }
1501 return ::mlir::success();
1502}
1503
1504::llvm::LogicalResult IncludeOp::verifyInvariants() {
1505 return verifyInvariantsImpl();
1506}
1507
1508::mlir::ParseResult IncludeOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
1509 ::mlir::SymbolRefAttr calleeAttr;
1510 ::mlir::ArrayAttr templateParamsAttr;
1511 ::llvm::SmallVector<::mlir::OpAsmParser::UnresolvedOperand, 4> argOperandsOperands;
1512 ::llvm::SMLoc argOperandsOperandsLoc;
1513 (void)argOperandsOperandsLoc;
1514 ::llvm::SmallVector<::mlir::OpAsmParser::UnresolvedOperand, 4> mapOperandsOperands;
1515 llvm::SmallVector<int32_t> mapOperandsOperandGroupSizes;
1516 ::llvm::SMLoc mapOperandsOperandsLoc;
1517 (void)mapOperandsOperandsLoc;
1518 ::mlir::DenseI32ArrayAttr numDimsPerMapAttr;
1519 ::llvm::ArrayRef<::mlir::Type> argOperandsTypes;
1520 ::llvm::ArrayRef<::mlir::Type> allResultTypes;
1521
1522 if (parser.parseCustomAttributeWithFallback(calleeAttr, parser.getBuilder().getType<::mlir::NoneType>())) {
1523 return ::mlir::failure();
1524 }
1525 if (calleeAttr) result.getOrAddProperties<IncludeOp::Properties>().callee = calleeAttr;
1526 if (::mlir::succeeded(parser.parseOptionalLess())) {
1527 {
1528 auto odsResult = parseTemplateParams(parser, templateParamsAttr);
1529 if (odsResult) return ::mlir::failure();
1530 if (templateParamsAttr)
1531 result.getOrAddProperties<IncludeOp::Properties>().templateParams = templateParamsAttr;
1532 }
1533 if (parser.parseGreater())
1534 return ::mlir::failure();
1535 }
1536 if (parser.parseLParen())
1537 return ::mlir::failure();
1538
1539 argOperandsOperandsLoc = parser.getCurrentLocation();
1540 if (parser.parseOperandList(argOperandsOperands))
1541 return ::mlir::failure();
1542 if (parser.parseRParen())
1543 return ::mlir::failure();
1544 if (::mlir::succeeded(parser.parseOptionalLBrace())) {
1545 {
1546 mapOperandsOperandsLoc = parser.getCurrentLocation();
1547 ::llvm::SmallVector<::llvm::SmallVector<::mlir::OpAsmParser::UnresolvedOperand>> mapOperandsOperandGroups;
1548 auto odsResult = parseMultiDimAndSymbolList(parser, mapOperandsOperandGroups, numDimsPerMapAttr);
1549 if (odsResult) return ::mlir::failure();
1550 for (const auto &subRange : mapOperandsOperandGroups) {
1551 mapOperandsOperands.append(subRange.begin(), subRange.end());
1552 mapOperandsOperandGroupSizes.push_back(subRange.size());
1553 }
1554 if (numDimsPerMapAttr)
1555 result.getOrAddProperties<IncludeOp::Properties>().numDimsPerMap = numDimsPerMapAttr;
1556 }
1557 if (parser.parseRBrace())
1558 return ::mlir::failure();
1559 }
1560 if (parser.parseColon())
1561 return ::mlir::failure();
1562
1563 ::mlir::FunctionType argOperands__allResult_functionType;
1564 if (parser.parseType(argOperands__allResult_functionType))
1565 return ::mlir::failure();
1566 argOperandsTypes = argOperands__allResult_functionType.getInputs();
1567 allResultTypes = argOperands__allResult_functionType.getResults();
1568 {
1569 auto odsResult = parseAttrDictWithWarnings(parser, result.attributes, result);
1570 if (odsResult) return ::mlir::failure();
1571 }
1572::llvm::copy(::llvm::ArrayRef<int32_t>({static_cast<int32_t>(argOperandsOperands.size()), static_cast<int32_t>(mapOperandsOperands.size())}), result.getOrAddProperties<IncludeOp::Properties>().operandSegmentSizes.begin());
1573 result.getOrAddProperties<IncludeOp::Properties>().mapOpGroupSizes = parser.getBuilder().getDenseI32ArrayAttr(mapOperandsOperandGroupSizes);
1574 ::mlir::Type odsBuildableType0 = parser.getBuilder().getIndexType();
1575 result.addTypes(allResultTypes);
1576 if (parser.resolveOperands(argOperandsOperands, argOperandsTypes, argOperandsOperandsLoc, result.operands))
1577 return ::mlir::failure();
1578 if (parser.resolveOperands(mapOperandsOperands, odsBuildableType0, mapOperandsOperandsLoc, result.operands))
1579 return ::mlir::failure();
1580 return ::mlir::success();
1581}
1582
1583::llvm::LogicalResult IncludeOp::setPropertiesFromParsedAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
1584 ::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
1585 if (!dict) {
1586 emitError() << "expected DictionaryAttr to set properties";
1587 return ::mlir::failure();
1588 }
1589 {
1590
1591 auto &propStorage = prop.mapOpGroupSizes;
1592 auto attr = dict.get("mapOpGroupSizes");
1593 if (attr || /*isRequired=*/true) {
1594 if (!attr) {
1595 emitError() << "expected key entry for mapOpGroupSizes in DictionaryAttr to set "
1596 "Properties.";
1597 return ::mlir::failure();
1598 }
1599 auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
1600 if (convertedAttr) {
1601 propStorage = convertedAttr;
1602 } else {
1603 emitError() << "Invalid attribute `mapOpGroupSizes` in property conversion: " << attr;
1604 return ::mlir::failure();
1605 }
1606 }
1607 }
1608 return ::mlir::success();
1609}
1610
1611void IncludeOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
1612 _odsPrinter << ' ';
1613 _odsPrinter.printAttributeWithoutType(getCalleeAttr());
1614 if (((getTemplateParamsAttr()))) {
1615 _odsPrinter << "<";
1616 printTemplateParams(_odsPrinter, *this, getTemplateParamsAttr());
1617 _odsPrinter << ">";
1618 }
1619 _odsPrinter << "(";
1620 _odsPrinter << getArgOperands();
1621 _odsPrinter << ")";
1622 if (((!getMapOperands().empty()) || (getNumDimsPerMapAttr() != ::mlir::OpBuilder((*this)->getContext()).getDenseI32ArrayAttr({})))) {
1623 _odsPrinter << ' ' << "{";
1625 _odsPrinter << "}";
1626 }
1627 _odsPrinter << ' ' << ":";
1628 _odsPrinter << ' ';
1629 _odsPrinter.printFunctionalType(getArgOperands().getTypes(), getOperation()->getResultTypes());
1630 _odsPrinter << ' ';
1631 printAttrDictWithWarnings(_odsPrinter, *this, getOperation()->getAttrDictionary(), getProperties());
1632}
1633
1634} // namespace verif
1635} // namespace llzk
1636MLIR_DEFINE_EXPLICIT_TYPE_ID(::llzk::verif::IncludeOp)
1637
1638namespace llzk {
1639namespace verif {
1640
1641//===----------------------------------------------------------------------===//
1642// ::llzk::verif::IncreasesOp definitions
1643//===----------------------------------------------------------------------===//
1644
1645namespace detail {
1646} // namespace detail
1648
1649::llvm::LogicalResult IncreasesOpAdaptor::verify(::mlir::Location loc) {
1650 return ::mlir::success();
1651}
1652
1653void IncreasesOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value value) {
1654 odsState.addOperands(value);
1655}
1656
1657void IncreasesOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value value) {
1658 odsState.addOperands(value);
1659 assert(resultTypes.size() == 0u && "mismatched number of results");
1660 odsState.addTypes(resultTypes);
1661}
1662
1663void IncreasesOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
1664 assert(operands.size() == 1u && "mismatched number of parameters");
1665 odsState.addOperands(operands);
1666 odsState.addAttributes(attributes);
1667 assert(resultTypes.size() == 0u && "mismatched number of return types");
1668 odsState.addTypes(resultTypes);
1669}
1670
1671::llvm::LogicalResult IncreasesOp::verifyInvariantsImpl() {
1672 {
1673 unsigned index = 0; (void)index;
1674 auto valueGroup0 = getODSOperands(0);
1675
1676 for (auto v : valueGroup0) {
1677 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops2(*this, v.getType(), "operand", index++)))
1678 return ::mlir::failure();
1679 }
1680 }
1681 return ::mlir::success();
1682}
1683
1684::llvm::LogicalResult IncreasesOp::verifyInvariants() {
1685 return verifyInvariantsImpl();
1686}
1687
1688::mlir::ParseResult IncreasesOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
1689 ::mlir::OpAsmParser::UnresolvedOperand valueRawOperand{};
1690 ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> valueOperands(&valueRawOperand, 1); ::llvm::SMLoc valueOperandsLoc;
1691 (void)valueOperandsLoc;
1692
1693 valueOperandsLoc = parser.getCurrentLocation();
1694 if (parser.parseOperand(valueRawOperand))
1695 return ::mlir::failure();
1696 {
1697 auto loc = parser.getCurrentLocation();(void)loc;
1698 if (parser.parseOptionalAttrDict(result.attributes))
1699 return ::mlir::failure();
1700 }
1701 ::mlir::Type odsBuildableType0 = ::llzk::felt::FeltType::get(parser.getBuilder().getContext());
1702 if (parser.resolveOperands(valueOperands, odsBuildableType0, valueOperandsLoc, result.operands))
1703 return ::mlir::failure();
1704 return ::mlir::success();
1705}
1706
1707void IncreasesOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
1708 _odsPrinter << ' ';
1709 _odsPrinter << getValue();
1710 ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
1711 _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
1712}
1713
1714// This side effect models "program termination". Based on
1715// https://github.com/llvm/llvm-project/blob/f325e4b2d836d6e65a4d0cf3efc6b0996ccf3765/mlir/lib/Dialect/ControlFlow/IR/ControlFlowOps.cpp#L92-L97
1717 ::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects
1718) {
1719 effects.emplace_back(::mlir::MemoryEffects::Write::get());
1720}
1721} // namespace verif
1722} // namespace llzk
1723MLIR_DEFINE_EXPLICIT_TYPE_ID(::llzk::verif::IncreasesOp)
1724
1725namespace llzk {
1726namespace verif {
1727
1728//===----------------------------------------------------------------------===//
1729// ::llzk::verif::InvariantOp definitions
1730//===----------------------------------------------------------------------===//
1731
1732namespace detail {
1734
1736 auto attr = getLoopNameAttr();
1737 return attr.getValue();
1738}
1739
1741 auto attr = getLoopArgTypesAttr();
1742 return attr;
1743}
1744
1745} // namespace detail
1747
1748::llvm::LogicalResult InvariantOpAdaptor::verify(::mlir::Location loc) {
1749 auto tblgen_loop_arg_types = getProperties().loop_arg_types; (void)tblgen_loop_arg_types;
1750 if (!tblgen_loop_arg_types) return emitError(loc, "'verif.invariant' op ""requires attribute 'loop_arg_types'");
1751 auto tblgen_loop_name = getProperties().loop_name; (void)tblgen_loop_name;
1752 if (!tblgen_loop_name) return emitError(loc, "'verif.invariant' op ""requires attribute 'loop_name'");
1753
1754 if (tblgen_loop_name && !((::llvm::isa<::mlir::StringAttr>(tblgen_loop_name))))
1755 return emitError(loc, "'verif.invariant' op ""attribute 'loop_name' failed to satisfy constraint: string attribute");
1756
1757 if (tblgen_loop_arg_types && !(((::llvm::isa<::mlir::ArrayAttr>(tblgen_loop_arg_types))) && (::llvm::all_of(::llvm::cast<::mlir::ArrayAttr>(tblgen_loop_arg_types), [&](::mlir::Attribute attr) { return attr && (((::llvm::isa<::mlir::TypeAttr>(attr))) && ((::llvm::isa<::mlir::Type>(::llvm::cast<::mlir::TypeAttr>(attr).getValue()))) && ((true))); }))))
1758 return emitError(loc, "'verif.invariant' op ""attribute 'loop_arg_types' failed to satisfy constraint: type array attribute");
1759 return ::mlir::success();
1760}
1761
1762::llvm::LogicalResult InvariantOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
1763 ::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
1764 if (!dict) {
1765 emitError() << "expected DictionaryAttr to set properties";
1766 return ::mlir::failure();
1767 }
1768
1769 {
1770 auto &propStorage = prop.loop_arg_types;
1771 auto attr = dict.get("loop_arg_types");
1772 if (attr) {
1773 auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
1774 if (convertedAttr) {
1775 propStorage = convertedAttr;
1776 } else {
1777 emitError() << "Invalid attribute `loop_arg_types` in property conversion: " << attr;
1778 return ::mlir::failure();
1779 }
1780 }
1781 }
1782
1783 {
1784 auto &propStorage = prop.loop_name;
1785 auto attr = dict.get("loop_name");
1786 if (attr) {
1787 auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
1788 if (convertedAttr) {
1789 propStorage = convertedAttr;
1790 } else {
1791 emitError() << "Invalid attribute `loop_name` in property conversion: " << attr;
1792 return ::mlir::failure();
1793 }
1794 }
1795 }
1796 return ::mlir::success();
1797}
1798
1799::mlir::Attribute InvariantOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
1800 ::mlir::SmallVector<::mlir::NamedAttribute> attrs;
1801 ::mlir::Builder odsBuilder{ctx};
1802
1803 {
1804 const auto &propStorage = prop.loop_arg_types;
1805 if (propStorage)
1806 attrs.push_back(odsBuilder.getNamedAttr("loop_arg_types",
1807 propStorage));
1808 }
1809
1810 {
1811 const auto &propStorage = prop.loop_name;
1812 if (propStorage)
1813 attrs.push_back(odsBuilder.getNamedAttr("loop_name",
1814 propStorage));
1815 }
1816
1817 if (!attrs.empty())
1818 return odsBuilder.getDictionaryAttr(attrs);
1819 return {};
1820}
1821
1823 return llvm::hash_combine(
1824 llvm::hash_value(prop.loop_arg_types.getAsOpaquePointer()),
1825 llvm::hash_value(prop.loop_name.getAsOpaquePointer()));
1826}
1827
1828std::optional<mlir::Attribute> InvariantOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
1829 if (name == "loop_arg_types")
1830 return prop.loop_arg_types;
1831
1832 if (name == "loop_name")
1833 return prop.loop_name;
1834 return std::nullopt;
1835}
1836
1837void InvariantOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
1838 if (name == "loop_arg_types") {
1839 prop.loop_arg_types = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.loop_arg_types)>>(value);
1840 return;
1841 }
1842
1843 if (name == "loop_name") {
1844 prop.loop_name = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.loop_name)>>(value);
1845 return;
1846 }
1847}
1848
1849void InvariantOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
1850 if (prop.loop_arg_types) attrs.append("loop_arg_types", prop.loop_arg_types);
1851
1852 if (prop.loop_name) attrs.append("loop_name", prop.loop_name);
1853}
1854
1855::llvm::LogicalResult InvariantOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
1856 {
1857 ::mlir::Attribute attr = attrs.get(getLoopArgTypesAttrName(opName));
1858 if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_Ops7(attr, "loop_arg_types", emitError)))
1859 return ::mlir::failure();
1860 }
1861
1862 {
1863 ::mlir::Attribute attr = attrs.get(getLoopNameAttrName(opName));
1864 if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_Ops1(attr, "loop_name", emitError)))
1865 return ::mlir::failure();
1866 }
1867 return ::mlir::success();
1868}
1869
1870::llvm::LogicalResult InvariantOp::readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state) {
1871 auto &prop = state.getOrAddProperties<Properties>(); (void)prop;
1872 if (::mlir::failed(reader.readAttribute(prop.loop_arg_types)))
1873 return ::mlir::failure();
1874
1875 if (::mlir::failed(reader.readAttribute(prop.loop_name)))
1876 return ::mlir::failure();
1877 return ::mlir::success();
1878}
1879
1880void InvariantOp::writeProperties(::mlir::DialectBytecodeWriter &writer) {
1881 auto &prop = getProperties(); (void)prop;
1882 writer.writeAttribute(prop.loop_arg_types);
1883 writer.writeAttribute(prop.loop_name);
1884}
1885
1886::llvm::StringRef InvariantOp::getLoopName() {
1887 auto attr = getLoopNameAttr();
1888 return attr.getValue();
1889}
1890
1891::mlir::ArrayAttr InvariantOp::getLoopArgTypes() {
1892 auto attr = getLoopArgTypesAttr();
1893 return attr;
1894}
1895
1896void InvariantOp::setLoopName(::llvm::StringRef attrValue) {
1897 getProperties().loop_name = ::mlir::Builder((*this)->getContext()).getStringAttr(attrValue);
1898}
1899
1900::llvm::LogicalResult InvariantOp::verifyInvariantsImpl() {
1901 auto tblgen_loop_arg_types = getProperties().loop_arg_types; (void)tblgen_loop_arg_types;
1902 if (!tblgen_loop_arg_types) return emitOpError("requires attribute 'loop_arg_types'");
1903 auto tblgen_loop_name = getProperties().loop_name; (void)tblgen_loop_name;
1904 if (!tblgen_loop_name) return emitOpError("requires attribute 'loop_name'");
1905
1906 if (::mlir::failed(__mlir_ods_local_attr_constraint_Ops1(*this, tblgen_loop_name, "loop_name")))
1907 return ::mlir::failure();
1908
1909 if (::mlir::failed(__mlir_ods_local_attr_constraint_Ops7(*this, tblgen_loop_arg_types, "loop_arg_types")))
1910 return ::mlir::failure();
1911 {
1912 unsigned index = 0; (void)index;
1913
1914 for (auto &region : ::llvm::MutableArrayRef((*this)->getRegion(0)))
1915 if (::mlir::failed(__mlir_ods_local_region_constraint_Ops2(*this, region, "region", index++)))
1916 return ::mlir::failure();
1917 }
1918 return ::mlir::success();
1919}
1920
1921::llvm::LogicalResult InvariantOp::verifyInvariants() {
1922 if(::mlir::succeeded(verifyInvariantsImpl()) && ::mlir::succeeded(verify()))
1923 return ::mlir::success();
1924 return ::mlir::failure();
1925}
1926
1927} // namespace verif
1928} // namespace llzk
1929MLIR_DEFINE_EXPLICIT_TYPE_ID(::llzk::verif::InvariantOp)
1930
1931namespace llzk {
1932namespace verif {
1933
1934//===----------------------------------------------------------------------===//
1935// ::llzk::verif::OldOp definitions
1936//===----------------------------------------------------------------------===//
1937
1938namespace detail {
1939} // namespace detail
1941
1942::llvm::LogicalResult OldOpAdaptor::verify(::mlir::Location loc) {
1943 return ::mlir::success();
1944}
1945
1946void OldOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value value) {
1947 odsState.addOperands(value);
1948 odsState.addTypes(result);
1949}
1950
1951void OldOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value value) {
1952 odsState.addOperands(value);
1953
1954 ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
1955 if (::mlir::succeeded(OldOp::inferReturnTypes(odsBuilder.getContext(),
1956 odsState.location, odsState.operands,
1957 odsState.attributes.getDictionary(odsState.getContext()),
1958 odsState.getRawProperties(),
1959 odsState.regions, inferredReturnTypes)))
1960 odsState.addTypes(inferredReturnTypes);
1961 else
1962 ::mlir::detail::reportFatalInferReturnTypesError(odsState);
1963
1964}
1965
1966void OldOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value value) {
1967 odsState.addOperands(value);
1968 assert(resultTypes.size() == 1u && "mismatched number of results");
1969 odsState.addTypes(resultTypes);
1970}
1971
1972void OldOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
1973 assert(operands.size() == 1u && "mismatched number of parameters");
1974 odsState.addOperands(operands);
1975 odsState.addAttributes(attributes);
1976 assert(resultTypes.size() == 1u && "mismatched number of return types");
1977 odsState.addTypes(resultTypes);
1978}
1979
1980void OldOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
1981 assert(operands.size() == 1u && "mismatched number of parameters");
1982 odsState.addOperands(operands);
1983 odsState.addAttributes(attributes);
1984
1985 ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
1986 if (::mlir::succeeded(OldOp::inferReturnTypes(odsBuilder.getContext(),
1987 odsState.location, operands,
1988 odsState.attributes.getDictionary(odsState.getContext()),
1989 odsState.getRawProperties(),
1990 odsState.regions, inferredReturnTypes))) {
1991 assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
1992 odsState.addTypes(inferredReturnTypes);
1993 } else {
1994 ::llvm::report_fatal_error("Failed to infer result type(s).");
1995 }
1996}
1997
1998::llvm::LogicalResult OldOp::verifyInvariantsImpl() {
1999 {
2000 unsigned index = 0; (void)index;
2001 auto valueGroup0 = getODSOperands(0);
2002
2003 for (auto v : valueGroup0) {
2004 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops6(*this, v.getType(), "operand", index++)))
2005 return ::mlir::failure();
2006 }
2007 }
2008 {
2009 unsigned index = 0; (void)index;
2010 auto valueGroup0 = getODSResults(0);
2011
2012 for (auto v : valueGroup0) {
2013 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops6(*this, v.getType(), "result", index++)))
2014 return ::mlir::failure();
2015 }
2016 }
2017 if (!((((*this->getODSOperands(0).begin()).getType()) == ((*this->getODSResults(0).begin()).getType()) && ((*this->getODSResults(0).begin()).getType()) == ((*this->getODSOperands(0).begin()).getType()))))
2018 return emitOpError("failed to verify that all of {value, result} have same type");
2019 return ::mlir::success();
2020}
2021
2022::llvm::LogicalResult OldOp::verifyInvariants() {
2023 return verifyInvariantsImpl();
2024}
2025
2026::llvm::LogicalResult OldOp::inferReturnTypes(::mlir::MLIRContext *context, ::std::optional<::mlir::Location> location, ::mlir::ValueRange operands, ::mlir::DictionaryAttr attributes, ::mlir::OpaqueProperties properties, ::mlir::RegionRange regions, ::llvm::SmallVectorImpl<::mlir::Type>&inferredReturnTypes) {
2027 inferredReturnTypes.resize(1);
2028 ::mlir::Builder odsBuilder(context);
2029 if (operands.size() <= 0)
2030 return ::mlir::failure();
2031 ::mlir::Type odsInferredType0 = operands[0].getType();
2032 inferredReturnTypes[0] = odsInferredType0;
2033 return ::mlir::success();
2034}
2035
2036::mlir::ParseResult OldOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
2037 ::mlir::OpAsmParser::UnresolvedOperand valueRawOperand{};
2038 ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> valueOperands(&valueRawOperand, 1); ::llvm::SMLoc valueOperandsLoc;
2039 (void)valueOperandsLoc;
2040 ::mlir::Type resultRawType{};
2041 ::llvm::ArrayRef<::mlir::Type> resultTypes(&resultRawType, 1);
2042
2043 valueOperandsLoc = parser.getCurrentLocation();
2044 if (parser.parseOperand(valueRawOperand))
2045 return ::mlir::failure();
2046 if (parser.parseColon())
2047 return ::mlir::failure();
2048
2049 {
2050 ::mlir::Type type;
2051 if (parser.parseCustomTypeWithFallback(type))
2052 return ::mlir::failure();
2053 resultRawType = type;
2054 }
2055 {
2056 auto loc = parser.getCurrentLocation();(void)loc;
2057 if (parser.parseOptionalAttrDict(result.attributes))
2058 return ::mlir::failure();
2059 }
2060 result.addTypes(resultTypes);
2061 if (parser.resolveOperands(valueOperands, resultTypes[0], valueOperandsLoc, result.operands))
2062 return ::mlir::failure();
2063 return ::mlir::success();
2064}
2065
2066void OldOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
2067 _odsPrinter << ' ';
2068 _odsPrinter << getValue();
2069 _odsPrinter << ' ' << ":";
2070 _odsPrinter << ' ';
2071 {
2072 auto type = getResult().getType();
2073 if (auto validType = ::llvm::dyn_cast<::mlir::Type>(type))
2074 _odsPrinter.printStrippedAttrOrType(validType);
2075 else
2076 _odsPrinter << type;
2077 }
2078 ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
2079 _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
2080}
2081
2082void OldOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
2083}
2084
2085} // namespace verif
2086} // namespace llzk
2087MLIR_DEFINE_EXPLICIT_TYPE_ID(::llzk::verif::OldOp)
2088
2089namespace llzk {
2090namespace verif {
2091
2092//===----------------------------------------------------------------------===//
2093// ::llzk::verif::ProveDetOp definitions
2094//===----------------------------------------------------------------------===//
2095
2096namespace detail {
2097} // namespace detail
2099
2100::llvm::LogicalResult ProveDetOpAdaptor::verify(::mlir::Location loc) {
2101 return ::mlir::success();
2102}
2103
2104void ProveDetOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value condition) {
2105 odsState.addOperands(condition);
2106 odsState.addTypes(result);
2107}
2108
2109void ProveDetOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value condition) {
2110 odsState.addOperands(condition);
2111
2112 ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
2113 if (::mlir::succeeded(ProveDetOp::inferReturnTypes(odsBuilder.getContext(),
2114 odsState.location, odsState.operands,
2115 odsState.attributes.getDictionary(odsState.getContext()),
2116 odsState.getRawProperties(),
2117 odsState.regions, inferredReturnTypes)))
2118 odsState.addTypes(inferredReturnTypes);
2119 else
2120 ::mlir::detail::reportFatalInferReturnTypesError(odsState);
2121
2122}
2123
2124void ProveDetOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value condition) {
2125 odsState.addOperands(condition);
2126 assert(resultTypes.size() == 1u && "mismatched number of results");
2127 odsState.addTypes(resultTypes);
2128}
2129
2130void ProveDetOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
2131 assert(operands.size() == 1u && "mismatched number of parameters");
2132 odsState.addOperands(operands);
2133 odsState.addAttributes(attributes);
2134 assert(resultTypes.size() == 1u && "mismatched number of return types");
2135 odsState.addTypes(resultTypes);
2136}
2137
2138void ProveDetOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
2139 assert(operands.size() == 1u && "mismatched number of parameters");
2140 odsState.addOperands(operands);
2141 odsState.addAttributes(attributes);
2142
2143 ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
2144 if (::mlir::succeeded(ProveDetOp::inferReturnTypes(odsBuilder.getContext(),
2145 odsState.location, operands,
2146 odsState.attributes.getDictionary(odsState.getContext()),
2147 odsState.getRawProperties(),
2148 odsState.regions, inferredReturnTypes))) {
2149 assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
2150 odsState.addTypes(inferredReturnTypes);
2151 } else {
2152 ::llvm::report_fatal_error("Failed to infer result type(s).");
2153 }
2154}
2155
2156::llvm::LogicalResult ProveDetOp::verifyInvariantsImpl() {
2157 {
2158 unsigned index = 0; (void)index;
2159 auto valueGroup0 = getODSOperands(0);
2160
2161 for (auto v : valueGroup0) {
2162 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops1(*this, v.getType(), "operand", index++)))
2163 return ::mlir::failure();
2164 }
2165 }
2166 {
2167 unsigned index = 0; (void)index;
2168 auto valueGroup0 = getODSResults(0);
2169
2170 for (auto v : valueGroup0) {
2171 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops3(*this, v.getType(), "result", index++)))
2172 return ::mlir::failure();
2173 }
2174 }
2175 return ::mlir::success();
2176}
2177
2178::llvm::LogicalResult ProveDetOp::verifyInvariants() {
2179 return verifyInvariantsImpl();
2180}
2181
2182::llvm::LogicalResult ProveDetOp::inferReturnTypes(::mlir::MLIRContext *context, ::std::optional<::mlir::Location> location, ::mlir::ValueRange operands, ::mlir::DictionaryAttr attributes, ::mlir::OpaqueProperties properties, ::mlir::RegionRange regions, ::llvm::SmallVectorImpl<::mlir::Type>&inferredReturnTypes) {
2183 inferredReturnTypes.resize(1);
2184 ::mlir::Builder odsBuilder(context);
2185 ::mlir::Type odsInferredType0 = odsBuilder.getIntegerType(1);
2186 inferredReturnTypes[0] = odsInferredType0;
2187 return ::mlir::success();
2188}
2189
2190::mlir::ParseResult ProveDetOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
2191 ::mlir::OpAsmParser::UnresolvedOperand conditionRawOperand{};
2192 ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> conditionOperands(&conditionRawOperand, 1); ::llvm::SMLoc conditionOperandsLoc;
2193 (void)conditionOperandsLoc;
2194 ::mlir::Type conditionRawType{};
2195 ::llvm::ArrayRef<::mlir::Type> conditionTypes(&conditionRawType, 1);
2196
2197 conditionOperandsLoc = parser.getCurrentLocation();
2198 if (parser.parseOperand(conditionRawOperand))
2199 return ::mlir::failure();
2200 {
2201 auto loc = parser.getCurrentLocation();(void)loc;
2202 if (parser.parseOptionalAttrDict(result.attributes))
2203 return ::mlir::failure();
2204 }
2205 if (parser.parseColon())
2206 return ::mlir::failure();
2207
2208 {
2209 ::mlir::Type type;
2210 if (parser.parseCustomTypeWithFallback(type))
2211 return ::mlir::failure();
2212 conditionRawType = type;
2213 }
2214 ::mlir::Type odsBuildableType0 = parser.getBuilder().getIntegerType(1);
2215 result.addTypes(odsBuildableType0);
2216 if (parser.resolveOperands(conditionOperands, conditionTypes, conditionOperandsLoc, result.operands))
2217 return ::mlir::failure();
2218 return ::mlir::success();
2219}
2220
2221void ProveDetOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
2222 _odsPrinter << ' ';
2223 _odsPrinter << getCondition();
2224 ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
2225 _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
2226 _odsPrinter << ' ' << ":";
2227 _odsPrinter << ' ';
2228 {
2229 auto type = getCondition().getType();
2230 if (auto validType = ::llvm::dyn_cast<::mlir::Type>(type))
2231 _odsPrinter.printStrippedAttrOrType(validType);
2232 else
2233 _odsPrinter << type;
2234 }
2235}
2236
2237} // namespace verif
2238} // namespace llzk
2239MLIR_DEFINE_EXPLICIT_TYPE_ID(::llzk::verif::ProveDetOp)
2240
2241namespace llzk {
2242namespace verif {
2243
2244//===----------------------------------------------------------------------===//
2245// ::llzk::verif::RequireComputeOp definitions
2246//===----------------------------------------------------------------------===//
2247
2248namespace detail {
2249} // namespace detail
2251
2252::llvm::LogicalResult RequireComputeOpAdaptor::verify(::mlir::Location loc) {
2253 return ::mlir::success();
2254}
2255
2256void RequireComputeOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value condition) {
2257 odsState.addOperands(condition);
2258}
2259
2260void RequireComputeOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value condition) {
2261 odsState.addOperands(condition);
2262 assert(resultTypes.size() == 0u && "mismatched number of results");
2263 odsState.addTypes(resultTypes);
2264}
2265
2266void RequireComputeOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
2267 assert(operands.size() == 1u && "mismatched number of parameters");
2268 odsState.addOperands(operands);
2269 odsState.addAttributes(attributes);
2270 assert(resultTypes.size() == 0u && "mismatched number of return types");
2271 odsState.addTypes(resultTypes);
2272}
2273
2275 {
2276 unsigned index = 0; (void)index;
2277 auto valueGroup0 = getODSOperands(0);
2278
2279 for (auto v : valueGroup0) {
2280 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops3(*this, v.getType(), "operand", index++)))
2281 return ::mlir::failure();
2282 }
2283 }
2284 return ::mlir::success();
2285}
2286
2287::llvm::LogicalResult RequireComputeOp::verifyInvariants() {
2288 return verifyInvariantsImpl();
2289}
2290
2291::mlir::ParseResult RequireComputeOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
2292 ::mlir::OpAsmParser::UnresolvedOperand conditionRawOperand{};
2293 ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> conditionOperands(&conditionRawOperand, 1); ::llvm::SMLoc conditionOperandsLoc;
2294 (void)conditionOperandsLoc;
2295
2296 conditionOperandsLoc = parser.getCurrentLocation();
2297 if (parser.parseOperand(conditionRawOperand))
2298 return ::mlir::failure();
2299 {
2300 auto loc = parser.getCurrentLocation();(void)loc;
2301 if (parser.parseOptionalAttrDict(result.attributes))
2302 return ::mlir::failure();
2303 }
2304 ::mlir::Type odsBuildableType0 = parser.getBuilder().getIntegerType(1);
2305 if (parser.resolveOperands(conditionOperands, odsBuildableType0, conditionOperandsLoc, result.operands))
2306 return ::mlir::failure();
2307 return ::mlir::success();
2308}
2309
2310void RequireComputeOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
2311 _odsPrinter << ' ';
2312 _odsPrinter << getCondition();
2313 ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
2314 _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
2315}
2316
2317// This side effect models "program termination". Based on
2318// https://github.com/llvm/llvm-project/blob/f325e4b2d836d6e65a4d0cf3efc6b0996ccf3765/mlir/lib/Dialect/ControlFlow/IR/ControlFlowOps.cpp#L92-L97
2320 ::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects
2321) {
2322 effects.emplace_back(::mlir::MemoryEffects::Write::get());
2323}
2324} // namespace verif
2325} // namespace llzk
2326MLIR_DEFINE_EXPLICIT_TYPE_ID(::llzk::verif::RequireComputeOp)
2327
2328namespace llzk {
2329namespace verif {
2330
2331//===----------------------------------------------------------------------===//
2332// ::llzk::verif::RequireConstrainOp definitions
2333//===----------------------------------------------------------------------===//
2334
2335namespace detail {
2336} // namespace detail
2338
2339::llvm::LogicalResult RequireConstrainOpAdaptor::verify(::mlir::Location loc) {
2340 return ::mlir::success();
2341}
2342
2343void RequireConstrainOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value condition) {
2344 odsState.addOperands(condition);
2345}
2346
2347void RequireConstrainOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value condition) {
2348 odsState.addOperands(condition);
2349 assert(resultTypes.size() == 0u && "mismatched number of results");
2350 odsState.addTypes(resultTypes);
2351}
2352
2353void RequireConstrainOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
2354 assert(operands.size() == 1u && "mismatched number of parameters");
2355 odsState.addOperands(operands);
2356 odsState.addAttributes(attributes);
2357 assert(resultTypes.size() == 0u && "mismatched number of return types");
2358 odsState.addTypes(resultTypes);
2359}
2360
2362 {
2363 unsigned index = 0; (void)index;
2364 auto valueGroup0 = getODSOperands(0);
2365
2366 for (auto v : valueGroup0) {
2367 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops3(*this, v.getType(), "operand", index++)))
2368 return ::mlir::failure();
2369 }
2370 }
2371 return ::mlir::success();
2372}
2373
2375 return verifyInvariantsImpl();
2376}
2377
2378::mlir::ParseResult RequireConstrainOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
2379 ::mlir::OpAsmParser::UnresolvedOperand conditionRawOperand{};
2380 ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> conditionOperands(&conditionRawOperand, 1); ::llvm::SMLoc conditionOperandsLoc;
2381 (void)conditionOperandsLoc;
2382
2383 conditionOperandsLoc = parser.getCurrentLocation();
2384 if (parser.parseOperand(conditionRawOperand))
2385 return ::mlir::failure();
2386 {
2387 auto loc = parser.getCurrentLocation();(void)loc;
2388 if (parser.parseOptionalAttrDict(result.attributes))
2389 return ::mlir::failure();
2390 }
2391 ::mlir::Type odsBuildableType0 = parser.getBuilder().getIntegerType(1);
2392 if (parser.resolveOperands(conditionOperands, odsBuildableType0, conditionOperandsLoc, result.operands))
2393 return ::mlir::failure();
2394 return ::mlir::success();
2395}
2396
2397void RequireConstrainOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
2398 _odsPrinter << ' ';
2399 _odsPrinter << getCondition();
2400 ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
2401 _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
2402}
2403
2404// This side effect models "program termination". Based on
2405// https://github.com/llvm/llvm-project/blob/f325e4b2d836d6e65a4d0cf3efc6b0996ccf3765/mlir/lib/Dialect/ControlFlow/IR/ControlFlowOps.cpp#L92-L97
2407 ::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects
2408) {
2409 effects.emplace_back(::mlir::MemoryEffects::Write::get());
2410}
2411} // namespace verif
2412} // namespace llzk
2413MLIR_DEFINE_EXPLICIT_TYPE_ID(::llzk::verif::RequireConstrainOp)
2414
2415namespace llzk {
2416namespace verif {
2417
2418//===----------------------------------------------------------------------===//
2419// ::llzk::verif::StepOp definitions
2420//===----------------------------------------------------------------------===//
2421
2422namespace detail {
2423} // namespace detail
2425
2426::llvm::LogicalResult StepOpAdaptor::verify(::mlir::Location loc) {
2427 return ::mlir::success();
2428}
2429
2430void StepOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState) {
2431 (void)odsState.addRegion();
2432}
2433
2434void StepOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes) {
2435 (void)odsState.addRegion();
2436 assert(resultTypes.size() == 0u && "mismatched number of results");
2437 odsState.addTypes(resultTypes);
2438}
2439
2440void StepOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
2441 assert(operands.size() == 0u && "mismatched number of parameters");
2442 odsState.addOperands(operands);
2443 odsState.addAttributes(attributes);
2444 for (unsigned i = 0; i != 1; ++i)
2445 (void)odsState.addRegion();
2446 assert(resultTypes.size() == 0u && "mismatched number of return types");
2447 odsState.addTypes(resultTypes);
2448}
2449
2450::llvm::LogicalResult StepOp::verifyInvariantsImpl() {
2451 {
2452 unsigned index = 0; (void)index;
2453
2454 for (auto &region : ::llvm::MutableArrayRef((*this)->getRegion(0)))
2455 if (::mlir::failed(__mlir_ods_local_region_constraint_Ops2(*this, region, "region", index++)))
2456 return ::mlir::failure();
2457 }
2458 return ::mlir::success();
2459}
2460
2461::llvm::LogicalResult StepOp::verifyInvariants() {
2462 return verifyInvariantsImpl();
2463}
2464
2465::mlir::ParseResult StepOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
2466 std::unique_ptr<::mlir::Region> regionRegion = std::make_unique<::mlir::Region>();
2467
2468 if (parser.parseRegion(*regionRegion))
2469 return ::mlir::failure();
2470
2471 if (regionRegion->empty()) regionRegion->emplaceBlock();
2472 {
2473 auto loc = parser.getCurrentLocation();(void)loc;
2474 if (parser.parseOptionalAttrDict(result.attributes))
2475 return ::mlir::failure();
2476 }
2477 result.addRegion(std::move(regionRegion));
2478 return ::mlir::success();
2479}
2480
2481void StepOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
2482 _odsPrinter << ' ';
2483 _odsPrinter.printRegion(getRegion());
2484 ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
2485 _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
2486}
2487
2488// This side effect models "program termination". Based on
2489// https://github.com/llvm/llvm-project/blob/f325e4b2d836d6e65a4d0cf3efc6b0996ccf3765/mlir/lib/Dialect/ControlFlow/IR/ControlFlowOps.cpp#L92-L97
2491 ::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects
2492) {
2493 effects.emplace_back(::mlir::MemoryEffects::Write::get());
2494}
2495} // namespace verif
2496} // namespace llzk
2497MLIR_DEFINE_EXPLICIT_TYPE_ID(::llzk::verif::StepOp)
2498
2499namespace llzk {
2500namespace verif {
2501
2502//===----------------------------------------------------------------------===//
2503// ::llzk::verif::StepYieldOp definitions
2504//===----------------------------------------------------------------------===//
2505
2506namespace detail {
2507} // namespace detail
2509
2510::llvm::LogicalResult StepYieldOpAdaptor::verify(::mlir::Location loc) {
2511 return ::mlir::success();
2512}
2513
2514void StepYieldOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value value) {
2515 odsState.addOperands(value);
2516}
2517
2518void StepYieldOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value value) {
2519 odsState.addOperands(value);
2520 assert(resultTypes.size() == 0u && "mismatched number of results");
2521 odsState.addTypes(resultTypes);
2522}
2523
2524void StepYieldOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
2525 assert(operands.size() == 1u && "mismatched number of parameters");
2526 odsState.addOperands(operands);
2527 odsState.addAttributes(attributes);
2528 assert(resultTypes.size() == 0u && "mismatched number of return types");
2529 odsState.addTypes(resultTypes);
2530}
2531
2532::llvm::LogicalResult StepYieldOp::verifyInvariantsImpl() {
2533 {
2534 unsigned index = 0; (void)index;
2535 auto valueGroup0 = getODSOperands(0);
2536
2537 for (auto v : valueGroup0) {
2538 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops3(*this, v.getType(), "operand", index++)))
2539 return ::mlir::failure();
2540 }
2541 }
2542 return ::mlir::success();
2543}
2544
2545::llvm::LogicalResult StepYieldOp::verifyInvariants() {
2546 return verifyInvariantsImpl();
2547}
2548
2549::mlir::ParseResult StepYieldOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
2550 ::mlir::OpAsmParser::UnresolvedOperand valueRawOperand{};
2551 ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> valueOperands(&valueRawOperand, 1); ::llvm::SMLoc valueOperandsLoc;
2552 (void)valueOperandsLoc;
2553
2554 valueOperandsLoc = parser.getCurrentLocation();
2555 if (parser.parseOperand(valueRawOperand))
2556 return ::mlir::failure();
2557 {
2558 auto loc = parser.getCurrentLocation();(void)loc;
2559 if (parser.parseOptionalAttrDict(result.attributes))
2560 return ::mlir::failure();
2561 }
2562 ::mlir::Type odsBuildableType0 = parser.getBuilder().getIntegerType(1);
2563 if (parser.resolveOperands(valueOperands, odsBuildableType0, valueOperandsLoc, result.operands))
2564 return ::mlir::failure();
2565 return ::mlir::success();
2566}
2567
2568void StepYieldOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
2569 _odsPrinter << ' ';
2570 _odsPrinter << getValue();
2571 ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
2572 _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
2573}
2574
2575} // namespace verif
2576} // namespace llzk
2577MLIR_DEFINE_EXPLICIT_TYPE_ID(::llzk::verif::StepYieldOp)
2578
2579namespace llzk {
2580namespace verif {
2581
2582//===----------------------------------------------------------------------===//
2583// ::llzk::verif::VerifAssertOp definitions
2584//===----------------------------------------------------------------------===//
2585
2586namespace detail {
2587} // namespace detail
2589
2590::llvm::LogicalResult VerifAssertOpAdaptor::verify(::mlir::Location loc) {
2591 return ::mlir::success();
2592}
2593
2594void VerifAssertOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value condition) {
2595 odsState.addOperands(condition);
2596}
2597
2598void VerifAssertOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value condition) {
2599 odsState.addOperands(condition);
2600 assert(resultTypes.size() == 0u && "mismatched number of results");
2601 odsState.addTypes(resultTypes);
2602}
2603
2604void VerifAssertOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
2605 assert(operands.size() == 1u && "mismatched number of parameters");
2606 odsState.addOperands(operands);
2607 odsState.addAttributes(attributes);
2608 assert(resultTypes.size() == 0u && "mismatched number of return types");
2609 odsState.addTypes(resultTypes);
2610}
2611
2613 {
2614 unsigned index = 0; (void)index;
2615 auto valueGroup0 = getODSOperands(0);
2616
2617 for (auto v : valueGroup0) {
2618 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops3(*this, v.getType(), "operand", index++)))
2619 return ::mlir::failure();
2620 }
2621 }
2622 return ::mlir::success();
2623}
2624
2625::llvm::LogicalResult VerifAssertOp::verifyInvariants() {
2626 return verifyInvariantsImpl();
2627}
2628
2629::mlir::ParseResult VerifAssertOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
2630 ::mlir::OpAsmParser::UnresolvedOperand conditionRawOperand{};
2631 ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> conditionOperands(&conditionRawOperand, 1); ::llvm::SMLoc conditionOperandsLoc;
2632 (void)conditionOperandsLoc;
2633
2634 conditionOperandsLoc = parser.getCurrentLocation();
2635 if (parser.parseOperand(conditionRawOperand))
2636 return ::mlir::failure();
2637 {
2638 auto loc = parser.getCurrentLocation();(void)loc;
2639 if (parser.parseOptionalAttrDict(result.attributes))
2640 return ::mlir::failure();
2641 }
2642 ::mlir::Type odsBuildableType0 = parser.getBuilder().getIntegerType(1);
2643 if (parser.resolveOperands(conditionOperands, odsBuildableType0, conditionOperandsLoc, result.operands))
2644 return ::mlir::failure();
2645 return ::mlir::success();
2646}
2647
2648void VerifAssertOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
2649 _odsPrinter << ' ';
2650 _odsPrinter << getCondition();
2651 ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
2652 _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
2653}
2654
2655// This side effect models "program termination". Based on
2656// https://github.com/llvm/llvm-project/blob/f325e4b2d836d6e65a4d0cf3efc6b0996ccf3765/mlir/lib/Dialect/ControlFlow/IR/ControlFlowOps.cpp#L92-L97
2658 ::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects
2659) {
2660 effects.emplace_back(::mlir::MemoryEffects::Write::get());
2661}
2662} // namespace verif
2663} // namespace llzk
2664MLIR_DEFINE_EXPLICIT_TYPE_ID(::llzk::verif::VerifAssertOp)
2665
2666namespace llzk {
2667namespace verif {
2668
2669//===----------------------------------------------------------------------===//
2670// ::llzk::verif::VerifProveOp definitions
2671//===----------------------------------------------------------------------===//
2672
2673namespace detail {
2674} // namespace detail
2676
2677::llvm::LogicalResult VerifProveOpAdaptor::verify(::mlir::Location loc) {
2678 return ::mlir::success();
2679}
2680
2681void VerifProveOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value condition) {
2682 odsState.addOperands(condition);
2683}
2684
2685void VerifProveOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value condition) {
2686 odsState.addOperands(condition);
2687 assert(resultTypes.size() == 0u && "mismatched number of results");
2688 odsState.addTypes(resultTypes);
2689}
2690
2691void VerifProveOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
2692 assert(operands.size() == 1u && "mismatched number of parameters");
2693 odsState.addOperands(operands);
2694 odsState.addAttributes(attributes);
2695 assert(resultTypes.size() == 0u && "mismatched number of return types");
2696 odsState.addTypes(resultTypes);
2697}
2698
2699::llvm::LogicalResult VerifProveOp::verifyInvariantsImpl() {
2700 {
2701 unsigned index = 0; (void)index;
2702 auto valueGroup0 = getODSOperands(0);
2703
2704 for (auto v : valueGroup0) {
2705 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops3(*this, v.getType(), "operand", index++)))
2706 return ::mlir::failure();
2707 }
2708 }
2709 return ::mlir::success();
2710}
2711
2712::llvm::LogicalResult VerifProveOp::verifyInvariants() {
2713 return verifyInvariantsImpl();
2714}
2715
2716::mlir::ParseResult VerifProveOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
2717 ::mlir::OpAsmParser::UnresolvedOperand conditionRawOperand{};
2718 ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> conditionOperands(&conditionRawOperand, 1); ::llvm::SMLoc conditionOperandsLoc;
2719 (void)conditionOperandsLoc;
2720
2721 conditionOperandsLoc = parser.getCurrentLocation();
2722 if (parser.parseOperand(conditionRawOperand))
2723 return ::mlir::failure();
2724 {
2725 auto loc = parser.getCurrentLocation();(void)loc;
2726 if (parser.parseOptionalAttrDict(result.attributes))
2727 return ::mlir::failure();
2728 }
2729 ::mlir::Type odsBuildableType0 = parser.getBuilder().getIntegerType(1);
2730 if (parser.resolveOperands(conditionOperands, odsBuildableType0, conditionOperandsLoc, result.operands))
2731 return ::mlir::failure();
2732 return ::mlir::success();
2733}
2734
2735void VerifProveOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
2736 _odsPrinter << ' ';
2737 _odsPrinter << getCondition();
2738 ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
2739 _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
2740}
2741
2742// This side effect models "program termination". Based on
2743// https://github.com/llvm/llvm-project/blob/f325e4b2d836d6e65a4d0cf3efc6b0996ccf3765/mlir/lib/Dialect/ControlFlow/IR/ControlFlowOps.cpp#L92-L97
2745 ::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects
2746) {
2747 effects.emplace_back(::mlir::MemoryEffects::Write::get());
2748}
2749} // namespace verif
2750} // namespace llzk
2751MLIR_DEFINE_EXPLICIT_TYPE_ID(::llzk::verif::VerifProveOp)
2752
2753namespace llzk {
2754namespace verif {
2755
2756//===----------------------------------------------------------------------===//
2757// ::llzk::verif::VerifSMTProveOp definitions
2758//===----------------------------------------------------------------------===//
2759
2760namespace detail {
2761} // namespace detail
2763
2764::llvm::LogicalResult VerifSMTProveOpAdaptor::verify(::mlir::Location loc) {
2765 return ::mlir::success();
2766}
2767
2768void VerifSMTProveOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value condition) {
2769 odsState.addOperands(condition);
2770}
2771
2772void VerifSMTProveOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value condition) {
2773 odsState.addOperands(condition);
2774 assert(resultTypes.size() == 0u && "mismatched number of results");
2775 odsState.addTypes(resultTypes);
2776}
2777
2778void VerifSMTProveOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
2779 assert(operands.size() == 1u && "mismatched number of parameters");
2780 odsState.addOperands(operands);
2781 odsState.addAttributes(attributes);
2782 assert(resultTypes.size() == 0u && "mismatched number of return types");
2783 odsState.addTypes(resultTypes);
2784}
2785
2787 {
2788 unsigned index = 0; (void)index;
2789 auto valueGroup0 = getODSOperands(0);
2790
2791 for (auto v : valueGroup0) {
2792 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops7(*this, v.getType(), "operand", index++)))
2793 return ::mlir::failure();
2794 }
2795 }
2796 return ::mlir::success();
2797}
2798
2799::llvm::LogicalResult VerifSMTProveOp::verifyInvariants() {
2800 return verifyInvariantsImpl();
2801}
2802
2803::mlir::ParseResult VerifSMTProveOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
2804 ::mlir::OpAsmParser::UnresolvedOperand conditionRawOperand{};
2805 ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> conditionOperands(&conditionRawOperand, 1); ::llvm::SMLoc conditionOperandsLoc;
2806 (void)conditionOperandsLoc;
2807
2808 conditionOperandsLoc = parser.getCurrentLocation();
2809 if (parser.parseOperand(conditionRawOperand))
2810 return ::mlir::failure();
2811 {
2812 auto loc = parser.getCurrentLocation();(void)loc;
2813 if (parser.parseOptionalAttrDict(result.attributes))
2814 return ::mlir::failure();
2815 }
2816 ::mlir::Type odsBuildableType0 = parser.getBuilder().getType<::llzk::smt::BoolType>();
2817 if (parser.resolveOperands(conditionOperands, odsBuildableType0, conditionOperandsLoc, result.operands))
2818 return ::mlir::failure();
2819 return ::mlir::success();
2820}
2821
2822void VerifSMTProveOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
2823 _odsPrinter << ' ';
2824 _odsPrinter << getCondition();
2825 ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
2826 _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
2827}
2828
2829} // namespace verif
2830} // namespace llzk
2831MLIR_DEFINE_EXPLICIT_TYPE_ID(::llzk::verif::VerifSMTProveOp)
2832
2833
2834#endif // GET_OP_CLASSES
2835
static FeltType get(::mlir::MLIRContext *context, ::mlir::StringAttr fieldName)
Definition Types.cpp.inc:67
AssumeDetOpAdaptor(AssumeDetOp op)
Definition Ops.cpp.inc:244
::llvm::LogicalResult verify(::mlir::Location loc)
Definition Ops.cpp.inc:246
AssumeDetOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs={}, const ::mlir::EmptyProperties &properties={}, ::mlir::RegionRange regions={})
Definition Ops.h.inc:139
::mlir::Operation::operand_range getODSOperands(unsigned index)
Definition Ops.h.inc:196
::mlir::TypedValue<::mlir::Type > getHint()
Definition Ops.h.inc:202
void print(::mlir::OpAsmPrinter &_odsPrinter)
Definition Ops.cpp.inc:314
::llvm::LogicalResult verifyInvariants()
Definition Ops.cpp.inc:281
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
Definition Ops.cpp.inc:285
::llvm::LogicalResult verifyInvariantsImpl()
Definition Ops.cpp.inc:268
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value hint)
Definition Ops.cpp.inc:250
ContractEndOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs={}, const ::mlir::EmptyProperties &properties={}, ::mlir::RegionRange regions={})
Definition Ops.h.inc:270
::llvm::LogicalResult verify(::mlir::Location loc)
Definition Ops.cpp.inc:352
ContractEndOpAdaptor(ContractEndOp op)
Definition Ops.cpp.inc:350
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
Definition Ops.cpp.inc:380
::llvm::LogicalResult verifyInvariantsImpl()
Definition Ops.cpp.inc:372
::llvm::LogicalResult verifyInvariants()
Definition Ops.cpp.inc:376
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState)
Definition Ops.cpp.inc:356
void print(::mlir::OpAsmPrinter &_odsPrinter)
Definition Ops.cpp.inc:389
void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect > > &effects)
Definition Ops.cpp.inc:394
ContractOpAdaptor(ContractOp op)
Definition Ops.cpp.inc:432
::llvm::LogicalResult verify(::mlir::Location loc)
Definition Ops.cpp.inc:434
ContractOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:479
::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:614
::mlir::StringAttr getFunctionTypeAttrName()
Definition Ops.h.inc:536
static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value)
Definition Ops.cpp.inc:582
static std::optional< mlir::Attribute > getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name)
Definition Ops.cpp.inc:567
static llvm::hash_code computePropertiesHash(const Properties &prop)
Definition Ops.cpp.inc:559
::mlir::StringAttr getTargetAttrName()
Definition Ops.h.inc:552
void setFunctionType(::mlir::FunctionType attrValue)
Definition Ops.cpp.inc:690
::mlir::StringAttr getSymNameAttr()
Definition Ops.h.inc:597
::llvm::LogicalResult verifyInvariants()
Definition Ops.cpp.inc:762
::llvm::LogicalResult verify()
Definition Ops.cpp:610
::std::optional< ::mlir::ArrayAttr > getArgAttrs()
Definition Ops.cpp.inc:681
::mlir::FunctionType getFunctionType()
Definition Ops.cpp.inc:676
::mlir::StringAttr getSymNameAttrName()
Definition Ops.h.inc:544
::mlir::StringAttr getArgAttrsAttrName()
Definition Ops.h.inc:528
::mlir::TypeAttr getFunctionTypeAttr()
Definition Ops.h.inc:607
::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop)
Definition Ops.cpp.inc:522
static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs)
Definition Ops.cpp.inc:604
::mlir::SymbolRefAttr getTargetAttr()
Definition Ops.h.inc:602
::mlir::SymbolRefAttr getFullyQualifiedName(bool requireParent=true)
Return the full name for this contract from the root module, including all surrounding symbol table n...
Definition Ops.cpp:392
::llvm::LogicalResult verifyInvariantsImpl()
Definition Ops.cpp.inc:732
::mlir::ArrayAttr getArgAttrsAttr()
Definition Ops.h.inc:612
void writeProperties(::mlir::DialectBytecodeWriter &writer)
Definition Ops.cpp.inc:657
void setSymName(::llvm::StringRef attrValue)
Definition Ops.cpp.inc:686
::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:457
::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state)
Definition Ops.cpp.inc:641
::mlir::SymbolRefAttr getTarget()
Definition Ops.cpp.inc:671
FoldAdaptor::Properties Properties
Definition Ops.h.inc:522
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::StringAttr sym_name, ::mlir::SymbolRefAttr target, ::mlir::TypeAttr function_type, ::mlir::ArrayAttr arg_attrs={})
Definition Ops.cpp.inc:694
::llvm::StringRef getSymName()
Definition Ops.cpp.inc:666
DecreasesOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs={}, const ::mlir::EmptyProperties &properties={}, ::mlir::RegionRange regions={})
Definition Ops.h.inc:804
DecreasesOpAdaptor(DecreasesOp op)
Definition Ops.cpp.inc:781
::llvm::LogicalResult verify(::mlir::Location loc)
Definition Ops.cpp.inc:783
::mlir::TypedValue<::llzk::felt::FeltType > getValue()
Definition Ops.h.inc:867
void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect > > &effects)
Definition Ops.cpp.inc:850
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
Definition Ops.cpp.inc:822
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value value)
Definition Ops.cpp.inc:787
::llvm::LogicalResult verifyInvariantsImpl()
Definition Ops.cpp.inc:805
::mlir::Operation::operand_range getODSOperands(unsigned index)
Definition Ops.h.inc:861
::llvm::LogicalResult verifyInvariants()
Definition Ops.cpp.inc:818
void print(::mlir::OpAsmPrinter &_odsPrinter)
Definition Ops.cpp.inc:841
EnsureComputeOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs={}, const ::mlir::EmptyProperties &properties={}, ::mlir::RegionRange regions={})
Definition Ops.h.inc:936
EnsureComputeOpAdaptor(EnsureComputeOp op)
Definition Ops.cpp.inc:868
::llvm::LogicalResult verify(::mlir::Location loc)
Definition Ops.cpp.inc:870
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
Definition Ops.cpp.inc:909
void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect > > &effects)
Definition Ops.cpp.inc:937
::llvm::LogicalResult verifyInvariants()
Definition Ops.cpp.inc:905
void print(::mlir::OpAsmPrinter &_odsPrinter)
Definition Ops.cpp.inc:928
::mlir::Operation::operand_range getODSOperands(unsigned index)
Definition Ops.h.inc:993
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value condition)
Definition Ops.cpp.inc:874
::llvm::LogicalResult verifyInvariantsImpl()
Definition Ops.cpp.inc:892
::mlir::TypedValue<::mlir::IntegerType > getCondition()
Definition Ops.h.inc:999
::llvm::LogicalResult verify(::mlir::Location loc)
Definition Ops.cpp.inc:957
EnsureConstrainOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs={}, const ::mlir::EmptyProperties &properties={}, ::mlir::RegionRange regions={})
Definition Ops.h.inc:1068
EnsureConstrainOpAdaptor(EnsureConstrainOp op)
Definition Ops.cpp.inc:955
::mlir::Operation::operand_range getODSOperands(unsigned index)
Definition Ops.h.inc:1125
void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect > > &effects)
Definition Ops.cpp.inc:1024
::llvm::LogicalResult verifyInvariants()
Definition Ops.cpp.inc:992
void print(::mlir::OpAsmPrinter &_odsPrinter)
Definition Ops.cpp.inc:1015
::llvm::LogicalResult verifyInvariantsImpl()
Definition Ops.cpp.inc:979
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value condition)
Definition Ops.cpp.inc:961
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
Definition Ops.cpp.inc:996
::mlir::TypedValue<::mlir::IntegerType > getCondition()
Definition Ops.h.inc:1131
::llvm::LogicalResult verify(::mlir::Location loc)
Definition Ops.cpp.inc:1080
IncludeOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:1286
void setNumDimsPerMap(::llvm::ArrayRef< int32_t > attrValue)
Definition Ops.cpp.inc:1423
::mlir::MutableOperandRange getArgOperandsMutable()
Definition Ops.cpp.inc:1111
::mlir::ArrayAttr getTemplateParamsAttr()
Definition Ops.h.inc:1436
::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop)
Definition Ops.cpp.inc:1199
::llvm::LogicalResult verifyInvariantsImpl()
Definition Ops.cpp.inc:1465
static llvm::hash_code computePropertiesHash(const Properties &prop)
Definition Ops.cpp.inc:1244
::mlir::Operation::operand_range getODSOperands(unsigned index)
Definition Ops.h.inc:1396
::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state)
Definition Ops.cpp.inc:1340
void setMapOpGroupSizes(::llvm::ArrayRef< int32_t > attrValue)
Definition Ops.cpp.inc:1427
::mlir::OperandRangeRange getMapOperands()
Definition Ops.h.inc:1406
::llvm::LogicalResult setPropertiesFromParsedAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:1583
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
Definition Ops.cpp.inc:1508
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index)
Definition Ops.cpp.inc:1102
::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:1313
::llvm::ArrayRef< int32_t > getMapOpGroupSizes()
Definition Ops.cpp.inc:1418
void writeProperties(::mlir::DialectBytecodeWriter &writer)
Definition Ops.cpp.inc:1380
::mlir::SymbolRefAttr getCalleeAttr()
Definition Ops.h.inc:1431
FoldAdaptor::Properties Properties
Definition Ops.h.inc:1345
static std::optional< mlir::Attribute > getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name)
Definition Ops.cpp.inc:1256
::mlir::Operation::operand_range getArgOperands()
Definition Ops.h.inc:1402
static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs)
Definition Ops.cpp.inc:1302
::mlir::SymbolRefAttr getCallee()
Definition Ops.cpp.inc:1403
::mlir::StringAttr getCalleeAttrName()
Definition Ops.h.inc:1351
::mlir::StringAttr getMapOpGroupSizesAttrName()
Definition Ops.h.inc:1359
::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:1123
::mlir::MutableOperandRangeRange getMapOperandsMutable()
Definition Ops.cpp.inc:1117
::std::optional< ::mlir::ArrayAttr > getTemplateParams()
Definition Ops.cpp.inc:1408
static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value)
Definition Ops.cpp.inc:1272
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::SymbolRefAttr callee, ::mlir::ValueRange argOperands={}, ::llvm::ArrayRef<::mlir::Attribute > templateParams={})
void print(::mlir::OpAsmPrinter &_odsPrinter)
Definition Ops.cpp.inc:1611
static void populateDefaultProperties(::mlir::OperationName opName, Properties &properties)
Definition Ops.cpp.inc:1459
::llvm::ArrayRef< int32_t > getNumDimsPerMap()
Definition Ops.cpp.inc:1413
::mlir::StringAttr getNumDimsPerMapAttrName()
Definition Ops.h.inc:1367
::mlir::DenseI32ArrayAttr getNumDimsPerMapAttr()
Definition Ops.h.inc:1441
::llvm::LogicalResult verifyInvariants()
Definition Ops.cpp.inc:1504
::mlir::DenseI32ArrayAttr getMapOpGroupSizesAttr()
Definition Ops.h.inc:1446
::mlir::StringAttr getTemplateParamsAttrName()
Definition Ops.h.inc:1375
IncreasesOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs={}, const ::mlir::EmptyProperties &properties={}, ::mlir::RegionRange regions={})
Definition Ops.h.inc:1604
IncreasesOpAdaptor(IncreasesOp op)
Definition Ops.cpp.inc:1647
::llvm::LogicalResult verify(::mlir::Location loc)
Definition Ops.cpp.inc:1649
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
Definition Ops.cpp.inc:1688
::llvm::LogicalResult verifyInvariants()
Definition Ops.cpp.inc:1684
void print(::mlir::OpAsmPrinter &_odsPrinter)
Definition Ops.cpp.inc:1707
::llvm::LogicalResult verifyInvariantsImpl()
Definition Ops.cpp.inc:1671
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value value)
Definition Ops.cpp.inc:1653
::mlir::Operation::operand_range getODSOperands(unsigned index)
Definition Ops.h.inc:1661
::mlir::TypedValue<::llzk::felt::FeltType > getValue()
Definition Ops.h.inc:1667
void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect > > &effects)
Definition Ops.cpp.inc:1716
::llvm::LogicalResult verify(::mlir::Location loc)
Definition Ops.cpp.inc:1748
InvariantOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:1792
InvariantOpAdaptor(InvariantOp op)
Definition Ops.cpp.inc:1746
::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:1855
static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value)
Definition Ops.cpp.inc:1837
::mlir::StringAttr getLoopArgTypesAttrName()
Definition Ops.h.inc:1841
void writeProperties(::mlir::DialectBytecodeWriter &writer)
Definition Ops.cpp.inc:1880
void setLoopName(::llvm::StringRef attrValue)
Definition Ops.cpp.inc:1896
static std::optional< mlir::Attribute > getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name)
Definition Ops.cpp.inc:1828
::mlir::ArrayAttr getLoopArgTypesAttr()
Definition Ops.h.inc:1899
::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop)
Definition Ops.cpp.inc:1799
::mlir::ArrayAttr getLoopArgTypes()
Definition Ops.cpp.inc:1891
static llvm::hash_code computePropertiesHash(const Properties &prop)
Definition Ops.cpp.inc:1822
::mlir::StringAttr getLoopNameAttr()
Definition Ops.h.inc:1894
::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state)
Definition Ops.cpp.inc:1870
::llvm::StringRef getLoopName()
Definition Ops.cpp.inc:1886
FoldAdaptor::Properties Properties
Definition Ops.h.inc:1835
::llvm::LogicalResult verify()
Definition Ops.cpp:1160
static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs)
Definition Ops.cpp.inc:1849
::llvm::LogicalResult verifyInvariantsImpl()
Definition Ops.cpp.inc:1900
::llvm::LogicalResult verifyInvariants()
Definition Ops.cpp.inc:1921
::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:1762
::mlir::StringAttr getLoopNameAttrName()
Definition Ops.h.inc:1849
::llvm::LogicalResult verify(::mlir::Location loc)
Definition Ops.cpp.inc:1942
OldOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs={}, const ::mlir::EmptyProperties &properties={}, ::mlir::RegionRange regions={})
Definition Ops.h.inc:1978
void print(::mlir::OpAsmPrinter &_odsPrinter)
Definition Ops.cpp.inc:2066
::llvm::LogicalResult verifyInvariantsImpl()
Definition Ops.cpp.inc:1998
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
Definition Ops.cpp.inc:2036
::mlir::Operation::operand_range getODSOperands(unsigned index)
Definition Ops.h.inc:2035
::mlir::TypedValue<::mlir::Type > getResult()
Definition Ops.h.inc:2060
::llvm::LogicalResult verifyInvariants()
Definition Ops.cpp.inc:2022
void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect > > &effects)
Definition Ops.cpp.inc:2082
::mlir::TypedValue<::mlir::Type > getValue()
Definition Ops.h.inc:2041
::llvm::LogicalResult inferReturnTypes(::mlir::MLIRContext *context, ::std::optional<::mlir::Location > location, ::mlir::ValueRange operands, ::mlir::DictionaryAttr attributes, ::mlir::OpaqueProperties properties, ::mlir::RegionRange regions, ::llvm::SmallVectorImpl<::mlir::Type > &inferredReturnTypes)
Definition Ops.cpp.inc:2026
::mlir::Operation::result_range getODSResults(unsigned index)
Definition Ops.h.inc:2054
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value value)
Definition Ops.cpp.inc:1946
::llvm::LogicalResult verify(::mlir::Location loc)
Definition Ops.cpp.inc:2100
ProveDetOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs={}, const ::mlir::EmptyProperties &properties={}, ::mlir::RegionRange regions={})
Definition Ops.h.inc:2117
::llvm::LogicalResult verifyInvariantsImpl()
Definition Ops.cpp.inc:2156
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value condition)
Definition Ops.cpp.inc:2104
void print(::mlir::OpAsmPrinter &_odsPrinter)
Definition Ops.cpp.inc:2221
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
Definition Ops.cpp.inc:2190
::mlir::TypedValue<::mlir::Type > getCondition()
Definition Ops.h.inc:2180
::mlir::Operation::result_range getODSResults(unsigned index)
Definition Ops.h.inc:2193
::mlir::Operation::operand_range getODSOperands(unsigned index)
Definition Ops.h.inc:2174
::llvm::LogicalResult verifyInvariants()
Definition Ops.cpp.inc:2178
::llvm::LogicalResult inferReturnTypes(::mlir::MLIRContext *context, ::std::optional<::mlir::Location > location, ::mlir::ValueRange operands, ::mlir::DictionaryAttr attributes, ::mlir::OpaqueProperties properties, ::mlir::RegionRange regions, ::llvm::SmallVectorImpl<::mlir::Type > &inferredReturnTypes)
Definition Ops.cpp.inc:2182
RequireComputeOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs={}, const ::mlir::EmptyProperties &properties={}, ::mlir::RegionRange regions={})
Definition Ops.h.inc:2255
RequireComputeOpAdaptor(RequireComputeOp op)
Definition Ops.cpp.inc:2250
::llvm::LogicalResult verify(::mlir::Location loc)
Definition Ops.cpp.inc:2252
::llvm::LogicalResult verifyInvariantsImpl()
Definition Ops.cpp.inc:2274
void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect > > &effects)
Definition Ops.cpp.inc:2319
::llvm::LogicalResult verifyInvariants()
Definition Ops.cpp.inc:2287
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
Definition Ops.cpp.inc:2291
::mlir::TypedValue<::mlir::IntegerType > getCondition()
Definition Ops.h.inc:2318
::mlir::Operation::operand_range getODSOperands(unsigned index)
Definition Ops.h.inc:2312
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value condition)
Definition Ops.cpp.inc:2256
void print(::mlir::OpAsmPrinter &_odsPrinter)
Definition Ops.cpp.inc:2310
RequireConstrainOpAdaptor(RequireConstrainOp op)
Definition Ops.cpp.inc:2337
RequireConstrainOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs={}, const ::mlir::EmptyProperties &properties={}, ::mlir::RegionRange regions={})
Definition Ops.h.inc:2387
::llvm::LogicalResult verify(::mlir::Location loc)
Definition Ops.cpp.inc:2339
::llvm::LogicalResult verifyInvariants()
Definition Ops.cpp.inc:2374
::mlir::TypedValue<::mlir::IntegerType > getCondition()
Definition Ops.h.inc:2450
void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect > > &effects)
Definition Ops.cpp.inc:2406
::llvm::LogicalResult verifyInvariantsImpl()
Definition Ops.cpp.inc:2361
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value condition)
Definition Ops.cpp.inc:2343
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
Definition Ops.cpp.inc:2378
::mlir::Operation::operand_range getODSOperands(unsigned index)
Definition Ops.h.inc:2444
void print(::mlir::OpAsmPrinter &_odsPrinter)
Definition Ops.cpp.inc:2397
::llvm::LogicalResult verify(::mlir::Location loc)
Definition Ops.cpp.inc:2426
StepOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs={}, const ::mlir::EmptyProperties &properties={}, ::mlir::RegionRange regions={})
Definition Ops.h.inc:2527
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
Definition Ops.cpp.inc:2465
::llvm::LogicalResult verifyInvariantsImpl()
Definition Ops.cpp.inc:2450
::llvm::LogicalResult verifyInvariants()
Definition Ops.cpp.inc:2461
void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect > > &effects)
Definition Ops.cpp.inc:2490
::mlir::Region & getRegion()
Definition Ops.h.inc:2596
void print(::mlir::OpAsmPrinter &_odsPrinter)
Definition Ops.cpp.inc:2481
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState)
Definition Ops.cpp.inc:2430
StepYieldOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs={}, const ::mlir::EmptyProperties &properties={}, ::mlir::RegionRange regions={})
Definition Ops.h.inc:2650
::llvm::LogicalResult verify(::mlir::Location loc)
Definition Ops.cpp.inc:2510
StepYieldOpAdaptor(StepYieldOp op)
Definition Ops.cpp.inc:2508
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value value)
Definition Ops.cpp.inc:2514
::mlir::TypedValue<::mlir::IntegerType > getValue()
Definition Ops.h.inc:2713
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
Definition Ops.cpp.inc:2549
::llvm::LogicalResult verifyInvariantsImpl()
Definition Ops.cpp.inc:2532
::mlir::Operation::operand_range getODSOperands(unsigned index)
Definition Ops.h.inc:2707
::llvm::LogicalResult verifyInvariants()
Definition Ops.cpp.inc:2545
void print(::mlir::OpAsmPrinter &_odsPrinter)
Definition Ops.cpp.inc:2568
VerifAssertOpAdaptor(VerifAssertOp op)
Definition Ops.cpp.inc:2588
::llvm::LogicalResult verify(::mlir::Location loc)
Definition Ops.cpp.inc:2590
VerifAssertOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs={}, const ::mlir::EmptyProperties &properties={}, ::mlir::RegionRange regions={})
Definition Ops.h.inc:2781
::mlir::TypedValue<::mlir::IntegerType > getCondition()
Definition Ops.h.inc:2844
::llvm::LogicalResult verifyInvariantsImpl()
Definition Ops.cpp.inc:2612
::mlir::Operation::operand_range getODSOperands(unsigned index)
Definition Ops.h.inc:2838
void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect > > &effects)
Definition Ops.cpp.inc:2657
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
Definition Ops.cpp.inc:2629
void print(::mlir::OpAsmPrinter &_odsPrinter)
Definition Ops.cpp.inc:2648
::llvm::LogicalResult verifyInvariants()
Definition Ops.cpp.inc:2625
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value condition)
Definition Ops.cpp.inc:2594
VerifProveOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs={}, const ::mlir::EmptyProperties &properties={}, ::mlir::RegionRange regions={})
Definition Ops.h.inc:2913
VerifProveOpAdaptor(VerifProveOp op)
Definition Ops.cpp.inc:2675
::llvm::LogicalResult verify(::mlir::Location loc)
Definition Ops.cpp.inc:2677
::mlir::TypedValue<::mlir::IntegerType > getCondition()
Definition Ops.h.inc:2976
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
Definition Ops.cpp.inc:2716
::llvm::LogicalResult verifyInvariantsImpl()
Definition Ops.cpp.inc:2699
::llvm::LogicalResult verifyInvariants()
Definition Ops.cpp.inc:2712
void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect > > &effects)
Definition Ops.cpp.inc:2744
::mlir::Operation::operand_range getODSOperands(unsigned index)
Definition Ops.h.inc:2970
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value condition)
Definition Ops.cpp.inc:2681
void print(::mlir::OpAsmPrinter &_odsPrinter)
Definition Ops.cpp.inc:2735
VerifSMTProveOpAdaptor(VerifSMTProveOp op)
Definition Ops.cpp.inc:2762
::llvm::LogicalResult verify(::mlir::Location loc)
Definition Ops.cpp.inc:2764
VerifSMTProveOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs={}, const ::mlir::EmptyProperties &properties={}, ::mlir::RegionRange regions={})
Definition Ops.h.inc:3045
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value condition)
Definition Ops.cpp.inc:2768
::mlir::Operation::operand_range getODSOperands(unsigned index)
Definition Ops.h.inc:3102
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
Definition Ops.cpp.inc:2803
::llvm::LogicalResult verifyInvariants()
Definition Ops.cpp.inc:2799
::llvm::LogicalResult verifyInvariantsImpl()
Definition Ops.cpp.inc:2786
::mlir::TypedValue<::llzk::smt::BoolType > getCondition()
Definition Ops.h.inc:3108
void print(::mlir::OpAsmPrinter &_odsPrinter)
Definition Ops.cpp.inc:2822
::std::optional<::mlir::OperationName > odsOpName
Definition Ops.h.inc:418
ContractOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:422
::std::optional< ::mlir::ArrayAttr > getArgAttrs()
Definition Ops.cpp.inc:426
::llvm::ArrayRef< int32_t > getNumDimsPerMap()
Definition Ops.cpp.inc:1067
::mlir::DenseI32ArrayAttr getNumDimsPerMapAttr()
Definition Ops.cpp.inc:1062
::std::optional<::mlir::OperationName > odsOpName
Definition Ops.h.inc:1240
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize)
Definition Ops.cpp.inc:1043
::llvm::ArrayRef< int32_t > getMapOpGroupSizes()
Definition Ops.cpp.inc:1072
::std::optional< ::mlir::ArrayAttr > getTemplateParams()
Definition Ops.cpp.inc:1057
IncludeOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:1244
::mlir::DenseI32ArrayAttr getMapOpGroupSizesAttr()
Definition Ops.h.inc:1273
::std::optional<::mlir::OperationName > odsOpName
Definition Ops.h.inc:1743
InvariantOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:1747
void printTemplateParams(mlir::AsmPrinter &printer, mlir::ArrayAttr value)
Definition OpHelpers.h:238
mlir::ParseResult parseAttrDictWithWarnings(mlir::OpAsmParser &parser, mlir::NamedAttrList &extraAttrs, mlir::OperationState &state)
Definition OpHelpers.h:191
bool isValidEmitEqType(Type type)
bool isValidType(Type type)
void printMultiDimAndSymbolList(mlir::OpAsmPrinter &printer, mlir::Operation *op, mlir::OperandRangeRange multiMapOperands, mlir::DenseI32ArrayAttr numDimsPerMap)
Definition OpHelpers.h:184
void printAttrDictWithWarnings(mlir::OpAsmPrinter &printer, ConcreteOp op, mlir::DictionaryAttr extraAttrs, typename mlir::PropertiesSelector< ConcreteOp >::type state)
Definition OpHelpers.h:198
mlir::ParseResult parseTemplateParams(mlir::AsmParser &parser, mlir::ArrayAttr &value)
Definition OpHelpers.h:205
mlir::ParseResult parseMultiDimAndSymbolList(mlir::OpAsmParser &parser, mlir::SmallVector< mlir::SmallVector< mlir::OpAsmParser::UnresolvedOperand > > &multiMapOperands, mlir::DenseI32ArrayAttr &numDimsPerMap)
Definition OpHelpers.h:176