LLZK 2.0.0
An open-source IR for Zero Knowledge (ZK) circuits
Loading...
Searching...
No Matches
Ops.cpp.inc
Go to the documentation of this file.
1/*===- TableGen'erated file -------------------------------------*- C++ -*-===*\
2|* *|
3|* Op Definitions *|
4|* *|
5|* Automatically generated file, do not edit! *|
6|* From: Ops.td *|
7|* *|
8\*===----------------------------------------------------------------------===*/
9
10#ifdef GET_OP_LIST
11#undef GET_OP_LIST
12
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 felt {
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 (!((::llvm::isa<llzk::polymorphic::TypeVarType,::llzk::felt::FeltType>(type)))) {
48 return op->emitOpError(valueKind) << " #" << valueIndex
49 << " must be finite field element or type variable, 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 (!((::llzk::isValidType(type)))) {
58 return op->emitOpError(valueKind) << " #" << valueIndex
59 << " must be a valid LLZK type, but got " << type;
60 }
61 return ::mlir::success();
62}
63
64static ::llvm::LogicalResult __mlir_ods_local_attr_constraint_Ops1(
65 ::mlir::Attribute attr, ::llvm::StringRef attrName, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
66 if (attr && !((::llvm::isa<::llzk::felt::FeltConstAttr>(attr))))
67 return emitError() << "attribute '" << attrName
68 << "' failed to satisfy constraint: finite field element";
69 return ::mlir::success();
70}
71static ::llvm::LogicalResult __mlir_ods_local_attr_constraint_Ops1(
72 ::mlir::Operation *op, ::mlir::Attribute attr, ::llvm::StringRef attrName) {
73 return __mlir_ods_local_attr_constraint_Ops1(attr, attrName, [op]() {
74 return op->emitOpError();
75 });
76}
77} // namespace felt
78} // namespace llzk
79namespace llzk {
80namespace felt {
81
82//===----------------------------------------------------------------------===//
83// ::llzk::felt::AddFeltOp definitions
84//===----------------------------------------------------------------------===//
85
86namespace detail {
87} // namespace detail
89
90::llvm::LogicalResult AddFeltOpAdaptor::verify(::mlir::Location loc) {
91 return ::mlir::success();
92}
93
94void AddFeltOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs) {
95 odsState.addOperands(lhs);
96 odsState.addOperands(rhs);
97 odsState.addTypes(result);
98}
99
100void AddFeltOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value lhs, ::mlir::Value rhs) {
101 odsState.addOperands(lhs);
102 odsState.addOperands(rhs);
103
104 ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
105 if (::mlir::succeeded(AddFeltOp::inferReturnTypes(odsBuilder.getContext(),
106 odsState.location, odsState.operands,
107 odsState.attributes.getDictionary(odsState.getContext()),
108 odsState.getRawProperties(),
109 odsState.regions, inferredReturnTypes)))
110 odsState.addTypes(inferredReturnTypes);
111 else
112 ::mlir::detail::reportFatalInferReturnTypesError(odsState);
113
114}
115
116void AddFeltOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs) {
117 odsState.addOperands(lhs);
118 odsState.addOperands(rhs);
119 assert(resultTypes.size() == 1u && "mismatched number of results");
120 odsState.addTypes(resultTypes);
121}
122
123void AddFeltOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
124 assert(operands.size() == 2u && "mismatched number of parameters");
125 odsState.addOperands(operands);
126 odsState.addAttributes(attributes);
127 assert(resultTypes.size() == 1u && "mismatched number of return types");
128 odsState.addTypes(resultTypes);
129}
130
131void AddFeltOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
132 assert(operands.size() == 2u && "mismatched number of parameters");
133 odsState.addOperands(operands);
134 odsState.addAttributes(attributes);
135
136 ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
137 if (::mlir::succeeded(AddFeltOp::inferReturnTypes(odsBuilder.getContext(),
138 odsState.location, operands,
139 odsState.attributes.getDictionary(odsState.getContext()),
140 odsState.getRawProperties(),
141 odsState.regions, inferredReturnTypes))) {
142 assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
143 odsState.addTypes(inferredReturnTypes);
144 } else {
145 ::llvm::report_fatal_error("Failed to infer result type(s).");
146 }
147}
148
149::llvm::LogicalResult AddFeltOp::verifyInvariantsImpl() {
150 {
151 unsigned index = 0; (void)index;
152 auto valueGroup0 = getODSOperands(0);
153
154 for (auto v : valueGroup0) {
155 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops1(*this, v.getType(), "operand", index++)))
156 return ::mlir::failure();
157 }
158 auto valueGroup1 = getODSOperands(1);
159
160 for (auto v : valueGroup1) {
161 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops1(*this, v.getType(), "operand", index++)))
162 return ::mlir::failure();
163 }
164 }
165 {
166 unsigned index = 0; (void)index;
167 auto valueGroup0 = getODSResults(0);
168
169 for (auto v : valueGroup0) {
170 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops2(*this, v.getType(), "result", index++)))
171 return ::mlir::failure();
172 }
173 }
174 if (!((::llzk::typesUnify((*this->getODSOperands(0).begin()).getType(), (*this->getODSOperands(1).begin()).getType()))))
175 return emitOpError("failed to verify that rhs type matches with lhs type");
176 if (!((::llzk::typesUnify((*this->getODSOperands(0).begin()).getType(), (*this->getODSResults(0).begin()).getType()))))
177 return emitOpError("failed to verify that result type matches with lhs type");
178 if (!((::llzk::typesUnify((*this->getODSOperands(1).begin()).getType(), (*this->getODSResults(0).begin()).getType()))))
179 return emitOpError("failed to verify that result type matches with rhs type");
180 return ::mlir::success();
181}
182
183::llvm::LogicalResult AddFeltOp::verifyInvariants() {
184 return verifyInvariantsImpl();
185}
186
187::mlir::ParseResult AddFeltOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
188 ::mlir::OpAsmParser::UnresolvedOperand lhsRawOperand{};
189 ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> lhsOperands(&lhsRawOperand, 1); ::llvm::SMLoc lhsOperandsLoc;
190 (void)lhsOperandsLoc;
191 ::mlir::OpAsmParser::UnresolvedOperand rhsRawOperand{};
192 ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> rhsOperands(&rhsRawOperand, 1); ::llvm::SMLoc rhsOperandsLoc;
193 (void)rhsOperandsLoc;
194 ::mlir::Type lhsRawType{};
195 ::llvm::ArrayRef<::mlir::Type> lhsTypes(&lhsRawType, 1);
196 ::mlir::Type rhsRawType{};
197 ::llvm::ArrayRef<::mlir::Type> rhsTypes(&rhsRawType, 1);
198
199 lhsOperandsLoc = parser.getCurrentLocation();
200 if (parser.parseOperand(lhsRawOperand))
201 return ::mlir::failure();
202 if (parser.parseComma())
203 return ::mlir::failure();
204
205 rhsOperandsLoc = parser.getCurrentLocation();
206 if (parser.parseOperand(rhsRawOperand))
207 return ::mlir::failure();
208 {
209 auto odsResult = parseInferredOrParsedType(parser, lhsRawType, true);
210 if (odsResult) return ::mlir::failure();
211 }
212 {
213 auto odsResult = parseInferredOrParsedType(parser, rhsRawType, false);
214 if (odsResult) return ::mlir::failure();
215 }
216 {
217 auto loc = parser.getCurrentLocation();(void)loc;
218 if (parser.parseOptionalAttrDict(result.attributes))
219 return ::mlir::failure();
220 }
221 if (parser.resolveOperands(lhsOperands, lhsTypes, lhsOperandsLoc, result.operands))
222 return ::mlir::failure();
223 if (parser.resolveOperands(rhsOperands, rhsTypes, rhsOperandsLoc, result.operands))
224 return ::mlir::failure();
225
226 ::llvm::SmallVector<::mlir::Type> inferredReturnTypes;
227 if (::mlir::failed(AddFeltOp::inferReturnTypes(parser.getContext(),
228 result.location, result.operands,
229 result.attributes.getDictionary(parser.getContext()),
230 result.getRawProperties(),
231 result.regions, inferredReturnTypes)))
232 return ::mlir::failure();
233 result.addTypes(inferredReturnTypes);
234 return ::mlir::success();
235}
236
237void AddFeltOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
238 _odsPrinter << ' ';
239 _odsPrinter << getLhs();
240 _odsPrinter << ",";
241 _odsPrinter << ' ';
242 _odsPrinter << getRhs();
243 printInferredOrParsedType(_odsPrinter, *this, getLhs().getType(), true);
244 printInferredOrParsedType(_odsPrinter, *this, getRhs().getType(), false);
245 ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
246 _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
247}
248
249void AddFeltOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
250}
251
252 ::llvm::LogicalResult
253 AddFeltOp::inferReturnTypes(::mlir::MLIRContext *context,
254 std::optional<::mlir::Location> location,
255 ::mlir::ValueRange operands, ::mlir::DictionaryAttr attributes,
256 ::mlir::OpaqueProperties properties, ::mlir::RegionRange regions,
257 ::llvm::SmallVectorImpl<::mlir::Type> &inferredReturnTypes) {
258 AddFeltOp::Adaptor adaptor(operands, attributes, properties, regions);
259 return AddFeltOp::inferReturnTypes(context,
260 location, adaptor, inferredReturnTypes);
261 }
262
263
264::llvm::LogicalResult AddFeltOp::inferReturnTypes(
265 mlir::MLIRContext *context, std::optional<mlir::Location> loc, Adaptor adaptor,
266 llvm::SmallVectorImpl<mlir::Type> &inferred
267) {
268 inferred.resize(1);
269 auto value = adaptor.getLhs();
270 inferred[0] = value ? value.getType() : FeltType::get(context, mlir::StringAttr());
271 return mlir::success();
272}
273
274bool AddFeltOp::isCompatibleReturnTypes(mlir::TypeRange l, mlir::TypeRange r) {
275 return l == r;
276}
277} // namespace felt
278} // namespace llzk
279MLIR_DEFINE_EXPLICIT_TYPE_ID(::llzk::felt::AddFeltOp)
280
281namespace llzk {
282namespace felt {
283
284//===----------------------------------------------------------------------===//
285// ::llzk::felt::AndFeltOp definitions
286//===----------------------------------------------------------------------===//
287
288namespace detail {
289} // namespace detail
291
292::llvm::LogicalResult AndFeltOpAdaptor::verify(::mlir::Location loc) {
293 return ::mlir::success();
294}
295
296void AndFeltOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs) {
297 odsState.addOperands(lhs);
298 odsState.addOperands(rhs);
299 odsState.addTypes(result);
300}
301
302void AndFeltOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value lhs, ::mlir::Value rhs) {
303 odsState.addOperands(lhs);
304 odsState.addOperands(rhs);
305
306 ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
307 if (::mlir::succeeded(AndFeltOp::inferReturnTypes(odsBuilder.getContext(),
308 odsState.location, odsState.operands,
309 odsState.attributes.getDictionary(odsState.getContext()),
310 odsState.getRawProperties(),
311 odsState.regions, inferredReturnTypes)))
312 odsState.addTypes(inferredReturnTypes);
313 else
314 ::mlir::detail::reportFatalInferReturnTypesError(odsState);
315
316}
317
318void AndFeltOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs) {
319 odsState.addOperands(lhs);
320 odsState.addOperands(rhs);
321 assert(resultTypes.size() == 1u && "mismatched number of results");
322 odsState.addTypes(resultTypes);
323}
324
325void AndFeltOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
326 assert(operands.size() == 2u && "mismatched number of parameters");
327 odsState.addOperands(operands);
328 odsState.addAttributes(attributes);
329 assert(resultTypes.size() == 1u && "mismatched number of return types");
330 odsState.addTypes(resultTypes);
331}
332
333void AndFeltOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
334 assert(operands.size() == 2u && "mismatched number of parameters");
335 odsState.addOperands(operands);
336 odsState.addAttributes(attributes);
337
338 ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
339 if (::mlir::succeeded(AndFeltOp::inferReturnTypes(odsBuilder.getContext(),
340 odsState.location, operands,
341 odsState.attributes.getDictionary(odsState.getContext()),
342 odsState.getRawProperties(),
343 odsState.regions, inferredReturnTypes))) {
344 assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
345 odsState.addTypes(inferredReturnTypes);
346 } else {
347 ::llvm::report_fatal_error("Failed to infer result type(s).");
348 }
349}
350
351::llvm::LogicalResult AndFeltOp::verifyInvariantsImpl() {
352 {
353 unsigned index = 0; (void)index;
354 auto valueGroup0 = getODSOperands(0);
355
356 for (auto v : valueGroup0) {
357 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops1(*this, v.getType(), "operand", index++)))
358 return ::mlir::failure();
359 }
360 auto valueGroup1 = getODSOperands(1);
361
362 for (auto v : valueGroup1) {
363 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops1(*this, v.getType(), "operand", index++)))
364 return ::mlir::failure();
365 }
366 }
367 {
368 unsigned index = 0; (void)index;
369 auto valueGroup0 = getODSResults(0);
370
371 for (auto v : valueGroup0) {
372 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops2(*this, v.getType(), "result", index++)))
373 return ::mlir::failure();
374 }
375 }
376 if (!((::llzk::typesUnify((*this->getODSOperands(0).begin()).getType(), (*this->getODSOperands(1).begin()).getType()))))
377 return emitOpError("failed to verify that rhs type matches with lhs type");
378 if (!((::llzk::typesUnify((*this->getODSOperands(0).begin()).getType(), (*this->getODSResults(0).begin()).getType()))))
379 return emitOpError("failed to verify that result type matches with lhs type");
380 if (!((::llzk::typesUnify((*this->getODSOperands(1).begin()).getType(), (*this->getODSResults(0).begin()).getType()))))
381 return emitOpError("failed to verify that result type matches with rhs type");
382 return ::mlir::success();
383}
384
385::llvm::LogicalResult AndFeltOp::verifyInvariants() {
386 return verifyInvariantsImpl();
387}
388
389::mlir::ParseResult AndFeltOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
390 ::mlir::OpAsmParser::UnresolvedOperand lhsRawOperand{};
391 ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> lhsOperands(&lhsRawOperand, 1); ::llvm::SMLoc lhsOperandsLoc;
392 (void)lhsOperandsLoc;
393 ::mlir::OpAsmParser::UnresolvedOperand rhsRawOperand{};
394 ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> rhsOperands(&rhsRawOperand, 1); ::llvm::SMLoc rhsOperandsLoc;
395 (void)rhsOperandsLoc;
396 ::mlir::Type lhsRawType{};
397 ::llvm::ArrayRef<::mlir::Type> lhsTypes(&lhsRawType, 1);
398 ::mlir::Type rhsRawType{};
399 ::llvm::ArrayRef<::mlir::Type> rhsTypes(&rhsRawType, 1);
400
401 lhsOperandsLoc = parser.getCurrentLocation();
402 if (parser.parseOperand(lhsRawOperand))
403 return ::mlir::failure();
404 if (parser.parseComma())
405 return ::mlir::failure();
406
407 rhsOperandsLoc = parser.getCurrentLocation();
408 if (parser.parseOperand(rhsRawOperand))
409 return ::mlir::failure();
410 {
411 auto odsResult = parseInferredOrParsedType(parser, lhsRawType, true);
412 if (odsResult) return ::mlir::failure();
413 }
414 {
415 auto odsResult = parseInferredOrParsedType(parser, rhsRawType, false);
416 if (odsResult) return ::mlir::failure();
417 }
418 {
419 auto loc = parser.getCurrentLocation();(void)loc;
420 if (parser.parseOptionalAttrDict(result.attributes))
421 return ::mlir::failure();
422 }
423 if (parser.resolveOperands(lhsOperands, lhsTypes, lhsOperandsLoc, result.operands))
424 return ::mlir::failure();
425 if (parser.resolveOperands(rhsOperands, rhsTypes, rhsOperandsLoc, result.operands))
426 return ::mlir::failure();
427
428 ::llvm::SmallVector<::mlir::Type> inferredReturnTypes;
429 if (::mlir::failed(AndFeltOp::inferReturnTypes(parser.getContext(),
430 result.location, result.operands,
431 result.attributes.getDictionary(parser.getContext()),
432 result.getRawProperties(),
433 result.regions, inferredReturnTypes)))
434 return ::mlir::failure();
435 result.addTypes(inferredReturnTypes);
436 return ::mlir::success();
437}
438
439void AndFeltOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
440 _odsPrinter << ' ';
441 _odsPrinter << getLhs();
442 _odsPrinter << ",";
443 _odsPrinter << ' ';
444 _odsPrinter << getRhs();
445 printInferredOrParsedType(_odsPrinter, *this, getLhs().getType(), true);
446 printInferredOrParsedType(_odsPrinter, *this, getRhs().getType(), false);
447 ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
448 _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
449}
450
451void AndFeltOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
452}
453
454 ::llvm::LogicalResult
455 AndFeltOp::inferReturnTypes(::mlir::MLIRContext *context,
456 std::optional<::mlir::Location> location,
457 ::mlir::ValueRange operands, ::mlir::DictionaryAttr attributes,
458 ::mlir::OpaqueProperties properties, ::mlir::RegionRange regions,
459 ::llvm::SmallVectorImpl<::mlir::Type> &inferredReturnTypes) {
460 AndFeltOp::Adaptor adaptor(operands, attributes, properties, regions);
461 return AndFeltOp::inferReturnTypes(context,
462 location, adaptor, inferredReturnTypes);
463 }
464
465
466::llvm::LogicalResult AndFeltOp::inferReturnTypes(
467 mlir::MLIRContext *context, std::optional<mlir::Location> loc, Adaptor adaptor,
468 llvm::SmallVectorImpl<mlir::Type> &inferred
469) {
470 inferred.resize(1);
471 auto value = adaptor.getLhs();
472 inferred[0] = value ? value.getType() : FeltType::get(context, mlir::StringAttr());
473 return mlir::success();
474}
475
476bool AndFeltOp::isCompatibleReturnTypes(mlir::TypeRange l, mlir::TypeRange r) {
477 return l == r;
478}
479} // namespace felt
480} // namespace llzk
481MLIR_DEFINE_EXPLICIT_TYPE_ID(::llzk::felt::AndFeltOp)
482
483namespace llzk {
484namespace felt {
485
486//===----------------------------------------------------------------------===//
487// ::llzk::felt::DivFeltOp definitions
488//===----------------------------------------------------------------------===//
489
490namespace detail {
491} // namespace detail
493
494::llvm::LogicalResult DivFeltOpAdaptor::verify(::mlir::Location loc) {
495 return ::mlir::success();
496}
497
498void DivFeltOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs) {
499 odsState.addOperands(lhs);
500 odsState.addOperands(rhs);
501 odsState.addTypes(result);
502}
503
504void DivFeltOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value lhs, ::mlir::Value rhs) {
505 odsState.addOperands(lhs);
506 odsState.addOperands(rhs);
507
508 ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
509 if (::mlir::succeeded(DivFeltOp::inferReturnTypes(odsBuilder.getContext(),
510 odsState.location, odsState.operands,
511 odsState.attributes.getDictionary(odsState.getContext()),
512 odsState.getRawProperties(),
513 odsState.regions, inferredReturnTypes)))
514 odsState.addTypes(inferredReturnTypes);
515 else
516 ::mlir::detail::reportFatalInferReturnTypesError(odsState);
517
518}
519
520void DivFeltOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs) {
521 odsState.addOperands(lhs);
522 odsState.addOperands(rhs);
523 assert(resultTypes.size() == 1u && "mismatched number of results");
524 odsState.addTypes(resultTypes);
525}
526
527void DivFeltOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
528 assert(operands.size() == 2u && "mismatched number of parameters");
529 odsState.addOperands(operands);
530 odsState.addAttributes(attributes);
531 assert(resultTypes.size() == 1u && "mismatched number of return types");
532 odsState.addTypes(resultTypes);
533}
534
535void DivFeltOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
536 assert(operands.size() == 2u && "mismatched number of parameters");
537 odsState.addOperands(operands);
538 odsState.addAttributes(attributes);
539
540 ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
541 if (::mlir::succeeded(DivFeltOp::inferReturnTypes(odsBuilder.getContext(),
542 odsState.location, operands,
543 odsState.attributes.getDictionary(odsState.getContext()),
544 odsState.getRawProperties(),
545 odsState.regions, inferredReturnTypes))) {
546 assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
547 odsState.addTypes(inferredReturnTypes);
548 } else {
549 ::llvm::report_fatal_error("Failed to infer result type(s).");
550 }
551}
552
553::llvm::LogicalResult DivFeltOp::verifyInvariantsImpl() {
554 {
555 unsigned index = 0; (void)index;
556 auto valueGroup0 = getODSOperands(0);
557
558 for (auto v : valueGroup0) {
559 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops1(*this, v.getType(), "operand", index++)))
560 return ::mlir::failure();
561 }
562 auto valueGroup1 = getODSOperands(1);
563
564 for (auto v : valueGroup1) {
565 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops1(*this, v.getType(), "operand", index++)))
566 return ::mlir::failure();
567 }
568 }
569 {
570 unsigned index = 0; (void)index;
571 auto valueGroup0 = getODSResults(0);
572
573 for (auto v : valueGroup0) {
574 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops2(*this, v.getType(), "result", index++)))
575 return ::mlir::failure();
576 }
577 }
578 if (!((::llzk::typesUnify((*this->getODSOperands(0).begin()).getType(), (*this->getODSOperands(1).begin()).getType()))))
579 return emitOpError("failed to verify that rhs type matches with lhs type");
580 if (!((::llzk::typesUnify((*this->getODSOperands(0).begin()).getType(), (*this->getODSResults(0).begin()).getType()))))
581 return emitOpError("failed to verify that result type matches with lhs type");
582 if (!((::llzk::typesUnify((*this->getODSOperands(1).begin()).getType(), (*this->getODSResults(0).begin()).getType()))))
583 return emitOpError("failed to verify that result type matches with rhs type");
584 return ::mlir::success();
585}
586
587::llvm::LogicalResult DivFeltOp::verifyInvariants() {
588 return verifyInvariantsImpl();
589}
590
591::mlir::ParseResult DivFeltOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
592 ::mlir::OpAsmParser::UnresolvedOperand lhsRawOperand{};
593 ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> lhsOperands(&lhsRawOperand, 1); ::llvm::SMLoc lhsOperandsLoc;
594 (void)lhsOperandsLoc;
595 ::mlir::OpAsmParser::UnresolvedOperand rhsRawOperand{};
596 ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> rhsOperands(&rhsRawOperand, 1); ::llvm::SMLoc rhsOperandsLoc;
597 (void)rhsOperandsLoc;
598 ::mlir::Type lhsRawType{};
599 ::llvm::ArrayRef<::mlir::Type> lhsTypes(&lhsRawType, 1);
600 ::mlir::Type rhsRawType{};
601 ::llvm::ArrayRef<::mlir::Type> rhsTypes(&rhsRawType, 1);
602
603 lhsOperandsLoc = parser.getCurrentLocation();
604 if (parser.parseOperand(lhsRawOperand))
605 return ::mlir::failure();
606 if (parser.parseComma())
607 return ::mlir::failure();
608
609 rhsOperandsLoc = parser.getCurrentLocation();
610 if (parser.parseOperand(rhsRawOperand))
611 return ::mlir::failure();
612 {
613 auto odsResult = parseInferredOrParsedType(parser, lhsRawType, true);
614 if (odsResult) return ::mlir::failure();
615 }
616 {
617 auto odsResult = parseInferredOrParsedType(parser, rhsRawType, false);
618 if (odsResult) return ::mlir::failure();
619 }
620 {
621 auto loc = parser.getCurrentLocation();(void)loc;
622 if (parser.parseOptionalAttrDict(result.attributes))
623 return ::mlir::failure();
624 }
625 if (parser.resolveOperands(lhsOperands, lhsTypes, lhsOperandsLoc, result.operands))
626 return ::mlir::failure();
627 if (parser.resolveOperands(rhsOperands, rhsTypes, rhsOperandsLoc, result.operands))
628 return ::mlir::failure();
629
630 ::llvm::SmallVector<::mlir::Type> inferredReturnTypes;
631 if (::mlir::failed(DivFeltOp::inferReturnTypes(parser.getContext(),
632 result.location, result.operands,
633 result.attributes.getDictionary(parser.getContext()),
634 result.getRawProperties(),
635 result.regions, inferredReturnTypes)))
636 return ::mlir::failure();
637 result.addTypes(inferredReturnTypes);
638 return ::mlir::success();
639}
640
641void DivFeltOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
642 _odsPrinter << ' ';
643 _odsPrinter << getLhs();
644 _odsPrinter << ",";
645 _odsPrinter << ' ';
646 _odsPrinter << getRhs();
647 printInferredOrParsedType(_odsPrinter, *this, getLhs().getType(), true);
648 printInferredOrParsedType(_odsPrinter, *this, getRhs().getType(), false);
649 ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
650 _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
651}
652
653void DivFeltOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
654}
655
656 ::llvm::LogicalResult
657 DivFeltOp::inferReturnTypes(::mlir::MLIRContext *context,
658 std::optional<::mlir::Location> location,
659 ::mlir::ValueRange operands, ::mlir::DictionaryAttr attributes,
660 ::mlir::OpaqueProperties properties, ::mlir::RegionRange regions,
661 ::llvm::SmallVectorImpl<::mlir::Type> &inferredReturnTypes) {
662 DivFeltOp::Adaptor adaptor(operands, attributes, properties, regions);
663 return DivFeltOp::inferReturnTypes(context,
664 location, adaptor, inferredReturnTypes);
665 }
666
667
668::llvm::LogicalResult DivFeltOp::inferReturnTypes(
669 mlir::MLIRContext *context, std::optional<mlir::Location> loc, Adaptor adaptor,
670 llvm::SmallVectorImpl<mlir::Type> &inferred
671) {
672 inferred.resize(1);
673 auto value = adaptor.getLhs();
674 inferred[0] = value ? value.getType() : FeltType::get(context, mlir::StringAttr());
675 return mlir::success();
676}
677
678bool DivFeltOp::isCompatibleReturnTypes(mlir::TypeRange l, mlir::TypeRange r) {
679 return l == r;
680}
681} // namespace felt
682} // namespace llzk
683MLIR_DEFINE_EXPLICIT_TYPE_ID(::llzk::felt::DivFeltOp)
684
685namespace llzk {
686namespace felt {
687
688//===----------------------------------------------------------------------===//
689// ::llzk::felt::FeltConstantOp definitions
690//===----------------------------------------------------------------------===//
691
692namespace detail {
694
695::llzk::felt::FeltConstAttr FeltConstantOpGenericAdaptorBase::getValue() {
696 auto attr = getValueAttr();
697 return ::llvm::cast<::llzk::felt::FeltConstAttr>(attr);
698}
699
700} // namespace detail
702
703::llvm::LogicalResult FeltConstantOpAdaptor::verify(::mlir::Location loc) {
704 auto tblgen_value = getProperties().value; (void)tblgen_value;
705 if (!tblgen_value) return emitError(loc, "'felt.const' op ""requires attribute 'value'");
706
707 if (tblgen_value && !((::llvm::isa<::llzk::felt::FeltConstAttr>(tblgen_value))))
708 return emitError(loc, "'felt.const' op ""attribute 'value' failed to satisfy constraint: finite field element");
709 return ::mlir::success();
710}
711
712::llvm::LogicalResult FeltConstantOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
713 ::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
714 if (!dict) {
715 emitError() << "expected DictionaryAttr to set properties";
716 return ::mlir::failure();
717 }
718
719 {
720 auto &propStorage = prop.value;
721 auto attr = dict.get("value");
722 if (attr) {
723 auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
724 if (convertedAttr) {
725 propStorage = convertedAttr;
726 } else {
727 emitError() << "Invalid attribute `value` in property conversion: " << attr;
728 return ::mlir::failure();
729 }
730 }
731 }
732 return ::mlir::success();
733}
734
735::mlir::Attribute FeltConstantOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
736 ::mlir::SmallVector<::mlir::NamedAttribute> attrs;
737 ::mlir::Builder odsBuilder{ctx};
738
739 {
740 const auto &propStorage = prop.value;
741 if (propStorage)
742 attrs.push_back(odsBuilder.getNamedAttr("value",
743 propStorage));
744 }
745
746 if (!attrs.empty())
747 return odsBuilder.getDictionaryAttr(attrs);
748 return {};
749}
750
752 return llvm::hash_combine(
753 llvm::hash_value(prop.value.getAsOpaquePointer()));
754}
755
756std::optional<mlir::Attribute> FeltConstantOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
757 if (name == "value")
758 return prop.value;
759 return std::nullopt;
760}
761
762void FeltConstantOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
763 if (name == "value") {
764 prop.value = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.value)>>(value);
765 return;
766 }
767}
768
769void FeltConstantOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
770 if (prop.value) attrs.append("value", prop.value);
771}
772
773::llvm::LogicalResult FeltConstantOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
774 {
775 ::mlir::Attribute attr = attrs.get(getValueAttrName(opName));
776 if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_Ops1(attr, "value", emitError)))
777 return ::mlir::failure();
778 }
779 return ::mlir::success();
780}
781
782::llvm::LogicalResult FeltConstantOp::readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state) {
783 auto &prop = state.getOrAddProperties<Properties>(); (void)prop;
784 if (::mlir::failed(reader.readAttribute(prop.value)))
785 return ::mlir::failure();
786 return ::mlir::success();
787}
788
789void FeltConstantOp::writeProperties(::mlir::DialectBytecodeWriter &writer) {
790 auto &prop = getProperties(); (void)prop;
791 writer.writeAttribute(prop.value);
792}
793
794::llzk::felt::FeltConstAttr FeltConstantOp::getValue() {
795 auto attr = getValueAttr();
796 return ::llvm::cast<::llzk::felt::FeltConstAttr>(attr);
797}
798
799void FeltConstantOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::llzk::felt::FeltConstAttr value) {
800 odsState.getOrAddProperties<Properties>().value = value;
801 odsState.addTypes(result);
802}
803
804void FeltConstantOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::llzk::felt::FeltConstAttr value) {
805 odsState.getOrAddProperties<Properties>().value = value;
806
807 ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
808 if (::mlir::succeeded(FeltConstantOp::inferReturnTypes(odsBuilder.getContext(),
809 odsState.location, odsState.operands,
810 odsState.attributes.getDictionary(odsState.getContext()),
811 odsState.getRawProperties(),
812 odsState.regions, inferredReturnTypes)))
813 odsState.addTypes(inferredReturnTypes);
814 else
815 ::mlir::detail::reportFatalInferReturnTypesError(odsState);
816
817}
818
819void FeltConstantOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::llzk::felt::FeltConstAttr value) {
820 odsState.getOrAddProperties<Properties>().value = value;
821 assert(resultTypes.size() == 1u && "mismatched number of results");
822 odsState.addTypes(resultTypes);
823}
824
825void FeltConstantOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
826 assert(operands.size() == 0u && "mismatched number of parameters");
827 odsState.addOperands(operands);
828 odsState.addAttributes(attributes);
829 assert(resultTypes.size() == 1u && "mismatched number of return types");
830 odsState.addTypes(resultTypes);
831
832 if (!attributes.empty()) {
833 ::mlir::OpaqueProperties properties =
834 &odsState.getOrAddProperties<FeltConstantOp::Properties>();
835 std::optional<::mlir::RegisteredOperationName> info =
836 odsState.name.getRegisteredInfo();
837 if (failed(info->setOpPropertiesFromAttribute(odsState.name, properties,
838 odsState.attributes.getDictionary(odsState.getContext()), nullptr)))
839 ::llvm::report_fatal_error("Property conversion failed.");
840 }
841}
842
843void FeltConstantOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
844 assert(operands.size() == 0u && "mismatched number of parameters");
845 odsState.addOperands(operands);
846 odsState.addAttributes(attributes);
847
848 if (!attributes.empty()) {
849 ::mlir::OpaqueProperties properties =
850 &odsState.getOrAddProperties<FeltConstantOp::Properties>();
851 std::optional<::mlir::RegisteredOperationName> info =
852 odsState.name.getRegisteredInfo();
853 if (failed(info->setOpPropertiesFromAttribute(odsState.name, properties,
854 odsState.attributes.getDictionary(odsState.getContext()), nullptr)))
855 ::llvm::report_fatal_error("Property conversion failed.");
856 }
857 ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
858 if (::mlir::succeeded(FeltConstantOp::inferReturnTypes(odsBuilder.getContext(),
859 odsState.location, operands,
860 odsState.attributes.getDictionary(odsState.getContext()),
861 odsState.getRawProperties(),
862 odsState.regions, inferredReturnTypes))) {
863 assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
864 odsState.addTypes(inferredReturnTypes);
865 } else {
866 ::llvm::report_fatal_error("Failed to infer result type(s).");
867 }
868}
869
871 auto tblgen_value = getProperties().value; (void)tblgen_value;
872 if (!tblgen_value) return emitOpError("requires attribute 'value'");
873
874 if (::mlir::failed(__mlir_ods_local_attr_constraint_Ops1(*this, tblgen_value, "value")))
875 return ::mlir::failure();
876 {
877 unsigned index = 0; (void)index;
878 auto valueGroup0 = getODSResults(0);
879
880 for (auto v : valueGroup0) {
881 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops2(*this, v.getType(), "result", index++)))
882 return ::mlir::failure();
883 }
884 }
885 if (!((::llzk::typesUnify(getValue().getType(), (*this->getODSResults(0).begin()).getType()))))
886 return emitOpError("failed to verify that result type matches with value type");
887 return ::mlir::success();
888}
889
890::llvm::LogicalResult FeltConstantOp::verifyInvariants() {
891 return verifyInvariantsImpl();
892}
893
894::mlir::ParseResult FeltConstantOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
895 ::llzk::felt::FeltConstAttr valueAttr;
896
897 if (parser.parseCustomAttributeWithFallback(valueAttr, ::mlir::Type{})) {
898 return ::mlir::failure();
899 }
900 if (valueAttr) result.getOrAddProperties<FeltConstantOp::Properties>().value = valueAttr;
901 {
902 auto loc = parser.getCurrentLocation();(void)loc;
903 if (parser.parseOptionalAttrDict(result.attributes))
904 return ::mlir::failure();
905 if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() {
906 return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op ";
907 })))
908 return ::mlir::failure();
909 }
910
911 ::llvm::SmallVector<::mlir::Type> inferredReturnTypes;
912 if (::mlir::failed(FeltConstantOp::inferReturnTypes(parser.getContext(),
913 result.location, result.operands,
914 result.attributes.getDictionary(parser.getContext()),
915 result.getRawProperties(),
916 result.regions, inferredReturnTypes)))
917 return ::mlir::failure();
918 result.addTypes(inferredReturnTypes);
919 return ::mlir::success();
920}
921
922void FeltConstantOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
923 _odsPrinter << ' ';
924_odsPrinter.printStrippedAttrOrType(getValueAttr());
925 ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
926 elidedAttrs.push_back("value");
927 _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
928}
929
930void FeltConstantOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
931}
932
933::llvm::LogicalResult
934FeltConstantOp::inferReturnTypes(::mlir::MLIRContext *context,
935 std::optional<::mlir::Location> location,
936 ::mlir::ValueRange operands, ::mlir::DictionaryAttr attributes,
937 ::mlir::OpaqueProperties properties, ::mlir::RegionRange regions,
938 ::llvm::SmallVectorImpl<::mlir::Type> &inferredReturnTypes) {
939 FeltConstantOp::Adaptor adaptor(operands, attributes, properties, regions);
941 location, adaptor, inferredReturnTypes);
942}
943
944} // namespace felt
945} // namespace llzk
946MLIR_DEFINE_EXPLICIT_TYPE_ID(::llzk::felt::FeltConstantOp)
947
948namespace llzk {
949namespace felt {
950
951//===----------------------------------------------------------------------===//
952// ::llzk::felt::InvFeltOp definitions
953//===----------------------------------------------------------------------===//
954
955namespace detail {
956} // namespace detail
958
959::llvm::LogicalResult InvFeltOpAdaptor::verify(::mlir::Location loc) {
960 return ::mlir::success();
961}
962
963void InvFeltOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value operand) {
964 odsState.addOperands(operand);
965 odsState.addTypes(result);
966}
967
968void InvFeltOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value operand) {
969 odsState.addOperands(operand);
970
971 ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
972 if (::mlir::succeeded(InvFeltOp::inferReturnTypes(odsBuilder.getContext(),
973 odsState.location, odsState.operands,
974 odsState.attributes.getDictionary(odsState.getContext()),
975 odsState.getRawProperties(),
976 odsState.regions, inferredReturnTypes)))
977 odsState.addTypes(inferredReturnTypes);
978 else
979 ::mlir::detail::reportFatalInferReturnTypesError(odsState);
980
981}
982
983void InvFeltOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value operand) {
984 odsState.addOperands(operand);
985 assert(resultTypes.size() == 1u && "mismatched number of results");
986 odsState.addTypes(resultTypes);
987}
988
989void InvFeltOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
990 assert(operands.size() == 1u && "mismatched number of parameters");
991 odsState.addOperands(operands);
992 odsState.addAttributes(attributes);
993 assert(resultTypes.size() == 1u && "mismatched number of return types");
994 odsState.addTypes(resultTypes);
995}
996
997void InvFeltOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
998 assert(operands.size() == 1u && "mismatched number of parameters");
999 odsState.addOperands(operands);
1000 odsState.addAttributes(attributes);
1001
1002 ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
1003 if (::mlir::succeeded(InvFeltOp::inferReturnTypes(odsBuilder.getContext(),
1004 odsState.location, operands,
1005 odsState.attributes.getDictionary(odsState.getContext()),
1006 odsState.getRawProperties(),
1007 odsState.regions, inferredReturnTypes))) {
1008 assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
1009 odsState.addTypes(inferredReturnTypes);
1010 } else {
1011 ::llvm::report_fatal_error("Failed to infer result type(s).");
1012 }
1013}
1014
1015::llvm::LogicalResult InvFeltOp::verifyInvariantsImpl() {
1016 {
1017 unsigned index = 0; (void)index;
1018 auto valueGroup0 = getODSOperands(0);
1019
1020 for (auto v : valueGroup0) {
1021 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops1(*this, v.getType(), "operand", index++)))
1022 return ::mlir::failure();
1023 }
1024 }
1025 {
1026 unsigned index = 0; (void)index;
1027 auto valueGroup0 = getODSResults(0);
1028
1029 for (auto v : valueGroup0) {
1030 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops2(*this, v.getType(), "result", index++)))
1031 return ::mlir::failure();
1032 }
1033 }
1034 if (!((::llzk::typesUnify((*this->getODSOperands(0).begin()).getType(), (*this->getODSResults(0).begin()).getType()))))
1035 return emitOpError("failed to verify that result type matches with operand type");
1036 return ::mlir::success();
1037}
1038
1039::llvm::LogicalResult InvFeltOp::verifyInvariants() {
1040 return verifyInvariantsImpl();
1041}
1042
1043::mlir::ParseResult InvFeltOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
1044 ::mlir::OpAsmParser::UnresolvedOperand operandRawOperand{};
1045 ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> operandOperands(&operandRawOperand, 1); ::llvm::SMLoc operandOperandsLoc;
1046 (void)operandOperandsLoc;
1047 ::mlir::Type operandRawType{};
1048 ::llvm::ArrayRef<::mlir::Type> operandTypes(&operandRawType, 1);
1049
1050 operandOperandsLoc = parser.getCurrentLocation();
1051 if (parser.parseOperand(operandRawOperand))
1052 return ::mlir::failure();
1053 {
1054 auto odsResult = parseInferredOrParsedType(parser, operandRawType, true);
1055 if (odsResult) return ::mlir::failure();
1056 }
1057 {
1058 auto loc = parser.getCurrentLocation();(void)loc;
1059 if (parser.parseOptionalAttrDict(result.attributes))
1060 return ::mlir::failure();
1061 }
1062 if (parser.resolveOperands(operandOperands, operandTypes, operandOperandsLoc, result.operands))
1063 return ::mlir::failure();
1064
1065 ::llvm::SmallVector<::mlir::Type> inferredReturnTypes;
1066 if (::mlir::failed(InvFeltOp::inferReturnTypes(parser.getContext(),
1067 result.location, result.operands,
1068 result.attributes.getDictionary(parser.getContext()),
1069 result.getRawProperties(),
1070 result.regions, inferredReturnTypes)))
1071 return ::mlir::failure();
1072 result.addTypes(inferredReturnTypes);
1073 return ::mlir::success();
1074}
1075
1076void InvFeltOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
1077 _odsPrinter << ' ';
1078 _odsPrinter << getOperand();
1079 printInferredOrParsedType(_odsPrinter, *this, getOperand().getType(), true);
1080 ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
1081 _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
1082}
1083
1084void InvFeltOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
1085}
1086
1087 ::llvm::LogicalResult
1088 InvFeltOp::inferReturnTypes(::mlir::MLIRContext *context,
1089 std::optional<::mlir::Location> location,
1090 ::mlir::ValueRange operands, ::mlir::DictionaryAttr attributes,
1091 ::mlir::OpaqueProperties properties, ::mlir::RegionRange regions,
1092 ::llvm::SmallVectorImpl<::mlir::Type> &inferredReturnTypes) {
1093 InvFeltOp::Adaptor adaptor(operands, attributes, properties, regions);
1094 return InvFeltOp::inferReturnTypes(context,
1095 location, adaptor, inferredReturnTypes);
1096 }
1097
1098
1099::llvm::LogicalResult InvFeltOp::inferReturnTypes(
1100 mlir::MLIRContext *context, std::optional<mlir::Location> loc, Adaptor adaptor,
1101 llvm::SmallVectorImpl<mlir::Type> &inferred
1102) {
1103 inferred.resize(1);
1104 auto value = adaptor.getOperand();
1105 inferred[0] = value ? value.getType() : FeltType::get(context, mlir::StringAttr());
1106 return mlir::success();
1107}
1108
1109bool InvFeltOp::isCompatibleReturnTypes(mlir::TypeRange l, mlir::TypeRange r) {
1110 return l == r;
1111}
1112} // namespace felt
1113} // namespace llzk
1114MLIR_DEFINE_EXPLICIT_TYPE_ID(::llzk::felt::InvFeltOp)
1115
1116namespace llzk {
1117namespace felt {
1118
1119//===----------------------------------------------------------------------===//
1120// ::llzk::felt::MulFeltOp definitions
1121//===----------------------------------------------------------------------===//
1122
1123namespace detail {
1124} // namespace detail
1126
1127::llvm::LogicalResult MulFeltOpAdaptor::verify(::mlir::Location loc) {
1128 return ::mlir::success();
1129}
1130
1131void MulFeltOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs) {
1132 odsState.addOperands(lhs);
1133 odsState.addOperands(rhs);
1134 odsState.addTypes(result);
1135}
1136
1137void MulFeltOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value lhs, ::mlir::Value rhs) {
1138 odsState.addOperands(lhs);
1139 odsState.addOperands(rhs);
1140
1141 ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
1142 if (::mlir::succeeded(MulFeltOp::inferReturnTypes(odsBuilder.getContext(),
1143 odsState.location, odsState.operands,
1144 odsState.attributes.getDictionary(odsState.getContext()),
1145 odsState.getRawProperties(),
1146 odsState.regions, inferredReturnTypes)))
1147 odsState.addTypes(inferredReturnTypes);
1148 else
1149 ::mlir::detail::reportFatalInferReturnTypesError(odsState);
1150
1151}
1152
1153void MulFeltOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs) {
1154 odsState.addOperands(lhs);
1155 odsState.addOperands(rhs);
1156 assert(resultTypes.size() == 1u && "mismatched number of results");
1157 odsState.addTypes(resultTypes);
1158}
1159
1160void MulFeltOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
1161 assert(operands.size() == 2u && "mismatched number of parameters");
1162 odsState.addOperands(operands);
1163 odsState.addAttributes(attributes);
1164 assert(resultTypes.size() == 1u && "mismatched number of return types");
1165 odsState.addTypes(resultTypes);
1166}
1167
1168void MulFeltOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
1169 assert(operands.size() == 2u && "mismatched number of parameters");
1170 odsState.addOperands(operands);
1171 odsState.addAttributes(attributes);
1172
1173 ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
1174 if (::mlir::succeeded(MulFeltOp::inferReturnTypes(odsBuilder.getContext(),
1175 odsState.location, operands,
1176 odsState.attributes.getDictionary(odsState.getContext()),
1177 odsState.getRawProperties(),
1178 odsState.regions, inferredReturnTypes))) {
1179 assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
1180 odsState.addTypes(inferredReturnTypes);
1181 } else {
1182 ::llvm::report_fatal_error("Failed to infer result type(s).");
1183 }
1184}
1185
1186::llvm::LogicalResult MulFeltOp::verifyInvariantsImpl() {
1187 {
1188 unsigned index = 0; (void)index;
1189 auto valueGroup0 = getODSOperands(0);
1190
1191 for (auto v : valueGroup0) {
1192 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops1(*this, v.getType(), "operand", index++)))
1193 return ::mlir::failure();
1194 }
1195 auto valueGroup1 = getODSOperands(1);
1196
1197 for (auto v : valueGroup1) {
1198 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops1(*this, v.getType(), "operand", index++)))
1199 return ::mlir::failure();
1200 }
1201 }
1202 {
1203 unsigned index = 0; (void)index;
1204 auto valueGroup0 = getODSResults(0);
1205
1206 for (auto v : valueGroup0) {
1207 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops2(*this, v.getType(), "result", index++)))
1208 return ::mlir::failure();
1209 }
1210 }
1211 if (!((::llzk::typesUnify((*this->getODSOperands(0).begin()).getType(), (*this->getODSOperands(1).begin()).getType()))))
1212 return emitOpError("failed to verify that rhs type matches with lhs type");
1213 if (!((::llzk::typesUnify((*this->getODSOperands(0).begin()).getType(), (*this->getODSResults(0).begin()).getType()))))
1214 return emitOpError("failed to verify that result type matches with lhs type");
1215 if (!((::llzk::typesUnify((*this->getODSOperands(1).begin()).getType(), (*this->getODSResults(0).begin()).getType()))))
1216 return emitOpError("failed to verify that result type matches with rhs type");
1217 return ::mlir::success();
1218}
1219
1220::llvm::LogicalResult MulFeltOp::verifyInvariants() {
1221 return verifyInvariantsImpl();
1222}
1223
1224::mlir::ParseResult MulFeltOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
1225 ::mlir::OpAsmParser::UnresolvedOperand lhsRawOperand{};
1226 ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> lhsOperands(&lhsRawOperand, 1); ::llvm::SMLoc lhsOperandsLoc;
1227 (void)lhsOperandsLoc;
1228 ::mlir::OpAsmParser::UnresolvedOperand rhsRawOperand{};
1229 ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> rhsOperands(&rhsRawOperand, 1); ::llvm::SMLoc rhsOperandsLoc;
1230 (void)rhsOperandsLoc;
1231 ::mlir::Type lhsRawType{};
1232 ::llvm::ArrayRef<::mlir::Type> lhsTypes(&lhsRawType, 1);
1233 ::mlir::Type rhsRawType{};
1234 ::llvm::ArrayRef<::mlir::Type> rhsTypes(&rhsRawType, 1);
1235
1236 lhsOperandsLoc = parser.getCurrentLocation();
1237 if (parser.parseOperand(lhsRawOperand))
1238 return ::mlir::failure();
1239 if (parser.parseComma())
1240 return ::mlir::failure();
1241
1242 rhsOperandsLoc = parser.getCurrentLocation();
1243 if (parser.parseOperand(rhsRawOperand))
1244 return ::mlir::failure();
1245 {
1246 auto odsResult = parseInferredOrParsedType(parser, lhsRawType, true);
1247 if (odsResult) return ::mlir::failure();
1248 }
1249 {
1250 auto odsResult = parseInferredOrParsedType(parser, rhsRawType, false);
1251 if (odsResult) return ::mlir::failure();
1252 }
1253 {
1254 auto loc = parser.getCurrentLocation();(void)loc;
1255 if (parser.parseOptionalAttrDict(result.attributes))
1256 return ::mlir::failure();
1257 }
1258 if (parser.resolveOperands(lhsOperands, lhsTypes, lhsOperandsLoc, result.operands))
1259 return ::mlir::failure();
1260 if (parser.resolveOperands(rhsOperands, rhsTypes, rhsOperandsLoc, result.operands))
1261 return ::mlir::failure();
1262
1263 ::llvm::SmallVector<::mlir::Type> inferredReturnTypes;
1264 if (::mlir::failed(MulFeltOp::inferReturnTypes(parser.getContext(),
1265 result.location, result.operands,
1266 result.attributes.getDictionary(parser.getContext()),
1267 result.getRawProperties(),
1268 result.regions, inferredReturnTypes)))
1269 return ::mlir::failure();
1270 result.addTypes(inferredReturnTypes);
1271 return ::mlir::success();
1272}
1273
1274void MulFeltOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
1275 _odsPrinter << ' ';
1276 _odsPrinter << getLhs();
1277 _odsPrinter << ",";
1278 _odsPrinter << ' ';
1279 _odsPrinter << getRhs();
1280 printInferredOrParsedType(_odsPrinter, *this, getLhs().getType(), true);
1281 printInferredOrParsedType(_odsPrinter, *this, getRhs().getType(), false);
1282 ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
1283 _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
1284}
1285
1286void MulFeltOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
1287}
1288
1289 ::llvm::LogicalResult
1290 MulFeltOp::inferReturnTypes(::mlir::MLIRContext *context,
1291 std::optional<::mlir::Location> location,
1292 ::mlir::ValueRange operands, ::mlir::DictionaryAttr attributes,
1293 ::mlir::OpaqueProperties properties, ::mlir::RegionRange regions,
1294 ::llvm::SmallVectorImpl<::mlir::Type> &inferredReturnTypes) {
1295 MulFeltOp::Adaptor adaptor(operands, attributes, properties, regions);
1296 return MulFeltOp::inferReturnTypes(context,
1297 location, adaptor, inferredReturnTypes);
1298 }
1299
1300
1301::llvm::LogicalResult MulFeltOp::inferReturnTypes(
1302 mlir::MLIRContext *context, std::optional<mlir::Location> loc, Adaptor adaptor,
1303 llvm::SmallVectorImpl<mlir::Type> &inferred
1304) {
1305 inferred.resize(1);
1306 auto value = adaptor.getLhs();
1307 inferred[0] = value ? value.getType() : FeltType::get(context, mlir::StringAttr());
1308 return mlir::success();
1309}
1310
1311bool MulFeltOp::isCompatibleReturnTypes(mlir::TypeRange l, mlir::TypeRange r) {
1312 return l == r;
1313}
1314} // namespace felt
1315} // namespace llzk
1316MLIR_DEFINE_EXPLICIT_TYPE_ID(::llzk::felt::MulFeltOp)
1317
1318namespace llzk {
1319namespace felt {
1320
1321//===----------------------------------------------------------------------===//
1322// ::llzk::felt::NegFeltOp definitions
1323//===----------------------------------------------------------------------===//
1324
1325namespace detail {
1326} // namespace detail
1328
1329::llvm::LogicalResult NegFeltOpAdaptor::verify(::mlir::Location loc) {
1330 return ::mlir::success();
1331}
1332
1333void NegFeltOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value operand) {
1334 odsState.addOperands(operand);
1335 odsState.addTypes(result);
1336}
1337
1338void NegFeltOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value operand) {
1339 odsState.addOperands(operand);
1340
1341 ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
1342 if (::mlir::succeeded(NegFeltOp::inferReturnTypes(odsBuilder.getContext(),
1343 odsState.location, odsState.operands,
1344 odsState.attributes.getDictionary(odsState.getContext()),
1345 odsState.getRawProperties(),
1346 odsState.regions, inferredReturnTypes)))
1347 odsState.addTypes(inferredReturnTypes);
1348 else
1349 ::mlir::detail::reportFatalInferReturnTypesError(odsState);
1350
1351}
1352
1353void NegFeltOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value operand) {
1354 odsState.addOperands(operand);
1355 assert(resultTypes.size() == 1u && "mismatched number of results");
1356 odsState.addTypes(resultTypes);
1357}
1358
1359void NegFeltOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
1360 assert(operands.size() == 1u && "mismatched number of parameters");
1361 odsState.addOperands(operands);
1362 odsState.addAttributes(attributes);
1363 assert(resultTypes.size() == 1u && "mismatched number of return types");
1364 odsState.addTypes(resultTypes);
1365}
1366
1367void NegFeltOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
1368 assert(operands.size() == 1u && "mismatched number of parameters");
1369 odsState.addOperands(operands);
1370 odsState.addAttributes(attributes);
1371
1372 ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
1373 if (::mlir::succeeded(NegFeltOp::inferReturnTypes(odsBuilder.getContext(),
1374 odsState.location, operands,
1375 odsState.attributes.getDictionary(odsState.getContext()),
1376 odsState.getRawProperties(),
1377 odsState.regions, inferredReturnTypes))) {
1378 assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
1379 odsState.addTypes(inferredReturnTypes);
1380 } else {
1381 ::llvm::report_fatal_error("Failed to infer result type(s).");
1382 }
1383}
1384
1385::llvm::LogicalResult NegFeltOp::verifyInvariantsImpl() {
1386 {
1387 unsigned index = 0; (void)index;
1388 auto valueGroup0 = getODSOperands(0);
1389
1390 for (auto v : valueGroup0) {
1391 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops1(*this, v.getType(), "operand", index++)))
1392 return ::mlir::failure();
1393 }
1394 }
1395 {
1396 unsigned index = 0; (void)index;
1397 auto valueGroup0 = getODSResults(0);
1398
1399 for (auto v : valueGroup0) {
1400 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops2(*this, v.getType(), "result", index++)))
1401 return ::mlir::failure();
1402 }
1403 }
1404 if (!((::llzk::typesUnify((*this->getODSOperands(0).begin()).getType(), (*this->getODSResults(0).begin()).getType()))))
1405 return emitOpError("failed to verify that result type matches with operand type");
1406 return ::mlir::success();
1407}
1408
1409::llvm::LogicalResult NegFeltOp::verifyInvariants() {
1410 return verifyInvariantsImpl();
1411}
1412
1413::mlir::ParseResult NegFeltOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
1414 ::mlir::OpAsmParser::UnresolvedOperand operandRawOperand{};
1415 ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> operandOperands(&operandRawOperand, 1); ::llvm::SMLoc operandOperandsLoc;
1416 (void)operandOperandsLoc;
1417 ::mlir::Type operandRawType{};
1418 ::llvm::ArrayRef<::mlir::Type> operandTypes(&operandRawType, 1);
1419
1420 operandOperandsLoc = parser.getCurrentLocation();
1421 if (parser.parseOperand(operandRawOperand))
1422 return ::mlir::failure();
1423 {
1424 auto odsResult = parseInferredOrParsedType(parser, operandRawType, true);
1425 if (odsResult) return ::mlir::failure();
1426 }
1427 {
1428 auto loc = parser.getCurrentLocation();(void)loc;
1429 if (parser.parseOptionalAttrDict(result.attributes))
1430 return ::mlir::failure();
1431 }
1432 if (parser.resolveOperands(operandOperands, operandTypes, operandOperandsLoc, result.operands))
1433 return ::mlir::failure();
1434
1435 ::llvm::SmallVector<::mlir::Type> inferredReturnTypes;
1436 if (::mlir::failed(NegFeltOp::inferReturnTypes(parser.getContext(),
1437 result.location, result.operands,
1438 result.attributes.getDictionary(parser.getContext()),
1439 result.getRawProperties(),
1440 result.regions, inferredReturnTypes)))
1441 return ::mlir::failure();
1442 result.addTypes(inferredReturnTypes);
1443 return ::mlir::success();
1444}
1445
1446void NegFeltOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
1447 _odsPrinter << ' ';
1448 _odsPrinter << getOperand();
1449 printInferredOrParsedType(_odsPrinter, *this, getOperand().getType(), true);
1450 ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
1451 _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
1452}
1453
1454void NegFeltOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
1455}
1456
1457 ::llvm::LogicalResult
1458 NegFeltOp::inferReturnTypes(::mlir::MLIRContext *context,
1459 std::optional<::mlir::Location> location,
1460 ::mlir::ValueRange operands, ::mlir::DictionaryAttr attributes,
1461 ::mlir::OpaqueProperties properties, ::mlir::RegionRange regions,
1462 ::llvm::SmallVectorImpl<::mlir::Type> &inferredReturnTypes) {
1463 NegFeltOp::Adaptor adaptor(operands, attributes, properties, regions);
1464 return NegFeltOp::inferReturnTypes(context,
1465 location, adaptor, inferredReturnTypes);
1466 }
1467
1468
1469::llvm::LogicalResult NegFeltOp::inferReturnTypes(
1470 mlir::MLIRContext *context, std::optional<mlir::Location> loc, Adaptor adaptor,
1471 llvm::SmallVectorImpl<mlir::Type> &inferred
1472) {
1473 inferred.resize(1);
1474 auto value = adaptor.getOperand();
1475 inferred[0] = value ? value.getType() : FeltType::get(context, mlir::StringAttr());
1476 return mlir::success();
1477}
1478
1479bool NegFeltOp::isCompatibleReturnTypes(mlir::TypeRange l, mlir::TypeRange r) {
1480 return l == r;
1481}
1482} // namespace felt
1483} // namespace llzk
1484MLIR_DEFINE_EXPLICIT_TYPE_ID(::llzk::felt::NegFeltOp)
1485
1486namespace llzk {
1487namespace felt {
1488
1489//===----------------------------------------------------------------------===//
1490// ::llzk::felt::NotFeltOp definitions
1491//===----------------------------------------------------------------------===//
1492
1493namespace detail {
1494} // namespace detail
1496
1497::llvm::LogicalResult NotFeltOpAdaptor::verify(::mlir::Location loc) {
1498 return ::mlir::success();
1499}
1500
1501void NotFeltOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value operand) {
1502 odsState.addOperands(operand);
1503 odsState.addTypes(result);
1504}
1505
1506void NotFeltOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value operand) {
1507 odsState.addOperands(operand);
1508
1509 ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
1510 if (::mlir::succeeded(NotFeltOp::inferReturnTypes(odsBuilder.getContext(),
1511 odsState.location, odsState.operands,
1512 odsState.attributes.getDictionary(odsState.getContext()),
1513 odsState.getRawProperties(),
1514 odsState.regions, inferredReturnTypes)))
1515 odsState.addTypes(inferredReturnTypes);
1516 else
1517 ::mlir::detail::reportFatalInferReturnTypesError(odsState);
1518
1519}
1520
1521void NotFeltOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value operand) {
1522 odsState.addOperands(operand);
1523 assert(resultTypes.size() == 1u && "mismatched number of results");
1524 odsState.addTypes(resultTypes);
1525}
1526
1527void NotFeltOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
1528 assert(operands.size() == 1u && "mismatched number of parameters");
1529 odsState.addOperands(operands);
1530 odsState.addAttributes(attributes);
1531 assert(resultTypes.size() == 1u && "mismatched number of return types");
1532 odsState.addTypes(resultTypes);
1533}
1534
1535void NotFeltOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
1536 assert(operands.size() == 1u && "mismatched number of parameters");
1537 odsState.addOperands(operands);
1538 odsState.addAttributes(attributes);
1539
1540 ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
1541 if (::mlir::succeeded(NotFeltOp::inferReturnTypes(odsBuilder.getContext(),
1542 odsState.location, operands,
1543 odsState.attributes.getDictionary(odsState.getContext()),
1544 odsState.getRawProperties(),
1545 odsState.regions, inferredReturnTypes))) {
1546 assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
1547 odsState.addTypes(inferredReturnTypes);
1548 } else {
1549 ::llvm::report_fatal_error("Failed to infer result type(s).");
1550 }
1551}
1552
1553::llvm::LogicalResult NotFeltOp::verifyInvariantsImpl() {
1554 {
1555 unsigned index = 0; (void)index;
1556 auto valueGroup0 = getODSOperands(0);
1557
1558 for (auto v : valueGroup0) {
1559 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops1(*this, v.getType(), "operand", index++)))
1560 return ::mlir::failure();
1561 }
1562 }
1563 {
1564 unsigned index = 0; (void)index;
1565 auto valueGroup0 = getODSResults(0);
1566
1567 for (auto v : valueGroup0) {
1568 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops2(*this, v.getType(), "result", index++)))
1569 return ::mlir::failure();
1570 }
1571 }
1572 if (!((::llzk::typesUnify((*this->getODSOperands(0).begin()).getType(), (*this->getODSResults(0).begin()).getType()))))
1573 return emitOpError("failed to verify that result type matches with operand type");
1574 return ::mlir::success();
1575}
1576
1577::llvm::LogicalResult NotFeltOp::verifyInvariants() {
1578 return verifyInvariantsImpl();
1579}
1580
1581::mlir::ParseResult NotFeltOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
1582 ::mlir::OpAsmParser::UnresolvedOperand operandRawOperand{};
1583 ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> operandOperands(&operandRawOperand, 1); ::llvm::SMLoc operandOperandsLoc;
1584 (void)operandOperandsLoc;
1585 ::mlir::Type operandRawType{};
1586 ::llvm::ArrayRef<::mlir::Type> operandTypes(&operandRawType, 1);
1587
1588 operandOperandsLoc = parser.getCurrentLocation();
1589 if (parser.parseOperand(operandRawOperand))
1590 return ::mlir::failure();
1591 {
1592 auto odsResult = parseInferredOrParsedType(parser, operandRawType, true);
1593 if (odsResult) return ::mlir::failure();
1594 }
1595 {
1596 auto loc = parser.getCurrentLocation();(void)loc;
1597 if (parser.parseOptionalAttrDict(result.attributes))
1598 return ::mlir::failure();
1599 }
1600 if (parser.resolveOperands(operandOperands, operandTypes, operandOperandsLoc, result.operands))
1601 return ::mlir::failure();
1602
1603 ::llvm::SmallVector<::mlir::Type> inferredReturnTypes;
1604 if (::mlir::failed(NotFeltOp::inferReturnTypes(parser.getContext(),
1605 result.location, result.operands,
1606 result.attributes.getDictionary(parser.getContext()),
1607 result.getRawProperties(),
1608 result.regions, inferredReturnTypes)))
1609 return ::mlir::failure();
1610 result.addTypes(inferredReturnTypes);
1611 return ::mlir::success();
1612}
1613
1614void NotFeltOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
1615 _odsPrinter << ' ';
1616 _odsPrinter << getOperand();
1617 printInferredOrParsedType(_odsPrinter, *this, getOperand().getType(), true);
1618 ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
1619 _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
1620}
1621
1622void NotFeltOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
1623}
1624
1625 ::llvm::LogicalResult
1626 NotFeltOp::inferReturnTypes(::mlir::MLIRContext *context,
1627 std::optional<::mlir::Location> location,
1628 ::mlir::ValueRange operands, ::mlir::DictionaryAttr attributes,
1629 ::mlir::OpaqueProperties properties, ::mlir::RegionRange regions,
1630 ::llvm::SmallVectorImpl<::mlir::Type> &inferredReturnTypes) {
1631 NotFeltOp::Adaptor adaptor(operands, attributes, properties, regions);
1632 return NotFeltOp::inferReturnTypes(context,
1633 location, adaptor, inferredReturnTypes);
1634 }
1635
1636
1637::llvm::LogicalResult NotFeltOp::inferReturnTypes(
1638 mlir::MLIRContext *context, std::optional<mlir::Location> loc, Adaptor adaptor,
1639 llvm::SmallVectorImpl<mlir::Type> &inferred
1640) {
1641 inferred.resize(1);
1642 auto value = adaptor.getOperand();
1643 inferred[0] = value ? value.getType() : FeltType::get(context, mlir::StringAttr());
1644 return mlir::success();
1645}
1646
1647bool NotFeltOp::isCompatibleReturnTypes(mlir::TypeRange l, mlir::TypeRange r) {
1648 return l == r;
1649}
1650} // namespace felt
1651} // namespace llzk
1652MLIR_DEFINE_EXPLICIT_TYPE_ID(::llzk::felt::NotFeltOp)
1653
1654namespace llzk {
1655namespace felt {
1656
1657//===----------------------------------------------------------------------===//
1658// ::llzk::felt::OrFeltOp definitions
1659//===----------------------------------------------------------------------===//
1660
1661namespace detail {
1662} // namespace detail
1664
1665::llvm::LogicalResult OrFeltOpAdaptor::verify(::mlir::Location loc) {
1666 return ::mlir::success();
1667}
1668
1669void OrFeltOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs) {
1670 odsState.addOperands(lhs);
1671 odsState.addOperands(rhs);
1672 odsState.addTypes(result);
1673}
1674
1675void OrFeltOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value lhs, ::mlir::Value rhs) {
1676 odsState.addOperands(lhs);
1677 odsState.addOperands(rhs);
1678
1679 ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
1680 if (::mlir::succeeded(OrFeltOp::inferReturnTypes(odsBuilder.getContext(),
1681 odsState.location, odsState.operands,
1682 odsState.attributes.getDictionary(odsState.getContext()),
1683 odsState.getRawProperties(),
1684 odsState.regions, inferredReturnTypes)))
1685 odsState.addTypes(inferredReturnTypes);
1686 else
1687 ::mlir::detail::reportFatalInferReturnTypesError(odsState);
1688
1689}
1690
1691void OrFeltOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs) {
1692 odsState.addOperands(lhs);
1693 odsState.addOperands(rhs);
1694 assert(resultTypes.size() == 1u && "mismatched number of results");
1695 odsState.addTypes(resultTypes);
1696}
1697
1698void OrFeltOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
1699 assert(operands.size() == 2u && "mismatched number of parameters");
1700 odsState.addOperands(operands);
1701 odsState.addAttributes(attributes);
1702 assert(resultTypes.size() == 1u && "mismatched number of return types");
1703 odsState.addTypes(resultTypes);
1704}
1705
1706void OrFeltOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
1707 assert(operands.size() == 2u && "mismatched number of parameters");
1708 odsState.addOperands(operands);
1709 odsState.addAttributes(attributes);
1710
1711 ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
1712 if (::mlir::succeeded(OrFeltOp::inferReturnTypes(odsBuilder.getContext(),
1713 odsState.location, operands,
1714 odsState.attributes.getDictionary(odsState.getContext()),
1715 odsState.getRawProperties(),
1716 odsState.regions, inferredReturnTypes))) {
1717 assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
1718 odsState.addTypes(inferredReturnTypes);
1719 } else {
1720 ::llvm::report_fatal_error("Failed to infer result type(s).");
1721 }
1722}
1723
1724::llvm::LogicalResult OrFeltOp::verifyInvariantsImpl() {
1725 {
1726 unsigned index = 0; (void)index;
1727 auto valueGroup0 = getODSOperands(0);
1728
1729 for (auto v : valueGroup0) {
1730 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops1(*this, v.getType(), "operand", index++)))
1731 return ::mlir::failure();
1732 }
1733 auto valueGroup1 = getODSOperands(1);
1734
1735 for (auto v : valueGroup1) {
1736 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops1(*this, v.getType(), "operand", index++)))
1737 return ::mlir::failure();
1738 }
1739 }
1740 {
1741 unsigned index = 0; (void)index;
1742 auto valueGroup0 = getODSResults(0);
1743
1744 for (auto v : valueGroup0) {
1745 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops2(*this, v.getType(), "result", index++)))
1746 return ::mlir::failure();
1747 }
1748 }
1749 if (!((::llzk::typesUnify((*this->getODSOperands(0).begin()).getType(), (*this->getODSOperands(1).begin()).getType()))))
1750 return emitOpError("failed to verify that rhs type matches with lhs type");
1751 if (!((::llzk::typesUnify((*this->getODSOperands(0).begin()).getType(), (*this->getODSResults(0).begin()).getType()))))
1752 return emitOpError("failed to verify that result type matches with lhs type");
1753 if (!((::llzk::typesUnify((*this->getODSOperands(1).begin()).getType(), (*this->getODSResults(0).begin()).getType()))))
1754 return emitOpError("failed to verify that result type matches with rhs type");
1755 return ::mlir::success();
1756}
1757
1758::llvm::LogicalResult OrFeltOp::verifyInvariants() {
1759 return verifyInvariantsImpl();
1760}
1761
1762::mlir::ParseResult OrFeltOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
1763 ::mlir::OpAsmParser::UnresolvedOperand lhsRawOperand{};
1764 ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> lhsOperands(&lhsRawOperand, 1); ::llvm::SMLoc lhsOperandsLoc;
1765 (void)lhsOperandsLoc;
1766 ::mlir::OpAsmParser::UnresolvedOperand rhsRawOperand{};
1767 ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> rhsOperands(&rhsRawOperand, 1); ::llvm::SMLoc rhsOperandsLoc;
1768 (void)rhsOperandsLoc;
1769 ::mlir::Type lhsRawType{};
1770 ::llvm::ArrayRef<::mlir::Type> lhsTypes(&lhsRawType, 1);
1771 ::mlir::Type rhsRawType{};
1772 ::llvm::ArrayRef<::mlir::Type> rhsTypes(&rhsRawType, 1);
1773
1774 lhsOperandsLoc = parser.getCurrentLocation();
1775 if (parser.parseOperand(lhsRawOperand))
1776 return ::mlir::failure();
1777 if (parser.parseComma())
1778 return ::mlir::failure();
1779
1780 rhsOperandsLoc = parser.getCurrentLocation();
1781 if (parser.parseOperand(rhsRawOperand))
1782 return ::mlir::failure();
1783 {
1784 auto odsResult = parseInferredOrParsedType(parser, lhsRawType, true);
1785 if (odsResult) return ::mlir::failure();
1786 }
1787 {
1788 auto odsResult = parseInferredOrParsedType(parser, rhsRawType, false);
1789 if (odsResult) return ::mlir::failure();
1790 }
1791 {
1792 auto loc = parser.getCurrentLocation();(void)loc;
1793 if (parser.parseOptionalAttrDict(result.attributes))
1794 return ::mlir::failure();
1795 }
1796 if (parser.resolveOperands(lhsOperands, lhsTypes, lhsOperandsLoc, result.operands))
1797 return ::mlir::failure();
1798 if (parser.resolveOperands(rhsOperands, rhsTypes, rhsOperandsLoc, result.operands))
1799 return ::mlir::failure();
1800
1801 ::llvm::SmallVector<::mlir::Type> inferredReturnTypes;
1802 if (::mlir::failed(OrFeltOp::inferReturnTypes(parser.getContext(),
1803 result.location, result.operands,
1804 result.attributes.getDictionary(parser.getContext()),
1805 result.getRawProperties(),
1806 result.regions, inferredReturnTypes)))
1807 return ::mlir::failure();
1808 result.addTypes(inferredReturnTypes);
1809 return ::mlir::success();
1810}
1811
1812void OrFeltOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
1813 _odsPrinter << ' ';
1814 _odsPrinter << getLhs();
1815 _odsPrinter << ",";
1816 _odsPrinter << ' ';
1817 _odsPrinter << getRhs();
1818 printInferredOrParsedType(_odsPrinter, *this, getLhs().getType(), true);
1819 printInferredOrParsedType(_odsPrinter, *this, getRhs().getType(), false);
1820 ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
1821 _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
1822}
1823
1824void OrFeltOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
1825}
1826
1827 ::llvm::LogicalResult
1828 OrFeltOp::inferReturnTypes(::mlir::MLIRContext *context,
1829 std::optional<::mlir::Location> location,
1830 ::mlir::ValueRange operands, ::mlir::DictionaryAttr attributes,
1831 ::mlir::OpaqueProperties properties, ::mlir::RegionRange regions,
1832 ::llvm::SmallVectorImpl<::mlir::Type> &inferredReturnTypes) {
1833 OrFeltOp::Adaptor adaptor(operands, attributes, properties, regions);
1834 return OrFeltOp::inferReturnTypes(context,
1835 location, adaptor, inferredReturnTypes);
1836 }
1837
1838
1839::llvm::LogicalResult OrFeltOp::inferReturnTypes(
1840 mlir::MLIRContext *context, std::optional<mlir::Location> loc, Adaptor adaptor,
1841 llvm::SmallVectorImpl<mlir::Type> &inferred
1842) {
1843 inferred.resize(1);
1844 auto value = adaptor.getLhs();
1845 inferred[0] = value ? value.getType() : FeltType::get(context, mlir::StringAttr());
1846 return mlir::success();
1847}
1848
1849bool OrFeltOp::isCompatibleReturnTypes(mlir::TypeRange l, mlir::TypeRange r) {
1850 return l == r;
1851}
1852} // namespace felt
1853} // namespace llzk
1854MLIR_DEFINE_EXPLICIT_TYPE_ID(::llzk::felt::OrFeltOp)
1855
1856namespace llzk {
1857namespace felt {
1858
1859//===----------------------------------------------------------------------===//
1860// ::llzk::felt::PowFeltOp definitions
1861//===----------------------------------------------------------------------===//
1862
1863namespace detail {
1864} // namespace detail
1866
1867::llvm::LogicalResult PowFeltOpAdaptor::verify(::mlir::Location loc) {
1868 return ::mlir::success();
1869}
1870
1871void PowFeltOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs) {
1872 odsState.addOperands(lhs);
1873 odsState.addOperands(rhs);
1874 odsState.addTypes(result);
1875}
1876
1877void PowFeltOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value lhs, ::mlir::Value rhs) {
1878 odsState.addOperands(lhs);
1879 odsState.addOperands(rhs);
1880
1881 ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
1882 if (::mlir::succeeded(PowFeltOp::inferReturnTypes(odsBuilder.getContext(),
1883 odsState.location, odsState.operands,
1884 odsState.attributes.getDictionary(odsState.getContext()),
1885 odsState.getRawProperties(),
1886 odsState.regions, inferredReturnTypes)))
1887 odsState.addTypes(inferredReturnTypes);
1888 else
1889 ::mlir::detail::reportFatalInferReturnTypesError(odsState);
1890
1891}
1892
1893void PowFeltOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs) {
1894 odsState.addOperands(lhs);
1895 odsState.addOperands(rhs);
1896 assert(resultTypes.size() == 1u && "mismatched number of results");
1897 odsState.addTypes(resultTypes);
1898}
1899
1900void PowFeltOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
1901 assert(operands.size() == 2u && "mismatched number of parameters");
1902 odsState.addOperands(operands);
1903 odsState.addAttributes(attributes);
1904 assert(resultTypes.size() == 1u && "mismatched number of return types");
1905 odsState.addTypes(resultTypes);
1906}
1907
1908void PowFeltOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
1909 assert(operands.size() == 2u && "mismatched number of parameters");
1910 odsState.addOperands(operands);
1911 odsState.addAttributes(attributes);
1912
1913 ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
1914 if (::mlir::succeeded(PowFeltOp::inferReturnTypes(odsBuilder.getContext(),
1915 odsState.location, operands,
1916 odsState.attributes.getDictionary(odsState.getContext()),
1917 odsState.getRawProperties(),
1918 odsState.regions, inferredReturnTypes))) {
1919 assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
1920 odsState.addTypes(inferredReturnTypes);
1921 } else {
1922 ::llvm::report_fatal_error("Failed to infer result type(s).");
1923 }
1924}
1925
1926::llvm::LogicalResult PowFeltOp::verifyInvariantsImpl() {
1927 {
1928 unsigned index = 0; (void)index;
1929 auto valueGroup0 = getODSOperands(0);
1930
1931 for (auto v : valueGroup0) {
1932 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops1(*this, v.getType(), "operand", index++)))
1933 return ::mlir::failure();
1934 }
1935 auto valueGroup1 = getODSOperands(1);
1936
1937 for (auto v : valueGroup1) {
1938 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops1(*this, v.getType(), "operand", index++)))
1939 return ::mlir::failure();
1940 }
1941 }
1942 {
1943 unsigned index = 0; (void)index;
1944 auto valueGroup0 = getODSResults(0);
1945
1946 for (auto v : valueGroup0) {
1947 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops2(*this, v.getType(), "result", index++)))
1948 return ::mlir::failure();
1949 }
1950 }
1951 if (!((::llzk::typesUnify((*this->getODSOperands(0).begin()).getType(), (*this->getODSOperands(1).begin()).getType()))))
1952 return emitOpError("failed to verify that rhs type matches with lhs type");
1953 if (!((::llzk::typesUnify((*this->getODSOperands(0).begin()).getType(), (*this->getODSResults(0).begin()).getType()))))
1954 return emitOpError("failed to verify that result type matches with lhs type");
1955 if (!((::llzk::typesUnify((*this->getODSOperands(1).begin()).getType(), (*this->getODSResults(0).begin()).getType()))))
1956 return emitOpError("failed to verify that result type matches with rhs type");
1957 return ::mlir::success();
1958}
1959
1960::llvm::LogicalResult PowFeltOp::verifyInvariants() {
1961 return verifyInvariantsImpl();
1962}
1963
1964::mlir::ParseResult PowFeltOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
1965 ::mlir::OpAsmParser::UnresolvedOperand lhsRawOperand{};
1966 ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> lhsOperands(&lhsRawOperand, 1); ::llvm::SMLoc lhsOperandsLoc;
1967 (void)lhsOperandsLoc;
1968 ::mlir::OpAsmParser::UnresolvedOperand rhsRawOperand{};
1969 ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> rhsOperands(&rhsRawOperand, 1); ::llvm::SMLoc rhsOperandsLoc;
1970 (void)rhsOperandsLoc;
1971 ::mlir::Type lhsRawType{};
1972 ::llvm::ArrayRef<::mlir::Type> lhsTypes(&lhsRawType, 1);
1973 ::mlir::Type rhsRawType{};
1974 ::llvm::ArrayRef<::mlir::Type> rhsTypes(&rhsRawType, 1);
1975
1976 lhsOperandsLoc = parser.getCurrentLocation();
1977 if (parser.parseOperand(lhsRawOperand))
1978 return ::mlir::failure();
1979 if (parser.parseComma())
1980 return ::mlir::failure();
1981
1982 rhsOperandsLoc = parser.getCurrentLocation();
1983 if (parser.parseOperand(rhsRawOperand))
1984 return ::mlir::failure();
1985 {
1986 auto odsResult = parseInferredOrParsedType(parser, lhsRawType, true);
1987 if (odsResult) return ::mlir::failure();
1988 }
1989 {
1990 auto odsResult = parseInferredOrParsedType(parser, rhsRawType, false);
1991 if (odsResult) return ::mlir::failure();
1992 }
1993 {
1994 auto loc = parser.getCurrentLocation();(void)loc;
1995 if (parser.parseOptionalAttrDict(result.attributes))
1996 return ::mlir::failure();
1997 }
1998 if (parser.resolveOperands(lhsOperands, lhsTypes, lhsOperandsLoc, result.operands))
1999 return ::mlir::failure();
2000 if (parser.resolveOperands(rhsOperands, rhsTypes, rhsOperandsLoc, result.operands))
2001 return ::mlir::failure();
2002
2003 ::llvm::SmallVector<::mlir::Type> inferredReturnTypes;
2004 if (::mlir::failed(PowFeltOp::inferReturnTypes(parser.getContext(),
2005 result.location, result.operands,
2006 result.attributes.getDictionary(parser.getContext()),
2007 result.getRawProperties(),
2008 result.regions, inferredReturnTypes)))
2009 return ::mlir::failure();
2010 result.addTypes(inferredReturnTypes);
2011 return ::mlir::success();
2012}
2013
2014void PowFeltOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
2015 _odsPrinter << ' ';
2016 _odsPrinter << getLhs();
2017 _odsPrinter << ",";
2018 _odsPrinter << ' ';
2019 _odsPrinter << getRhs();
2020 printInferredOrParsedType(_odsPrinter, *this, getLhs().getType(), true);
2021 printInferredOrParsedType(_odsPrinter, *this, getRhs().getType(), false);
2022 ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
2023 _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
2024}
2025
2026void PowFeltOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
2027}
2028
2029 ::llvm::LogicalResult
2030 PowFeltOp::inferReturnTypes(::mlir::MLIRContext *context,
2031 std::optional<::mlir::Location> location,
2032 ::mlir::ValueRange operands, ::mlir::DictionaryAttr attributes,
2033 ::mlir::OpaqueProperties properties, ::mlir::RegionRange regions,
2034 ::llvm::SmallVectorImpl<::mlir::Type> &inferredReturnTypes) {
2035 PowFeltOp::Adaptor adaptor(operands, attributes, properties, regions);
2036 return PowFeltOp::inferReturnTypes(context,
2037 location, adaptor, inferredReturnTypes);
2038 }
2039
2040
2041::llvm::LogicalResult PowFeltOp::inferReturnTypes(
2042 mlir::MLIRContext *context, std::optional<mlir::Location> loc, Adaptor adaptor,
2043 llvm::SmallVectorImpl<mlir::Type> &inferred
2044) {
2045 inferred.resize(1);
2046 auto value = adaptor.getLhs();
2047 inferred[0] = value ? value.getType() : FeltType::get(context, mlir::StringAttr());
2048 return mlir::success();
2049}
2050
2051bool PowFeltOp::isCompatibleReturnTypes(mlir::TypeRange l, mlir::TypeRange r) {
2052 return l == r;
2053}
2054} // namespace felt
2055} // namespace llzk
2056MLIR_DEFINE_EXPLICIT_TYPE_ID(::llzk::felt::PowFeltOp)
2057
2058namespace llzk {
2059namespace felt {
2060
2061//===----------------------------------------------------------------------===//
2062// ::llzk::felt::ShlFeltOp definitions
2063//===----------------------------------------------------------------------===//
2064
2065namespace detail {
2066} // namespace detail
2068
2069::llvm::LogicalResult ShlFeltOpAdaptor::verify(::mlir::Location loc) {
2070 return ::mlir::success();
2071}
2072
2073void ShlFeltOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs) {
2074 odsState.addOperands(lhs);
2075 odsState.addOperands(rhs);
2076 odsState.addTypes(result);
2077}
2078
2079void ShlFeltOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value lhs, ::mlir::Value rhs) {
2080 odsState.addOperands(lhs);
2081 odsState.addOperands(rhs);
2082
2083 ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
2084 if (::mlir::succeeded(ShlFeltOp::inferReturnTypes(odsBuilder.getContext(),
2085 odsState.location, odsState.operands,
2086 odsState.attributes.getDictionary(odsState.getContext()),
2087 odsState.getRawProperties(),
2088 odsState.regions, inferredReturnTypes)))
2089 odsState.addTypes(inferredReturnTypes);
2090 else
2091 ::mlir::detail::reportFatalInferReturnTypesError(odsState);
2092
2093}
2094
2095void ShlFeltOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs) {
2096 odsState.addOperands(lhs);
2097 odsState.addOperands(rhs);
2098 assert(resultTypes.size() == 1u && "mismatched number of results");
2099 odsState.addTypes(resultTypes);
2100}
2101
2102void ShlFeltOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
2103 assert(operands.size() == 2u && "mismatched number of parameters");
2104 odsState.addOperands(operands);
2105 odsState.addAttributes(attributes);
2106 assert(resultTypes.size() == 1u && "mismatched number of return types");
2107 odsState.addTypes(resultTypes);
2108}
2109
2110void ShlFeltOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
2111 assert(operands.size() == 2u && "mismatched number of parameters");
2112 odsState.addOperands(operands);
2113 odsState.addAttributes(attributes);
2114
2115 ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
2116 if (::mlir::succeeded(ShlFeltOp::inferReturnTypes(odsBuilder.getContext(),
2117 odsState.location, operands,
2118 odsState.attributes.getDictionary(odsState.getContext()),
2119 odsState.getRawProperties(),
2120 odsState.regions, inferredReturnTypes))) {
2121 assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
2122 odsState.addTypes(inferredReturnTypes);
2123 } else {
2124 ::llvm::report_fatal_error("Failed to infer result type(s).");
2125 }
2126}
2127
2128::llvm::LogicalResult ShlFeltOp::verifyInvariantsImpl() {
2129 {
2130 unsigned index = 0; (void)index;
2131 auto valueGroup0 = getODSOperands(0);
2132
2133 for (auto v : valueGroup0) {
2134 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops1(*this, v.getType(), "operand", index++)))
2135 return ::mlir::failure();
2136 }
2137 auto valueGroup1 = getODSOperands(1);
2138
2139 for (auto v : valueGroup1) {
2140 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops1(*this, v.getType(), "operand", index++)))
2141 return ::mlir::failure();
2142 }
2143 }
2144 {
2145 unsigned index = 0; (void)index;
2146 auto valueGroup0 = getODSResults(0);
2147
2148 for (auto v : valueGroup0) {
2149 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops2(*this, v.getType(), "result", index++)))
2150 return ::mlir::failure();
2151 }
2152 }
2153 if (!((::llzk::typesUnify((*this->getODSOperands(0).begin()).getType(), (*this->getODSOperands(1).begin()).getType()))))
2154 return emitOpError("failed to verify that rhs type matches with lhs type");
2155 if (!((::llzk::typesUnify((*this->getODSOperands(0).begin()).getType(), (*this->getODSResults(0).begin()).getType()))))
2156 return emitOpError("failed to verify that result type matches with lhs type");
2157 if (!((::llzk::typesUnify((*this->getODSOperands(1).begin()).getType(), (*this->getODSResults(0).begin()).getType()))))
2158 return emitOpError("failed to verify that result type matches with rhs type");
2159 return ::mlir::success();
2160}
2161
2162::llvm::LogicalResult ShlFeltOp::verifyInvariants() {
2163 return verifyInvariantsImpl();
2164}
2165
2166::mlir::ParseResult ShlFeltOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
2167 ::mlir::OpAsmParser::UnresolvedOperand lhsRawOperand{};
2168 ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> lhsOperands(&lhsRawOperand, 1); ::llvm::SMLoc lhsOperandsLoc;
2169 (void)lhsOperandsLoc;
2170 ::mlir::OpAsmParser::UnresolvedOperand rhsRawOperand{};
2171 ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> rhsOperands(&rhsRawOperand, 1); ::llvm::SMLoc rhsOperandsLoc;
2172 (void)rhsOperandsLoc;
2173 ::mlir::Type lhsRawType{};
2174 ::llvm::ArrayRef<::mlir::Type> lhsTypes(&lhsRawType, 1);
2175 ::mlir::Type rhsRawType{};
2176 ::llvm::ArrayRef<::mlir::Type> rhsTypes(&rhsRawType, 1);
2177
2178 lhsOperandsLoc = parser.getCurrentLocation();
2179 if (parser.parseOperand(lhsRawOperand))
2180 return ::mlir::failure();
2181 if (parser.parseComma())
2182 return ::mlir::failure();
2183
2184 rhsOperandsLoc = parser.getCurrentLocation();
2185 if (parser.parseOperand(rhsRawOperand))
2186 return ::mlir::failure();
2187 {
2188 auto odsResult = parseInferredOrParsedType(parser, lhsRawType, true);
2189 if (odsResult) return ::mlir::failure();
2190 }
2191 {
2192 auto odsResult = parseInferredOrParsedType(parser, rhsRawType, false);
2193 if (odsResult) return ::mlir::failure();
2194 }
2195 {
2196 auto loc = parser.getCurrentLocation();(void)loc;
2197 if (parser.parseOptionalAttrDict(result.attributes))
2198 return ::mlir::failure();
2199 }
2200 if (parser.resolveOperands(lhsOperands, lhsTypes, lhsOperandsLoc, result.operands))
2201 return ::mlir::failure();
2202 if (parser.resolveOperands(rhsOperands, rhsTypes, rhsOperandsLoc, result.operands))
2203 return ::mlir::failure();
2204
2205 ::llvm::SmallVector<::mlir::Type> inferredReturnTypes;
2206 if (::mlir::failed(ShlFeltOp::inferReturnTypes(parser.getContext(),
2207 result.location, result.operands,
2208 result.attributes.getDictionary(parser.getContext()),
2209 result.getRawProperties(),
2210 result.regions, inferredReturnTypes)))
2211 return ::mlir::failure();
2212 result.addTypes(inferredReturnTypes);
2213 return ::mlir::success();
2214}
2215
2216void ShlFeltOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
2217 _odsPrinter << ' ';
2218 _odsPrinter << getLhs();
2219 _odsPrinter << ",";
2220 _odsPrinter << ' ';
2221 _odsPrinter << getRhs();
2222 printInferredOrParsedType(_odsPrinter, *this, getLhs().getType(), true);
2223 printInferredOrParsedType(_odsPrinter, *this, getRhs().getType(), false);
2224 ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
2225 _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
2226}
2227
2228void ShlFeltOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
2229}
2230
2231 ::llvm::LogicalResult
2232 ShlFeltOp::inferReturnTypes(::mlir::MLIRContext *context,
2233 std::optional<::mlir::Location> location,
2234 ::mlir::ValueRange operands, ::mlir::DictionaryAttr attributes,
2235 ::mlir::OpaqueProperties properties, ::mlir::RegionRange regions,
2236 ::llvm::SmallVectorImpl<::mlir::Type> &inferredReturnTypes) {
2237 ShlFeltOp::Adaptor adaptor(operands, attributes, properties, regions);
2238 return ShlFeltOp::inferReturnTypes(context,
2239 location, adaptor, inferredReturnTypes);
2240 }
2241
2242
2243::llvm::LogicalResult ShlFeltOp::inferReturnTypes(
2244 mlir::MLIRContext *context, std::optional<mlir::Location> loc, Adaptor adaptor,
2245 llvm::SmallVectorImpl<mlir::Type> &inferred
2246) {
2247 inferred.resize(1);
2248 auto value = adaptor.getLhs();
2249 inferred[0] = value ? value.getType() : FeltType::get(context, mlir::StringAttr());
2250 return mlir::success();
2251}
2252
2253bool ShlFeltOp::isCompatibleReturnTypes(mlir::TypeRange l, mlir::TypeRange r) {
2254 return l == r;
2255}
2256} // namespace felt
2257} // namespace llzk
2258MLIR_DEFINE_EXPLICIT_TYPE_ID(::llzk::felt::ShlFeltOp)
2259
2260namespace llzk {
2261namespace felt {
2262
2263//===----------------------------------------------------------------------===//
2264// ::llzk::felt::ShrFeltOp definitions
2265//===----------------------------------------------------------------------===//
2266
2267namespace detail {
2268} // namespace detail
2270
2271::llvm::LogicalResult ShrFeltOpAdaptor::verify(::mlir::Location loc) {
2272 return ::mlir::success();
2273}
2274
2275void ShrFeltOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs) {
2276 odsState.addOperands(lhs);
2277 odsState.addOperands(rhs);
2278 odsState.addTypes(result);
2279}
2280
2281void ShrFeltOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value lhs, ::mlir::Value rhs) {
2282 odsState.addOperands(lhs);
2283 odsState.addOperands(rhs);
2284
2285 ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
2286 if (::mlir::succeeded(ShrFeltOp::inferReturnTypes(odsBuilder.getContext(),
2287 odsState.location, odsState.operands,
2288 odsState.attributes.getDictionary(odsState.getContext()),
2289 odsState.getRawProperties(),
2290 odsState.regions, inferredReturnTypes)))
2291 odsState.addTypes(inferredReturnTypes);
2292 else
2293 ::mlir::detail::reportFatalInferReturnTypesError(odsState);
2294
2295}
2296
2297void ShrFeltOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs) {
2298 odsState.addOperands(lhs);
2299 odsState.addOperands(rhs);
2300 assert(resultTypes.size() == 1u && "mismatched number of results");
2301 odsState.addTypes(resultTypes);
2302}
2303
2304void ShrFeltOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
2305 assert(operands.size() == 2u && "mismatched number of parameters");
2306 odsState.addOperands(operands);
2307 odsState.addAttributes(attributes);
2308 assert(resultTypes.size() == 1u && "mismatched number of return types");
2309 odsState.addTypes(resultTypes);
2310}
2311
2312void ShrFeltOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
2313 assert(operands.size() == 2u && "mismatched number of parameters");
2314 odsState.addOperands(operands);
2315 odsState.addAttributes(attributes);
2316
2317 ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
2318 if (::mlir::succeeded(ShrFeltOp::inferReturnTypes(odsBuilder.getContext(),
2319 odsState.location, operands,
2320 odsState.attributes.getDictionary(odsState.getContext()),
2321 odsState.getRawProperties(),
2322 odsState.regions, inferredReturnTypes))) {
2323 assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
2324 odsState.addTypes(inferredReturnTypes);
2325 } else {
2326 ::llvm::report_fatal_error("Failed to infer result type(s).");
2327 }
2328}
2329
2330::llvm::LogicalResult ShrFeltOp::verifyInvariantsImpl() {
2331 {
2332 unsigned index = 0; (void)index;
2333 auto valueGroup0 = getODSOperands(0);
2334
2335 for (auto v : valueGroup0) {
2336 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops1(*this, v.getType(), "operand", index++)))
2337 return ::mlir::failure();
2338 }
2339 auto valueGroup1 = getODSOperands(1);
2340
2341 for (auto v : valueGroup1) {
2342 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops1(*this, v.getType(), "operand", index++)))
2343 return ::mlir::failure();
2344 }
2345 }
2346 {
2347 unsigned index = 0; (void)index;
2348 auto valueGroup0 = getODSResults(0);
2349
2350 for (auto v : valueGroup0) {
2351 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops2(*this, v.getType(), "result", index++)))
2352 return ::mlir::failure();
2353 }
2354 }
2355 if (!((::llzk::typesUnify((*this->getODSOperands(0).begin()).getType(), (*this->getODSOperands(1).begin()).getType()))))
2356 return emitOpError("failed to verify that rhs type matches with lhs type");
2357 if (!((::llzk::typesUnify((*this->getODSOperands(0).begin()).getType(), (*this->getODSResults(0).begin()).getType()))))
2358 return emitOpError("failed to verify that result type matches with lhs type");
2359 if (!((::llzk::typesUnify((*this->getODSOperands(1).begin()).getType(), (*this->getODSResults(0).begin()).getType()))))
2360 return emitOpError("failed to verify that result type matches with rhs type");
2361 return ::mlir::success();
2362}
2363
2364::llvm::LogicalResult ShrFeltOp::verifyInvariants() {
2365 return verifyInvariantsImpl();
2366}
2367
2368::mlir::ParseResult ShrFeltOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
2369 ::mlir::OpAsmParser::UnresolvedOperand lhsRawOperand{};
2370 ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> lhsOperands(&lhsRawOperand, 1); ::llvm::SMLoc lhsOperandsLoc;
2371 (void)lhsOperandsLoc;
2372 ::mlir::OpAsmParser::UnresolvedOperand rhsRawOperand{};
2373 ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> rhsOperands(&rhsRawOperand, 1); ::llvm::SMLoc rhsOperandsLoc;
2374 (void)rhsOperandsLoc;
2375 ::mlir::Type lhsRawType{};
2376 ::llvm::ArrayRef<::mlir::Type> lhsTypes(&lhsRawType, 1);
2377 ::mlir::Type rhsRawType{};
2378 ::llvm::ArrayRef<::mlir::Type> rhsTypes(&rhsRawType, 1);
2379
2380 lhsOperandsLoc = parser.getCurrentLocation();
2381 if (parser.parseOperand(lhsRawOperand))
2382 return ::mlir::failure();
2383 if (parser.parseComma())
2384 return ::mlir::failure();
2385
2386 rhsOperandsLoc = parser.getCurrentLocation();
2387 if (parser.parseOperand(rhsRawOperand))
2388 return ::mlir::failure();
2389 {
2390 auto odsResult = parseInferredOrParsedType(parser, lhsRawType, true);
2391 if (odsResult) return ::mlir::failure();
2392 }
2393 {
2394 auto odsResult = parseInferredOrParsedType(parser, rhsRawType, false);
2395 if (odsResult) return ::mlir::failure();
2396 }
2397 {
2398 auto loc = parser.getCurrentLocation();(void)loc;
2399 if (parser.parseOptionalAttrDict(result.attributes))
2400 return ::mlir::failure();
2401 }
2402 if (parser.resolveOperands(lhsOperands, lhsTypes, lhsOperandsLoc, result.operands))
2403 return ::mlir::failure();
2404 if (parser.resolveOperands(rhsOperands, rhsTypes, rhsOperandsLoc, result.operands))
2405 return ::mlir::failure();
2406
2407 ::llvm::SmallVector<::mlir::Type> inferredReturnTypes;
2408 if (::mlir::failed(ShrFeltOp::inferReturnTypes(parser.getContext(),
2409 result.location, result.operands,
2410 result.attributes.getDictionary(parser.getContext()),
2411 result.getRawProperties(),
2412 result.regions, inferredReturnTypes)))
2413 return ::mlir::failure();
2414 result.addTypes(inferredReturnTypes);
2415 return ::mlir::success();
2416}
2417
2418void ShrFeltOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
2419 _odsPrinter << ' ';
2420 _odsPrinter << getLhs();
2421 _odsPrinter << ",";
2422 _odsPrinter << ' ';
2423 _odsPrinter << getRhs();
2424 printInferredOrParsedType(_odsPrinter, *this, getLhs().getType(), true);
2425 printInferredOrParsedType(_odsPrinter, *this, getRhs().getType(), false);
2426 ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
2427 _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
2428}
2429
2430void ShrFeltOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
2431}
2432
2433 ::llvm::LogicalResult
2434 ShrFeltOp::inferReturnTypes(::mlir::MLIRContext *context,
2435 std::optional<::mlir::Location> location,
2436 ::mlir::ValueRange operands, ::mlir::DictionaryAttr attributes,
2437 ::mlir::OpaqueProperties properties, ::mlir::RegionRange regions,
2438 ::llvm::SmallVectorImpl<::mlir::Type> &inferredReturnTypes) {
2439 ShrFeltOp::Adaptor adaptor(operands, attributes, properties, regions);
2440 return ShrFeltOp::inferReturnTypes(context,
2441 location, adaptor, inferredReturnTypes);
2442 }
2443
2444
2445::llvm::LogicalResult ShrFeltOp::inferReturnTypes(
2446 mlir::MLIRContext *context, std::optional<mlir::Location> loc, Adaptor adaptor,
2447 llvm::SmallVectorImpl<mlir::Type> &inferred
2448) {
2449 inferred.resize(1);
2450 auto value = adaptor.getLhs();
2451 inferred[0] = value ? value.getType() : FeltType::get(context, mlir::StringAttr());
2452 return mlir::success();
2453}
2454
2455bool ShrFeltOp::isCompatibleReturnTypes(mlir::TypeRange l, mlir::TypeRange r) {
2456 return l == r;
2457}
2458} // namespace felt
2459} // namespace llzk
2460MLIR_DEFINE_EXPLICIT_TYPE_ID(::llzk::felt::ShrFeltOp)
2461
2462namespace llzk {
2463namespace felt {
2464
2465//===----------------------------------------------------------------------===//
2466// ::llzk::felt::SignedIntDivFeltOp definitions
2467//===----------------------------------------------------------------------===//
2468
2469namespace detail {
2470} // namespace detail
2472
2473::llvm::LogicalResult SignedIntDivFeltOpAdaptor::verify(::mlir::Location loc) {
2474 return ::mlir::success();
2475}
2476
2477void SignedIntDivFeltOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs) {
2478 odsState.addOperands(lhs);
2479 odsState.addOperands(rhs);
2480 odsState.addTypes(result);
2481}
2482
2483void SignedIntDivFeltOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value lhs, ::mlir::Value rhs) {
2484 odsState.addOperands(lhs);
2485 odsState.addOperands(rhs);
2486
2487 ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
2488 if (::mlir::succeeded(SignedIntDivFeltOp::inferReturnTypes(odsBuilder.getContext(),
2489 odsState.location, odsState.operands,
2490 odsState.attributes.getDictionary(odsState.getContext()),
2491 odsState.getRawProperties(),
2492 odsState.regions, inferredReturnTypes)))
2493 odsState.addTypes(inferredReturnTypes);
2494 else
2495 ::mlir::detail::reportFatalInferReturnTypesError(odsState);
2496
2497}
2498
2499void SignedIntDivFeltOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs) {
2500 odsState.addOperands(lhs);
2501 odsState.addOperands(rhs);
2502 assert(resultTypes.size() == 1u && "mismatched number of results");
2503 odsState.addTypes(resultTypes);
2504}
2505
2506void SignedIntDivFeltOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
2507 assert(operands.size() == 2u && "mismatched number of parameters");
2508 odsState.addOperands(operands);
2509 odsState.addAttributes(attributes);
2510 assert(resultTypes.size() == 1u && "mismatched number of return types");
2511 odsState.addTypes(resultTypes);
2512}
2513
2514void SignedIntDivFeltOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
2515 assert(operands.size() == 2u && "mismatched number of parameters");
2516 odsState.addOperands(operands);
2517 odsState.addAttributes(attributes);
2518
2519 ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
2520 if (::mlir::succeeded(SignedIntDivFeltOp::inferReturnTypes(odsBuilder.getContext(),
2521 odsState.location, operands,
2522 odsState.attributes.getDictionary(odsState.getContext()),
2523 odsState.getRawProperties(),
2524 odsState.regions, inferredReturnTypes))) {
2525 assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
2526 odsState.addTypes(inferredReturnTypes);
2527 } else {
2528 ::llvm::report_fatal_error("Failed to infer result type(s).");
2529 }
2530}
2531
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_Ops1(*this, v.getType(), "operand", index++)))
2539 return ::mlir::failure();
2540 }
2541 auto valueGroup1 = getODSOperands(1);
2542
2543 for (auto v : valueGroup1) {
2544 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops1(*this, v.getType(), "operand", index++)))
2545 return ::mlir::failure();
2546 }
2547 }
2548 {
2549 unsigned index = 0; (void)index;
2550 auto valueGroup0 = getODSResults(0);
2551
2552 for (auto v : valueGroup0) {
2553 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops2(*this, v.getType(), "result", index++)))
2554 return ::mlir::failure();
2555 }
2556 }
2557 if (!((::llzk::typesUnify((*this->getODSOperands(0).begin()).getType(), (*this->getODSOperands(1).begin()).getType()))))
2558 return emitOpError("failed to verify that rhs type matches with lhs type");
2559 if (!((::llzk::typesUnify((*this->getODSOperands(0).begin()).getType(), (*this->getODSResults(0).begin()).getType()))))
2560 return emitOpError("failed to verify that result type matches with lhs type");
2561 if (!((::llzk::typesUnify((*this->getODSOperands(1).begin()).getType(), (*this->getODSResults(0).begin()).getType()))))
2562 return emitOpError("failed to verify that result type matches with rhs type");
2563 return ::mlir::success();
2564}
2565
2567 return verifyInvariantsImpl();
2568}
2569
2570::mlir::ParseResult SignedIntDivFeltOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
2571 ::mlir::OpAsmParser::UnresolvedOperand lhsRawOperand{};
2572 ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> lhsOperands(&lhsRawOperand, 1); ::llvm::SMLoc lhsOperandsLoc;
2573 (void)lhsOperandsLoc;
2574 ::mlir::OpAsmParser::UnresolvedOperand rhsRawOperand{};
2575 ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> rhsOperands(&rhsRawOperand, 1); ::llvm::SMLoc rhsOperandsLoc;
2576 (void)rhsOperandsLoc;
2577 ::mlir::Type lhsRawType{};
2578 ::llvm::ArrayRef<::mlir::Type> lhsTypes(&lhsRawType, 1);
2579 ::mlir::Type rhsRawType{};
2580 ::llvm::ArrayRef<::mlir::Type> rhsTypes(&rhsRawType, 1);
2581
2582 lhsOperandsLoc = parser.getCurrentLocation();
2583 if (parser.parseOperand(lhsRawOperand))
2584 return ::mlir::failure();
2585 if (parser.parseComma())
2586 return ::mlir::failure();
2587
2588 rhsOperandsLoc = parser.getCurrentLocation();
2589 if (parser.parseOperand(rhsRawOperand))
2590 return ::mlir::failure();
2591 {
2592 auto odsResult = parseInferredOrParsedType(parser, lhsRawType, true);
2593 if (odsResult) return ::mlir::failure();
2594 }
2595 {
2596 auto odsResult = parseInferredOrParsedType(parser, rhsRawType, false);
2597 if (odsResult) return ::mlir::failure();
2598 }
2599 {
2600 auto loc = parser.getCurrentLocation();(void)loc;
2601 if (parser.parseOptionalAttrDict(result.attributes))
2602 return ::mlir::failure();
2603 }
2604 if (parser.resolveOperands(lhsOperands, lhsTypes, lhsOperandsLoc, result.operands))
2605 return ::mlir::failure();
2606 if (parser.resolveOperands(rhsOperands, rhsTypes, rhsOperandsLoc, result.operands))
2607 return ::mlir::failure();
2608
2609 ::llvm::SmallVector<::mlir::Type> inferredReturnTypes;
2610 if (::mlir::failed(SignedIntDivFeltOp::inferReturnTypes(parser.getContext(),
2611 result.location, result.operands,
2612 result.attributes.getDictionary(parser.getContext()),
2613 result.getRawProperties(),
2614 result.regions, inferredReturnTypes)))
2615 return ::mlir::failure();
2616 result.addTypes(inferredReturnTypes);
2617 return ::mlir::success();
2618}
2619
2620void SignedIntDivFeltOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
2621 _odsPrinter << ' ';
2622 _odsPrinter << getLhs();
2623 _odsPrinter << ",";
2624 _odsPrinter << ' ';
2625 _odsPrinter << getRhs();
2626 printInferredOrParsedType(_odsPrinter, *this, getLhs().getType(), true);
2627 printInferredOrParsedType(_odsPrinter, *this, getRhs().getType(), false);
2628 ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
2629 _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
2630}
2631
2632void SignedIntDivFeltOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
2633}
2634
2635 ::llvm::LogicalResult
2636 SignedIntDivFeltOp::inferReturnTypes(::mlir::MLIRContext *context,
2637 std::optional<::mlir::Location> location,
2638 ::mlir::ValueRange operands, ::mlir::DictionaryAttr attributes,
2639 ::mlir::OpaqueProperties properties, ::mlir::RegionRange regions,
2640 ::llvm::SmallVectorImpl<::mlir::Type> &inferredReturnTypes) {
2641 SignedIntDivFeltOp::Adaptor adaptor(operands, attributes, properties, regions);
2643 location, adaptor, inferredReturnTypes);
2644 }
2645
2646
2647::llvm::LogicalResult SignedIntDivFeltOp::inferReturnTypes(
2648 mlir::MLIRContext *context, std::optional<mlir::Location> loc, Adaptor adaptor,
2649 llvm::SmallVectorImpl<mlir::Type> &inferred
2650) {
2651 inferred.resize(1);
2652 auto value = adaptor.getLhs();
2653 inferred[0] = value ? value.getType() : FeltType::get(context, mlir::StringAttr());
2654 return mlir::success();
2655}
2656
2657bool SignedIntDivFeltOp::isCompatibleReturnTypes(mlir::TypeRange l, mlir::TypeRange r) {
2658 return l == r;
2659}
2660} // namespace felt
2661} // namespace llzk
2662MLIR_DEFINE_EXPLICIT_TYPE_ID(::llzk::felt::SignedIntDivFeltOp)
2663
2664namespace llzk {
2665namespace felt {
2666
2667//===----------------------------------------------------------------------===//
2668// ::llzk::felt::SignedModFeltOp definitions
2669//===----------------------------------------------------------------------===//
2670
2671namespace detail {
2672} // namespace detail
2674
2675::llvm::LogicalResult SignedModFeltOpAdaptor::verify(::mlir::Location loc) {
2676 return ::mlir::success();
2677}
2678
2679void SignedModFeltOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs) {
2680 odsState.addOperands(lhs);
2681 odsState.addOperands(rhs);
2682 odsState.addTypes(result);
2683}
2684
2685void SignedModFeltOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value lhs, ::mlir::Value rhs) {
2686 odsState.addOperands(lhs);
2687 odsState.addOperands(rhs);
2688
2689 ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
2690 if (::mlir::succeeded(SignedModFeltOp::inferReturnTypes(odsBuilder.getContext(),
2691 odsState.location, odsState.operands,
2692 odsState.attributes.getDictionary(odsState.getContext()),
2693 odsState.getRawProperties(),
2694 odsState.regions, inferredReturnTypes)))
2695 odsState.addTypes(inferredReturnTypes);
2696 else
2697 ::mlir::detail::reportFatalInferReturnTypesError(odsState);
2698
2699}
2700
2701void SignedModFeltOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs) {
2702 odsState.addOperands(lhs);
2703 odsState.addOperands(rhs);
2704 assert(resultTypes.size() == 1u && "mismatched number of results");
2705 odsState.addTypes(resultTypes);
2706}
2707
2708void SignedModFeltOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
2709 assert(operands.size() == 2u && "mismatched number of parameters");
2710 odsState.addOperands(operands);
2711 odsState.addAttributes(attributes);
2712 assert(resultTypes.size() == 1u && "mismatched number of return types");
2713 odsState.addTypes(resultTypes);
2714}
2715
2716void SignedModFeltOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
2717 assert(operands.size() == 2u && "mismatched number of parameters");
2718 odsState.addOperands(operands);
2719 odsState.addAttributes(attributes);
2720
2721 ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
2722 if (::mlir::succeeded(SignedModFeltOp::inferReturnTypes(odsBuilder.getContext(),
2723 odsState.location, operands,
2724 odsState.attributes.getDictionary(odsState.getContext()),
2725 odsState.getRawProperties(),
2726 odsState.regions, inferredReturnTypes))) {
2727 assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
2728 odsState.addTypes(inferredReturnTypes);
2729 } else {
2730 ::llvm::report_fatal_error("Failed to infer result type(s).");
2731 }
2732}
2733
2735 {
2736 unsigned index = 0; (void)index;
2737 auto valueGroup0 = getODSOperands(0);
2738
2739 for (auto v : valueGroup0) {
2740 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops1(*this, v.getType(), "operand", index++)))
2741 return ::mlir::failure();
2742 }
2743 auto valueGroup1 = getODSOperands(1);
2744
2745 for (auto v : valueGroup1) {
2746 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops1(*this, v.getType(), "operand", index++)))
2747 return ::mlir::failure();
2748 }
2749 }
2750 {
2751 unsigned index = 0; (void)index;
2752 auto valueGroup0 = getODSResults(0);
2753
2754 for (auto v : valueGroup0) {
2755 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops2(*this, v.getType(), "result", index++)))
2756 return ::mlir::failure();
2757 }
2758 }
2759 if (!((::llzk::typesUnify((*this->getODSOperands(0).begin()).getType(), (*this->getODSOperands(1).begin()).getType()))))
2760 return emitOpError("failed to verify that rhs type matches with lhs type");
2761 if (!((::llzk::typesUnify((*this->getODSOperands(0).begin()).getType(), (*this->getODSResults(0).begin()).getType()))))
2762 return emitOpError("failed to verify that result type matches with lhs type");
2763 if (!((::llzk::typesUnify((*this->getODSOperands(1).begin()).getType(), (*this->getODSResults(0).begin()).getType()))))
2764 return emitOpError("failed to verify that result type matches with rhs type");
2765 return ::mlir::success();
2766}
2767
2768::llvm::LogicalResult SignedModFeltOp::verifyInvariants() {
2769 return verifyInvariantsImpl();
2770}
2771
2772::mlir::ParseResult SignedModFeltOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
2773 ::mlir::OpAsmParser::UnresolvedOperand lhsRawOperand{};
2774 ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> lhsOperands(&lhsRawOperand, 1); ::llvm::SMLoc lhsOperandsLoc;
2775 (void)lhsOperandsLoc;
2776 ::mlir::OpAsmParser::UnresolvedOperand rhsRawOperand{};
2777 ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> rhsOperands(&rhsRawOperand, 1); ::llvm::SMLoc rhsOperandsLoc;
2778 (void)rhsOperandsLoc;
2779 ::mlir::Type lhsRawType{};
2780 ::llvm::ArrayRef<::mlir::Type> lhsTypes(&lhsRawType, 1);
2781 ::mlir::Type rhsRawType{};
2782 ::llvm::ArrayRef<::mlir::Type> rhsTypes(&rhsRawType, 1);
2783
2784 lhsOperandsLoc = parser.getCurrentLocation();
2785 if (parser.parseOperand(lhsRawOperand))
2786 return ::mlir::failure();
2787 if (parser.parseComma())
2788 return ::mlir::failure();
2789
2790 rhsOperandsLoc = parser.getCurrentLocation();
2791 if (parser.parseOperand(rhsRawOperand))
2792 return ::mlir::failure();
2793 {
2794 auto odsResult = parseInferredOrParsedType(parser, lhsRawType, true);
2795 if (odsResult) return ::mlir::failure();
2796 }
2797 {
2798 auto odsResult = parseInferredOrParsedType(parser, rhsRawType, false);
2799 if (odsResult) return ::mlir::failure();
2800 }
2801 {
2802 auto loc = parser.getCurrentLocation();(void)loc;
2803 if (parser.parseOptionalAttrDict(result.attributes))
2804 return ::mlir::failure();
2805 }
2806 if (parser.resolveOperands(lhsOperands, lhsTypes, lhsOperandsLoc, result.operands))
2807 return ::mlir::failure();
2808 if (parser.resolveOperands(rhsOperands, rhsTypes, rhsOperandsLoc, result.operands))
2809 return ::mlir::failure();
2810
2811 ::llvm::SmallVector<::mlir::Type> inferredReturnTypes;
2812 if (::mlir::failed(SignedModFeltOp::inferReturnTypes(parser.getContext(),
2813 result.location, result.operands,
2814 result.attributes.getDictionary(parser.getContext()),
2815 result.getRawProperties(),
2816 result.regions, inferredReturnTypes)))
2817 return ::mlir::failure();
2818 result.addTypes(inferredReturnTypes);
2819 return ::mlir::success();
2820}
2821
2822void SignedModFeltOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
2823 _odsPrinter << ' ';
2824 _odsPrinter << getLhs();
2825 _odsPrinter << ",";
2826 _odsPrinter << ' ';
2827 _odsPrinter << getRhs();
2828 printInferredOrParsedType(_odsPrinter, *this, getLhs().getType(), true);
2829 printInferredOrParsedType(_odsPrinter, *this, getRhs().getType(), false);
2830 ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
2831 _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
2832}
2833
2834void SignedModFeltOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
2835}
2836
2837 ::llvm::LogicalResult
2838 SignedModFeltOp::inferReturnTypes(::mlir::MLIRContext *context,
2839 std::optional<::mlir::Location> location,
2840 ::mlir::ValueRange operands, ::mlir::DictionaryAttr attributes,
2841 ::mlir::OpaqueProperties properties, ::mlir::RegionRange regions,
2842 ::llvm::SmallVectorImpl<::mlir::Type> &inferredReturnTypes) {
2843 SignedModFeltOp::Adaptor adaptor(operands, attributes, properties, regions);
2844 return SignedModFeltOp::inferReturnTypes(context,
2845 location, adaptor, inferredReturnTypes);
2846 }
2847
2848
2849::llvm::LogicalResult SignedModFeltOp::inferReturnTypes(
2850 mlir::MLIRContext *context, std::optional<mlir::Location> loc, Adaptor adaptor,
2851 llvm::SmallVectorImpl<mlir::Type> &inferred
2852) {
2853 inferred.resize(1);
2854 auto value = adaptor.getLhs();
2855 inferred[0] = value ? value.getType() : FeltType::get(context, mlir::StringAttr());
2856 return mlir::success();
2857}
2858
2859bool SignedModFeltOp::isCompatibleReturnTypes(mlir::TypeRange l, mlir::TypeRange r) {
2860 return l == r;
2861}
2862} // namespace felt
2863} // namespace llzk
2864MLIR_DEFINE_EXPLICIT_TYPE_ID(::llzk::felt::SignedModFeltOp)
2865
2866namespace llzk {
2867namespace felt {
2868
2869//===----------------------------------------------------------------------===//
2870// ::llzk::felt::SubFeltOp definitions
2871//===----------------------------------------------------------------------===//
2872
2873namespace detail {
2874} // namespace detail
2876
2877::llvm::LogicalResult SubFeltOpAdaptor::verify(::mlir::Location loc) {
2878 return ::mlir::success();
2879}
2880
2881void SubFeltOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs) {
2882 odsState.addOperands(lhs);
2883 odsState.addOperands(rhs);
2884 odsState.addTypes(result);
2885}
2886
2887void SubFeltOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value lhs, ::mlir::Value rhs) {
2888 odsState.addOperands(lhs);
2889 odsState.addOperands(rhs);
2890
2891 ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
2892 if (::mlir::succeeded(SubFeltOp::inferReturnTypes(odsBuilder.getContext(),
2893 odsState.location, odsState.operands,
2894 odsState.attributes.getDictionary(odsState.getContext()),
2895 odsState.getRawProperties(),
2896 odsState.regions, inferredReturnTypes)))
2897 odsState.addTypes(inferredReturnTypes);
2898 else
2899 ::mlir::detail::reportFatalInferReturnTypesError(odsState);
2900
2901}
2902
2903void SubFeltOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs) {
2904 odsState.addOperands(lhs);
2905 odsState.addOperands(rhs);
2906 assert(resultTypes.size() == 1u && "mismatched number of results");
2907 odsState.addTypes(resultTypes);
2908}
2909
2910void SubFeltOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
2911 assert(operands.size() == 2u && "mismatched number of parameters");
2912 odsState.addOperands(operands);
2913 odsState.addAttributes(attributes);
2914 assert(resultTypes.size() == 1u && "mismatched number of return types");
2915 odsState.addTypes(resultTypes);
2916}
2917
2918void SubFeltOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
2919 assert(operands.size() == 2u && "mismatched number of parameters");
2920 odsState.addOperands(operands);
2921 odsState.addAttributes(attributes);
2922
2923 ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
2924 if (::mlir::succeeded(SubFeltOp::inferReturnTypes(odsBuilder.getContext(),
2925 odsState.location, operands,
2926 odsState.attributes.getDictionary(odsState.getContext()),
2927 odsState.getRawProperties(),
2928 odsState.regions, inferredReturnTypes))) {
2929 assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
2930 odsState.addTypes(inferredReturnTypes);
2931 } else {
2932 ::llvm::report_fatal_error("Failed to infer result type(s).");
2933 }
2934}
2935
2936::llvm::LogicalResult SubFeltOp::verifyInvariantsImpl() {
2937 {
2938 unsigned index = 0; (void)index;
2939 auto valueGroup0 = getODSOperands(0);
2940
2941 for (auto v : valueGroup0) {
2942 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops1(*this, v.getType(), "operand", index++)))
2943 return ::mlir::failure();
2944 }
2945 auto valueGroup1 = getODSOperands(1);
2946
2947 for (auto v : valueGroup1) {
2948 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops1(*this, v.getType(), "operand", index++)))
2949 return ::mlir::failure();
2950 }
2951 }
2952 {
2953 unsigned index = 0; (void)index;
2954 auto valueGroup0 = getODSResults(0);
2955
2956 for (auto v : valueGroup0) {
2957 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops2(*this, v.getType(), "result", index++)))
2958 return ::mlir::failure();
2959 }
2960 }
2961 if (!((::llzk::typesUnify((*this->getODSOperands(0).begin()).getType(), (*this->getODSOperands(1).begin()).getType()))))
2962 return emitOpError("failed to verify that rhs type matches with lhs type");
2963 if (!((::llzk::typesUnify((*this->getODSOperands(0).begin()).getType(), (*this->getODSResults(0).begin()).getType()))))
2964 return emitOpError("failed to verify that result type matches with lhs type");
2965 if (!((::llzk::typesUnify((*this->getODSOperands(1).begin()).getType(), (*this->getODSResults(0).begin()).getType()))))
2966 return emitOpError("failed to verify that result type matches with rhs type");
2967 return ::mlir::success();
2968}
2969
2970::llvm::LogicalResult SubFeltOp::verifyInvariants() {
2971 return verifyInvariantsImpl();
2972}
2973
2974::mlir::ParseResult SubFeltOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
2975 ::mlir::OpAsmParser::UnresolvedOperand lhsRawOperand{};
2976 ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> lhsOperands(&lhsRawOperand, 1); ::llvm::SMLoc lhsOperandsLoc;
2977 (void)lhsOperandsLoc;
2978 ::mlir::OpAsmParser::UnresolvedOperand rhsRawOperand{};
2979 ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> rhsOperands(&rhsRawOperand, 1); ::llvm::SMLoc rhsOperandsLoc;
2980 (void)rhsOperandsLoc;
2981 ::mlir::Type lhsRawType{};
2982 ::llvm::ArrayRef<::mlir::Type> lhsTypes(&lhsRawType, 1);
2983 ::mlir::Type rhsRawType{};
2984 ::llvm::ArrayRef<::mlir::Type> rhsTypes(&rhsRawType, 1);
2985
2986 lhsOperandsLoc = parser.getCurrentLocation();
2987 if (parser.parseOperand(lhsRawOperand))
2988 return ::mlir::failure();
2989 if (parser.parseComma())
2990 return ::mlir::failure();
2991
2992 rhsOperandsLoc = parser.getCurrentLocation();
2993 if (parser.parseOperand(rhsRawOperand))
2994 return ::mlir::failure();
2995 {
2996 auto odsResult = parseInferredOrParsedType(parser, lhsRawType, true);
2997 if (odsResult) return ::mlir::failure();
2998 }
2999 {
3000 auto odsResult = parseInferredOrParsedType(parser, rhsRawType, false);
3001 if (odsResult) return ::mlir::failure();
3002 }
3003 {
3004 auto loc = parser.getCurrentLocation();(void)loc;
3005 if (parser.parseOptionalAttrDict(result.attributes))
3006 return ::mlir::failure();
3007 }
3008 if (parser.resolveOperands(lhsOperands, lhsTypes, lhsOperandsLoc, result.operands))
3009 return ::mlir::failure();
3010 if (parser.resolveOperands(rhsOperands, rhsTypes, rhsOperandsLoc, result.operands))
3011 return ::mlir::failure();
3012
3013 ::llvm::SmallVector<::mlir::Type> inferredReturnTypes;
3014 if (::mlir::failed(SubFeltOp::inferReturnTypes(parser.getContext(),
3015 result.location, result.operands,
3016 result.attributes.getDictionary(parser.getContext()),
3017 result.getRawProperties(),
3018 result.regions, inferredReturnTypes)))
3019 return ::mlir::failure();
3020 result.addTypes(inferredReturnTypes);
3021 return ::mlir::success();
3022}
3023
3024void SubFeltOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
3025 _odsPrinter << ' ';
3026 _odsPrinter << getLhs();
3027 _odsPrinter << ",";
3028 _odsPrinter << ' ';
3029 _odsPrinter << getRhs();
3030 printInferredOrParsedType(_odsPrinter, *this, getLhs().getType(), true);
3031 printInferredOrParsedType(_odsPrinter, *this, getRhs().getType(), false);
3032 ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
3033 _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
3034}
3035
3036void SubFeltOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
3037}
3038
3039 ::llvm::LogicalResult
3040 SubFeltOp::inferReturnTypes(::mlir::MLIRContext *context,
3041 std::optional<::mlir::Location> location,
3042 ::mlir::ValueRange operands, ::mlir::DictionaryAttr attributes,
3043 ::mlir::OpaqueProperties properties, ::mlir::RegionRange regions,
3044 ::llvm::SmallVectorImpl<::mlir::Type> &inferredReturnTypes) {
3045 SubFeltOp::Adaptor adaptor(operands, attributes, properties, regions);
3046 return SubFeltOp::inferReturnTypes(context,
3047 location, adaptor, inferredReturnTypes);
3048 }
3049
3050
3051::llvm::LogicalResult SubFeltOp::inferReturnTypes(
3052 mlir::MLIRContext *context, std::optional<mlir::Location> loc, Adaptor adaptor,
3053 llvm::SmallVectorImpl<mlir::Type> &inferred
3054) {
3055 inferred.resize(1);
3056 auto value = adaptor.getLhs();
3057 inferred[0] = value ? value.getType() : FeltType::get(context, mlir::StringAttr());
3058 return mlir::success();
3059}
3060
3061bool SubFeltOp::isCompatibleReturnTypes(mlir::TypeRange l, mlir::TypeRange r) {
3062 return l == r;
3063}
3064} // namespace felt
3065} // namespace llzk
3066MLIR_DEFINE_EXPLICIT_TYPE_ID(::llzk::felt::SubFeltOp)
3067
3068namespace llzk {
3069namespace felt {
3070
3071//===----------------------------------------------------------------------===//
3072// ::llzk::felt::UnsignedIntDivFeltOp definitions
3073//===----------------------------------------------------------------------===//
3074
3075namespace detail {
3076} // namespace detail
3078
3079::llvm::LogicalResult UnsignedIntDivFeltOpAdaptor::verify(::mlir::Location loc) {
3080 return ::mlir::success();
3081}
3082
3083void UnsignedIntDivFeltOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs) {
3084 odsState.addOperands(lhs);
3085 odsState.addOperands(rhs);
3086 odsState.addTypes(result);
3087}
3088
3089void UnsignedIntDivFeltOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value lhs, ::mlir::Value rhs) {
3090 odsState.addOperands(lhs);
3091 odsState.addOperands(rhs);
3092
3093 ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
3094 if (::mlir::succeeded(UnsignedIntDivFeltOp::inferReturnTypes(odsBuilder.getContext(),
3095 odsState.location, odsState.operands,
3096 odsState.attributes.getDictionary(odsState.getContext()),
3097 odsState.getRawProperties(),
3098 odsState.regions, inferredReturnTypes)))
3099 odsState.addTypes(inferredReturnTypes);
3100 else
3101 ::mlir::detail::reportFatalInferReturnTypesError(odsState);
3102
3103}
3104
3105void UnsignedIntDivFeltOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs) {
3106 odsState.addOperands(lhs);
3107 odsState.addOperands(rhs);
3108 assert(resultTypes.size() == 1u && "mismatched number of results");
3109 odsState.addTypes(resultTypes);
3110}
3111
3112void UnsignedIntDivFeltOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
3113 assert(operands.size() == 2u && "mismatched number of parameters");
3114 odsState.addOperands(operands);
3115 odsState.addAttributes(attributes);
3116 assert(resultTypes.size() == 1u && "mismatched number of return types");
3117 odsState.addTypes(resultTypes);
3118}
3119
3120void UnsignedIntDivFeltOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
3121 assert(operands.size() == 2u && "mismatched number of parameters");
3122 odsState.addOperands(operands);
3123 odsState.addAttributes(attributes);
3124
3125 ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
3126 if (::mlir::succeeded(UnsignedIntDivFeltOp::inferReturnTypes(odsBuilder.getContext(),
3127 odsState.location, operands,
3128 odsState.attributes.getDictionary(odsState.getContext()),
3129 odsState.getRawProperties(),
3130 odsState.regions, inferredReturnTypes))) {
3131 assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
3132 odsState.addTypes(inferredReturnTypes);
3133 } else {
3134 ::llvm::report_fatal_error("Failed to infer result type(s).");
3135 }
3136}
3137
3139 {
3140 unsigned index = 0; (void)index;
3141 auto valueGroup0 = getODSOperands(0);
3142
3143 for (auto v : valueGroup0) {
3144 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops1(*this, v.getType(), "operand", index++)))
3145 return ::mlir::failure();
3146 }
3147 auto valueGroup1 = getODSOperands(1);
3148
3149 for (auto v : valueGroup1) {
3150 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops1(*this, v.getType(), "operand", index++)))
3151 return ::mlir::failure();
3152 }
3153 }
3154 {
3155 unsigned index = 0; (void)index;
3156 auto valueGroup0 = getODSResults(0);
3157
3158 for (auto v : valueGroup0) {
3159 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops2(*this, v.getType(), "result", index++)))
3160 return ::mlir::failure();
3161 }
3162 }
3163 if (!((::llzk::typesUnify((*this->getODSOperands(0).begin()).getType(), (*this->getODSOperands(1).begin()).getType()))))
3164 return emitOpError("failed to verify that rhs type matches with lhs type");
3165 if (!((::llzk::typesUnify((*this->getODSOperands(0).begin()).getType(), (*this->getODSResults(0).begin()).getType()))))
3166 return emitOpError("failed to verify that result type matches with lhs type");
3167 if (!((::llzk::typesUnify((*this->getODSOperands(1).begin()).getType(), (*this->getODSResults(0).begin()).getType()))))
3168 return emitOpError("failed to verify that result type matches with rhs type");
3169 return ::mlir::success();
3170}
3171
3173 return verifyInvariantsImpl();
3174}
3175
3176::mlir::ParseResult UnsignedIntDivFeltOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
3177 ::mlir::OpAsmParser::UnresolvedOperand lhsRawOperand{};
3178 ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> lhsOperands(&lhsRawOperand, 1); ::llvm::SMLoc lhsOperandsLoc;
3179 (void)lhsOperandsLoc;
3180 ::mlir::OpAsmParser::UnresolvedOperand rhsRawOperand{};
3181 ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> rhsOperands(&rhsRawOperand, 1); ::llvm::SMLoc rhsOperandsLoc;
3182 (void)rhsOperandsLoc;
3183 ::mlir::Type lhsRawType{};
3184 ::llvm::ArrayRef<::mlir::Type> lhsTypes(&lhsRawType, 1);
3185 ::mlir::Type rhsRawType{};
3186 ::llvm::ArrayRef<::mlir::Type> rhsTypes(&rhsRawType, 1);
3187
3188 lhsOperandsLoc = parser.getCurrentLocation();
3189 if (parser.parseOperand(lhsRawOperand))
3190 return ::mlir::failure();
3191 if (parser.parseComma())
3192 return ::mlir::failure();
3193
3194 rhsOperandsLoc = parser.getCurrentLocation();
3195 if (parser.parseOperand(rhsRawOperand))
3196 return ::mlir::failure();
3197 {
3198 auto odsResult = parseInferredOrParsedType(parser, lhsRawType, true);
3199 if (odsResult) return ::mlir::failure();
3200 }
3201 {
3202 auto odsResult = parseInferredOrParsedType(parser, rhsRawType, false);
3203 if (odsResult) return ::mlir::failure();
3204 }
3205 {
3206 auto loc = parser.getCurrentLocation();(void)loc;
3207 if (parser.parseOptionalAttrDict(result.attributes))
3208 return ::mlir::failure();
3209 }
3210 if (parser.resolveOperands(lhsOperands, lhsTypes, lhsOperandsLoc, result.operands))
3211 return ::mlir::failure();
3212 if (parser.resolveOperands(rhsOperands, rhsTypes, rhsOperandsLoc, result.operands))
3213 return ::mlir::failure();
3214
3215 ::llvm::SmallVector<::mlir::Type> inferredReturnTypes;
3216 if (::mlir::failed(UnsignedIntDivFeltOp::inferReturnTypes(parser.getContext(),
3217 result.location, result.operands,
3218 result.attributes.getDictionary(parser.getContext()),
3219 result.getRawProperties(),
3220 result.regions, inferredReturnTypes)))
3221 return ::mlir::failure();
3222 result.addTypes(inferredReturnTypes);
3223 return ::mlir::success();
3224}
3225
3226void UnsignedIntDivFeltOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
3227 _odsPrinter << ' ';
3228 _odsPrinter << getLhs();
3229 _odsPrinter << ",";
3230 _odsPrinter << ' ';
3231 _odsPrinter << getRhs();
3232 printInferredOrParsedType(_odsPrinter, *this, getLhs().getType(), true);
3233 printInferredOrParsedType(_odsPrinter, *this, getRhs().getType(), false);
3234 ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
3235 _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
3236}
3237
3238void UnsignedIntDivFeltOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
3239}
3240
3241 ::llvm::LogicalResult
3242 UnsignedIntDivFeltOp::inferReturnTypes(::mlir::MLIRContext *context,
3243 std::optional<::mlir::Location> location,
3244 ::mlir::ValueRange operands, ::mlir::DictionaryAttr attributes,
3245 ::mlir::OpaqueProperties properties, ::mlir::RegionRange regions,
3246 ::llvm::SmallVectorImpl<::mlir::Type> &inferredReturnTypes) {
3247 UnsignedIntDivFeltOp::Adaptor adaptor(operands, attributes, properties, regions);
3249 location, adaptor, inferredReturnTypes);
3250 }
3251
3252
3253::llvm::LogicalResult UnsignedIntDivFeltOp::inferReturnTypes(
3254 mlir::MLIRContext *context, std::optional<mlir::Location> loc, Adaptor adaptor,
3255 llvm::SmallVectorImpl<mlir::Type> &inferred
3256) {
3257 inferred.resize(1);
3258 auto value = adaptor.getLhs();
3259 inferred[0] = value ? value.getType() : FeltType::get(context, mlir::StringAttr());
3260 return mlir::success();
3261}
3262
3263bool UnsignedIntDivFeltOp::isCompatibleReturnTypes(mlir::TypeRange l, mlir::TypeRange r) {
3264 return l == r;
3265}
3266} // namespace felt
3267} // namespace llzk
3268MLIR_DEFINE_EXPLICIT_TYPE_ID(::llzk::felt::UnsignedIntDivFeltOp)
3269
3270namespace llzk {
3271namespace felt {
3272
3273//===----------------------------------------------------------------------===//
3274// ::llzk::felt::UnsignedModFeltOp definitions
3275//===----------------------------------------------------------------------===//
3276
3277namespace detail {
3278} // namespace detail
3280
3281::llvm::LogicalResult UnsignedModFeltOpAdaptor::verify(::mlir::Location loc) {
3282 return ::mlir::success();
3283}
3284
3285void UnsignedModFeltOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs) {
3286 odsState.addOperands(lhs);
3287 odsState.addOperands(rhs);
3288 odsState.addTypes(result);
3289}
3290
3291void UnsignedModFeltOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value lhs, ::mlir::Value rhs) {
3292 odsState.addOperands(lhs);
3293 odsState.addOperands(rhs);
3294
3295 ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
3296 if (::mlir::succeeded(UnsignedModFeltOp::inferReturnTypes(odsBuilder.getContext(),
3297 odsState.location, odsState.operands,
3298 odsState.attributes.getDictionary(odsState.getContext()),
3299 odsState.getRawProperties(),
3300 odsState.regions, inferredReturnTypes)))
3301 odsState.addTypes(inferredReturnTypes);
3302 else
3303 ::mlir::detail::reportFatalInferReturnTypesError(odsState);
3304
3305}
3306
3307void UnsignedModFeltOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs) {
3308 odsState.addOperands(lhs);
3309 odsState.addOperands(rhs);
3310 assert(resultTypes.size() == 1u && "mismatched number of results");
3311 odsState.addTypes(resultTypes);
3312}
3313
3314void UnsignedModFeltOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
3315 assert(operands.size() == 2u && "mismatched number of parameters");
3316 odsState.addOperands(operands);
3317 odsState.addAttributes(attributes);
3318 assert(resultTypes.size() == 1u && "mismatched number of return types");
3319 odsState.addTypes(resultTypes);
3320}
3321
3322void UnsignedModFeltOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
3323 assert(operands.size() == 2u && "mismatched number of parameters");
3324 odsState.addOperands(operands);
3325 odsState.addAttributes(attributes);
3326
3327 ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
3328 if (::mlir::succeeded(UnsignedModFeltOp::inferReturnTypes(odsBuilder.getContext(),
3329 odsState.location, operands,
3330 odsState.attributes.getDictionary(odsState.getContext()),
3331 odsState.getRawProperties(),
3332 odsState.regions, inferredReturnTypes))) {
3333 assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
3334 odsState.addTypes(inferredReturnTypes);
3335 } else {
3336 ::llvm::report_fatal_error("Failed to infer result type(s).");
3337 }
3338}
3339
3341 {
3342 unsigned index = 0; (void)index;
3343 auto valueGroup0 = getODSOperands(0);
3344
3345 for (auto v : valueGroup0) {
3346 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops1(*this, v.getType(), "operand", index++)))
3347 return ::mlir::failure();
3348 }
3349 auto valueGroup1 = getODSOperands(1);
3350
3351 for (auto v : valueGroup1) {
3352 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops1(*this, v.getType(), "operand", index++)))
3353 return ::mlir::failure();
3354 }
3355 }
3356 {
3357 unsigned index = 0; (void)index;
3358 auto valueGroup0 = getODSResults(0);
3359
3360 for (auto v : valueGroup0) {
3361 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops2(*this, v.getType(), "result", index++)))
3362 return ::mlir::failure();
3363 }
3364 }
3365 if (!((::llzk::typesUnify((*this->getODSOperands(0).begin()).getType(), (*this->getODSOperands(1).begin()).getType()))))
3366 return emitOpError("failed to verify that rhs type matches with lhs type");
3367 if (!((::llzk::typesUnify((*this->getODSOperands(0).begin()).getType(), (*this->getODSResults(0).begin()).getType()))))
3368 return emitOpError("failed to verify that result type matches with lhs type");
3369 if (!((::llzk::typesUnify((*this->getODSOperands(1).begin()).getType(), (*this->getODSResults(0).begin()).getType()))))
3370 return emitOpError("failed to verify that result type matches with rhs type");
3371 return ::mlir::success();
3372}
3373
3375 return verifyInvariantsImpl();
3376}
3377
3378::mlir::ParseResult UnsignedModFeltOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
3379 ::mlir::OpAsmParser::UnresolvedOperand lhsRawOperand{};
3380 ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> lhsOperands(&lhsRawOperand, 1); ::llvm::SMLoc lhsOperandsLoc;
3381 (void)lhsOperandsLoc;
3382 ::mlir::OpAsmParser::UnresolvedOperand rhsRawOperand{};
3383 ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> rhsOperands(&rhsRawOperand, 1); ::llvm::SMLoc rhsOperandsLoc;
3384 (void)rhsOperandsLoc;
3385 ::mlir::Type lhsRawType{};
3386 ::llvm::ArrayRef<::mlir::Type> lhsTypes(&lhsRawType, 1);
3387 ::mlir::Type rhsRawType{};
3388 ::llvm::ArrayRef<::mlir::Type> rhsTypes(&rhsRawType, 1);
3389
3390 lhsOperandsLoc = parser.getCurrentLocation();
3391 if (parser.parseOperand(lhsRawOperand))
3392 return ::mlir::failure();
3393 if (parser.parseComma())
3394 return ::mlir::failure();
3395
3396 rhsOperandsLoc = parser.getCurrentLocation();
3397 if (parser.parseOperand(rhsRawOperand))
3398 return ::mlir::failure();
3399 {
3400 auto odsResult = parseInferredOrParsedType(parser, lhsRawType, true);
3401 if (odsResult) return ::mlir::failure();
3402 }
3403 {
3404 auto odsResult = parseInferredOrParsedType(parser, rhsRawType, false);
3405 if (odsResult) return ::mlir::failure();
3406 }
3407 {
3408 auto loc = parser.getCurrentLocation();(void)loc;
3409 if (parser.parseOptionalAttrDict(result.attributes))
3410 return ::mlir::failure();
3411 }
3412 if (parser.resolveOperands(lhsOperands, lhsTypes, lhsOperandsLoc, result.operands))
3413 return ::mlir::failure();
3414 if (parser.resolveOperands(rhsOperands, rhsTypes, rhsOperandsLoc, result.operands))
3415 return ::mlir::failure();
3416
3417 ::llvm::SmallVector<::mlir::Type> inferredReturnTypes;
3418 if (::mlir::failed(UnsignedModFeltOp::inferReturnTypes(parser.getContext(),
3419 result.location, result.operands,
3420 result.attributes.getDictionary(parser.getContext()),
3421 result.getRawProperties(),
3422 result.regions, inferredReturnTypes)))
3423 return ::mlir::failure();
3424 result.addTypes(inferredReturnTypes);
3425 return ::mlir::success();
3426}
3427
3428void UnsignedModFeltOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
3429 _odsPrinter << ' ';
3430 _odsPrinter << getLhs();
3431 _odsPrinter << ",";
3432 _odsPrinter << ' ';
3433 _odsPrinter << getRhs();
3434 printInferredOrParsedType(_odsPrinter, *this, getLhs().getType(), true);
3435 printInferredOrParsedType(_odsPrinter, *this, getRhs().getType(), false);
3436 ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
3437 _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
3438}
3439
3440void UnsignedModFeltOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
3441}
3442
3443 ::llvm::LogicalResult
3444 UnsignedModFeltOp::inferReturnTypes(::mlir::MLIRContext *context,
3445 std::optional<::mlir::Location> location,
3446 ::mlir::ValueRange operands, ::mlir::DictionaryAttr attributes,
3447 ::mlir::OpaqueProperties properties, ::mlir::RegionRange regions,
3448 ::llvm::SmallVectorImpl<::mlir::Type> &inferredReturnTypes) {
3449 UnsignedModFeltOp::Adaptor adaptor(operands, attributes, properties, regions);
3451 location, adaptor, inferredReturnTypes);
3452 }
3453
3454
3455::llvm::LogicalResult UnsignedModFeltOp::inferReturnTypes(
3456 mlir::MLIRContext *context, std::optional<mlir::Location> loc, Adaptor adaptor,
3457 llvm::SmallVectorImpl<mlir::Type> &inferred
3458) {
3459 inferred.resize(1);
3460 auto value = adaptor.getLhs();
3461 inferred[0] = value ? value.getType() : FeltType::get(context, mlir::StringAttr());
3462 return mlir::success();
3463}
3464
3465bool UnsignedModFeltOp::isCompatibleReturnTypes(mlir::TypeRange l, mlir::TypeRange r) {
3466 return l == r;
3467}
3468} // namespace felt
3469} // namespace llzk
3470MLIR_DEFINE_EXPLICIT_TYPE_ID(::llzk::felt::UnsignedModFeltOp)
3471
3472namespace llzk {
3473namespace felt {
3474
3475//===----------------------------------------------------------------------===//
3476// ::llzk::felt::XorFeltOp definitions
3477//===----------------------------------------------------------------------===//
3478
3479namespace detail {
3480} // namespace detail
3482
3483::llvm::LogicalResult XorFeltOpAdaptor::verify(::mlir::Location loc) {
3484 return ::mlir::success();
3485}
3486
3487void XorFeltOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs) {
3488 odsState.addOperands(lhs);
3489 odsState.addOperands(rhs);
3490 odsState.addTypes(result);
3491}
3492
3493void XorFeltOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value lhs, ::mlir::Value rhs) {
3494 odsState.addOperands(lhs);
3495 odsState.addOperands(rhs);
3496
3497 ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
3498 if (::mlir::succeeded(XorFeltOp::inferReturnTypes(odsBuilder.getContext(),
3499 odsState.location, odsState.operands,
3500 odsState.attributes.getDictionary(odsState.getContext()),
3501 odsState.getRawProperties(),
3502 odsState.regions, inferredReturnTypes)))
3503 odsState.addTypes(inferredReturnTypes);
3504 else
3505 ::mlir::detail::reportFatalInferReturnTypesError(odsState);
3506
3507}
3508
3509void XorFeltOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs) {
3510 odsState.addOperands(lhs);
3511 odsState.addOperands(rhs);
3512 assert(resultTypes.size() == 1u && "mismatched number of results");
3513 odsState.addTypes(resultTypes);
3514}
3515
3516void XorFeltOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
3517 assert(operands.size() == 2u && "mismatched number of parameters");
3518 odsState.addOperands(operands);
3519 odsState.addAttributes(attributes);
3520 assert(resultTypes.size() == 1u && "mismatched number of return types");
3521 odsState.addTypes(resultTypes);
3522}
3523
3524void XorFeltOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
3525 assert(operands.size() == 2u && "mismatched number of parameters");
3526 odsState.addOperands(operands);
3527 odsState.addAttributes(attributes);
3528
3529 ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
3530 if (::mlir::succeeded(XorFeltOp::inferReturnTypes(odsBuilder.getContext(),
3531 odsState.location, operands,
3532 odsState.attributes.getDictionary(odsState.getContext()),
3533 odsState.getRawProperties(),
3534 odsState.regions, inferredReturnTypes))) {
3535 assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
3536 odsState.addTypes(inferredReturnTypes);
3537 } else {
3538 ::llvm::report_fatal_error("Failed to infer result type(s).");
3539 }
3540}
3541
3542::llvm::LogicalResult XorFeltOp::verifyInvariantsImpl() {
3543 {
3544 unsigned index = 0; (void)index;
3545 auto valueGroup0 = getODSOperands(0);
3546
3547 for (auto v : valueGroup0) {
3548 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops1(*this, v.getType(), "operand", index++)))
3549 return ::mlir::failure();
3550 }
3551 auto valueGroup1 = getODSOperands(1);
3552
3553 for (auto v : valueGroup1) {
3554 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops1(*this, v.getType(), "operand", index++)))
3555 return ::mlir::failure();
3556 }
3557 }
3558 {
3559 unsigned index = 0; (void)index;
3560 auto valueGroup0 = getODSResults(0);
3561
3562 for (auto v : valueGroup0) {
3563 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops2(*this, v.getType(), "result", index++)))
3564 return ::mlir::failure();
3565 }
3566 }
3567 if (!((::llzk::typesUnify((*this->getODSOperands(0).begin()).getType(), (*this->getODSOperands(1).begin()).getType()))))
3568 return emitOpError("failed to verify that rhs type matches with lhs type");
3569 if (!((::llzk::typesUnify((*this->getODSOperands(0).begin()).getType(), (*this->getODSResults(0).begin()).getType()))))
3570 return emitOpError("failed to verify that result type matches with lhs type");
3571 if (!((::llzk::typesUnify((*this->getODSOperands(1).begin()).getType(), (*this->getODSResults(0).begin()).getType()))))
3572 return emitOpError("failed to verify that result type matches with rhs type");
3573 return ::mlir::success();
3574}
3575
3576::llvm::LogicalResult XorFeltOp::verifyInvariants() {
3577 return verifyInvariantsImpl();
3578}
3579
3580::mlir::ParseResult XorFeltOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
3581 ::mlir::OpAsmParser::UnresolvedOperand lhsRawOperand{};
3582 ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> lhsOperands(&lhsRawOperand, 1); ::llvm::SMLoc lhsOperandsLoc;
3583 (void)lhsOperandsLoc;
3584 ::mlir::OpAsmParser::UnresolvedOperand rhsRawOperand{};
3585 ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> rhsOperands(&rhsRawOperand, 1); ::llvm::SMLoc rhsOperandsLoc;
3586 (void)rhsOperandsLoc;
3587 ::mlir::Type lhsRawType{};
3588 ::llvm::ArrayRef<::mlir::Type> lhsTypes(&lhsRawType, 1);
3589 ::mlir::Type rhsRawType{};
3590 ::llvm::ArrayRef<::mlir::Type> rhsTypes(&rhsRawType, 1);
3591
3592 lhsOperandsLoc = parser.getCurrentLocation();
3593 if (parser.parseOperand(lhsRawOperand))
3594 return ::mlir::failure();
3595 if (parser.parseComma())
3596 return ::mlir::failure();
3597
3598 rhsOperandsLoc = parser.getCurrentLocation();
3599 if (parser.parseOperand(rhsRawOperand))
3600 return ::mlir::failure();
3601 {
3602 auto odsResult = parseInferredOrParsedType(parser, lhsRawType, true);
3603 if (odsResult) return ::mlir::failure();
3604 }
3605 {
3606 auto odsResult = parseInferredOrParsedType(parser, rhsRawType, false);
3607 if (odsResult) return ::mlir::failure();
3608 }
3609 {
3610 auto loc = parser.getCurrentLocation();(void)loc;
3611 if (parser.parseOptionalAttrDict(result.attributes))
3612 return ::mlir::failure();
3613 }
3614 if (parser.resolveOperands(lhsOperands, lhsTypes, lhsOperandsLoc, result.operands))
3615 return ::mlir::failure();
3616 if (parser.resolveOperands(rhsOperands, rhsTypes, rhsOperandsLoc, result.operands))
3617 return ::mlir::failure();
3618
3619 ::llvm::SmallVector<::mlir::Type> inferredReturnTypes;
3620 if (::mlir::failed(XorFeltOp::inferReturnTypes(parser.getContext(),
3621 result.location, result.operands,
3622 result.attributes.getDictionary(parser.getContext()),
3623 result.getRawProperties(),
3624 result.regions, inferredReturnTypes)))
3625 return ::mlir::failure();
3626 result.addTypes(inferredReturnTypes);
3627 return ::mlir::success();
3628}
3629
3630void XorFeltOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
3631 _odsPrinter << ' ';
3632 _odsPrinter << getLhs();
3633 _odsPrinter << ",";
3634 _odsPrinter << ' ';
3635 _odsPrinter << getRhs();
3636 printInferredOrParsedType(_odsPrinter, *this, getLhs().getType(), true);
3637 printInferredOrParsedType(_odsPrinter, *this, getRhs().getType(), false);
3638 ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
3639 _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
3640}
3641
3642void XorFeltOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
3643}
3644
3645 ::llvm::LogicalResult
3646 XorFeltOp::inferReturnTypes(::mlir::MLIRContext *context,
3647 std::optional<::mlir::Location> location,
3648 ::mlir::ValueRange operands, ::mlir::DictionaryAttr attributes,
3649 ::mlir::OpaqueProperties properties, ::mlir::RegionRange regions,
3650 ::llvm::SmallVectorImpl<::mlir::Type> &inferredReturnTypes) {
3651 XorFeltOp::Adaptor adaptor(operands, attributes, properties, regions);
3652 return XorFeltOp::inferReturnTypes(context,
3653 location, adaptor, inferredReturnTypes);
3654 }
3655
3656
3657::llvm::LogicalResult XorFeltOp::inferReturnTypes(
3658 mlir::MLIRContext *context, std::optional<mlir::Location> loc, Adaptor adaptor,
3659 llvm::SmallVectorImpl<mlir::Type> &inferred
3660) {
3661 inferred.resize(1);
3662 auto value = adaptor.getLhs();
3663 inferred[0] = value ? value.getType() : FeltType::get(context, mlir::StringAttr());
3664 return mlir::success();
3665}
3666
3667bool XorFeltOp::isCompatibleReturnTypes(mlir::TypeRange l, mlir::TypeRange r) {
3668 return l == r;
3669}
3670} // namespace felt
3671} // namespace llzk
3672MLIR_DEFINE_EXPLICIT_TYPE_ID(::llzk::felt::XorFeltOp)
3673
3674
3675#endif // GET_OP_CLASSES
3676
::llvm::LogicalResult verify(::mlir::Location loc)
Definition Ops.cpp.inc:90
AddFeltOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs={}, const ::mlir::EmptyProperties &properties={}, ::mlir::RegionRange regions={})
Definition Ops.h.inc:139
AddFeltOpAdaptor(AddFeltOp op)
Definition Ops.cpp.inc:88
::llvm::LogicalResult verifyInvariants()
Definition Ops.cpp.inc:183
::mlir::TypedValue<::mlir::Type > getLhs()
Definition Ops.h.inc:206
static bool isCompatibleReturnTypes(::mlir::TypeRange l, ::mlir::TypeRange r)
Definition Ops.cpp.inc:274
::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)
::llvm::LogicalResult verifyInvariantsImpl()
Definition Ops.cpp.inc:149
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
Definition Ops.cpp.inc:187
void print(::mlir::OpAsmPrinter &_odsPrinter)
Definition Ops.cpp.inc:237
::mlir::Operation::result_range getODSResults(unsigned index)
Definition Ops.h.inc:228
::mlir::TypedValue<::mlir::Type > getRhs()
Definition Ops.h.inc:210
void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect > > &effects)
Definition Ops.cpp.inc:249
AddFeltOpAdaptor Adaptor
Definition Ops.h.inc:184
::mlir::Operation::operand_range getODSOperands(unsigned index)
Definition Ops.h.inc:200
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs)
Definition Ops.cpp.inc:94
AndFeltOpAdaptor(AndFeltOp op)
Definition Ops.cpp.inc:290
::llvm::LogicalResult verify(::mlir::Location loc)
Definition Ops.cpp.inc:292
AndFeltOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs={}, const ::mlir::EmptyProperties &properties={}, ::mlir::RegionRange regions={})
Definition Ops.h.inc:326
::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)
::llvm::LogicalResult verifyInvariantsImpl()
Definition Ops.cpp.inc:351
void print(::mlir::OpAsmPrinter &_odsPrinter)
Definition Ops.cpp.inc:439
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs)
Definition Ops.cpp.inc:296
::llvm::LogicalResult verifyInvariants()
Definition Ops.cpp.inc:385
::mlir::TypedValue<::mlir::Type > getRhs()
Definition Ops.h.inc:397
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
Definition Ops.cpp.inc:389
::mlir::Operation::operand_range getODSOperands(unsigned index)
Definition Ops.h.inc:387
::mlir::TypedValue<::mlir::Type > getLhs()
Definition Ops.h.inc:393
static bool isCompatibleReturnTypes(::mlir::TypeRange l, ::mlir::TypeRange r)
Definition Ops.cpp.inc:476
AndFeltOpAdaptor Adaptor
Definition Ops.h.inc:371
::mlir::Operation::result_range getODSResults(unsigned index)
Definition Ops.h.inc:415
void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect > > &effects)
Definition Ops.cpp.inc:451
::llvm::LogicalResult verify(::mlir::Location loc)
Definition Ops.cpp.inc:494
DivFeltOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs={}, const ::mlir::EmptyProperties &properties={}, ::mlir::RegionRange regions={})
Definition Ops.h.inc:513
DivFeltOpAdaptor(DivFeltOp op)
Definition Ops.cpp.inc:492
::mlir::Operation::result_range getODSResults(unsigned index)
Definition Ops.h.inc:602
::llvm::LogicalResult verifyInvariantsImpl()
Definition Ops.cpp.inc:553
void print(::mlir::OpAsmPrinter &_odsPrinter)
Definition Ops.cpp.inc:641
DivFeltOpAdaptor Adaptor
Definition Ops.h.inc:558
::mlir::TypedValue<::mlir::Type > getRhs()
Definition Ops.h.inc:584
static bool isCompatibleReturnTypes(::mlir::TypeRange l, ::mlir::TypeRange r)
Definition Ops.cpp.inc:678
::mlir::TypedValue<::mlir::Type > getLhs()
Definition Ops.h.inc:580
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
Definition Ops.cpp.inc:591
void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect > > &effects)
Definition Ops.cpp.inc:653
::llvm::LogicalResult verifyInvariants()
Definition Ops.cpp.inc:587
::mlir::Operation::operand_range getODSOperands(unsigned index)
Definition Ops.h.inc:574
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs)
Definition Ops.cpp.inc:498
::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)
::llvm::LogicalResult verify(::mlir::Location loc)
Definition Ops.cpp.inc:703
FeltConstantOpAdaptor(FeltConstantOp op)
Definition Ops.cpp.inc:701
FeltConstantOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:731
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::llzk::felt::FeltConstAttr value)
Definition Ops.cpp.inc:799
void writeProperties(::mlir::DialectBytecodeWriter &writer)
Definition Ops.cpp.inc:789
FeltConstantOpAdaptor Adaptor
Definition Ops.h.inc:770
FoldAdaptor::Properties Properties
Definition Ops.h.inc:774
void print(::mlir::OpAsmPrinter &_odsPrinter)
Definition Ops.cpp.inc:922
::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)
::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state)
Definition Ops.cpp.inc:782
static std::optional< mlir::Attribute > getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name)
Definition Ops.cpp.inc:756
static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs)
Definition Ops.cpp.inc:769
::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:712
::llvm::LogicalResult verifyInvariantsImpl()
Definition Ops.cpp.inc:870
void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect > > &effects)
Definition Ops.cpp.inc:930
::llzk::felt::FeltConstAttr getValueAttr()
Definition Ops.h.inc:825
::mlir::Operation::result_range getODSResults(unsigned index)
Definition Ops.h.inc:806
static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value)
Definition Ops.cpp.inc:762
::mlir::StringAttr getValueAttrName()
Definition Ops.h.inc:780
static llvm::hash_code computePropertiesHash(const Properties &prop)
Definition Ops.cpp.inc:751
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
Definition Ops.cpp.inc:894
::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:773
::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop)
Definition Ops.cpp.inc:735
::llvm::LogicalResult verifyInvariants()
Definition Ops.cpp.inc:890
::llzk::felt::FeltConstAttr getValue()
Definition Ops.cpp.inc:794
static FeltType get(::mlir::MLIRContext *context, ::mlir::StringAttr fieldName)
Definition Types.cpp.inc:67
InvFeltOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs={}, const ::mlir::EmptyProperties &properties={}, ::mlir::RegionRange regions={})
Definition Ops.h.inc:910
::llvm::LogicalResult verify(::mlir::Location loc)
Definition Ops.cpp.inc:959
InvFeltOpAdaptor(InvFeltOp op)
Definition Ops.cpp.inc:957
InvFeltOpAdaptor Adaptor
Definition Ops.h.inc:951
::mlir::TypedValue<::mlir::Type > getOperand()
Definition Ops.h.inc:973
::mlir::Operation::result_range getODSResults(unsigned index)
Definition Ops.h.inc:986
void print(::mlir::OpAsmPrinter &_odsPrinter)
Definition Ops.cpp.inc:1076
::llvm::LogicalResult verifyInvariants()
Definition Ops.cpp.inc:1039
::mlir::Operation::operand_range getODSOperands(unsigned index)
Definition Ops.h.inc:967
static bool isCompatibleReturnTypes(::mlir::TypeRange l, ::mlir::TypeRange r)
Definition Ops.cpp.inc:1109
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value operand)
Definition Ops.cpp.inc:963
::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)
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
Definition Ops.cpp.inc:1043
void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect > > &effects)
Definition Ops.cpp.inc:1084
::llvm::LogicalResult verifyInvariantsImpl()
Definition Ops.cpp.inc:1015
MulFeltOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs={}, const ::mlir::EmptyProperties &properties={}, ::mlir::RegionRange regions={})
Definition Ops.h.inc:1084
::llvm::LogicalResult verify(::mlir::Location loc)
Definition Ops.cpp.inc:1127
void print(::mlir::OpAsmPrinter &_odsPrinter)
Definition Ops.cpp.inc:1274
::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)
::mlir::TypedValue<::mlir::Type > getLhs()
Definition Ops.h.inc:1151
::llvm::LogicalResult verifyInvariantsImpl()
Definition Ops.cpp.inc:1186
::mlir::TypedValue<::mlir::Type > getRhs()
Definition Ops.h.inc:1155
MulFeltOpAdaptor Adaptor
Definition Ops.h.inc:1129
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs)
Definition Ops.cpp.inc:1131
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
Definition Ops.cpp.inc:1224
void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect > > &effects)
Definition Ops.cpp.inc:1286
::mlir::Operation::result_range getODSResults(unsigned index)
Definition Ops.h.inc:1173
::llvm::LogicalResult verifyInvariants()
Definition Ops.cpp.inc:1220
static bool isCompatibleReturnTypes(::mlir::TypeRange l, ::mlir::TypeRange r)
Definition Ops.cpp.inc:1311
::mlir::Operation::operand_range getODSOperands(unsigned index)
Definition Ops.h.inc:1145
NegFeltOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs={}, const ::mlir::EmptyProperties &properties={}, ::mlir::RegionRange regions={})
Definition Ops.h.inc:1271
::llvm::LogicalResult verify(::mlir::Location loc)
Definition Ops.cpp.inc:1329
::llvm::LogicalResult verifyInvariantsImpl()
Definition Ops.cpp.inc:1385
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value operand)
Definition Ops.cpp.inc:1333
void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect > > &effects)
Definition Ops.cpp.inc:1454
::llvm::LogicalResult verifyInvariants()
Definition Ops.cpp.inc:1409
::mlir::TypedValue<::mlir::Type > getOperand()
Definition Ops.h.inc:1334
::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)
static bool isCompatibleReturnTypes(::mlir::TypeRange l, ::mlir::TypeRange r)
Definition Ops.cpp.inc:1479
::mlir::Operation::result_range getODSResults(unsigned index)
Definition Ops.h.inc:1347
NegFeltOpAdaptor Adaptor
Definition Ops.h.inc:1312
void print(::mlir::OpAsmPrinter &_odsPrinter)
Definition Ops.cpp.inc:1446
::mlir::Operation::operand_range getODSOperands(unsigned index)
Definition Ops.h.inc:1328
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
Definition Ops.cpp.inc:1413
::llvm::LogicalResult verify(::mlir::Location loc)
Definition Ops.cpp.inc:1497
NotFeltOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs={}, const ::mlir::EmptyProperties &properties={}, ::mlir::RegionRange regions={})
Definition Ops.h.inc:1445
::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)
NotFeltOpAdaptor Adaptor
Definition Ops.h.inc:1486
::llvm::LogicalResult verifyInvariantsImpl()
Definition Ops.cpp.inc:1553
::mlir::Operation::result_range getODSResults(unsigned index)
Definition Ops.h.inc:1521
::mlir::Operation::operand_range getODSOperands(unsigned index)
Definition Ops.h.inc:1502
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value operand)
Definition Ops.cpp.inc:1501
::mlir::TypedValue<::mlir::Type > getOperand()
Definition Ops.h.inc:1508
::llvm::LogicalResult verifyInvariants()
Definition Ops.cpp.inc:1577
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
Definition Ops.cpp.inc:1581
void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect > > &effects)
Definition Ops.cpp.inc:1622
void print(::mlir::OpAsmPrinter &_odsPrinter)
Definition Ops.cpp.inc:1614
static bool isCompatibleReturnTypes(::mlir::TypeRange l, ::mlir::TypeRange r)
Definition Ops.cpp.inc:1647
OrFeltOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs={}, const ::mlir::EmptyProperties &properties={}, ::mlir::RegionRange regions={})
Definition Ops.h.inc:1619
::llvm::LogicalResult verify(::mlir::Location loc)
Definition Ops.cpp.inc:1665
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
Definition Ops.cpp.inc:1762
::mlir::Operation::result_range getODSResults(unsigned index)
Definition Ops.h.inc:1708
static bool isCompatibleReturnTypes(::mlir::TypeRange l, ::mlir::TypeRange r)
Definition Ops.cpp.inc:1849
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs)
Definition Ops.cpp.inc:1669
void print(::mlir::OpAsmPrinter &_odsPrinter)
Definition Ops.cpp.inc:1812
::mlir::Operation::operand_range getODSOperands(unsigned index)
Definition Ops.h.inc:1680
::llvm::LogicalResult verifyInvariants()
Definition Ops.cpp.inc:1758
OrFeltOpAdaptor Adaptor
Definition Ops.h.inc:1664
::mlir::TypedValue<::mlir::Type > getRhs()
Definition Ops.h.inc:1690
::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)
::llvm::LogicalResult verifyInvariantsImpl()
Definition Ops.cpp.inc:1724
void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect > > &effects)
Definition Ops.cpp.inc:1824
::mlir::TypedValue<::mlir::Type > getLhs()
Definition Ops.h.inc:1686
::llvm::LogicalResult verify(::mlir::Location loc)
Definition Ops.cpp.inc:1867
PowFeltOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs={}, const ::mlir::EmptyProperties &properties={}, ::mlir::RegionRange regions={})
Definition Ops.h.inc:1806
::mlir::TypedValue<::mlir::Type > getLhs()
Definition Ops.h.inc:1873
::mlir::Operation::operand_range getODSOperands(unsigned index)
Definition Ops.h.inc:1867
void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect > > &effects)
Definition Ops.cpp.inc:2026
::mlir::Operation::result_range getODSResults(unsigned index)
Definition Ops.h.inc:1895
void print(::mlir::OpAsmPrinter &_odsPrinter)
Definition Ops.cpp.inc:2014
::mlir::TypedValue<::mlir::Type > getRhs()
Definition Ops.h.inc:1877
static bool isCompatibleReturnTypes(::mlir::TypeRange l, ::mlir::TypeRange r)
Definition Ops.cpp.inc:2051
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
Definition Ops.cpp.inc:1964
::llvm::LogicalResult verifyInvariantsImpl()
Definition Ops.cpp.inc:1926
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs)
Definition Ops.cpp.inc:1871
PowFeltOpAdaptor Adaptor
Definition Ops.h.inc:1851
::llvm::LogicalResult verifyInvariants()
Definition Ops.cpp.inc:1960
::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)
::llvm::LogicalResult verify(::mlir::Location loc)
Definition Ops.cpp.inc:2069
ShlFeltOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs={}, const ::mlir::EmptyProperties &properties={}, ::mlir::RegionRange regions={})
Definition Ops.h.inc:1993
void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect > > &effects)
Definition Ops.cpp.inc:2228
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs)
Definition Ops.cpp.inc:2073
::mlir::TypedValue<::mlir::Type > getLhs()
Definition Ops.h.inc:2060
static bool isCompatibleReturnTypes(::mlir::TypeRange l, ::mlir::TypeRange r)
Definition Ops.cpp.inc:2253
::mlir::TypedValue<::mlir::Type > getRhs()
Definition Ops.h.inc:2064
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
Definition Ops.cpp.inc:2166
ShlFeltOpAdaptor Adaptor
Definition Ops.h.inc:2038
void print(::mlir::OpAsmPrinter &_odsPrinter)
Definition Ops.cpp.inc:2216
::llvm::LogicalResult verifyInvariantsImpl()
Definition Ops.cpp.inc:2128
::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)
::mlir::Operation::operand_range getODSOperands(unsigned index)
Definition Ops.h.inc:2054
::mlir::Operation::result_range getODSResults(unsigned index)
Definition Ops.h.inc:2082
::llvm::LogicalResult verifyInvariants()
Definition Ops.cpp.inc:2162
ShrFeltOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs={}, const ::mlir::EmptyProperties &properties={}, ::mlir::RegionRange regions={})
Definition Ops.h.inc:2180
::llvm::LogicalResult verify(::mlir::Location loc)
Definition Ops.cpp.inc:2271
::llvm::LogicalResult verifyInvariants()
Definition Ops.cpp.inc:2364
void print(::mlir::OpAsmPrinter &_odsPrinter)
Definition Ops.cpp.inc:2418
::mlir::Operation::operand_range getODSOperands(unsigned index)
Definition Ops.h.inc:2241
::mlir::TypedValue<::mlir::Type > getRhs()
Definition Ops.h.inc:2251
void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect > > &effects)
Definition Ops.cpp.inc:2430
ShrFeltOpAdaptor Adaptor
Definition Ops.h.inc:2225
::mlir::Operation::result_range getODSResults(unsigned index)
Definition Ops.h.inc:2269
::llvm::LogicalResult verifyInvariantsImpl()
Definition Ops.cpp.inc:2330
::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)
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs)
Definition Ops.cpp.inc:2275
::mlir::TypedValue<::mlir::Type > getLhs()
Definition Ops.h.inc:2247
static bool isCompatibleReturnTypes(::mlir::TypeRange l, ::mlir::TypeRange r)
Definition Ops.cpp.inc:2455
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
Definition Ops.cpp.inc:2368
::llvm::LogicalResult verify(::mlir::Location loc)
Definition Ops.cpp.inc:2473
SignedIntDivFeltOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs={}, const ::mlir::EmptyProperties &properties={}, ::mlir::RegionRange regions={})
Definition Ops.h.inc:2367
SignedIntDivFeltOpAdaptor(SignedIntDivFeltOp op)
Definition Ops.cpp.inc:2471
::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)
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
Definition Ops.cpp.inc:2570
static bool isCompatibleReturnTypes(::mlir::TypeRange l, ::mlir::TypeRange r)
Definition Ops.cpp.inc:2657
::llvm::LogicalResult verifyInvariantsImpl()
Definition Ops.cpp.inc:2532
::mlir::Operation::operand_range getODSOperands(unsigned index)
Definition Ops.h.inc:2428
::mlir::Operation::result_range getODSResults(unsigned index)
Definition Ops.h.inc:2456
::mlir::TypedValue<::mlir::Type > getRhs()
Definition Ops.h.inc:2438
::mlir::TypedValue<::mlir::Type > getLhs()
Definition Ops.h.inc:2434
::llvm::LogicalResult verifyInvariants()
Definition Ops.cpp.inc:2566
SignedIntDivFeltOpAdaptor Adaptor
Definition Ops.h.inc:2412
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs)
Definition Ops.cpp.inc:2477
void print(::mlir::OpAsmPrinter &_odsPrinter)
Definition Ops.cpp.inc:2620
void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect > > &effects)
Definition Ops.cpp.inc:2632
SignedModFeltOpAdaptor(SignedModFeltOp op)
Definition Ops.cpp.inc:2673
::llvm::LogicalResult verify(::mlir::Location loc)
Definition Ops.cpp.inc:2675
SignedModFeltOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs={}, const ::mlir::EmptyProperties &properties={}, ::mlir::RegionRange regions={})
Definition Ops.h.inc:2554
::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)
SignedModFeltOpAdaptor Adaptor
Definition Ops.h.inc:2599
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
Definition Ops.cpp.inc:2772
::mlir::TypedValue<::mlir::Type > getRhs()
Definition Ops.h.inc:2625
void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect > > &effects)
Definition Ops.cpp.inc:2834
void print(::mlir::OpAsmPrinter &_odsPrinter)
Definition Ops.cpp.inc:2822
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs)
Definition Ops.cpp.inc:2679
static bool isCompatibleReturnTypes(::mlir::TypeRange l, ::mlir::TypeRange r)
Definition Ops.cpp.inc:2859
::mlir::TypedValue<::mlir::Type > getLhs()
Definition Ops.h.inc:2621
::mlir::Operation::result_range getODSResults(unsigned index)
Definition Ops.h.inc:2643
::mlir::Operation::operand_range getODSOperands(unsigned index)
Definition Ops.h.inc:2615
::llvm::LogicalResult verifyInvariantsImpl()
Definition Ops.cpp.inc:2734
::llvm::LogicalResult verifyInvariants()
Definition Ops.cpp.inc:2768
SubFeltOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs={}, const ::mlir::EmptyProperties &properties={}, ::mlir::RegionRange regions={})
Definition Ops.h.inc:2741
::llvm::LogicalResult verify(::mlir::Location loc)
Definition Ops.cpp.inc:2877
::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)
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
Definition Ops.cpp.inc:2974
::mlir::Operation::result_range getODSResults(unsigned index)
Definition Ops.h.inc:2830
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs)
Definition Ops.cpp.inc:2881
::llvm::LogicalResult verifyInvariantsImpl()
Definition Ops.cpp.inc:2936
void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect > > &effects)
Definition Ops.cpp.inc:3036
::mlir::TypedValue<::mlir::Type > getRhs()
Definition Ops.h.inc:2812
void print(::mlir::OpAsmPrinter &_odsPrinter)
Definition Ops.cpp.inc:3024
static bool isCompatibleReturnTypes(::mlir::TypeRange l, ::mlir::TypeRange r)
Definition Ops.cpp.inc:3061
::llvm::LogicalResult verifyInvariants()
Definition Ops.cpp.inc:2970
::mlir::TypedValue<::mlir::Type > getLhs()
Definition Ops.h.inc:2808
SubFeltOpAdaptor Adaptor
Definition Ops.h.inc:2786
::mlir::Operation::operand_range getODSOperands(unsigned index)
Definition Ops.h.inc:2802
UnsignedIntDivFeltOpAdaptor(UnsignedIntDivFeltOp op)
Definition Ops.cpp.inc:3077
UnsignedIntDivFeltOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs={}, const ::mlir::EmptyProperties &properties={}, ::mlir::RegionRange regions={})
Definition Ops.h.inc:2928
::llvm::LogicalResult verify(::mlir::Location loc)
Definition Ops.cpp.inc:3079
void print(::mlir::OpAsmPrinter &_odsPrinter)
Definition Ops.cpp.inc:3226
::mlir::TypedValue<::mlir::Type > getRhs()
Definition Ops.h.inc:2999
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
Definition Ops.cpp.inc:3176
UnsignedIntDivFeltOpAdaptor Adaptor
Definition Ops.h.inc:2973
void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect > > &effects)
Definition Ops.cpp.inc:3238
::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)
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs)
Definition Ops.cpp.inc:3083
static bool isCompatibleReturnTypes(::mlir::TypeRange l, ::mlir::TypeRange r)
Definition Ops.cpp.inc:3263
::llvm::LogicalResult verifyInvariantsImpl()
Definition Ops.cpp.inc:3138
::mlir::TypedValue<::mlir::Type > getLhs()
Definition Ops.h.inc:2995
::mlir::Operation::result_range getODSResults(unsigned index)
Definition Ops.h.inc:3017
::llvm::LogicalResult verifyInvariants()
Definition Ops.cpp.inc:3172
::mlir::Operation::operand_range getODSOperands(unsigned index)
Definition Ops.h.inc:2989
UnsignedModFeltOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs={}, const ::mlir::EmptyProperties &properties={}, ::mlir::RegionRange regions={})
Definition Ops.h.inc:3115
::llvm::LogicalResult verify(::mlir::Location loc)
Definition Ops.cpp.inc:3281
UnsignedModFeltOpAdaptor(UnsignedModFeltOp op)
Definition Ops.cpp.inc:3279
void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect > > &effects)
Definition Ops.cpp.inc:3440
::mlir::TypedValue<::mlir::Type > getRhs()
Definition Ops.h.inc:3186
::mlir::Operation::operand_range getODSOperands(unsigned index)
Definition Ops.h.inc:3176
::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)
static bool isCompatibleReturnTypes(::mlir::TypeRange l, ::mlir::TypeRange r)
Definition Ops.cpp.inc:3465
::llvm::LogicalResult verifyInvariants()
Definition Ops.cpp.inc:3374
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
Definition Ops.cpp.inc:3378
::mlir::Operation::result_range getODSResults(unsigned index)
Definition Ops.h.inc:3204
UnsignedModFeltOpAdaptor Adaptor
Definition Ops.h.inc:3160
::llvm::LogicalResult verifyInvariantsImpl()
Definition Ops.cpp.inc:3340
::mlir::TypedValue<::mlir::Type > getLhs()
Definition Ops.h.inc:3182
void print(::mlir::OpAsmPrinter &_odsPrinter)
Definition Ops.cpp.inc:3428
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs)
Definition Ops.cpp.inc:3285
::llvm::LogicalResult verify(::mlir::Location loc)
Definition Ops.cpp.inc:3483
XorFeltOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs={}, const ::mlir::EmptyProperties &properties={}, ::mlir::RegionRange regions={})
Definition Ops.h.inc:3302
XorFeltOpAdaptor Adaptor
Definition Ops.h.inc:3347
::mlir::Operation::result_range getODSResults(unsigned index)
Definition Ops.h.inc:3391
::llvm::LogicalResult verifyInvariantsImpl()
Definition Ops.cpp.inc:3542
::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)
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
Definition Ops.cpp.inc:3580
::mlir::TypedValue<::mlir::Type > getLhs()
Definition Ops.h.inc:3369
::llvm::LogicalResult verifyInvariants()
Definition Ops.cpp.inc:3576
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs)
Definition Ops.cpp.inc:3487
::mlir::Operation::operand_range getODSOperands(unsigned index)
Definition Ops.h.inc:3363
void print(::mlir::OpAsmPrinter &_odsPrinter)
Definition Ops.cpp.inc:3630
::mlir::TypedValue<::mlir::Type > getRhs()
Definition Ops.h.inc:3373
static bool isCompatibleReturnTypes(::mlir::TypeRange l, ::mlir::TypeRange r)
Definition Ops.cpp.inc:3667
void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect > > &effects)
Definition Ops.cpp.inc:3642
::llzk::felt::FeltConstAttr getValueAttr()
Definition Ops.h.inc:718
::std::optional<::mlir::OperationName > odsOpName
Definition Ops.h.inc:696
FeltConstantOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:700
bool isValidType(Type type)
bool typesUnify(Type lhs, Type rhs, ArrayRef< StringRef > rhsReversePrefix, UnificationMap *unifications)