LLZK 3.0.0
An open-source IR for Zero Knowledge (ZK) circuits
Loading...
Searching...
No Matches
Ops.cpp.inc
Go to the documentation of this file.
1/*===- TableGen'erated file -------------------------------------*- C++ -*-===*\
2|* *|
3|* Op Definitions *|
4|* *|
5|* Automatically generated file, do not edit! *|
6|* From: Ops.td *|
7|* *|
8\*===----------------------------------------------------------------------===*/
9
10#ifdef GET_OP_LIST
11#undef GET_OP_LIST
12
31#endif // GET_OP_LIST
32
33#ifdef GET_OP_CLASSES
34#undef GET_OP_CLASSES
35
36
37//===----------------------------------------------------------------------===//
38// Local Utility Method Definitions
39//===----------------------------------------------------------------------===//
40
41
42static ::llvm::LogicalResult __mlir_ods_local_type_constraint_Ops1(
43 ::mlir::Operation *op, ::mlir::Type type, ::llvm::StringRef valueKind,
44 unsigned valueIndex) {
45 if (!((::llvm::isa<llzk::polymorphic::TypeVarType,::llzk::felt::FeltType>(type)))) {
46 return op->emitOpError(valueKind) << " #" << valueIndex
47 << " must be finite field element or type variable, but got " << type;
48 }
49 return ::mlir::success();
50}
51
52static ::llvm::LogicalResult __mlir_ods_local_type_constraint_Ops2(
53 ::mlir::Operation *op, ::mlir::Type type, ::llvm::StringRef valueKind,
54 unsigned valueIndex) {
55 if (!((::llzk::isValidType(type)))) {
56 return op->emitOpError(valueKind) << " #" << valueIndex
57 << " must be a valid LLZK type, but got " << type;
58 }
59 return ::mlir::success();
60}
61
62static ::llvm::LogicalResult __mlir_ods_local_attr_constraint_Ops1(
63 ::mlir::Attribute attr, ::llvm::StringRef attrName, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
64 if (attr && !((::llvm::isa<::llzk::felt::FeltConstAttr>(attr))))
65 return emitError() << "attribute '" << attrName
66 << "' failed to satisfy constraint: finite field element";
67 return ::mlir::success();
68}
69static ::llvm::LogicalResult __mlir_ods_local_attr_constraint_Ops1(
70 ::mlir::Operation *op, ::mlir::Attribute attr, ::llvm::StringRef attrName) {
71 return __mlir_ods_local_attr_constraint_Ops1(attr, attrName, [op]() {
72 return op->emitOpError();
73 });
74}
75namespace llzk::felt {
76
77
78//===----------------------------------------------------------------------===//
79// ::llzk::felt::AddFeltOp definitions
80//===----------------------------------------------------------------------===//
81
82namespace detail {
83
84AddFeltOpGenericAdaptorBase::AddFeltOpGenericAdaptorBase(AddFeltOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
85
86
87} // namespace detail
89
90::llvm::LogicalResult AddFeltOpAdaptor::verify(::mlir::Location loc) {
91 return ::mlir::success();
92}
93
94::llvm::LogicalResult AddFeltOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
95 ::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
96 if (!dict) {
97 emitError() << "expected DictionaryAttr to set properties";
98 return ::mlir::failure();
99 }
100 return ::mlir::success();
101}
102
103::mlir::Attribute AddFeltOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
104 ::mlir::SmallVector<::mlir::NamedAttribute> attrs;
105 ::mlir::Builder odsBuilder{ctx};
106
107 if (!attrs.empty())
108 return odsBuilder.getDictionaryAttr(attrs);
109 return {};
110}
111
112llvm::hash_code AddFeltOp::computePropertiesHash(const Properties &prop) {
113 using llvm::hash_value;
114 return llvm::hash_combine();
115}
116
117std::optional<mlir::Attribute> AddFeltOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
118 return std::nullopt;
119}
120
121void AddFeltOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
122}
123
124void AddFeltOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
125}
126
127::llvm::LogicalResult AddFeltOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
128 return ::mlir::success();
129}
130
131void AddFeltOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs) {
132 odsState.addOperands(lhs);
133 odsState.addOperands(rhs);
134 odsState.addTypes(result);
135}
136
137AddFeltOp AddFeltOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs) {
138 ::mlir::OperationState __state__(location, getOperationName());
139 build(builder, __state__, std::forward<decltype(result)>(result), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs));
140 auto __res__ = ::llvm::dyn_cast<AddFeltOp>(builder.create(__state__));
141 assert(__res__ && "builder didn't return the right type");
142 return __res__;
143}
144
145AddFeltOp AddFeltOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs) {
146 return create(builder, builder.getLoc(), std::forward<decltype(result)>(result), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs));
147}
148
149void AddFeltOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value lhs, ::mlir::Value rhs) {
150 odsState.addOperands(lhs);
151 odsState.addOperands(rhs);
152
153 ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
154 if (::mlir::succeeded(AddFeltOp::inferReturnTypes(odsBuilder.getContext(),
155 odsState.location, odsState.operands,
156 odsState.attributes.getDictionary(odsState.getContext()),
157 odsState.getRawProperties(),
158 odsState.regions, inferredReturnTypes)))
159 odsState.addTypes(inferredReturnTypes);
160 else
161 ::mlir::detail::reportFatalInferReturnTypesError(odsState);
162
163}
164
165AddFeltOp AddFeltOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value lhs, ::mlir::Value rhs) {
166 ::mlir::OperationState __state__(location, getOperationName());
167 build(builder, __state__, std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs));
168 auto __res__ = ::llvm::dyn_cast<AddFeltOp>(builder.create(__state__));
169 assert(__res__ && "builder didn't return the right type");
170 return __res__;
171}
172
173AddFeltOp AddFeltOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value lhs, ::mlir::Value rhs) {
174 return create(builder, builder.getLoc(), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs));
175}
176
177void AddFeltOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs) {
178 odsState.addOperands(lhs);
179 odsState.addOperands(rhs);
180 assert(resultTypes.size() == 1u && "mismatched number of results");
181 odsState.addTypes(resultTypes);
182}
183
184AddFeltOp AddFeltOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs) {
185 ::mlir::OperationState __state__(location, getOperationName());
186 build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs));
187 auto __res__ = ::llvm::dyn_cast<AddFeltOp>(builder.create(__state__));
188 assert(__res__ && "builder didn't return the right type");
189 return __res__;
190}
191
192AddFeltOp AddFeltOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs) {
193 return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs));
194}
195
196void AddFeltOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
197 assert(operands.size() == 2u && "mismatched number of parameters");
198 odsState.addOperands(operands);
199 odsState.addAttributes(attributes);
200 assert(resultTypes.size() == 1u && "mismatched number of return types");
201 odsState.addTypes(resultTypes);
202}
203
204AddFeltOp AddFeltOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
205 ::mlir::OperationState __state__(location, getOperationName());
206 build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
207 auto __res__ = ::llvm::dyn_cast<AddFeltOp>(builder.create(__state__));
208 assert(__res__ && "builder didn't return the right type");
209 return __res__;
210}
211
212AddFeltOp AddFeltOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
213 return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
214}
215
216void AddFeltOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
217 assert(operands.size() == 2u && "mismatched number of parameters");
218 odsState.addOperands(operands);
219 odsState.addAttributes(attributes);
220
221 ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
222 if (::mlir::succeeded(AddFeltOp::inferReturnTypes(odsBuilder.getContext(),
223 odsState.location, operands,
224 odsState.attributes.getDictionary(odsState.getContext()),
225 odsState.getRawProperties(),
226 odsState.regions, inferredReturnTypes))) {
227 assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
228 odsState.addTypes(inferredReturnTypes);
229 } else {
230 ::llvm::report_fatal_error("Failed to infer result type(s).");
231 }
232}
233
234AddFeltOp AddFeltOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
235 ::mlir::OperationState __state__(location, getOperationName());
236 build(builder, __state__, std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
237 auto __res__ = ::llvm::dyn_cast<AddFeltOp>(builder.create(__state__));
238 assert(__res__ && "builder didn't return the right type");
239 return __res__;
240}
241
242AddFeltOp AddFeltOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
243 return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
244}
245
246void AddFeltOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
247 assert(operands.size() == 2u && "mismatched number of parameters");
248 odsState.addOperands(operands);
249 odsState.useProperties(const_cast<Properties&>(properties));
250 odsState.addAttributes(discardableAttributes);
251 assert(resultTypes.size() == 1u && "mismatched number of return types");
252 odsState.addTypes(resultTypes);
253}
254
255AddFeltOp AddFeltOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
256 ::mlir::OperationState __state__(location, getOperationName());
257 build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
258 auto __res__ = ::llvm::dyn_cast<AddFeltOp>(builder.create(__state__));
259 assert(__res__ && "builder didn't return the right type");
260 return __res__;
261}
262
263AddFeltOp AddFeltOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
264 return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
265}
266
267void AddFeltOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
268 assert(operands.size() == 2u && "mismatched number of parameters");
269 odsState.addOperands(operands);
270 odsState.useProperties(const_cast<Properties &>(properties));
271 odsState.addAttributes(discardableAttributes);
272
273 ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
274 if (::mlir::succeeded(AddFeltOp::inferReturnTypes(odsBuilder.getContext(),
275 odsState.location, operands,
276 odsState.attributes.getDictionary(odsState.getContext()),
277 odsState.getRawProperties(),
278 odsState.regions, inferredReturnTypes))) {
279 assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
280 odsState.addTypes(inferredReturnTypes);
281 } else {
282 ::llvm::report_fatal_error("Failed to infer result type(s).");
283 }
284}
285
286AddFeltOp AddFeltOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
287 ::mlir::OperationState __state__(location, getOperationName());
288 build(builder, __state__, std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
289 auto __res__ = ::llvm::dyn_cast<AddFeltOp>(builder.create(__state__));
290 assert(__res__ && "builder didn't return the right type");
291 return __res__;
292}
293
294AddFeltOp AddFeltOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
295 return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
296}
297
298::llvm::LogicalResult AddFeltOp::verifyInvariantsImpl() {
299 {
300 unsigned index = 0; (void)index;
301 auto valueGroup0 = getODSOperands(0);
302
303 for (auto v : valueGroup0) {
304 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops1(*this, v.getType(), "operand", index++)))
305 return ::mlir::failure();
306 }
307 auto valueGroup1 = getODSOperands(1);
308
309 for (auto v : valueGroup1) {
310 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops1(*this, v.getType(), "operand", index++)))
311 return ::mlir::failure();
312 }
313 }
314 {
315 unsigned index = 0; (void)index;
316 auto valueGroup0 = getODSResults(0);
317
318 for (auto v : valueGroup0) {
319 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops2(*this, v.getType(), "result", index++)))
320 return ::mlir::failure();
321 }
322 }
323 if (!((::llzk::typesUnify((*this->getODSOperands(0).begin()).getType(), (*this->getODSOperands(1).begin()).getType()))))
324 return emitOpError("failed to verify that rhs type matches with lhs type");
325 if (!((::llzk::typesUnify((*this->getODSOperands(0).begin()).getType(), (*this->getODSResults(0).begin()).getType()))))
326 return emitOpError("failed to verify that result type matches with lhs type");
327 if (!((::llzk::typesUnify((*this->getODSOperands(1).begin()).getType(), (*this->getODSResults(0).begin()).getType()))))
328 return emitOpError("failed to verify that result type matches with rhs type");
329 return ::mlir::success();
330}
331
332::llvm::LogicalResult AddFeltOp::verifyInvariants() {
333 return verifyInvariantsImpl();
334}
335
336::mlir::ParseResult AddFeltOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
337 ::mlir::OpAsmParser::UnresolvedOperand lhsRawOperand{};
338 ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> lhsOperands(&lhsRawOperand, 1); ::llvm::SMLoc lhsOperandsLoc;
339 (void)lhsOperandsLoc;
340 ::mlir::OpAsmParser::UnresolvedOperand rhsRawOperand{};
341 ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> rhsOperands(&rhsRawOperand, 1); ::llvm::SMLoc rhsOperandsLoc;
342 (void)rhsOperandsLoc;
343 ::mlir::Type lhsRawType{};
344 ::llvm::ArrayRef<::mlir::Type> lhsTypes(&lhsRawType, 1);
345 ::mlir::Type rhsRawType{};
346 ::llvm::ArrayRef<::mlir::Type> rhsTypes(&rhsRawType, 1);
347
348 lhsOperandsLoc = parser.getCurrentLocation();
349 if (parser.parseOperand(lhsRawOperand))
350 return ::mlir::failure();
351 if (parser.parseComma())
352 return ::mlir::failure();
353
354 rhsOperandsLoc = parser.getCurrentLocation();
355 if (parser.parseOperand(rhsRawOperand))
356 return ::mlir::failure();
357 {
358 auto odsResult = parseInferredOrParsedType(parser, lhsRawType, true);
359 if (odsResult) return ::mlir::failure();
360 }
361 {
362 auto odsResult = parseInferredOrParsedType(parser, rhsRawType, false);
363 if (odsResult) return ::mlir::failure();
364 }
365 {
366 auto loc = parser.getCurrentLocation();(void)loc;
367 if (parser.parseOptionalAttrDict(result.attributes))
368 return ::mlir::failure();
369 if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() {
370 return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op ";
371 })))
372 return ::mlir::failure();
373 }
374 if (parser.resolveOperands(lhsOperands, lhsTypes, lhsOperandsLoc, result.operands))
375 return ::mlir::failure();
376 if (parser.resolveOperands(rhsOperands, rhsTypes, rhsOperandsLoc, result.operands))
377 return ::mlir::failure();
378
379 ::llvm::SmallVector<::mlir::Type> inferredReturnTypes;
380 if (::mlir::failed(AddFeltOp::inferReturnTypes(parser.getContext(),
381 result.location, result.operands,
382 result.attributes.getDictionary(parser.getContext()),
383 result.getRawProperties(),
384 result.regions, inferredReturnTypes)))
385 return ::mlir::failure();
386 result.addTypes(inferredReturnTypes);
387 return ::mlir::success();
388}
389
390void AddFeltOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
391 _odsPrinter << ' ';
392 _odsPrinter << getLhs();
393 _odsPrinter << ",";
394 _odsPrinter << ' ';
395 _odsPrinter << getRhs();
396 printInferredOrParsedType(_odsPrinter, *this, getLhs().getType(), true);
397 printInferredOrParsedType(_odsPrinter, *this, getRhs().getType(), false);
398 ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
399 _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
400}
401
402void AddFeltOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
403}
404
405 ::llvm::LogicalResult
406 AddFeltOp::inferReturnTypes(::mlir::MLIRContext *context,
407 std::optional<::mlir::Location> location,
408 ::mlir::ValueRange operands, ::mlir::DictionaryAttr attributes,
409 ::mlir::PropertyRef properties, ::mlir::RegionRange regions,
410 ::llvm::SmallVectorImpl<::mlir::Type> &inferredReturnTypes) {
411 AddFeltOp::Adaptor adaptor(operands, attributes, properties, regions);
412 return AddFeltOp::inferReturnTypes(context,
413 location, adaptor, inferredReturnTypes);
414 }
415
416
417::llvm::LogicalResult AddFeltOp::inferReturnTypes(
418 mlir::MLIRContext *context, std::optional<mlir::Location> loc, Adaptor adaptor,
419 llvm::SmallVectorImpl<mlir::Type> &inferred
420) {
421 inferred.resize(1);
422 auto value = adaptor.getLhs();
423 inferred[0] = value ? value.getType() : FeltType::get(context, mlir::StringAttr());
424 return mlir::success();
425}
426
427bool AddFeltOp::isCompatibleReturnTypes(mlir::TypeRange l, mlir::TypeRange r) {
428 return l == r;
429}
430
431} // namespace llzk::felt
432MLIR_DEFINE_EXPLICIT_TYPE_ID(::llzk::felt::AddFeltOp)
433
434namespace llzk::felt {
435
436
437//===----------------------------------------------------------------------===//
438// ::llzk::felt::AndFeltOp definitions
439//===----------------------------------------------------------------------===//
440
441namespace detail {
442
443AndFeltOpGenericAdaptorBase::AndFeltOpGenericAdaptorBase(AndFeltOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
444
445
446} // namespace detail
448
449::llvm::LogicalResult AndFeltOpAdaptor::verify(::mlir::Location loc) {
450 return ::mlir::success();
451}
452
453::llvm::LogicalResult AndFeltOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
454 ::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
455 if (!dict) {
456 emitError() << "expected DictionaryAttr to set properties";
457 return ::mlir::failure();
458 }
459 return ::mlir::success();
460}
461
462::mlir::Attribute AndFeltOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
463 ::mlir::SmallVector<::mlir::NamedAttribute> attrs;
464 ::mlir::Builder odsBuilder{ctx};
465
466 if (!attrs.empty())
467 return odsBuilder.getDictionaryAttr(attrs);
468 return {};
469}
470
471llvm::hash_code AndFeltOp::computePropertiesHash(const Properties &prop) {
472 using llvm::hash_value;
473 return llvm::hash_combine();
474}
475
476std::optional<mlir::Attribute> AndFeltOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
477 return std::nullopt;
478}
479
480void AndFeltOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
481}
482
483void AndFeltOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
484}
485
486::llvm::LogicalResult AndFeltOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
487 return ::mlir::success();
488}
489
490void AndFeltOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs) {
491 odsState.addOperands(lhs);
492 odsState.addOperands(rhs);
493 odsState.addTypes(result);
494}
495
496AndFeltOp AndFeltOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs) {
497 ::mlir::OperationState __state__(location, getOperationName());
498 build(builder, __state__, std::forward<decltype(result)>(result), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs));
499 auto __res__ = ::llvm::dyn_cast<AndFeltOp>(builder.create(__state__));
500 assert(__res__ && "builder didn't return the right type");
501 return __res__;
502}
503
504AndFeltOp AndFeltOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs) {
505 return create(builder, builder.getLoc(), std::forward<decltype(result)>(result), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs));
506}
507
508void AndFeltOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value lhs, ::mlir::Value rhs) {
509 odsState.addOperands(lhs);
510 odsState.addOperands(rhs);
511
512 ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
513 if (::mlir::succeeded(AndFeltOp::inferReturnTypes(odsBuilder.getContext(),
514 odsState.location, odsState.operands,
515 odsState.attributes.getDictionary(odsState.getContext()),
516 odsState.getRawProperties(),
517 odsState.regions, inferredReturnTypes)))
518 odsState.addTypes(inferredReturnTypes);
519 else
520 ::mlir::detail::reportFatalInferReturnTypesError(odsState);
521
522}
523
524AndFeltOp AndFeltOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value lhs, ::mlir::Value rhs) {
525 ::mlir::OperationState __state__(location, getOperationName());
526 build(builder, __state__, std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs));
527 auto __res__ = ::llvm::dyn_cast<AndFeltOp>(builder.create(__state__));
528 assert(__res__ && "builder didn't return the right type");
529 return __res__;
530}
531
532AndFeltOp AndFeltOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value lhs, ::mlir::Value rhs) {
533 return create(builder, builder.getLoc(), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs));
534}
535
536void AndFeltOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs) {
537 odsState.addOperands(lhs);
538 odsState.addOperands(rhs);
539 assert(resultTypes.size() == 1u && "mismatched number of results");
540 odsState.addTypes(resultTypes);
541}
542
543AndFeltOp AndFeltOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs) {
544 ::mlir::OperationState __state__(location, getOperationName());
545 build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs));
546 auto __res__ = ::llvm::dyn_cast<AndFeltOp>(builder.create(__state__));
547 assert(__res__ && "builder didn't return the right type");
548 return __res__;
549}
550
551AndFeltOp AndFeltOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs) {
552 return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs));
553}
554
555void AndFeltOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
556 assert(operands.size() == 2u && "mismatched number of parameters");
557 odsState.addOperands(operands);
558 odsState.addAttributes(attributes);
559 assert(resultTypes.size() == 1u && "mismatched number of return types");
560 odsState.addTypes(resultTypes);
561}
562
563AndFeltOp AndFeltOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
564 ::mlir::OperationState __state__(location, getOperationName());
565 build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
566 auto __res__ = ::llvm::dyn_cast<AndFeltOp>(builder.create(__state__));
567 assert(__res__ && "builder didn't return the right type");
568 return __res__;
569}
570
571AndFeltOp AndFeltOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
572 return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
573}
574
575void AndFeltOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
576 assert(operands.size() == 2u && "mismatched number of parameters");
577 odsState.addOperands(operands);
578 odsState.addAttributes(attributes);
579
580 ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
581 if (::mlir::succeeded(AndFeltOp::inferReturnTypes(odsBuilder.getContext(),
582 odsState.location, operands,
583 odsState.attributes.getDictionary(odsState.getContext()),
584 odsState.getRawProperties(),
585 odsState.regions, inferredReturnTypes))) {
586 assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
587 odsState.addTypes(inferredReturnTypes);
588 } else {
589 ::llvm::report_fatal_error("Failed to infer result type(s).");
590 }
591}
592
593AndFeltOp AndFeltOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
594 ::mlir::OperationState __state__(location, getOperationName());
595 build(builder, __state__, std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
596 auto __res__ = ::llvm::dyn_cast<AndFeltOp>(builder.create(__state__));
597 assert(__res__ && "builder didn't return the right type");
598 return __res__;
599}
600
601AndFeltOp AndFeltOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
602 return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
603}
604
605void AndFeltOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
606 assert(operands.size() == 2u && "mismatched number of parameters");
607 odsState.addOperands(operands);
608 odsState.useProperties(const_cast<Properties&>(properties));
609 odsState.addAttributes(discardableAttributes);
610 assert(resultTypes.size() == 1u && "mismatched number of return types");
611 odsState.addTypes(resultTypes);
612}
613
614AndFeltOp AndFeltOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
615 ::mlir::OperationState __state__(location, getOperationName());
616 build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
617 auto __res__ = ::llvm::dyn_cast<AndFeltOp>(builder.create(__state__));
618 assert(__res__ && "builder didn't return the right type");
619 return __res__;
620}
621
622AndFeltOp AndFeltOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
623 return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
624}
625
626void AndFeltOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
627 assert(operands.size() == 2u && "mismatched number of parameters");
628 odsState.addOperands(operands);
629 odsState.useProperties(const_cast<Properties &>(properties));
630 odsState.addAttributes(discardableAttributes);
631
632 ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
633 if (::mlir::succeeded(AndFeltOp::inferReturnTypes(odsBuilder.getContext(),
634 odsState.location, operands,
635 odsState.attributes.getDictionary(odsState.getContext()),
636 odsState.getRawProperties(),
637 odsState.regions, inferredReturnTypes))) {
638 assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
639 odsState.addTypes(inferredReturnTypes);
640 } else {
641 ::llvm::report_fatal_error("Failed to infer result type(s).");
642 }
643}
644
645AndFeltOp AndFeltOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
646 ::mlir::OperationState __state__(location, getOperationName());
647 build(builder, __state__, std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
648 auto __res__ = ::llvm::dyn_cast<AndFeltOp>(builder.create(__state__));
649 assert(__res__ && "builder didn't return the right type");
650 return __res__;
651}
652
653AndFeltOp AndFeltOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
654 return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
655}
656
657::llvm::LogicalResult AndFeltOp::verifyInvariantsImpl() {
658 {
659 unsigned index = 0; (void)index;
660 auto valueGroup0 = getODSOperands(0);
661
662 for (auto v : valueGroup0) {
663 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops1(*this, v.getType(), "operand", index++)))
664 return ::mlir::failure();
665 }
666 auto valueGroup1 = getODSOperands(1);
667
668 for (auto v : valueGroup1) {
669 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops1(*this, v.getType(), "operand", index++)))
670 return ::mlir::failure();
671 }
672 }
673 {
674 unsigned index = 0; (void)index;
675 auto valueGroup0 = getODSResults(0);
676
677 for (auto v : valueGroup0) {
678 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops2(*this, v.getType(), "result", index++)))
679 return ::mlir::failure();
680 }
681 }
682 if (!((::llzk::typesUnify((*this->getODSOperands(0).begin()).getType(), (*this->getODSOperands(1).begin()).getType()))))
683 return emitOpError("failed to verify that rhs type matches with lhs type");
684 if (!((::llzk::typesUnify((*this->getODSOperands(0).begin()).getType(), (*this->getODSResults(0).begin()).getType()))))
685 return emitOpError("failed to verify that result type matches with lhs type");
686 if (!((::llzk::typesUnify((*this->getODSOperands(1).begin()).getType(), (*this->getODSResults(0).begin()).getType()))))
687 return emitOpError("failed to verify that result type matches with rhs type");
688 return ::mlir::success();
689}
690
691::llvm::LogicalResult AndFeltOp::verifyInvariants() {
692 return verifyInvariantsImpl();
693}
694
695::mlir::ParseResult AndFeltOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
696 ::mlir::OpAsmParser::UnresolvedOperand lhsRawOperand{};
697 ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> lhsOperands(&lhsRawOperand, 1); ::llvm::SMLoc lhsOperandsLoc;
698 (void)lhsOperandsLoc;
699 ::mlir::OpAsmParser::UnresolvedOperand rhsRawOperand{};
700 ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> rhsOperands(&rhsRawOperand, 1); ::llvm::SMLoc rhsOperandsLoc;
701 (void)rhsOperandsLoc;
702 ::mlir::Type lhsRawType{};
703 ::llvm::ArrayRef<::mlir::Type> lhsTypes(&lhsRawType, 1);
704 ::mlir::Type rhsRawType{};
705 ::llvm::ArrayRef<::mlir::Type> rhsTypes(&rhsRawType, 1);
706
707 lhsOperandsLoc = parser.getCurrentLocation();
708 if (parser.parseOperand(lhsRawOperand))
709 return ::mlir::failure();
710 if (parser.parseComma())
711 return ::mlir::failure();
712
713 rhsOperandsLoc = parser.getCurrentLocation();
714 if (parser.parseOperand(rhsRawOperand))
715 return ::mlir::failure();
716 {
717 auto odsResult = parseInferredOrParsedType(parser, lhsRawType, true);
718 if (odsResult) return ::mlir::failure();
719 }
720 {
721 auto odsResult = parseInferredOrParsedType(parser, rhsRawType, false);
722 if (odsResult) return ::mlir::failure();
723 }
724 {
725 auto loc = parser.getCurrentLocation();(void)loc;
726 if (parser.parseOptionalAttrDict(result.attributes))
727 return ::mlir::failure();
728 if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() {
729 return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op ";
730 })))
731 return ::mlir::failure();
732 }
733 if (parser.resolveOperands(lhsOperands, lhsTypes, lhsOperandsLoc, result.operands))
734 return ::mlir::failure();
735 if (parser.resolveOperands(rhsOperands, rhsTypes, rhsOperandsLoc, result.operands))
736 return ::mlir::failure();
737
738 ::llvm::SmallVector<::mlir::Type> inferredReturnTypes;
739 if (::mlir::failed(AndFeltOp::inferReturnTypes(parser.getContext(),
740 result.location, result.operands,
741 result.attributes.getDictionary(parser.getContext()),
742 result.getRawProperties(),
743 result.regions, inferredReturnTypes)))
744 return ::mlir::failure();
745 result.addTypes(inferredReturnTypes);
746 return ::mlir::success();
747}
748
749void AndFeltOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
750 _odsPrinter << ' ';
751 _odsPrinter << getLhs();
752 _odsPrinter << ",";
753 _odsPrinter << ' ';
754 _odsPrinter << getRhs();
755 printInferredOrParsedType(_odsPrinter, *this, getLhs().getType(), true);
756 printInferredOrParsedType(_odsPrinter, *this, getRhs().getType(), false);
757 ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
758 _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
759}
760
761void AndFeltOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
762}
763
764 ::llvm::LogicalResult
765 AndFeltOp::inferReturnTypes(::mlir::MLIRContext *context,
766 std::optional<::mlir::Location> location,
767 ::mlir::ValueRange operands, ::mlir::DictionaryAttr attributes,
768 ::mlir::PropertyRef properties, ::mlir::RegionRange regions,
769 ::llvm::SmallVectorImpl<::mlir::Type> &inferredReturnTypes) {
770 AndFeltOp::Adaptor adaptor(operands, attributes, properties, regions);
771 return AndFeltOp::inferReturnTypes(context,
772 location, adaptor, inferredReturnTypes);
773 }
774
775
776::llvm::LogicalResult AndFeltOp::inferReturnTypes(
777 mlir::MLIRContext *context, std::optional<mlir::Location> loc, Adaptor adaptor,
778 llvm::SmallVectorImpl<mlir::Type> &inferred
779) {
780 inferred.resize(1);
781 auto value = adaptor.getLhs();
782 inferred[0] = value ? value.getType() : FeltType::get(context, mlir::StringAttr());
783 return mlir::success();
784}
785
786bool AndFeltOp::isCompatibleReturnTypes(mlir::TypeRange l, mlir::TypeRange r) {
787 return l == r;
788}
789
790} // namespace llzk::felt
791MLIR_DEFINE_EXPLICIT_TYPE_ID(::llzk::felt::AndFeltOp)
792
793namespace llzk::felt {
794
795
796//===----------------------------------------------------------------------===//
797// ::llzk::felt::DivFeltOp definitions
798//===----------------------------------------------------------------------===//
799
800namespace detail {
801
802DivFeltOpGenericAdaptorBase::DivFeltOpGenericAdaptorBase(DivFeltOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
803
804
805} // namespace detail
807
808::llvm::LogicalResult DivFeltOpAdaptor::verify(::mlir::Location loc) {
809 return ::mlir::success();
810}
811
812::llvm::LogicalResult DivFeltOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
813 ::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
814 if (!dict) {
815 emitError() << "expected DictionaryAttr to set properties";
816 return ::mlir::failure();
817 }
818 return ::mlir::success();
819}
820
821::mlir::Attribute DivFeltOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
822 ::mlir::SmallVector<::mlir::NamedAttribute> attrs;
823 ::mlir::Builder odsBuilder{ctx};
824
825 if (!attrs.empty())
826 return odsBuilder.getDictionaryAttr(attrs);
827 return {};
828}
829
830llvm::hash_code DivFeltOp::computePropertiesHash(const Properties &prop) {
831 using llvm::hash_value;
832 return llvm::hash_combine();
833}
834
835std::optional<mlir::Attribute> DivFeltOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
836 return std::nullopt;
837}
838
839void DivFeltOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
840}
841
842void DivFeltOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
843}
844
845::llvm::LogicalResult DivFeltOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
846 return ::mlir::success();
847}
848
849void DivFeltOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs) {
850 odsState.addOperands(lhs);
851 odsState.addOperands(rhs);
852 odsState.addTypes(result);
853}
854
855DivFeltOp DivFeltOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs) {
856 ::mlir::OperationState __state__(location, getOperationName());
857 build(builder, __state__, std::forward<decltype(result)>(result), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs));
858 auto __res__ = ::llvm::dyn_cast<DivFeltOp>(builder.create(__state__));
859 assert(__res__ && "builder didn't return the right type");
860 return __res__;
861}
862
863DivFeltOp DivFeltOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs) {
864 return create(builder, builder.getLoc(), std::forward<decltype(result)>(result), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs));
865}
866
867void DivFeltOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value lhs, ::mlir::Value rhs) {
868 odsState.addOperands(lhs);
869 odsState.addOperands(rhs);
870
871 ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
872 if (::mlir::succeeded(DivFeltOp::inferReturnTypes(odsBuilder.getContext(),
873 odsState.location, odsState.operands,
874 odsState.attributes.getDictionary(odsState.getContext()),
875 odsState.getRawProperties(),
876 odsState.regions, inferredReturnTypes)))
877 odsState.addTypes(inferredReturnTypes);
878 else
879 ::mlir::detail::reportFatalInferReturnTypesError(odsState);
880
881}
882
883DivFeltOp DivFeltOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value lhs, ::mlir::Value rhs) {
884 ::mlir::OperationState __state__(location, getOperationName());
885 build(builder, __state__, std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs));
886 auto __res__ = ::llvm::dyn_cast<DivFeltOp>(builder.create(__state__));
887 assert(__res__ && "builder didn't return the right type");
888 return __res__;
889}
890
891DivFeltOp DivFeltOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value lhs, ::mlir::Value rhs) {
892 return create(builder, builder.getLoc(), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs));
893}
894
895void DivFeltOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs) {
896 odsState.addOperands(lhs);
897 odsState.addOperands(rhs);
898 assert(resultTypes.size() == 1u && "mismatched number of results");
899 odsState.addTypes(resultTypes);
900}
901
902DivFeltOp DivFeltOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs) {
903 ::mlir::OperationState __state__(location, getOperationName());
904 build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs));
905 auto __res__ = ::llvm::dyn_cast<DivFeltOp>(builder.create(__state__));
906 assert(__res__ && "builder didn't return the right type");
907 return __res__;
908}
909
910DivFeltOp DivFeltOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs) {
911 return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs));
912}
913
914void DivFeltOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
915 assert(operands.size() == 2u && "mismatched number of parameters");
916 odsState.addOperands(operands);
917 odsState.addAttributes(attributes);
918 assert(resultTypes.size() == 1u && "mismatched number of return types");
919 odsState.addTypes(resultTypes);
920}
921
922DivFeltOp DivFeltOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
923 ::mlir::OperationState __state__(location, getOperationName());
924 build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
925 auto __res__ = ::llvm::dyn_cast<DivFeltOp>(builder.create(__state__));
926 assert(__res__ && "builder didn't return the right type");
927 return __res__;
928}
929
930DivFeltOp DivFeltOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
931 return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
932}
933
934void DivFeltOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
935 assert(operands.size() == 2u && "mismatched number of parameters");
936 odsState.addOperands(operands);
937 odsState.addAttributes(attributes);
938
939 ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
940 if (::mlir::succeeded(DivFeltOp::inferReturnTypes(odsBuilder.getContext(),
941 odsState.location, operands,
942 odsState.attributes.getDictionary(odsState.getContext()),
943 odsState.getRawProperties(),
944 odsState.regions, inferredReturnTypes))) {
945 assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
946 odsState.addTypes(inferredReturnTypes);
947 } else {
948 ::llvm::report_fatal_error("Failed to infer result type(s).");
949 }
950}
951
952DivFeltOp DivFeltOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
953 ::mlir::OperationState __state__(location, getOperationName());
954 build(builder, __state__, std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
955 auto __res__ = ::llvm::dyn_cast<DivFeltOp>(builder.create(__state__));
956 assert(__res__ && "builder didn't return the right type");
957 return __res__;
958}
959
960DivFeltOp DivFeltOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
961 return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
962}
963
964void DivFeltOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
965 assert(operands.size() == 2u && "mismatched number of parameters");
966 odsState.addOperands(operands);
967 odsState.useProperties(const_cast<Properties&>(properties));
968 odsState.addAttributes(discardableAttributes);
969 assert(resultTypes.size() == 1u && "mismatched number of return types");
970 odsState.addTypes(resultTypes);
971}
972
973DivFeltOp DivFeltOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
974 ::mlir::OperationState __state__(location, getOperationName());
975 build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
976 auto __res__ = ::llvm::dyn_cast<DivFeltOp>(builder.create(__state__));
977 assert(__res__ && "builder didn't return the right type");
978 return __res__;
979}
980
981DivFeltOp DivFeltOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
982 return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
983}
984
985void DivFeltOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
986 assert(operands.size() == 2u && "mismatched number of parameters");
987 odsState.addOperands(operands);
988 odsState.useProperties(const_cast<Properties &>(properties));
989 odsState.addAttributes(discardableAttributes);
990
991 ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
992 if (::mlir::succeeded(DivFeltOp::inferReturnTypes(odsBuilder.getContext(),
993 odsState.location, operands,
994 odsState.attributes.getDictionary(odsState.getContext()),
995 odsState.getRawProperties(),
996 odsState.regions, inferredReturnTypes))) {
997 assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
998 odsState.addTypes(inferredReturnTypes);
999 } else {
1000 ::llvm::report_fatal_error("Failed to infer result type(s).");
1001 }
1002}
1003
1004DivFeltOp DivFeltOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
1005 ::mlir::OperationState __state__(location, getOperationName());
1006 build(builder, __state__, std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
1007 auto __res__ = ::llvm::dyn_cast<DivFeltOp>(builder.create(__state__));
1008 assert(__res__ && "builder didn't return the right type");
1009 return __res__;
1010}
1011
1012DivFeltOp DivFeltOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
1013 return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
1014}
1015
1016::llvm::LogicalResult DivFeltOp::verifyInvariantsImpl() {
1017 {
1018 unsigned index = 0; (void)index;
1019 auto valueGroup0 = getODSOperands(0);
1020
1021 for (auto v : valueGroup0) {
1022 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops1(*this, v.getType(), "operand", index++)))
1023 return ::mlir::failure();
1024 }
1025 auto valueGroup1 = getODSOperands(1);
1026
1027 for (auto v : valueGroup1) {
1028 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops1(*this, v.getType(), "operand", index++)))
1029 return ::mlir::failure();
1030 }
1031 }
1032 {
1033 unsigned index = 0; (void)index;
1034 auto valueGroup0 = getODSResults(0);
1035
1036 for (auto v : valueGroup0) {
1037 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops2(*this, v.getType(), "result", index++)))
1038 return ::mlir::failure();
1039 }
1040 }
1041 if (!((::llzk::typesUnify((*this->getODSOperands(0).begin()).getType(), (*this->getODSOperands(1).begin()).getType()))))
1042 return emitOpError("failed to verify that rhs type matches with lhs type");
1043 if (!((::llzk::typesUnify((*this->getODSOperands(0).begin()).getType(), (*this->getODSResults(0).begin()).getType()))))
1044 return emitOpError("failed to verify that result type matches with lhs type");
1045 if (!((::llzk::typesUnify((*this->getODSOperands(1).begin()).getType(), (*this->getODSResults(0).begin()).getType()))))
1046 return emitOpError("failed to verify that result type matches with rhs type");
1047 return ::mlir::success();
1048}
1049
1050::llvm::LogicalResult DivFeltOp::verifyInvariants() {
1051 return verifyInvariantsImpl();
1052}
1053
1054::mlir::ParseResult DivFeltOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
1055 ::mlir::OpAsmParser::UnresolvedOperand lhsRawOperand{};
1056 ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> lhsOperands(&lhsRawOperand, 1); ::llvm::SMLoc lhsOperandsLoc;
1057 (void)lhsOperandsLoc;
1058 ::mlir::OpAsmParser::UnresolvedOperand rhsRawOperand{};
1059 ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> rhsOperands(&rhsRawOperand, 1); ::llvm::SMLoc rhsOperandsLoc;
1060 (void)rhsOperandsLoc;
1061 ::mlir::Type lhsRawType{};
1062 ::llvm::ArrayRef<::mlir::Type> lhsTypes(&lhsRawType, 1);
1063 ::mlir::Type rhsRawType{};
1064 ::llvm::ArrayRef<::mlir::Type> rhsTypes(&rhsRawType, 1);
1065
1066 lhsOperandsLoc = parser.getCurrentLocation();
1067 if (parser.parseOperand(lhsRawOperand))
1068 return ::mlir::failure();
1069 if (parser.parseComma())
1070 return ::mlir::failure();
1071
1072 rhsOperandsLoc = parser.getCurrentLocation();
1073 if (parser.parseOperand(rhsRawOperand))
1074 return ::mlir::failure();
1075 {
1076 auto odsResult = parseInferredOrParsedType(parser, lhsRawType, true);
1077 if (odsResult) return ::mlir::failure();
1078 }
1079 {
1080 auto odsResult = parseInferredOrParsedType(parser, rhsRawType, false);
1081 if (odsResult) return ::mlir::failure();
1082 }
1083 {
1084 auto loc = parser.getCurrentLocation();(void)loc;
1085 if (parser.parseOptionalAttrDict(result.attributes))
1086 return ::mlir::failure();
1087 if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() {
1088 return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op ";
1089 })))
1090 return ::mlir::failure();
1091 }
1092 if (parser.resolveOperands(lhsOperands, lhsTypes, lhsOperandsLoc, result.operands))
1093 return ::mlir::failure();
1094 if (parser.resolveOperands(rhsOperands, rhsTypes, rhsOperandsLoc, result.operands))
1095 return ::mlir::failure();
1096
1097 ::llvm::SmallVector<::mlir::Type> inferredReturnTypes;
1098 if (::mlir::failed(DivFeltOp::inferReturnTypes(parser.getContext(),
1099 result.location, result.operands,
1100 result.attributes.getDictionary(parser.getContext()),
1101 result.getRawProperties(),
1102 result.regions, inferredReturnTypes)))
1103 return ::mlir::failure();
1104 result.addTypes(inferredReturnTypes);
1105 return ::mlir::success();
1106}
1107
1108void DivFeltOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
1109 _odsPrinter << ' ';
1110 _odsPrinter << getLhs();
1111 _odsPrinter << ",";
1112 _odsPrinter << ' ';
1113 _odsPrinter << getRhs();
1114 printInferredOrParsedType(_odsPrinter, *this, getLhs().getType(), true);
1115 printInferredOrParsedType(_odsPrinter, *this, getRhs().getType(), false);
1116 ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
1117 _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
1118}
1119
1120void DivFeltOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
1121}
1122
1123 ::llvm::LogicalResult
1124 DivFeltOp::inferReturnTypes(::mlir::MLIRContext *context,
1125 std::optional<::mlir::Location> location,
1126 ::mlir::ValueRange operands, ::mlir::DictionaryAttr attributes,
1127 ::mlir::PropertyRef properties, ::mlir::RegionRange regions,
1128 ::llvm::SmallVectorImpl<::mlir::Type> &inferredReturnTypes) {
1129 DivFeltOp::Adaptor adaptor(operands, attributes, properties, regions);
1130 return DivFeltOp::inferReturnTypes(context,
1131 location, adaptor, inferredReturnTypes);
1132 }
1133
1134
1135::llvm::LogicalResult DivFeltOp::inferReturnTypes(
1136 mlir::MLIRContext *context, std::optional<mlir::Location> loc, Adaptor adaptor,
1137 llvm::SmallVectorImpl<mlir::Type> &inferred
1138) {
1139 inferred.resize(1);
1140 auto value = adaptor.getLhs();
1141 inferred[0] = value ? value.getType() : FeltType::get(context, mlir::StringAttr());
1142 return mlir::success();
1143}
1144
1145bool DivFeltOp::isCompatibleReturnTypes(mlir::TypeRange l, mlir::TypeRange r) {
1146 return l == r;
1147}
1148
1149} // namespace llzk::felt
1150MLIR_DEFINE_EXPLICIT_TYPE_ID(::llzk::felt::DivFeltOp)
1151
1152namespace llzk::felt {
1153
1154
1155//===----------------------------------------------------------------------===//
1156// ::llzk::felt::FeltConstantOp definitions
1157//===----------------------------------------------------------------------===//
1158
1159namespace detail {
1160
1162
1163::llzk::felt::FeltConstAttr FeltConstantOpGenericAdaptorBase::getValue() {
1164 auto attr = getValueAttr();
1165 return ::llvm::cast<::llzk::felt::FeltConstAttr>(attr);
1166}
1167
1168
1169} // namespace detail
1171
1172::llvm::LogicalResult FeltConstantOpAdaptor::verify(::mlir::Location loc) {
1173 auto tblgen_value = getProperties().value; (void)tblgen_value;
1174 if (!tblgen_value) return emitError(loc, "'felt.const' op requires attribute 'value'");
1175
1176 if (tblgen_value && !((::llvm::isa<::llzk::felt::FeltConstAttr>(tblgen_value))))
1177 return emitError(loc, "'felt.const' op attribute 'value' failed to satisfy constraint: finite field element");
1178 return ::mlir::success();
1179}
1180
1181::llvm::LogicalResult FeltConstantOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
1182 ::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
1183 if (!dict) {
1184 emitError() << "expected DictionaryAttr to set properties";
1185 return ::mlir::failure();
1186 }
1187
1188 {
1189 auto &propStorage = prop.value;
1190 auto attr = dict.get("value");
1191 if (attr) {
1192 auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
1193 if (convertedAttr) {
1194 propStorage = convertedAttr;
1195 } else {
1196 emitError() << "Invalid attribute `value` in property conversion: " << attr;
1197 return ::mlir::failure();
1198 }
1199 }
1200 }
1201 return ::mlir::success();
1202}
1203
1204::mlir::Attribute FeltConstantOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
1205 ::mlir::SmallVector<::mlir::NamedAttribute> attrs;
1206 ::mlir::Builder odsBuilder{ctx};
1207
1208 {
1209 const auto &propStorage = prop.value;
1210 if (propStorage)
1211 attrs.push_back(odsBuilder.getNamedAttr("value",
1212 propStorage));
1213 }
1214
1215 if (!attrs.empty())
1216 return odsBuilder.getDictionaryAttr(attrs);
1217 return {};
1218}
1219
1221 using llvm::hash_value;
1222 return llvm::hash_combine(
1223 llvm::hash_value(prop.value.getAsOpaquePointer()));
1224}
1225
1226std::optional<mlir::Attribute> FeltConstantOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
1227 if (name == "value")
1228 return prop.value;
1229 return std::nullopt;
1230}
1231
1232void FeltConstantOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
1233 if (name == "value") {
1234 prop.value = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.value)>>(value);
1235 return;
1236 }
1237}
1238
1239void FeltConstantOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
1240 if (prop.value) attrs.append("value", prop.value);
1241}
1242
1243::llvm::LogicalResult FeltConstantOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
1244 {
1245 ::mlir::Attribute attr = attrs.get(getValueAttrName(opName));
1246 if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_Ops1(attr, "value", emitError)))
1247 return ::mlir::failure();
1248 }
1249 return ::mlir::success();
1250}
1251
1252::llvm::LogicalResult FeltConstantOp::readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state) {
1253 auto &prop = state.getOrAddProperties<Properties>(); (void)prop;
1254 if (::mlir::failed(reader.readAttribute(prop.value)))
1255 return ::mlir::failure();
1256 return ::mlir::success();
1257}
1258
1259void FeltConstantOp::writeProperties(::mlir::DialectBytecodeWriter &writer) {
1260 auto &prop = getProperties(); (void)prop;
1261 writer.writeAttribute(prop.value);
1262}
1263
1264::llzk::felt::FeltConstAttr FeltConstantOp::getValue() {
1265 auto attr = getValueAttr();
1266 return ::llvm::cast<::llzk::felt::FeltConstAttr>(attr);
1267}
1268
1269void FeltConstantOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::llzk::felt::FeltConstAttr value) {
1270 odsState.getOrAddProperties<Properties>().value = value;
1271 odsState.addTypes(result);
1272}
1273
1274FeltConstantOp FeltConstantOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::llzk::felt::FeltConstAttr value) {
1275 ::mlir::OperationState __state__(location, getOperationName());
1276 build(builder, __state__, std::forward<decltype(result)>(result), std::forward<decltype(value)>(value));
1277 auto __res__ = ::llvm::dyn_cast<FeltConstantOp>(builder.create(__state__));
1278 assert(__res__ && "builder didn't return the right type");
1279 return __res__;
1280}
1281
1282FeltConstantOp FeltConstantOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::llzk::felt::FeltConstAttr value) {
1283 return create(builder, builder.getLoc(), std::forward<decltype(result)>(result), std::forward<decltype(value)>(value));
1284}
1285
1286void FeltConstantOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::llzk::felt::FeltConstAttr value) {
1287 odsState.getOrAddProperties<Properties>().value = value;
1288
1289 ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
1290 if (::mlir::succeeded(FeltConstantOp::inferReturnTypes(odsBuilder.getContext(),
1291 odsState.location, odsState.operands,
1292 odsState.attributes.getDictionary(odsState.getContext()),
1293 odsState.getRawProperties(),
1294 odsState.regions, inferredReturnTypes)))
1295 odsState.addTypes(inferredReturnTypes);
1296 else
1297 ::mlir::detail::reportFatalInferReturnTypesError(odsState);
1298
1299}
1300
1301FeltConstantOp FeltConstantOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::llzk::felt::FeltConstAttr value) {
1302 ::mlir::OperationState __state__(location, getOperationName());
1303 build(builder, __state__, std::forward<decltype(value)>(value));
1304 auto __res__ = ::llvm::dyn_cast<FeltConstantOp>(builder.create(__state__));
1305 assert(__res__ && "builder didn't return the right type");
1306 return __res__;
1307}
1308
1309FeltConstantOp FeltConstantOp::create(::mlir::ImplicitLocOpBuilder &builder, ::llzk::felt::FeltConstAttr value) {
1310 return create(builder, builder.getLoc(), std::forward<decltype(value)>(value));
1311}
1312
1313void FeltConstantOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::llzk::felt::FeltConstAttr value) {
1314 odsState.getOrAddProperties<Properties>().value = value;
1315 assert(resultTypes.size() == 1u && "mismatched number of results");
1316 odsState.addTypes(resultTypes);
1317}
1318
1319FeltConstantOp FeltConstantOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::llzk::felt::FeltConstAttr value) {
1320 ::mlir::OperationState __state__(location, getOperationName());
1321 build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(value)>(value));
1322 auto __res__ = ::llvm::dyn_cast<FeltConstantOp>(builder.create(__state__));
1323 assert(__res__ && "builder didn't return the right type");
1324 return __res__;
1325}
1326
1327FeltConstantOp FeltConstantOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::llzk::felt::FeltConstAttr value) {
1328 return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(value)>(value));
1329}
1330
1331void FeltConstantOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
1332 assert(operands.size() == 0u && "mismatched number of parameters");
1333 odsState.addOperands(operands);
1334 odsState.addAttributes(attributes);
1335 assert(resultTypes.size() == 1u && "mismatched number of return types");
1336 odsState.addTypes(resultTypes);
1337
1338 if (!attributes.empty()) {
1339 (void)odsState.getOrAddProperties<FeltConstantOp::Properties>();
1340 ::mlir::PropertyRef properties = odsState.getRawProperties();
1341 std::optional<::mlir::RegisteredOperationName> info =
1342 odsState.name.getRegisteredInfo();
1343 if (failed(info->setOpPropertiesFromAttribute(odsState.name, properties,
1344 odsState.attributes.getDictionary(odsState.getContext()), nullptr)))
1345 ::llvm::report_fatal_error("Property conversion failed.");
1346 }
1347}
1348
1349FeltConstantOp FeltConstantOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
1350 ::mlir::OperationState __state__(location, getOperationName());
1351 build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
1352 auto __res__ = ::llvm::dyn_cast<FeltConstantOp>(builder.create(__state__));
1353 assert(__res__ && "builder didn't return the right type");
1354 return __res__;
1355}
1356
1357FeltConstantOp FeltConstantOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
1358 return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
1359}
1360
1361void FeltConstantOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
1362 assert(operands.size() == 0u && "mismatched number of parameters");
1363 odsState.addOperands(operands);
1364 odsState.addAttributes(attributes);
1365
1366 if (!attributes.empty()) {
1367 (void)odsState.getOrAddProperties<FeltConstantOp::Properties>();
1368 ::mlir::PropertyRef properties = odsState.getRawProperties();
1369 std::optional<::mlir::RegisteredOperationName> info =
1370 odsState.name.getRegisteredInfo();
1371 if (failed(info->setOpPropertiesFromAttribute(odsState.name, properties,
1372 odsState.attributes.getDictionary(odsState.getContext()), nullptr)))
1373 ::llvm::report_fatal_error("Property conversion failed.");
1374 }
1375 ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
1376 if (::mlir::succeeded(FeltConstantOp::inferReturnTypes(odsBuilder.getContext(),
1377 odsState.location, operands,
1378 odsState.attributes.getDictionary(odsState.getContext()),
1379 odsState.getRawProperties(),
1380 odsState.regions, inferredReturnTypes))) {
1381 assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
1382 odsState.addTypes(inferredReturnTypes);
1383 } else {
1384 ::llvm::report_fatal_error("Failed to infer result type(s).");
1385 }
1386}
1387
1388FeltConstantOp FeltConstantOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
1389 ::mlir::OperationState __state__(location, getOperationName());
1390 build(builder, __state__, std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
1391 auto __res__ = ::llvm::dyn_cast<FeltConstantOp>(builder.create(__state__));
1392 assert(__res__ && "builder didn't return the right type");
1393 return __res__;
1394}
1395
1396FeltConstantOp FeltConstantOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
1397 return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
1398}
1399
1400void FeltConstantOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
1401 assert(operands.size() == 0u && "mismatched number of parameters");
1402 odsState.addOperands(operands);
1403 odsState.useProperties(const_cast<Properties&>(properties));
1404 odsState.addAttributes(discardableAttributes);
1405 assert(resultTypes.size() == 1u && "mismatched number of return types");
1406 odsState.addTypes(resultTypes);
1407}
1408
1409FeltConstantOp FeltConstantOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
1410 ::mlir::OperationState __state__(location, getOperationName());
1411 build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
1412 auto __res__ = ::llvm::dyn_cast<FeltConstantOp>(builder.create(__state__));
1413 assert(__res__ && "builder didn't return the right type");
1414 return __res__;
1415}
1416
1417FeltConstantOp FeltConstantOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
1418 return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
1419}
1420
1421void FeltConstantOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
1422 assert(operands.size() == 0u && "mismatched number of parameters");
1423 odsState.addOperands(operands);
1424 odsState.useProperties(const_cast<Properties &>(properties));
1425 odsState.addAttributes(discardableAttributes);
1426
1427 ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
1428 if (::mlir::succeeded(FeltConstantOp::inferReturnTypes(odsBuilder.getContext(),
1429 odsState.location, operands,
1430 odsState.attributes.getDictionary(odsState.getContext()),
1431 odsState.getRawProperties(),
1432 odsState.regions, inferredReturnTypes))) {
1433 assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
1434 odsState.addTypes(inferredReturnTypes);
1435 } else {
1436 ::llvm::report_fatal_error("Failed to infer result type(s).");
1437 }
1438}
1439
1440FeltConstantOp FeltConstantOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
1441 ::mlir::OperationState __state__(location, getOperationName());
1442 build(builder, __state__, std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
1443 auto __res__ = ::llvm::dyn_cast<FeltConstantOp>(builder.create(__state__));
1444 assert(__res__ && "builder didn't return the right type");
1445 return __res__;
1446}
1447
1448FeltConstantOp FeltConstantOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
1449 return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
1450}
1451
1453 auto tblgen_value = getProperties().value; (void)tblgen_value;
1454 if (!tblgen_value) return emitOpError("requires attribute 'value'");
1455
1456 if (::mlir::failed(__mlir_ods_local_attr_constraint_Ops1(*this, tblgen_value, "value")))
1457 return ::mlir::failure();
1458 {
1459 unsigned index = 0; (void)index;
1460 auto valueGroup0 = getODSResults(0);
1461
1462 for (auto v : valueGroup0) {
1463 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops2(*this, v.getType(), "result", index++)))
1464 return ::mlir::failure();
1465 }
1466 }
1467 if (!((::llzk::typesUnify(getValue().getType(), (*this->getODSResults(0).begin()).getType()))))
1468 return emitOpError("failed to verify that result type matches with value type");
1469 return ::mlir::success();
1470}
1471
1472::llvm::LogicalResult FeltConstantOp::verifyInvariants() {
1473 return verifyInvariantsImpl();
1474}
1475
1476void FeltConstantOp::getCanonicalizationPatterns(::mlir::RewritePatternSet &results, ::mlir::MLIRContext *context) {
1477 results.add(canonicalize);
1478}
1479
1480::mlir::ParseResult FeltConstantOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
1481 ::llzk::felt::FeltConstAttr valueAttr;
1482
1483 if (parser.parseCustomAttributeWithFallback(valueAttr, ::mlir::Type{})) {
1484 return ::mlir::failure();
1485 }
1486 if (valueAttr) result.getOrAddProperties<FeltConstantOp::Properties>().value = valueAttr;
1487 {
1488 auto loc = parser.getCurrentLocation();(void)loc;
1489 if (parser.parseOptionalAttrDict(result.attributes))
1490 return ::mlir::failure();
1491 if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() {
1492 return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op ";
1493 })))
1494 return ::mlir::failure();
1495 }
1496
1497 ::llvm::SmallVector<::mlir::Type> inferredReturnTypes;
1498 if (::mlir::failed(FeltConstantOp::inferReturnTypes(parser.getContext(),
1499 result.location, result.operands,
1500 result.attributes.getDictionary(parser.getContext()),
1501 result.getRawProperties(),
1502 result.regions, inferredReturnTypes)))
1503 return ::mlir::failure();
1504 result.addTypes(inferredReturnTypes);
1505 return ::mlir::success();
1506}
1507
1508void FeltConstantOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
1509 _odsPrinter << ' ';
1510_odsPrinter.printStrippedAttrOrType(getValueAttr());
1511 ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
1512 elidedAttrs.push_back("value");
1513 _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
1514}
1515
1516void FeltConstantOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
1517}
1518
1519::llvm::LogicalResult
1520FeltConstantOp::inferReturnTypes(::mlir::MLIRContext *context,
1521 std::optional<::mlir::Location> location,
1522 ::mlir::ValueRange operands, ::mlir::DictionaryAttr attributes,
1523 ::mlir::PropertyRef properties, ::mlir::RegionRange regions,
1524 ::llvm::SmallVectorImpl<::mlir::Type> &inferredReturnTypes) {
1525 FeltConstantOp::Adaptor adaptor(operands, attributes, properties, regions);
1526 return FeltConstantOp::inferReturnTypes(context,
1527 location, adaptor, inferredReturnTypes);
1528}
1529
1530
1531} // namespace llzk::felt
1532MLIR_DEFINE_EXPLICIT_TYPE_ID(::llzk::felt::FeltConstantOp)
1534
1535namespace llzk::felt {
1536
1537
1538//===----------------------------------------------------------------------===//
1539// ::llzk::felt::InvFeltOp definitions
1540//===----------------------------------------------------------------------===//
1541
1542namespace detail {
1543
1544InvFeltOpGenericAdaptorBase::InvFeltOpGenericAdaptorBase(InvFeltOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
1545
1546
1547} // namespace detail
1549
1550::llvm::LogicalResult InvFeltOpAdaptor::verify(::mlir::Location loc) {
1551 return ::mlir::success();
1552}
1553
1554::llvm::LogicalResult InvFeltOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
1555 ::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
1556 if (!dict) {
1557 emitError() << "expected DictionaryAttr to set properties";
1558 return ::mlir::failure();
1559 }
1560 return ::mlir::success();
1561}
1562
1563::mlir::Attribute InvFeltOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
1564 ::mlir::SmallVector<::mlir::NamedAttribute> attrs;
1565 ::mlir::Builder odsBuilder{ctx};
1566
1567 if (!attrs.empty())
1568 return odsBuilder.getDictionaryAttr(attrs);
1569 return {};
1570}
1571
1572llvm::hash_code InvFeltOp::computePropertiesHash(const Properties &prop) {
1573 using llvm::hash_value;
1574 return llvm::hash_combine();
1575}
1576
1577std::optional<mlir::Attribute> InvFeltOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
1578 return std::nullopt;
1579}
1580
1581void InvFeltOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
1582}
1583
1584void InvFeltOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
1585}
1586
1587::llvm::LogicalResult InvFeltOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
1588 return ::mlir::success();
1589}
1590
1591void InvFeltOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value operand) {
1592 odsState.addOperands(operand);
1593 odsState.addTypes(result);
1594}
1595
1596InvFeltOp InvFeltOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value operand) {
1597 ::mlir::OperationState __state__(location, getOperationName());
1598 build(builder, __state__, std::forward<decltype(result)>(result), std::forward<decltype(operand)>(operand));
1599 auto __res__ = ::llvm::dyn_cast<InvFeltOp>(builder.create(__state__));
1600 assert(__res__ && "builder didn't return the right type");
1601 return __res__;
1602}
1603
1604InvFeltOp InvFeltOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::Value operand) {
1605 return create(builder, builder.getLoc(), std::forward<decltype(result)>(result), std::forward<decltype(operand)>(operand));
1606}
1607
1608void InvFeltOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value operand) {
1609 odsState.addOperands(operand);
1610
1611 ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
1612 if (::mlir::succeeded(InvFeltOp::inferReturnTypes(odsBuilder.getContext(),
1613 odsState.location, odsState.operands,
1614 odsState.attributes.getDictionary(odsState.getContext()),
1615 odsState.getRawProperties(),
1616 odsState.regions, inferredReturnTypes)))
1617 odsState.addTypes(inferredReturnTypes);
1618 else
1619 ::mlir::detail::reportFatalInferReturnTypesError(odsState);
1620
1621}
1622
1623InvFeltOp InvFeltOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value operand) {
1624 ::mlir::OperationState __state__(location, getOperationName());
1625 build(builder, __state__, std::forward<decltype(operand)>(operand));
1626 auto __res__ = ::llvm::dyn_cast<InvFeltOp>(builder.create(__state__));
1627 assert(__res__ && "builder didn't return the right type");
1628 return __res__;
1629}
1630
1631InvFeltOp InvFeltOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value operand) {
1632 return create(builder, builder.getLoc(), std::forward<decltype(operand)>(operand));
1633}
1634
1635void InvFeltOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value operand) {
1636 odsState.addOperands(operand);
1637 assert(resultTypes.size() == 1u && "mismatched number of results");
1638 odsState.addTypes(resultTypes);
1639}
1640
1641InvFeltOp InvFeltOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value operand) {
1642 ::mlir::OperationState __state__(location, getOperationName());
1643 build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operand)>(operand));
1644 auto __res__ = ::llvm::dyn_cast<InvFeltOp>(builder.create(__state__));
1645 assert(__res__ && "builder didn't return the right type");
1646 return __res__;
1647}
1648
1649InvFeltOp InvFeltOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value operand) {
1650 return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operand)>(operand));
1651}
1652
1653void InvFeltOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
1654 assert(operands.size() == 1u && "mismatched number of parameters");
1655 odsState.addOperands(operands);
1656 odsState.addAttributes(attributes);
1657 assert(resultTypes.size() == 1u && "mismatched number of return types");
1658 odsState.addTypes(resultTypes);
1659}
1660
1661InvFeltOp InvFeltOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
1662 ::mlir::OperationState __state__(location, getOperationName());
1663 build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
1664 auto __res__ = ::llvm::dyn_cast<InvFeltOp>(builder.create(__state__));
1665 assert(__res__ && "builder didn't return the right type");
1666 return __res__;
1667}
1668
1669InvFeltOp InvFeltOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
1670 return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
1671}
1672
1673void InvFeltOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
1674 assert(operands.size() == 1u && "mismatched number of parameters");
1675 odsState.addOperands(operands);
1676 odsState.addAttributes(attributes);
1677
1678 ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
1679 if (::mlir::succeeded(InvFeltOp::inferReturnTypes(odsBuilder.getContext(),
1680 odsState.location, operands,
1681 odsState.attributes.getDictionary(odsState.getContext()),
1682 odsState.getRawProperties(),
1683 odsState.regions, inferredReturnTypes))) {
1684 assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
1685 odsState.addTypes(inferredReturnTypes);
1686 } else {
1687 ::llvm::report_fatal_error("Failed to infer result type(s).");
1688 }
1689}
1690
1691InvFeltOp InvFeltOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
1692 ::mlir::OperationState __state__(location, getOperationName());
1693 build(builder, __state__, std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
1694 auto __res__ = ::llvm::dyn_cast<InvFeltOp>(builder.create(__state__));
1695 assert(__res__ && "builder didn't return the right type");
1696 return __res__;
1697}
1698
1699InvFeltOp InvFeltOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
1700 return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
1701}
1702
1703void InvFeltOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
1704 assert(operands.size() == 1u && "mismatched number of parameters");
1705 odsState.addOperands(operands);
1706 odsState.useProperties(const_cast<Properties&>(properties));
1707 odsState.addAttributes(discardableAttributes);
1708 assert(resultTypes.size() == 1u && "mismatched number of return types");
1709 odsState.addTypes(resultTypes);
1710}
1711
1712InvFeltOp InvFeltOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
1713 ::mlir::OperationState __state__(location, getOperationName());
1714 build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
1715 auto __res__ = ::llvm::dyn_cast<InvFeltOp>(builder.create(__state__));
1716 assert(__res__ && "builder didn't return the right type");
1717 return __res__;
1718}
1719
1720InvFeltOp InvFeltOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
1721 return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
1722}
1723
1724void InvFeltOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
1725 assert(operands.size() == 1u && "mismatched number of parameters");
1726 odsState.addOperands(operands);
1727 odsState.useProperties(const_cast<Properties &>(properties));
1728 odsState.addAttributes(discardableAttributes);
1729
1730 ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
1731 if (::mlir::succeeded(InvFeltOp::inferReturnTypes(odsBuilder.getContext(),
1732 odsState.location, operands,
1733 odsState.attributes.getDictionary(odsState.getContext()),
1734 odsState.getRawProperties(),
1735 odsState.regions, inferredReturnTypes))) {
1736 assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
1737 odsState.addTypes(inferredReturnTypes);
1738 } else {
1739 ::llvm::report_fatal_error("Failed to infer result type(s).");
1740 }
1741}
1742
1743InvFeltOp InvFeltOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
1744 ::mlir::OperationState __state__(location, getOperationName());
1745 build(builder, __state__, std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
1746 auto __res__ = ::llvm::dyn_cast<InvFeltOp>(builder.create(__state__));
1747 assert(__res__ && "builder didn't return the right type");
1748 return __res__;
1749}
1750
1751InvFeltOp InvFeltOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
1752 return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
1753}
1754
1755::llvm::LogicalResult InvFeltOp::verifyInvariantsImpl() {
1756 {
1757 unsigned index = 0; (void)index;
1758 auto valueGroup0 = getODSOperands(0);
1759
1760 for (auto v : valueGroup0) {
1761 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops1(*this, v.getType(), "operand", index++)))
1762 return ::mlir::failure();
1763 }
1764 }
1765 {
1766 unsigned index = 0; (void)index;
1767 auto valueGroup0 = getODSResults(0);
1768
1769 for (auto v : valueGroup0) {
1770 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops2(*this, v.getType(), "result", index++)))
1771 return ::mlir::failure();
1772 }
1773 }
1774 if (!((::llzk::typesUnify((*this->getODSOperands(0).begin()).getType(), (*this->getODSResults(0).begin()).getType()))))
1775 return emitOpError("failed to verify that result type matches with operand type");
1776 return ::mlir::success();
1777}
1778
1779::llvm::LogicalResult InvFeltOp::verifyInvariants() {
1780 return verifyInvariantsImpl();
1781}
1782
1783::mlir::ParseResult InvFeltOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
1784 ::mlir::OpAsmParser::UnresolvedOperand operandRawOperand{};
1785 ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> operandOperands(&operandRawOperand, 1); ::llvm::SMLoc operandOperandsLoc;
1786 (void)operandOperandsLoc;
1787 ::mlir::Type operandRawType{};
1788 ::llvm::ArrayRef<::mlir::Type> operandTypes(&operandRawType, 1);
1789
1790 operandOperandsLoc = parser.getCurrentLocation();
1791 if (parser.parseOperand(operandRawOperand))
1792 return ::mlir::failure();
1793 {
1794 auto odsResult = parseInferredOrParsedType(parser, operandRawType, true);
1795 if (odsResult) return ::mlir::failure();
1796 }
1797 {
1798 auto loc = parser.getCurrentLocation();(void)loc;
1799 if (parser.parseOptionalAttrDict(result.attributes))
1800 return ::mlir::failure();
1801 if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() {
1802 return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op ";
1803 })))
1804 return ::mlir::failure();
1805 }
1806 if (parser.resolveOperands(operandOperands, operandTypes, operandOperandsLoc, result.operands))
1807 return ::mlir::failure();
1808
1809 ::llvm::SmallVector<::mlir::Type> inferredReturnTypes;
1810 if (::mlir::failed(InvFeltOp::inferReturnTypes(parser.getContext(),
1811 result.location, result.operands,
1812 result.attributes.getDictionary(parser.getContext()),
1813 result.getRawProperties(),
1814 result.regions, inferredReturnTypes)))
1815 return ::mlir::failure();
1816 result.addTypes(inferredReturnTypes);
1817 return ::mlir::success();
1818}
1819
1820void InvFeltOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
1821 _odsPrinter << ' ';
1822 _odsPrinter << getOperand();
1823 printInferredOrParsedType(_odsPrinter, *this, getOperand().getType(), true);
1824 ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
1825 _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
1826}
1827
1828void InvFeltOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
1829}
1830
1831 ::llvm::LogicalResult
1832 InvFeltOp::inferReturnTypes(::mlir::MLIRContext *context,
1833 std::optional<::mlir::Location> location,
1834 ::mlir::ValueRange operands, ::mlir::DictionaryAttr attributes,
1835 ::mlir::PropertyRef properties, ::mlir::RegionRange regions,
1836 ::llvm::SmallVectorImpl<::mlir::Type> &inferredReturnTypes) {
1837 InvFeltOp::Adaptor adaptor(operands, attributes, properties, regions);
1838 return InvFeltOp::inferReturnTypes(context,
1839 location, adaptor, inferredReturnTypes);
1840 }
1841
1842
1843::llvm::LogicalResult InvFeltOp::inferReturnTypes(
1844 mlir::MLIRContext *context, std::optional<mlir::Location> loc, Adaptor adaptor,
1845 llvm::SmallVectorImpl<mlir::Type> &inferred
1846) {
1847 inferred.resize(1);
1848 auto value = adaptor.getOperand();
1849 inferred[0] = value ? value.getType() : FeltType::get(context, mlir::StringAttr());
1850 return mlir::success();
1851}
1852
1853bool InvFeltOp::isCompatibleReturnTypes(mlir::TypeRange l, mlir::TypeRange r) {
1854 return l == r;
1855}
1856
1857} // namespace llzk::felt
1858MLIR_DEFINE_EXPLICIT_TYPE_ID(::llzk::felt::InvFeltOp)
1859
1860namespace llzk::felt {
1861
1862
1863//===----------------------------------------------------------------------===//
1864// ::llzk::felt::MulFeltOp definitions
1865//===----------------------------------------------------------------------===//
1866
1867namespace detail {
1868
1869MulFeltOpGenericAdaptorBase::MulFeltOpGenericAdaptorBase(MulFeltOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
1870
1871
1872} // namespace detail
1874
1875::llvm::LogicalResult MulFeltOpAdaptor::verify(::mlir::Location loc) {
1876 return ::mlir::success();
1877}
1878
1879::llvm::LogicalResult MulFeltOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
1880 ::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
1881 if (!dict) {
1882 emitError() << "expected DictionaryAttr to set properties";
1883 return ::mlir::failure();
1884 }
1885 return ::mlir::success();
1886}
1887
1888::mlir::Attribute MulFeltOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
1889 ::mlir::SmallVector<::mlir::NamedAttribute> attrs;
1890 ::mlir::Builder odsBuilder{ctx};
1891
1892 if (!attrs.empty())
1893 return odsBuilder.getDictionaryAttr(attrs);
1894 return {};
1895}
1896
1897llvm::hash_code MulFeltOp::computePropertiesHash(const Properties &prop) {
1898 using llvm::hash_value;
1899 return llvm::hash_combine();
1900}
1901
1902std::optional<mlir::Attribute> MulFeltOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
1903 return std::nullopt;
1904}
1905
1906void MulFeltOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
1907}
1908
1909void MulFeltOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
1910}
1911
1912::llvm::LogicalResult MulFeltOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
1913 return ::mlir::success();
1914}
1915
1916void MulFeltOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs) {
1917 odsState.addOperands(lhs);
1918 odsState.addOperands(rhs);
1919 odsState.addTypes(result);
1920}
1921
1922MulFeltOp MulFeltOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs) {
1923 ::mlir::OperationState __state__(location, getOperationName());
1924 build(builder, __state__, std::forward<decltype(result)>(result), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs));
1925 auto __res__ = ::llvm::dyn_cast<MulFeltOp>(builder.create(__state__));
1926 assert(__res__ && "builder didn't return the right type");
1927 return __res__;
1928}
1929
1930MulFeltOp MulFeltOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs) {
1931 return create(builder, builder.getLoc(), std::forward<decltype(result)>(result), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs));
1932}
1933
1934void MulFeltOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value lhs, ::mlir::Value rhs) {
1935 odsState.addOperands(lhs);
1936 odsState.addOperands(rhs);
1937
1938 ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
1939 if (::mlir::succeeded(MulFeltOp::inferReturnTypes(odsBuilder.getContext(),
1940 odsState.location, odsState.operands,
1941 odsState.attributes.getDictionary(odsState.getContext()),
1942 odsState.getRawProperties(),
1943 odsState.regions, inferredReturnTypes)))
1944 odsState.addTypes(inferredReturnTypes);
1945 else
1946 ::mlir::detail::reportFatalInferReturnTypesError(odsState);
1947
1948}
1949
1950MulFeltOp MulFeltOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value lhs, ::mlir::Value rhs) {
1951 ::mlir::OperationState __state__(location, getOperationName());
1952 build(builder, __state__, std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs));
1953 auto __res__ = ::llvm::dyn_cast<MulFeltOp>(builder.create(__state__));
1954 assert(__res__ && "builder didn't return the right type");
1955 return __res__;
1956}
1957
1958MulFeltOp MulFeltOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value lhs, ::mlir::Value rhs) {
1959 return create(builder, builder.getLoc(), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs));
1960}
1961
1962void MulFeltOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs) {
1963 odsState.addOperands(lhs);
1964 odsState.addOperands(rhs);
1965 assert(resultTypes.size() == 1u && "mismatched number of results");
1966 odsState.addTypes(resultTypes);
1967}
1968
1969MulFeltOp MulFeltOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs) {
1970 ::mlir::OperationState __state__(location, getOperationName());
1971 build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs));
1972 auto __res__ = ::llvm::dyn_cast<MulFeltOp>(builder.create(__state__));
1973 assert(__res__ && "builder didn't return the right type");
1974 return __res__;
1975}
1976
1977MulFeltOp MulFeltOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs) {
1978 return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs));
1979}
1980
1981void MulFeltOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
1982 assert(operands.size() == 2u && "mismatched number of parameters");
1983 odsState.addOperands(operands);
1984 odsState.addAttributes(attributes);
1985 assert(resultTypes.size() == 1u && "mismatched number of return types");
1986 odsState.addTypes(resultTypes);
1987}
1988
1989MulFeltOp MulFeltOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
1990 ::mlir::OperationState __state__(location, getOperationName());
1991 build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
1992 auto __res__ = ::llvm::dyn_cast<MulFeltOp>(builder.create(__state__));
1993 assert(__res__ && "builder didn't return the right type");
1994 return __res__;
1995}
1996
1997MulFeltOp MulFeltOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
1998 return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
1999}
2000
2001void MulFeltOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
2002 assert(operands.size() == 2u && "mismatched number of parameters");
2003 odsState.addOperands(operands);
2004 odsState.addAttributes(attributes);
2005
2006 ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
2007 if (::mlir::succeeded(MulFeltOp::inferReturnTypes(odsBuilder.getContext(),
2008 odsState.location, operands,
2009 odsState.attributes.getDictionary(odsState.getContext()),
2010 odsState.getRawProperties(),
2011 odsState.regions, inferredReturnTypes))) {
2012 assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
2013 odsState.addTypes(inferredReturnTypes);
2014 } else {
2015 ::llvm::report_fatal_error("Failed to infer result type(s).");
2016 }
2017}
2018
2019MulFeltOp MulFeltOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
2020 ::mlir::OperationState __state__(location, getOperationName());
2021 build(builder, __state__, std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
2022 auto __res__ = ::llvm::dyn_cast<MulFeltOp>(builder.create(__state__));
2023 assert(__res__ && "builder didn't return the right type");
2024 return __res__;
2025}
2026
2027MulFeltOp MulFeltOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
2028 return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
2029}
2030
2031void MulFeltOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
2032 assert(operands.size() == 2u && "mismatched number of parameters");
2033 odsState.addOperands(operands);
2034 odsState.useProperties(const_cast<Properties&>(properties));
2035 odsState.addAttributes(discardableAttributes);
2036 assert(resultTypes.size() == 1u && "mismatched number of return types");
2037 odsState.addTypes(resultTypes);
2038}
2039
2040MulFeltOp MulFeltOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
2041 ::mlir::OperationState __state__(location, getOperationName());
2042 build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
2043 auto __res__ = ::llvm::dyn_cast<MulFeltOp>(builder.create(__state__));
2044 assert(__res__ && "builder didn't return the right type");
2045 return __res__;
2046}
2047
2048MulFeltOp MulFeltOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
2049 return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
2050}
2051
2052void MulFeltOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
2053 assert(operands.size() == 2u && "mismatched number of parameters");
2054 odsState.addOperands(operands);
2055 odsState.useProperties(const_cast<Properties &>(properties));
2056 odsState.addAttributes(discardableAttributes);
2057
2058 ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
2059 if (::mlir::succeeded(MulFeltOp::inferReturnTypes(odsBuilder.getContext(),
2060 odsState.location, operands,
2061 odsState.attributes.getDictionary(odsState.getContext()),
2062 odsState.getRawProperties(),
2063 odsState.regions, inferredReturnTypes))) {
2064 assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
2065 odsState.addTypes(inferredReturnTypes);
2066 } else {
2067 ::llvm::report_fatal_error("Failed to infer result type(s).");
2068 }
2069}
2070
2071MulFeltOp MulFeltOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
2072 ::mlir::OperationState __state__(location, getOperationName());
2073 build(builder, __state__, std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
2074 auto __res__ = ::llvm::dyn_cast<MulFeltOp>(builder.create(__state__));
2075 assert(__res__ && "builder didn't return the right type");
2076 return __res__;
2077}
2078
2079MulFeltOp MulFeltOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
2080 return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
2081}
2082
2083::llvm::LogicalResult MulFeltOp::verifyInvariantsImpl() {
2084 {
2085 unsigned index = 0; (void)index;
2086 auto valueGroup0 = getODSOperands(0);
2087
2088 for (auto v : valueGroup0) {
2089 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops1(*this, v.getType(), "operand", index++)))
2090 return ::mlir::failure();
2091 }
2092 auto valueGroup1 = getODSOperands(1);
2093
2094 for (auto v : valueGroup1) {
2095 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops1(*this, v.getType(), "operand", index++)))
2096 return ::mlir::failure();
2097 }
2098 }
2099 {
2100 unsigned index = 0; (void)index;
2101 auto valueGroup0 = getODSResults(0);
2102
2103 for (auto v : valueGroup0) {
2104 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops2(*this, v.getType(), "result", index++)))
2105 return ::mlir::failure();
2106 }
2107 }
2108 if (!((::llzk::typesUnify((*this->getODSOperands(0).begin()).getType(), (*this->getODSOperands(1).begin()).getType()))))
2109 return emitOpError("failed to verify that rhs type matches with lhs type");
2110 if (!((::llzk::typesUnify((*this->getODSOperands(0).begin()).getType(), (*this->getODSResults(0).begin()).getType()))))
2111 return emitOpError("failed to verify that result type matches with lhs type");
2112 if (!((::llzk::typesUnify((*this->getODSOperands(1).begin()).getType(), (*this->getODSResults(0).begin()).getType()))))
2113 return emitOpError("failed to verify that result type matches with rhs type");
2114 return ::mlir::success();
2115}
2116
2117::llvm::LogicalResult MulFeltOp::verifyInvariants() {
2118 return verifyInvariantsImpl();
2119}
2120
2121::mlir::ParseResult MulFeltOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
2122 ::mlir::OpAsmParser::UnresolvedOperand lhsRawOperand{};
2123 ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> lhsOperands(&lhsRawOperand, 1); ::llvm::SMLoc lhsOperandsLoc;
2124 (void)lhsOperandsLoc;
2125 ::mlir::OpAsmParser::UnresolvedOperand rhsRawOperand{};
2126 ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> rhsOperands(&rhsRawOperand, 1); ::llvm::SMLoc rhsOperandsLoc;
2127 (void)rhsOperandsLoc;
2128 ::mlir::Type lhsRawType{};
2129 ::llvm::ArrayRef<::mlir::Type> lhsTypes(&lhsRawType, 1);
2130 ::mlir::Type rhsRawType{};
2131 ::llvm::ArrayRef<::mlir::Type> rhsTypes(&rhsRawType, 1);
2132
2133 lhsOperandsLoc = parser.getCurrentLocation();
2134 if (parser.parseOperand(lhsRawOperand))
2135 return ::mlir::failure();
2136 if (parser.parseComma())
2137 return ::mlir::failure();
2138
2139 rhsOperandsLoc = parser.getCurrentLocation();
2140 if (parser.parseOperand(rhsRawOperand))
2141 return ::mlir::failure();
2142 {
2143 auto odsResult = parseInferredOrParsedType(parser, lhsRawType, true);
2144 if (odsResult) return ::mlir::failure();
2145 }
2146 {
2147 auto odsResult = parseInferredOrParsedType(parser, rhsRawType, false);
2148 if (odsResult) return ::mlir::failure();
2149 }
2150 {
2151 auto loc = parser.getCurrentLocation();(void)loc;
2152 if (parser.parseOptionalAttrDict(result.attributes))
2153 return ::mlir::failure();
2154 if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() {
2155 return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op ";
2156 })))
2157 return ::mlir::failure();
2158 }
2159 if (parser.resolveOperands(lhsOperands, lhsTypes, lhsOperandsLoc, result.operands))
2160 return ::mlir::failure();
2161 if (parser.resolveOperands(rhsOperands, rhsTypes, rhsOperandsLoc, result.operands))
2162 return ::mlir::failure();
2163
2164 ::llvm::SmallVector<::mlir::Type> inferredReturnTypes;
2165 if (::mlir::failed(MulFeltOp::inferReturnTypes(parser.getContext(),
2166 result.location, result.operands,
2167 result.attributes.getDictionary(parser.getContext()),
2168 result.getRawProperties(),
2169 result.regions, inferredReturnTypes)))
2170 return ::mlir::failure();
2171 result.addTypes(inferredReturnTypes);
2172 return ::mlir::success();
2173}
2174
2175void MulFeltOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
2176 _odsPrinter << ' ';
2177 _odsPrinter << getLhs();
2178 _odsPrinter << ",";
2179 _odsPrinter << ' ';
2180 _odsPrinter << getRhs();
2181 printInferredOrParsedType(_odsPrinter, *this, getLhs().getType(), true);
2182 printInferredOrParsedType(_odsPrinter, *this, getRhs().getType(), false);
2183 ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
2184 _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
2185}
2186
2187void MulFeltOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
2188}
2189
2190 ::llvm::LogicalResult
2191 MulFeltOp::inferReturnTypes(::mlir::MLIRContext *context,
2192 std::optional<::mlir::Location> location,
2193 ::mlir::ValueRange operands, ::mlir::DictionaryAttr attributes,
2194 ::mlir::PropertyRef properties, ::mlir::RegionRange regions,
2195 ::llvm::SmallVectorImpl<::mlir::Type> &inferredReturnTypes) {
2196 MulFeltOp::Adaptor adaptor(operands, attributes, properties, regions);
2197 return MulFeltOp::inferReturnTypes(context,
2198 location, adaptor, inferredReturnTypes);
2199 }
2200
2201
2202::llvm::LogicalResult MulFeltOp::inferReturnTypes(
2203 mlir::MLIRContext *context, std::optional<mlir::Location> loc, Adaptor adaptor,
2204 llvm::SmallVectorImpl<mlir::Type> &inferred
2205) {
2206 inferred.resize(1);
2207 auto value = adaptor.getLhs();
2208 inferred[0] = value ? value.getType() : FeltType::get(context, mlir::StringAttr());
2209 return mlir::success();
2210}
2211
2212bool MulFeltOp::isCompatibleReturnTypes(mlir::TypeRange l, mlir::TypeRange r) {
2213 return l == r;
2214}
2215
2216} // namespace llzk::felt
2217MLIR_DEFINE_EXPLICIT_TYPE_ID(::llzk::felt::MulFeltOp)
2218
2219namespace llzk::felt {
2220
2221
2222//===----------------------------------------------------------------------===//
2223// ::llzk::felt::NegFeltOp definitions
2224//===----------------------------------------------------------------------===//
2225
2226namespace detail {
2227
2228NegFeltOpGenericAdaptorBase::NegFeltOpGenericAdaptorBase(NegFeltOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
2229
2230
2231} // namespace detail
2233
2234::llvm::LogicalResult NegFeltOpAdaptor::verify(::mlir::Location loc) {
2235 return ::mlir::success();
2236}
2237
2238::llvm::LogicalResult NegFeltOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
2239 ::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
2240 if (!dict) {
2241 emitError() << "expected DictionaryAttr to set properties";
2242 return ::mlir::failure();
2243 }
2244 return ::mlir::success();
2245}
2246
2247::mlir::Attribute NegFeltOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
2248 ::mlir::SmallVector<::mlir::NamedAttribute> attrs;
2249 ::mlir::Builder odsBuilder{ctx};
2250
2251 if (!attrs.empty())
2252 return odsBuilder.getDictionaryAttr(attrs);
2253 return {};
2254}
2255
2256llvm::hash_code NegFeltOp::computePropertiesHash(const Properties &prop) {
2257 using llvm::hash_value;
2258 return llvm::hash_combine();
2259}
2260
2261std::optional<mlir::Attribute> NegFeltOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
2262 return std::nullopt;
2263}
2264
2265void NegFeltOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
2266}
2267
2268void NegFeltOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
2269}
2270
2271::llvm::LogicalResult NegFeltOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
2272 return ::mlir::success();
2273}
2274
2275void NegFeltOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value operand) {
2276 odsState.addOperands(operand);
2277 odsState.addTypes(result);
2278}
2279
2280NegFeltOp NegFeltOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value operand) {
2281 ::mlir::OperationState __state__(location, getOperationName());
2282 build(builder, __state__, std::forward<decltype(result)>(result), std::forward<decltype(operand)>(operand));
2283 auto __res__ = ::llvm::dyn_cast<NegFeltOp>(builder.create(__state__));
2284 assert(__res__ && "builder didn't return the right type");
2285 return __res__;
2286}
2287
2288NegFeltOp NegFeltOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::Value operand) {
2289 return create(builder, builder.getLoc(), std::forward<decltype(result)>(result), std::forward<decltype(operand)>(operand));
2290}
2291
2292void NegFeltOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value operand) {
2293 odsState.addOperands(operand);
2294
2295 ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
2296 if (::mlir::succeeded(NegFeltOp::inferReturnTypes(odsBuilder.getContext(),
2297 odsState.location, odsState.operands,
2298 odsState.attributes.getDictionary(odsState.getContext()),
2299 odsState.getRawProperties(),
2300 odsState.regions, inferredReturnTypes)))
2301 odsState.addTypes(inferredReturnTypes);
2302 else
2303 ::mlir::detail::reportFatalInferReturnTypesError(odsState);
2304
2305}
2306
2307NegFeltOp NegFeltOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value operand) {
2308 ::mlir::OperationState __state__(location, getOperationName());
2309 build(builder, __state__, std::forward<decltype(operand)>(operand));
2310 auto __res__ = ::llvm::dyn_cast<NegFeltOp>(builder.create(__state__));
2311 assert(__res__ && "builder didn't return the right type");
2312 return __res__;
2313}
2314
2315NegFeltOp NegFeltOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value operand) {
2316 return create(builder, builder.getLoc(), std::forward<decltype(operand)>(operand));
2317}
2318
2319void NegFeltOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value operand) {
2320 odsState.addOperands(operand);
2321 assert(resultTypes.size() == 1u && "mismatched number of results");
2322 odsState.addTypes(resultTypes);
2323}
2324
2325NegFeltOp NegFeltOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value operand) {
2326 ::mlir::OperationState __state__(location, getOperationName());
2327 build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operand)>(operand));
2328 auto __res__ = ::llvm::dyn_cast<NegFeltOp>(builder.create(__state__));
2329 assert(__res__ && "builder didn't return the right type");
2330 return __res__;
2331}
2332
2333NegFeltOp NegFeltOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value operand) {
2334 return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operand)>(operand));
2335}
2336
2337void NegFeltOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
2338 assert(operands.size() == 1u && "mismatched number of parameters");
2339 odsState.addOperands(operands);
2340 odsState.addAttributes(attributes);
2341 assert(resultTypes.size() == 1u && "mismatched number of return types");
2342 odsState.addTypes(resultTypes);
2343}
2344
2345NegFeltOp NegFeltOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
2346 ::mlir::OperationState __state__(location, getOperationName());
2347 build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
2348 auto __res__ = ::llvm::dyn_cast<NegFeltOp>(builder.create(__state__));
2349 assert(__res__ && "builder didn't return the right type");
2350 return __res__;
2351}
2352
2353NegFeltOp NegFeltOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
2354 return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
2355}
2356
2357void NegFeltOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
2358 assert(operands.size() == 1u && "mismatched number of parameters");
2359 odsState.addOperands(operands);
2360 odsState.addAttributes(attributes);
2361
2362 ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
2363 if (::mlir::succeeded(NegFeltOp::inferReturnTypes(odsBuilder.getContext(),
2364 odsState.location, operands,
2365 odsState.attributes.getDictionary(odsState.getContext()),
2366 odsState.getRawProperties(),
2367 odsState.regions, inferredReturnTypes))) {
2368 assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
2369 odsState.addTypes(inferredReturnTypes);
2370 } else {
2371 ::llvm::report_fatal_error("Failed to infer result type(s).");
2372 }
2373}
2374
2375NegFeltOp NegFeltOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
2376 ::mlir::OperationState __state__(location, getOperationName());
2377 build(builder, __state__, std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
2378 auto __res__ = ::llvm::dyn_cast<NegFeltOp>(builder.create(__state__));
2379 assert(__res__ && "builder didn't return the right type");
2380 return __res__;
2381}
2382
2383NegFeltOp NegFeltOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
2384 return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
2385}
2386
2387void NegFeltOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
2388 assert(operands.size() == 1u && "mismatched number of parameters");
2389 odsState.addOperands(operands);
2390 odsState.useProperties(const_cast<Properties&>(properties));
2391 odsState.addAttributes(discardableAttributes);
2392 assert(resultTypes.size() == 1u && "mismatched number of return types");
2393 odsState.addTypes(resultTypes);
2394}
2395
2396NegFeltOp NegFeltOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
2397 ::mlir::OperationState __state__(location, getOperationName());
2398 build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
2399 auto __res__ = ::llvm::dyn_cast<NegFeltOp>(builder.create(__state__));
2400 assert(__res__ && "builder didn't return the right type");
2401 return __res__;
2402}
2403
2404NegFeltOp NegFeltOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
2405 return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
2406}
2407
2408void NegFeltOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
2409 assert(operands.size() == 1u && "mismatched number of parameters");
2410 odsState.addOperands(operands);
2411 odsState.useProperties(const_cast<Properties &>(properties));
2412 odsState.addAttributes(discardableAttributes);
2413
2414 ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
2415 if (::mlir::succeeded(NegFeltOp::inferReturnTypes(odsBuilder.getContext(),
2416 odsState.location, operands,
2417 odsState.attributes.getDictionary(odsState.getContext()),
2418 odsState.getRawProperties(),
2419 odsState.regions, inferredReturnTypes))) {
2420 assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
2421 odsState.addTypes(inferredReturnTypes);
2422 } else {
2423 ::llvm::report_fatal_error("Failed to infer result type(s).");
2424 }
2425}
2426
2427NegFeltOp NegFeltOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
2428 ::mlir::OperationState __state__(location, getOperationName());
2429 build(builder, __state__, std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
2430 auto __res__ = ::llvm::dyn_cast<NegFeltOp>(builder.create(__state__));
2431 assert(__res__ && "builder didn't return the right type");
2432 return __res__;
2433}
2434
2435NegFeltOp NegFeltOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
2436 return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
2437}
2438
2439::llvm::LogicalResult NegFeltOp::verifyInvariantsImpl() {
2440 {
2441 unsigned index = 0; (void)index;
2442 auto valueGroup0 = getODSOperands(0);
2443
2444 for (auto v : valueGroup0) {
2445 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops1(*this, v.getType(), "operand", index++)))
2446 return ::mlir::failure();
2447 }
2448 }
2449 {
2450 unsigned index = 0; (void)index;
2451 auto valueGroup0 = getODSResults(0);
2452
2453 for (auto v : valueGroup0) {
2454 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops2(*this, v.getType(), "result", index++)))
2455 return ::mlir::failure();
2456 }
2457 }
2458 if (!((::llzk::typesUnify((*this->getODSOperands(0).begin()).getType(), (*this->getODSResults(0).begin()).getType()))))
2459 return emitOpError("failed to verify that result type matches with operand type");
2460 return ::mlir::success();
2461}
2462
2463::llvm::LogicalResult NegFeltOp::verifyInvariants() {
2464 return verifyInvariantsImpl();
2465}
2466
2467::mlir::ParseResult NegFeltOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
2468 ::mlir::OpAsmParser::UnresolvedOperand operandRawOperand{};
2469 ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> operandOperands(&operandRawOperand, 1); ::llvm::SMLoc operandOperandsLoc;
2470 (void)operandOperandsLoc;
2471 ::mlir::Type operandRawType{};
2472 ::llvm::ArrayRef<::mlir::Type> operandTypes(&operandRawType, 1);
2473
2474 operandOperandsLoc = parser.getCurrentLocation();
2475 if (parser.parseOperand(operandRawOperand))
2476 return ::mlir::failure();
2477 {
2478 auto odsResult = parseInferredOrParsedType(parser, operandRawType, true);
2479 if (odsResult) return ::mlir::failure();
2480 }
2481 {
2482 auto loc = parser.getCurrentLocation();(void)loc;
2483 if (parser.parseOptionalAttrDict(result.attributes))
2484 return ::mlir::failure();
2485 if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() {
2486 return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op ";
2487 })))
2488 return ::mlir::failure();
2489 }
2490 if (parser.resolveOperands(operandOperands, operandTypes, operandOperandsLoc, result.operands))
2491 return ::mlir::failure();
2492
2493 ::llvm::SmallVector<::mlir::Type> inferredReturnTypes;
2494 if (::mlir::failed(NegFeltOp::inferReturnTypes(parser.getContext(),
2495 result.location, result.operands,
2496 result.attributes.getDictionary(parser.getContext()),
2497 result.getRawProperties(),
2498 result.regions, inferredReturnTypes)))
2499 return ::mlir::failure();
2500 result.addTypes(inferredReturnTypes);
2501 return ::mlir::success();
2502}
2503
2504void NegFeltOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
2505 _odsPrinter << ' ';
2506 _odsPrinter << getOperand();
2507 printInferredOrParsedType(_odsPrinter, *this, getOperand().getType(), true);
2508 ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
2509 _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
2510}
2511
2512void NegFeltOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
2513}
2514
2515 ::llvm::LogicalResult
2516 NegFeltOp::inferReturnTypes(::mlir::MLIRContext *context,
2517 std::optional<::mlir::Location> location,
2518 ::mlir::ValueRange operands, ::mlir::DictionaryAttr attributes,
2519 ::mlir::PropertyRef properties, ::mlir::RegionRange regions,
2520 ::llvm::SmallVectorImpl<::mlir::Type> &inferredReturnTypes) {
2521 NegFeltOp::Adaptor adaptor(operands, attributes, properties, regions);
2522 return NegFeltOp::inferReturnTypes(context,
2523 location, adaptor, inferredReturnTypes);
2524 }
2525
2526
2527::llvm::LogicalResult NegFeltOp::inferReturnTypes(
2528 mlir::MLIRContext *context, std::optional<mlir::Location> loc, Adaptor adaptor,
2529 llvm::SmallVectorImpl<mlir::Type> &inferred
2530) {
2531 inferred.resize(1);
2532 auto value = adaptor.getOperand();
2533 inferred[0] = value ? value.getType() : FeltType::get(context, mlir::StringAttr());
2534 return mlir::success();
2535}
2536
2537bool NegFeltOp::isCompatibleReturnTypes(mlir::TypeRange l, mlir::TypeRange r) {
2538 return l == r;
2539}
2540
2541} // namespace llzk::felt
2542MLIR_DEFINE_EXPLICIT_TYPE_ID(::llzk::felt::NegFeltOp)
2543
2544namespace llzk::felt {
2545
2546
2547//===----------------------------------------------------------------------===//
2548// ::llzk::felt::NotFeltOp definitions
2549//===----------------------------------------------------------------------===//
2550
2551namespace detail {
2552
2553NotFeltOpGenericAdaptorBase::NotFeltOpGenericAdaptorBase(NotFeltOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
2554
2555
2556} // namespace detail
2558
2559::llvm::LogicalResult NotFeltOpAdaptor::verify(::mlir::Location loc) {
2560 return ::mlir::success();
2561}
2562
2563::llvm::LogicalResult NotFeltOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
2564 ::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
2565 if (!dict) {
2566 emitError() << "expected DictionaryAttr to set properties";
2567 return ::mlir::failure();
2568 }
2569 return ::mlir::success();
2570}
2571
2572::mlir::Attribute NotFeltOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
2573 ::mlir::SmallVector<::mlir::NamedAttribute> attrs;
2574 ::mlir::Builder odsBuilder{ctx};
2575
2576 if (!attrs.empty())
2577 return odsBuilder.getDictionaryAttr(attrs);
2578 return {};
2579}
2580
2581llvm::hash_code NotFeltOp::computePropertiesHash(const Properties &prop) {
2582 using llvm::hash_value;
2583 return llvm::hash_combine();
2584}
2585
2586std::optional<mlir::Attribute> NotFeltOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
2587 return std::nullopt;
2588}
2589
2590void NotFeltOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
2591}
2592
2593void NotFeltOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
2594}
2595
2596::llvm::LogicalResult NotFeltOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
2597 return ::mlir::success();
2598}
2599
2600void NotFeltOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value operand) {
2601 odsState.addOperands(operand);
2602 odsState.addTypes(result);
2603}
2604
2605NotFeltOp NotFeltOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value operand) {
2606 ::mlir::OperationState __state__(location, getOperationName());
2607 build(builder, __state__, std::forward<decltype(result)>(result), std::forward<decltype(operand)>(operand));
2608 auto __res__ = ::llvm::dyn_cast<NotFeltOp>(builder.create(__state__));
2609 assert(__res__ && "builder didn't return the right type");
2610 return __res__;
2611}
2612
2613NotFeltOp NotFeltOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::Value operand) {
2614 return create(builder, builder.getLoc(), std::forward<decltype(result)>(result), std::forward<decltype(operand)>(operand));
2615}
2616
2617void NotFeltOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value operand) {
2618 odsState.addOperands(operand);
2619
2620 ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
2621 if (::mlir::succeeded(NotFeltOp::inferReturnTypes(odsBuilder.getContext(),
2622 odsState.location, odsState.operands,
2623 odsState.attributes.getDictionary(odsState.getContext()),
2624 odsState.getRawProperties(),
2625 odsState.regions, inferredReturnTypes)))
2626 odsState.addTypes(inferredReturnTypes);
2627 else
2628 ::mlir::detail::reportFatalInferReturnTypesError(odsState);
2629
2630}
2631
2632NotFeltOp NotFeltOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value operand) {
2633 ::mlir::OperationState __state__(location, getOperationName());
2634 build(builder, __state__, std::forward<decltype(operand)>(operand));
2635 auto __res__ = ::llvm::dyn_cast<NotFeltOp>(builder.create(__state__));
2636 assert(__res__ && "builder didn't return the right type");
2637 return __res__;
2638}
2639
2640NotFeltOp NotFeltOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value operand) {
2641 return create(builder, builder.getLoc(), std::forward<decltype(operand)>(operand));
2642}
2643
2644void NotFeltOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value operand) {
2645 odsState.addOperands(operand);
2646 assert(resultTypes.size() == 1u && "mismatched number of results");
2647 odsState.addTypes(resultTypes);
2648}
2649
2650NotFeltOp NotFeltOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value operand) {
2651 ::mlir::OperationState __state__(location, getOperationName());
2652 build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operand)>(operand));
2653 auto __res__ = ::llvm::dyn_cast<NotFeltOp>(builder.create(__state__));
2654 assert(__res__ && "builder didn't return the right type");
2655 return __res__;
2656}
2657
2658NotFeltOp NotFeltOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value operand) {
2659 return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operand)>(operand));
2660}
2661
2662void NotFeltOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
2663 assert(operands.size() == 1u && "mismatched number of parameters");
2664 odsState.addOperands(operands);
2665 odsState.addAttributes(attributes);
2666 assert(resultTypes.size() == 1u && "mismatched number of return types");
2667 odsState.addTypes(resultTypes);
2668}
2669
2670NotFeltOp NotFeltOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
2671 ::mlir::OperationState __state__(location, getOperationName());
2672 build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
2673 auto __res__ = ::llvm::dyn_cast<NotFeltOp>(builder.create(__state__));
2674 assert(__res__ && "builder didn't return the right type");
2675 return __res__;
2676}
2677
2678NotFeltOp NotFeltOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
2679 return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
2680}
2681
2682void NotFeltOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
2683 assert(operands.size() == 1u && "mismatched number of parameters");
2684 odsState.addOperands(operands);
2685 odsState.addAttributes(attributes);
2686
2687 ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
2688 if (::mlir::succeeded(NotFeltOp::inferReturnTypes(odsBuilder.getContext(),
2689 odsState.location, operands,
2690 odsState.attributes.getDictionary(odsState.getContext()),
2691 odsState.getRawProperties(),
2692 odsState.regions, inferredReturnTypes))) {
2693 assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
2694 odsState.addTypes(inferredReturnTypes);
2695 } else {
2696 ::llvm::report_fatal_error("Failed to infer result type(s).");
2697 }
2698}
2699
2700NotFeltOp NotFeltOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
2701 ::mlir::OperationState __state__(location, getOperationName());
2702 build(builder, __state__, std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
2703 auto __res__ = ::llvm::dyn_cast<NotFeltOp>(builder.create(__state__));
2704 assert(__res__ && "builder didn't return the right type");
2705 return __res__;
2706}
2707
2708NotFeltOp NotFeltOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
2709 return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
2710}
2711
2712void NotFeltOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
2713 assert(operands.size() == 1u && "mismatched number of parameters");
2714 odsState.addOperands(operands);
2715 odsState.useProperties(const_cast<Properties&>(properties));
2716 odsState.addAttributes(discardableAttributes);
2717 assert(resultTypes.size() == 1u && "mismatched number of return types");
2718 odsState.addTypes(resultTypes);
2719}
2720
2721NotFeltOp NotFeltOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
2722 ::mlir::OperationState __state__(location, getOperationName());
2723 build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
2724 auto __res__ = ::llvm::dyn_cast<NotFeltOp>(builder.create(__state__));
2725 assert(__res__ && "builder didn't return the right type");
2726 return __res__;
2727}
2728
2729NotFeltOp NotFeltOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
2730 return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
2731}
2732
2733void NotFeltOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
2734 assert(operands.size() == 1u && "mismatched number of parameters");
2735 odsState.addOperands(operands);
2736 odsState.useProperties(const_cast<Properties &>(properties));
2737 odsState.addAttributes(discardableAttributes);
2738
2739 ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
2740 if (::mlir::succeeded(NotFeltOp::inferReturnTypes(odsBuilder.getContext(),
2741 odsState.location, operands,
2742 odsState.attributes.getDictionary(odsState.getContext()),
2743 odsState.getRawProperties(),
2744 odsState.regions, inferredReturnTypes))) {
2745 assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
2746 odsState.addTypes(inferredReturnTypes);
2747 } else {
2748 ::llvm::report_fatal_error("Failed to infer result type(s).");
2749 }
2750}
2751
2752NotFeltOp NotFeltOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
2753 ::mlir::OperationState __state__(location, getOperationName());
2754 build(builder, __state__, std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
2755 auto __res__ = ::llvm::dyn_cast<NotFeltOp>(builder.create(__state__));
2756 assert(__res__ && "builder didn't return the right type");
2757 return __res__;
2758}
2759
2760NotFeltOp NotFeltOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
2761 return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
2762}
2763
2764::llvm::LogicalResult NotFeltOp::verifyInvariantsImpl() {
2765 {
2766 unsigned index = 0; (void)index;
2767 auto valueGroup0 = getODSOperands(0);
2768
2769 for (auto v : valueGroup0) {
2770 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops1(*this, v.getType(), "operand", index++)))
2771 return ::mlir::failure();
2772 }
2773 }
2774 {
2775 unsigned index = 0; (void)index;
2776 auto valueGroup0 = getODSResults(0);
2777
2778 for (auto v : valueGroup0) {
2779 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops2(*this, v.getType(), "result", index++)))
2780 return ::mlir::failure();
2781 }
2782 }
2783 if (!((::llzk::typesUnify((*this->getODSOperands(0).begin()).getType(), (*this->getODSResults(0).begin()).getType()))))
2784 return emitOpError("failed to verify that result type matches with operand type");
2785 return ::mlir::success();
2786}
2787
2788::llvm::LogicalResult NotFeltOp::verifyInvariants() {
2789 return verifyInvariantsImpl();
2790}
2791
2792::mlir::ParseResult NotFeltOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
2793 ::mlir::OpAsmParser::UnresolvedOperand operandRawOperand{};
2794 ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> operandOperands(&operandRawOperand, 1); ::llvm::SMLoc operandOperandsLoc;
2795 (void)operandOperandsLoc;
2796 ::mlir::Type operandRawType{};
2797 ::llvm::ArrayRef<::mlir::Type> operandTypes(&operandRawType, 1);
2798
2799 operandOperandsLoc = parser.getCurrentLocation();
2800 if (parser.parseOperand(operandRawOperand))
2801 return ::mlir::failure();
2802 {
2803 auto odsResult = parseInferredOrParsedType(parser, operandRawType, true);
2804 if (odsResult) return ::mlir::failure();
2805 }
2806 {
2807 auto loc = parser.getCurrentLocation();(void)loc;
2808 if (parser.parseOptionalAttrDict(result.attributes))
2809 return ::mlir::failure();
2810 if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() {
2811 return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op ";
2812 })))
2813 return ::mlir::failure();
2814 }
2815 if (parser.resolveOperands(operandOperands, operandTypes, operandOperandsLoc, result.operands))
2816 return ::mlir::failure();
2817
2818 ::llvm::SmallVector<::mlir::Type> inferredReturnTypes;
2819 if (::mlir::failed(NotFeltOp::inferReturnTypes(parser.getContext(),
2820 result.location, result.operands,
2821 result.attributes.getDictionary(parser.getContext()),
2822 result.getRawProperties(),
2823 result.regions, inferredReturnTypes)))
2824 return ::mlir::failure();
2825 result.addTypes(inferredReturnTypes);
2826 return ::mlir::success();
2827}
2828
2829void NotFeltOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
2830 _odsPrinter << ' ';
2831 _odsPrinter << getOperand();
2832 printInferredOrParsedType(_odsPrinter, *this, getOperand().getType(), true);
2833 ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
2834 _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
2835}
2836
2837void NotFeltOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
2838}
2839
2840 ::llvm::LogicalResult
2841 NotFeltOp::inferReturnTypes(::mlir::MLIRContext *context,
2842 std::optional<::mlir::Location> location,
2843 ::mlir::ValueRange operands, ::mlir::DictionaryAttr attributes,
2844 ::mlir::PropertyRef properties, ::mlir::RegionRange regions,
2845 ::llvm::SmallVectorImpl<::mlir::Type> &inferredReturnTypes) {
2846 NotFeltOp::Adaptor adaptor(operands, attributes, properties, regions);
2847 return NotFeltOp::inferReturnTypes(context,
2848 location, adaptor, inferredReturnTypes);
2849 }
2850
2851
2852::llvm::LogicalResult NotFeltOp::inferReturnTypes(
2853 mlir::MLIRContext *context, std::optional<mlir::Location> loc, Adaptor adaptor,
2854 llvm::SmallVectorImpl<mlir::Type> &inferred
2855) {
2856 inferred.resize(1);
2857 auto value = adaptor.getOperand();
2858 inferred[0] = value ? value.getType() : FeltType::get(context, mlir::StringAttr());
2859 return mlir::success();
2860}
2861
2862bool NotFeltOp::isCompatibleReturnTypes(mlir::TypeRange l, mlir::TypeRange r) {
2863 return l == r;
2864}
2865
2866} // namespace llzk::felt
2867MLIR_DEFINE_EXPLICIT_TYPE_ID(::llzk::felt::NotFeltOp)
2868
2869namespace llzk::felt {
2870
2871
2872//===----------------------------------------------------------------------===//
2873// ::llzk::felt::OrFeltOp definitions
2874//===----------------------------------------------------------------------===//
2875
2876namespace detail {
2877
2878OrFeltOpGenericAdaptorBase::OrFeltOpGenericAdaptorBase(OrFeltOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
2879
2880
2881} // namespace detail
2883
2884::llvm::LogicalResult OrFeltOpAdaptor::verify(::mlir::Location loc) {
2885 return ::mlir::success();
2886}
2887
2888::llvm::LogicalResult OrFeltOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
2889 ::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
2890 if (!dict) {
2891 emitError() << "expected DictionaryAttr to set properties";
2892 return ::mlir::failure();
2893 }
2894 return ::mlir::success();
2895}
2896
2897::mlir::Attribute OrFeltOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
2898 ::mlir::SmallVector<::mlir::NamedAttribute> attrs;
2899 ::mlir::Builder odsBuilder{ctx};
2900
2901 if (!attrs.empty())
2902 return odsBuilder.getDictionaryAttr(attrs);
2903 return {};
2904}
2905
2906llvm::hash_code OrFeltOp::computePropertiesHash(const Properties &prop) {
2907 using llvm::hash_value;
2908 return llvm::hash_combine();
2909}
2910
2911std::optional<mlir::Attribute> OrFeltOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
2912 return std::nullopt;
2913}
2914
2915void OrFeltOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
2916}
2917
2918void OrFeltOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
2919}
2920
2921::llvm::LogicalResult OrFeltOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
2922 return ::mlir::success();
2923}
2924
2925void OrFeltOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs) {
2926 odsState.addOperands(lhs);
2927 odsState.addOperands(rhs);
2928 odsState.addTypes(result);
2929}
2930
2931OrFeltOp OrFeltOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs) {
2932 ::mlir::OperationState __state__(location, getOperationName());
2933 build(builder, __state__, std::forward<decltype(result)>(result), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs));
2934 auto __res__ = ::llvm::dyn_cast<OrFeltOp>(builder.create(__state__));
2935 assert(__res__ && "builder didn't return the right type");
2936 return __res__;
2937}
2938
2939OrFeltOp OrFeltOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs) {
2940 return create(builder, builder.getLoc(), std::forward<decltype(result)>(result), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs));
2941}
2942
2943void OrFeltOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value lhs, ::mlir::Value rhs) {
2944 odsState.addOperands(lhs);
2945 odsState.addOperands(rhs);
2946
2947 ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
2948 if (::mlir::succeeded(OrFeltOp::inferReturnTypes(odsBuilder.getContext(),
2949 odsState.location, odsState.operands,
2950 odsState.attributes.getDictionary(odsState.getContext()),
2951 odsState.getRawProperties(),
2952 odsState.regions, inferredReturnTypes)))
2953 odsState.addTypes(inferredReturnTypes);
2954 else
2955 ::mlir::detail::reportFatalInferReturnTypesError(odsState);
2956
2957}
2958
2959OrFeltOp OrFeltOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value lhs, ::mlir::Value rhs) {
2960 ::mlir::OperationState __state__(location, getOperationName());
2961 build(builder, __state__, std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs));
2962 auto __res__ = ::llvm::dyn_cast<OrFeltOp>(builder.create(__state__));
2963 assert(__res__ && "builder didn't return the right type");
2964 return __res__;
2965}
2966
2967OrFeltOp OrFeltOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value lhs, ::mlir::Value rhs) {
2968 return create(builder, builder.getLoc(), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs));
2969}
2970
2971void OrFeltOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs) {
2972 odsState.addOperands(lhs);
2973 odsState.addOperands(rhs);
2974 assert(resultTypes.size() == 1u && "mismatched number of results");
2975 odsState.addTypes(resultTypes);
2976}
2977
2978OrFeltOp OrFeltOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs) {
2979 ::mlir::OperationState __state__(location, getOperationName());
2980 build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs));
2981 auto __res__ = ::llvm::dyn_cast<OrFeltOp>(builder.create(__state__));
2982 assert(__res__ && "builder didn't return the right type");
2983 return __res__;
2984}
2985
2986OrFeltOp OrFeltOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs) {
2987 return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs));
2988}
2989
2990void OrFeltOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
2991 assert(operands.size() == 2u && "mismatched number of parameters");
2992 odsState.addOperands(operands);
2993 odsState.addAttributes(attributes);
2994 assert(resultTypes.size() == 1u && "mismatched number of return types");
2995 odsState.addTypes(resultTypes);
2996}
2997
2998OrFeltOp OrFeltOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
2999 ::mlir::OperationState __state__(location, getOperationName());
3000 build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
3001 auto __res__ = ::llvm::dyn_cast<OrFeltOp>(builder.create(__state__));
3002 assert(__res__ && "builder didn't return the right type");
3003 return __res__;
3004}
3005
3006OrFeltOp OrFeltOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
3007 return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
3008}
3009
3010void OrFeltOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
3011 assert(operands.size() == 2u && "mismatched number of parameters");
3012 odsState.addOperands(operands);
3013 odsState.addAttributes(attributes);
3014
3015 ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
3016 if (::mlir::succeeded(OrFeltOp::inferReturnTypes(odsBuilder.getContext(),
3017 odsState.location, operands,
3018 odsState.attributes.getDictionary(odsState.getContext()),
3019 odsState.getRawProperties(),
3020 odsState.regions, inferredReturnTypes))) {
3021 assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
3022 odsState.addTypes(inferredReturnTypes);
3023 } else {
3024 ::llvm::report_fatal_error("Failed to infer result type(s).");
3025 }
3026}
3027
3028OrFeltOp OrFeltOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
3029 ::mlir::OperationState __state__(location, getOperationName());
3030 build(builder, __state__, std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
3031 auto __res__ = ::llvm::dyn_cast<OrFeltOp>(builder.create(__state__));
3032 assert(__res__ && "builder didn't return the right type");
3033 return __res__;
3034}
3035
3036OrFeltOp OrFeltOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
3037 return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
3038}
3039
3040void OrFeltOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
3041 assert(operands.size() == 2u && "mismatched number of parameters");
3042 odsState.addOperands(operands);
3043 odsState.useProperties(const_cast<Properties&>(properties));
3044 odsState.addAttributes(discardableAttributes);
3045 assert(resultTypes.size() == 1u && "mismatched number of return types");
3046 odsState.addTypes(resultTypes);
3047}
3048
3049OrFeltOp OrFeltOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
3050 ::mlir::OperationState __state__(location, getOperationName());
3051 build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
3052 auto __res__ = ::llvm::dyn_cast<OrFeltOp>(builder.create(__state__));
3053 assert(__res__ && "builder didn't return the right type");
3054 return __res__;
3055}
3056
3057OrFeltOp OrFeltOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
3058 return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
3059}
3060
3061void OrFeltOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
3062 assert(operands.size() == 2u && "mismatched number of parameters");
3063 odsState.addOperands(operands);
3064 odsState.useProperties(const_cast<Properties &>(properties));
3065 odsState.addAttributes(discardableAttributes);
3066
3067 ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
3068 if (::mlir::succeeded(OrFeltOp::inferReturnTypes(odsBuilder.getContext(),
3069 odsState.location, operands,
3070 odsState.attributes.getDictionary(odsState.getContext()),
3071 odsState.getRawProperties(),
3072 odsState.regions, inferredReturnTypes))) {
3073 assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
3074 odsState.addTypes(inferredReturnTypes);
3075 } else {
3076 ::llvm::report_fatal_error("Failed to infer result type(s).");
3077 }
3078}
3079
3080OrFeltOp OrFeltOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
3081 ::mlir::OperationState __state__(location, getOperationName());
3082 build(builder, __state__, std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
3083 auto __res__ = ::llvm::dyn_cast<OrFeltOp>(builder.create(__state__));
3084 assert(__res__ && "builder didn't return the right type");
3085 return __res__;
3086}
3087
3088OrFeltOp OrFeltOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
3089 return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
3090}
3091
3092::llvm::LogicalResult OrFeltOp::verifyInvariantsImpl() {
3093 {
3094 unsigned index = 0; (void)index;
3095 auto valueGroup0 = getODSOperands(0);
3096
3097 for (auto v : valueGroup0) {
3098 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops1(*this, v.getType(), "operand", index++)))
3099 return ::mlir::failure();
3100 }
3101 auto valueGroup1 = getODSOperands(1);
3102
3103 for (auto v : valueGroup1) {
3104 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops1(*this, v.getType(), "operand", index++)))
3105 return ::mlir::failure();
3106 }
3107 }
3108 {
3109 unsigned index = 0; (void)index;
3110 auto valueGroup0 = getODSResults(0);
3111
3112 for (auto v : valueGroup0) {
3113 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops2(*this, v.getType(), "result", index++)))
3114 return ::mlir::failure();
3115 }
3116 }
3117 if (!((::llzk::typesUnify((*this->getODSOperands(0).begin()).getType(), (*this->getODSOperands(1).begin()).getType()))))
3118 return emitOpError("failed to verify that rhs type matches with lhs type");
3119 if (!((::llzk::typesUnify((*this->getODSOperands(0).begin()).getType(), (*this->getODSResults(0).begin()).getType()))))
3120 return emitOpError("failed to verify that result type matches with lhs type");
3121 if (!((::llzk::typesUnify((*this->getODSOperands(1).begin()).getType(), (*this->getODSResults(0).begin()).getType()))))
3122 return emitOpError("failed to verify that result type matches with rhs type");
3123 return ::mlir::success();
3124}
3125
3126::llvm::LogicalResult OrFeltOp::verifyInvariants() {
3127 return verifyInvariantsImpl();
3128}
3129
3130::mlir::ParseResult OrFeltOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
3131 ::mlir::OpAsmParser::UnresolvedOperand lhsRawOperand{};
3132 ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> lhsOperands(&lhsRawOperand, 1); ::llvm::SMLoc lhsOperandsLoc;
3133 (void)lhsOperandsLoc;
3134 ::mlir::OpAsmParser::UnresolvedOperand rhsRawOperand{};
3135 ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> rhsOperands(&rhsRawOperand, 1); ::llvm::SMLoc rhsOperandsLoc;
3136 (void)rhsOperandsLoc;
3137 ::mlir::Type lhsRawType{};
3138 ::llvm::ArrayRef<::mlir::Type> lhsTypes(&lhsRawType, 1);
3139 ::mlir::Type rhsRawType{};
3140 ::llvm::ArrayRef<::mlir::Type> rhsTypes(&rhsRawType, 1);
3141
3142 lhsOperandsLoc = parser.getCurrentLocation();
3143 if (parser.parseOperand(lhsRawOperand))
3144 return ::mlir::failure();
3145 if (parser.parseComma())
3146 return ::mlir::failure();
3147
3148 rhsOperandsLoc = parser.getCurrentLocation();
3149 if (parser.parseOperand(rhsRawOperand))
3150 return ::mlir::failure();
3151 {
3152 auto odsResult = parseInferredOrParsedType(parser, lhsRawType, true);
3153 if (odsResult) return ::mlir::failure();
3154 }
3155 {
3156 auto odsResult = parseInferredOrParsedType(parser, rhsRawType, false);
3157 if (odsResult) return ::mlir::failure();
3158 }
3159 {
3160 auto loc = parser.getCurrentLocation();(void)loc;
3161 if (parser.parseOptionalAttrDict(result.attributes))
3162 return ::mlir::failure();
3163 if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() {
3164 return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op ";
3165 })))
3166 return ::mlir::failure();
3167 }
3168 if (parser.resolveOperands(lhsOperands, lhsTypes, lhsOperandsLoc, result.operands))
3169 return ::mlir::failure();
3170 if (parser.resolveOperands(rhsOperands, rhsTypes, rhsOperandsLoc, result.operands))
3171 return ::mlir::failure();
3172
3173 ::llvm::SmallVector<::mlir::Type> inferredReturnTypes;
3174 if (::mlir::failed(OrFeltOp::inferReturnTypes(parser.getContext(),
3175 result.location, result.operands,
3176 result.attributes.getDictionary(parser.getContext()),
3177 result.getRawProperties(),
3178 result.regions, inferredReturnTypes)))
3179 return ::mlir::failure();
3180 result.addTypes(inferredReturnTypes);
3181 return ::mlir::success();
3182}
3183
3184void OrFeltOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
3185 _odsPrinter << ' ';
3186 _odsPrinter << getLhs();
3187 _odsPrinter << ",";
3188 _odsPrinter << ' ';
3189 _odsPrinter << getRhs();
3190 printInferredOrParsedType(_odsPrinter, *this, getLhs().getType(), true);
3191 printInferredOrParsedType(_odsPrinter, *this, getRhs().getType(), false);
3192 ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
3193 _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
3194}
3195
3196void OrFeltOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
3197}
3198
3199 ::llvm::LogicalResult
3200 OrFeltOp::inferReturnTypes(::mlir::MLIRContext *context,
3201 std::optional<::mlir::Location> location,
3202 ::mlir::ValueRange operands, ::mlir::DictionaryAttr attributes,
3203 ::mlir::PropertyRef properties, ::mlir::RegionRange regions,
3204 ::llvm::SmallVectorImpl<::mlir::Type> &inferredReturnTypes) {
3205 OrFeltOp::Adaptor adaptor(operands, attributes, properties, regions);
3206 return OrFeltOp::inferReturnTypes(context,
3207 location, adaptor, inferredReturnTypes);
3208 }
3209
3210
3211::llvm::LogicalResult OrFeltOp::inferReturnTypes(
3212 mlir::MLIRContext *context, std::optional<mlir::Location> loc, Adaptor adaptor,
3213 llvm::SmallVectorImpl<mlir::Type> &inferred
3214) {
3215 inferred.resize(1);
3216 auto value = adaptor.getLhs();
3217 inferred[0] = value ? value.getType() : FeltType::get(context, mlir::StringAttr());
3218 return mlir::success();
3219}
3220
3221bool OrFeltOp::isCompatibleReturnTypes(mlir::TypeRange l, mlir::TypeRange r) {
3222 return l == r;
3223}
3224
3225} // namespace llzk::felt
3226MLIR_DEFINE_EXPLICIT_TYPE_ID(::llzk::felt::OrFeltOp)
3227
3228namespace llzk::felt {
3229
3230
3231//===----------------------------------------------------------------------===//
3232// ::llzk::felt::PowFeltOp definitions
3233//===----------------------------------------------------------------------===//
3234
3235namespace detail {
3236
3237PowFeltOpGenericAdaptorBase::PowFeltOpGenericAdaptorBase(PowFeltOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
3238
3239
3240} // namespace detail
3242
3243::llvm::LogicalResult PowFeltOpAdaptor::verify(::mlir::Location loc) {
3244 return ::mlir::success();
3245}
3246
3247::llvm::LogicalResult PowFeltOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
3248 ::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
3249 if (!dict) {
3250 emitError() << "expected DictionaryAttr to set properties";
3251 return ::mlir::failure();
3252 }
3253 return ::mlir::success();
3254}
3255
3256::mlir::Attribute PowFeltOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
3257 ::mlir::SmallVector<::mlir::NamedAttribute> attrs;
3258 ::mlir::Builder odsBuilder{ctx};
3259
3260 if (!attrs.empty())
3261 return odsBuilder.getDictionaryAttr(attrs);
3262 return {};
3263}
3264
3265llvm::hash_code PowFeltOp::computePropertiesHash(const Properties &prop) {
3266 using llvm::hash_value;
3267 return llvm::hash_combine();
3268}
3269
3270std::optional<mlir::Attribute> PowFeltOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
3271 return std::nullopt;
3272}
3273
3274void PowFeltOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
3275}
3276
3277void PowFeltOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
3278}
3279
3280::llvm::LogicalResult PowFeltOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
3281 return ::mlir::success();
3282}
3283
3284void PowFeltOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs) {
3285 odsState.addOperands(lhs);
3286 odsState.addOperands(rhs);
3287 odsState.addTypes(result);
3288}
3289
3290PowFeltOp PowFeltOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs) {
3291 ::mlir::OperationState __state__(location, getOperationName());
3292 build(builder, __state__, std::forward<decltype(result)>(result), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs));
3293 auto __res__ = ::llvm::dyn_cast<PowFeltOp>(builder.create(__state__));
3294 assert(__res__ && "builder didn't return the right type");
3295 return __res__;
3296}
3297
3298PowFeltOp PowFeltOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs) {
3299 return create(builder, builder.getLoc(), std::forward<decltype(result)>(result), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs));
3300}
3301
3302void PowFeltOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value lhs, ::mlir::Value rhs) {
3303 odsState.addOperands(lhs);
3304 odsState.addOperands(rhs);
3305
3306 ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
3307 if (::mlir::succeeded(PowFeltOp::inferReturnTypes(odsBuilder.getContext(),
3308 odsState.location, odsState.operands,
3309 odsState.attributes.getDictionary(odsState.getContext()),
3310 odsState.getRawProperties(),
3311 odsState.regions, inferredReturnTypes)))
3312 odsState.addTypes(inferredReturnTypes);
3313 else
3314 ::mlir::detail::reportFatalInferReturnTypesError(odsState);
3315
3316}
3317
3318PowFeltOp PowFeltOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value lhs, ::mlir::Value rhs) {
3319 ::mlir::OperationState __state__(location, getOperationName());
3320 build(builder, __state__, std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs));
3321 auto __res__ = ::llvm::dyn_cast<PowFeltOp>(builder.create(__state__));
3322 assert(__res__ && "builder didn't return the right type");
3323 return __res__;
3324}
3325
3326PowFeltOp PowFeltOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value lhs, ::mlir::Value rhs) {
3327 return create(builder, builder.getLoc(), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs));
3328}
3329
3330void PowFeltOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs) {
3331 odsState.addOperands(lhs);
3332 odsState.addOperands(rhs);
3333 assert(resultTypes.size() == 1u && "mismatched number of results");
3334 odsState.addTypes(resultTypes);
3335}
3336
3337PowFeltOp PowFeltOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs) {
3338 ::mlir::OperationState __state__(location, getOperationName());
3339 build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs));
3340 auto __res__ = ::llvm::dyn_cast<PowFeltOp>(builder.create(__state__));
3341 assert(__res__ && "builder didn't return the right type");
3342 return __res__;
3343}
3344
3345PowFeltOp PowFeltOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs) {
3346 return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs));
3347}
3348
3349void PowFeltOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
3350 assert(operands.size() == 2u && "mismatched number of parameters");
3351 odsState.addOperands(operands);
3352 odsState.addAttributes(attributes);
3353 assert(resultTypes.size() == 1u && "mismatched number of return types");
3354 odsState.addTypes(resultTypes);
3355}
3356
3357PowFeltOp PowFeltOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
3358 ::mlir::OperationState __state__(location, getOperationName());
3359 build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
3360 auto __res__ = ::llvm::dyn_cast<PowFeltOp>(builder.create(__state__));
3361 assert(__res__ && "builder didn't return the right type");
3362 return __res__;
3363}
3364
3365PowFeltOp PowFeltOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
3366 return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
3367}
3368
3369void PowFeltOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
3370 assert(operands.size() == 2u && "mismatched number of parameters");
3371 odsState.addOperands(operands);
3372 odsState.addAttributes(attributes);
3373
3374 ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
3375 if (::mlir::succeeded(PowFeltOp::inferReturnTypes(odsBuilder.getContext(),
3376 odsState.location, operands,
3377 odsState.attributes.getDictionary(odsState.getContext()),
3378 odsState.getRawProperties(),
3379 odsState.regions, inferredReturnTypes))) {
3380 assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
3381 odsState.addTypes(inferredReturnTypes);
3382 } else {
3383 ::llvm::report_fatal_error("Failed to infer result type(s).");
3384 }
3385}
3386
3387PowFeltOp PowFeltOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
3388 ::mlir::OperationState __state__(location, getOperationName());
3389 build(builder, __state__, std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
3390 auto __res__ = ::llvm::dyn_cast<PowFeltOp>(builder.create(__state__));
3391 assert(__res__ && "builder didn't return the right type");
3392 return __res__;
3393}
3394
3395PowFeltOp PowFeltOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
3396 return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
3397}
3398
3399void PowFeltOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
3400 assert(operands.size() == 2u && "mismatched number of parameters");
3401 odsState.addOperands(operands);
3402 odsState.useProperties(const_cast<Properties&>(properties));
3403 odsState.addAttributes(discardableAttributes);
3404 assert(resultTypes.size() == 1u && "mismatched number of return types");
3405 odsState.addTypes(resultTypes);
3406}
3407
3408PowFeltOp PowFeltOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
3409 ::mlir::OperationState __state__(location, getOperationName());
3410 build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
3411 auto __res__ = ::llvm::dyn_cast<PowFeltOp>(builder.create(__state__));
3412 assert(__res__ && "builder didn't return the right type");
3413 return __res__;
3414}
3415
3416PowFeltOp PowFeltOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
3417 return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
3418}
3419
3420void PowFeltOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
3421 assert(operands.size() == 2u && "mismatched number of parameters");
3422 odsState.addOperands(operands);
3423 odsState.useProperties(const_cast<Properties &>(properties));
3424 odsState.addAttributes(discardableAttributes);
3425
3426 ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
3427 if (::mlir::succeeded(PowFeltOp::inferReturnTypes(odsBuilder.getContext(),
3428 odsState.location, operands,
3429 odsState.attributes.getDictionary(odsState.getContext()),
3430 odsState.getRawProperties(),
3431 odsState.regions, inferredReturnTypes))) {
3432 assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
3433 odsState.addTypes(inferredReturnTypes);
3434 } else {
3435 ::llvm::report_fatal_error("Failed to infer result type(s).");
3436 }
3437}
3438
3439PowFeltOp PowFeltOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
3440 ::mlir::OperationState __state__(location, getOperationName());
3441 build(builder, __state__, std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
3442 auto __res__ = ::llvm::dyn_cast<PowFeltOp>(builder.create(__state__));
3443 assert(__res__ && "builder didn't return the right type");
3444 return __res__;
3445}
3446
3447PowFeltOp PowFeltOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
3448 return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
3449}
3450
3451::llvm::LogicalResult PowFeltOp::verifyInvariantsImpl() {
3452 {
3453 unsigned index = 0; (void)index;
3454 auto valueGroup0 = getODSOperands(0);
3455
3456 for (auto v : valueGroup0) {
3457 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops1(*this, v.getType(), "operand", index++)))
3458 return ::mlir::failure();
3459 }
3460 auto valueGroup1 = getODSOperands(1);
3461
3462 for (auto v : valueGroup1) {
3463 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops1(*this, v.getType(), "operand", index++)))
3464 return ::mlir::failure();
3465 }
3466 }
3467 {
3468 unsigned index = 0; (void)index;
3469 auto valueGroup0 = getODSResults(0);
3470
3471 for (auto v : valueGroup0) {
3472 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops2(*this, v.getType(), "result", index++)))
3473 return ::mlir::failure();
3474 }
3475 }
3476 if (!((::llzk::typesUnify((*this->getODSOperands(0).begin()).getType(), (*this->getODSOperands(1).begin()).getType()))))
3477 return emitOpError("failed to verify that rhs type matches with lhs type");
3478 if (!((::llzk::typesUnify((*this->getODSOperands(0).begin()).getType(), (*this->getODSResults(0).begin()).getType()))))
3479 return emitOpError("failed to verify that result type matches with lhs type");
3480 if (!((::llzk::typesUnify((*this->getODSOperands(1).begin()).getType(), (*this->getODSResults(0).begin()).getType()))))
3481 return emitOpError("failed to verify that result type matches with rhs type");
3482 return ::mlir::success();
3483}
3484
3485::llvm::LogicalResult PowFeltOp::verifyInvariants() {
3486 return verifyInvariantsImpl();
3487}
3488
3489::mlir::ParseResult PowFeltOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
3490 ::mlir::OpAsmParser::UnresolvedOperand lhsRawOperand{};
3491 ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> lhsOperands(&lhsRawOperand, 1); ::llvm::SMLoc lhsOperandsLoc;
3492 (void)lhsOperandsLoc;
3493 ::mlir::OpAsmParser::UnresolvedOperand rhsRawOperand{};
3494 ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> rhsOperands(&rhsRawOperand, 1); ::llvm::SMLoc rhsOperandsLoc;
3495 (void)rhsOperandsLoc;
3496 ::mlir::Type lhsRawType{};
3497 ::llvm::ArrayRef<::mlir::Type> lhsTypes(&lhsRawType, 1);
3498 ::mlir::Type rhsRawType{};
3499 ::llvm::ArrayRef<::mlir::Type> rhsTypes(&rhsRawType, 1);
3500
3501 lhsOperandsLoc = parser.getCurrentLocation();
3502 if (parser.parseOperand(lhsRawOperand))
3503 return ::mlir::failure();
3504 if (parser.parseComma())
3505 return ::mlir::failure();
3506
3507 rhsOperandsLoc = parser.getCurrentLocation();
3508 if (parser.parseOperand(rhsRawOperand))
3509 return ::mlir::failure();
3510 {
3511 auto odsResult = parseInferredOrParsedType(parser, lhsRawType, true);
3512 if (odsResult) return ::mlir::failure();
3513 }
3514 {
3515 auto odsResult = parseInferredOrParsedType(parser, rhsRawType, false);
3516 if (odsResult) return ::mlir::failure();
3517 }
3518 {
3519 auto loc = parser.getCurrentLocation();(void)loc;
3520 if (parser.parseOptionalAttrDict(result.attributes))
3521 return ::mlir::failure();
3522 if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() {
3523 return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op ";
3524 })))
3525 return ::mlir::failure();
3526 }
3527 if (parser.resolveOperands(lhsOperands, lhsTypes, lhsOperandsLoc, result.operands))
3528 return ::mlir::failure();
3529 if (parser.resolveOperands(rhsOperands, rhsTypes, rhsOperandsLoc, result.operands))
3530 return ::mlir::failure();
3531
3532 ::llvm::SmallVector<::mlir::Type> inferredReturnTypes;
3533 if (::mlir::failed(PowFeltOp::inferReturnTypes(parser.getContext(),
3534 result.location, result.operands,
3535 result.attributes.getDictionary(parser.getContext()),
3536 result.getRawProperties(),
3537 result.regions, inferredReturnTypes)))
3538 return ::mlir::failure();
3539 result.addTypes(inferredReturnTypes);
3540 return ::mlir::success();
3541}
3542
3543void PowFeltOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
3544 _odsPrinter << ' ';
3545 _odsPrinter << getLhs();
3546 _odsPrinter << ",";
3547 _odsPrinter << ' ';
3548 _odsPrinter << getRhs();
3549 printInferredOrParsedType(_odsPrinter, *this, getLhs().getType(), true);
3550 printInferredOrParsedType(_odsPrinter, *this, getRhs().getType(), false);
3551 ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
3552 _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
3553}
3554
3555void PowFeltOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
3556}
3557
3558 ::llvm::LogicalResult
3559 PowFeltOp::inferReturnTypes(::mlir::MLIRContext *context,
3560 std::optional<::mlir::Location> location,
3561 ::mlir::ValueRange operands, ::mlir::DictionaryAttr attributes,
3562 ::mlir::PropertyRef properties, ::mlir::RegionRange regions,
3563 ::llvm::SmallVectorImpl<::mlir::Type> &inferredReturnTypes) {
3564 PowFeltOp::Adaptor adaptor(operands, attributes, properties, regions);
3565 return PowFeltOp::inferReturnTypes(context,
3566 location, adaptor, inferredReturnTypes);
3567 }
3568
3569
3570::llvm::LogicalResult PowFeltOp::inferReturnTypes(
3571 mlir::MLIRContext *context, std::optional<mlir::Location> loc, Adaptor adaptor,
3572 llvm::SmallVectorImpl<mlir::Type> &inferred
3573) {
3574 inferred.resize(1);
3575 auto value = adaptor.getLhs();
3576 inferred[0] = value ? value.getType() : FeltType::get(context, mlir::StringAttr());
3577 return mlir::success();
3578}
3579
3580bool PowFeltOp::isCompatibleReturnTypes(mlir::TypeRange l, mlir::TypeRange r) {
3581 return l == r;
3582}
3583
3584} // namespace llzk::felt
3585MLIR_DEFINE_EXPLICIT_TYPE_ID(::llzk::felt::PowFeltOp)
3586
3587namespace llzk::felt {
3588
3589
3590//===----------------------------------------------------------------------===//
3591// ::llzk::felt::ShlFeltOp definitions
3592//===----------------------------------------------------------------------===//
3593
3594namespace detail {
3595
3596ShlFeltOpGenericAdaptorBase::ShlFeltOpGenericAdaptorBase(ShlFeltOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
3597
3598
3599} // namespace detail
3601
3602::llvm::LogicalResult ShlFeltOpAdaptor::verify(::mlir::Location loc) {
3603 return ::mlir::success();
3604}
3605
3606::llvm::LogicalResult ShlFeltOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
3607 ::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
3608 if (!dict) {
3609 emitError() << "expected DictionaryAttr to set properties";
3610 return ::mlir::failure();
3611 }
3612 return ::mlir::success();
3613}
3614
3615::mlir::Attribute ShlFeltOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
3616 ::mlir::SmallVector<::mlir::NamedAttribute> attrs;
3617 ::mlir::Builder odsBuilder{ctx};
3618
3619 if (!attrs.empty())
3620 return odsBuilder.getDictionaryAttr(attrs);
3621 return {};
3622}
3623
3624llvm::hash_code ShlFeltOp::computePropertiesHash(const Properties &prop) {
3625 using llvm::hash_value;
3626 return llvm::hash_combine();
3627}
3628
3629std::optional<mlir::Attribute> ShlFeltOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
3630 return std::nullopt;
3631}
3632
3633void ShlFeltOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
3634}
3635
3636void ShlFeltOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
3637}
3638
3639::llvm::LogicalResult ShlFeltOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
3640 return ::mlir::success();
3641}
3642
3643void ShlFeltOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs) {
3644 odsState.addOperands(lhs);
3645 odsState.addOperands(rhs);
3646 odsState.addTypes(result);
3647}
3648
3649ShlFeltOp ShlFeltOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs) {
3650 ::mlir::OperationState __state__(location, getOperationName());
3651 build(builder, __state__, std::forward<decltype(result)>(result), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs));
3652 auto __res__ = ::llvm::dyn_cast<ShlFeltOp>(builder.create(__state__));
3653 assert(__res__ && "builder didn't return the right type");
3654 return __res__;
3655}
3656
3657ShlFeltOp ShlFeltOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs) {
3658 return create(builder, builder.getLoc(), std::forward<decltype(result)>(result), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs));
3659}
3660
3661void ShlFeltOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value lhs, ::mlir::Value rhs) {
3662 odsState.addOperands(lhs);
3663 odsState.addOperands(rhs);
3664
3665 ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
3666 if (::mlir::succeeded(ShlFeltOp::inferReturnTypes(odsBuilder.getContext(),
3667 odsState.location, odsState.operands,
3668 odsState.attributes.getDictionary(odsState.getContext()),
3669 odsState.getRawProperties(),
3670 odsState.regions, inferredReturnTypes)))
3671 odsState.addTypes(inferredReturnTypes);
3672 else
3673 ::mlir::detail::reportFatalInferReturnTypesError(odsState);
3674
3675}
3676
3677ShlFeltOp ShlFeltOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value lhs, ::mlir::Value rhs) {
3678 ::mlir::OperationState __state__(location, getOperationName());
3679 build(builder, __state__, std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs));
3680 auto __res__ = ::llvm::dyn_cast<ShlFeltOp>(builder.create(__state__));
3681 assert(__res__ && "builder didn't return the right type");
3682 return __res__;
3683}
3684
3685ShlFeltOp ShlFeltOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value lhs, ::mlir::Value rhs) {
3686 return create(builder, builder.getLoc(), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs));
3687}
3688
3689void ShlFeltOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs) {
3690 odsState.addOperands(lhs);
3691 odsState.addOperands(rhs);
3692 assert(resultTypes.size() == 1u && "mismatched number of results");
3693 odsState.addTypes(resultTypes);
3694}
3695
3696ShlFeltOp ShlFeltOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs) {
3697 ::mlir::OperationState __state__(location, getOperationName());
3698 build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs));
3699 auto __res__ = ::llvm::dyn_cast<ShlFeltOp>(builder.create(__state__));
3700 assert(__res__ && "builder didn't return the right type");
3701 return __res__;
3702}
3703
3704ShlFeltOp ShlFeltOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs) {
3705 return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs));
3706}
3707
3708void ShlFeltOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
3709 assert(operands.size() == 2u && "mismatched number of parameters");
3710 odsState.addOperands(operands);
3711 odsState.addAttributes(attributes);
3712 assert(resultTypes.size() == 1u && "mismatched number of return types");
3713 odsState.addTypes(resultTypes);
3714}
3715
3716ShlFeltOp ShlFeltOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
3717 ::mlir::OperationState __state__(location, getOperationName());
3718 build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
3719 auto __res__ = ::llvm::dyn_cast<ShlFeltOp>(builder.create(__state__));
3720 assert(__res__ && "builder didn't return the right type");
3721 return __res__;
3722}
3723
3724ShlFeltOp ShlFeltOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
3725 return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
3726}
3727
3728void ShlFeltOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
3729 assert(operands.size() == 2u && "mismatched number of parameters");
3730 odsState.addOperands(operands);
3731 odsState.addAttributes(attributes);
3732
3733 ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
3734 if (::mlir::succeeded(ShlFeltOp::inferReturnTypes(odsBuilder.getContext(),
3735 odsState.location, operands,
3736 odsState.attributes.getDictionary(odsState.getContext()),
3737 odsState.getRawProperties(),
3738 odsState.regions, inferredReturnTypes))) {
3739 assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
3740 odsState.addTypes(inferredReturnTypes);
3741 } else {
3742 ::llvm::report_fatal_error("Failed to infer result type(s).");
3743 }
3744}
3745
3746ShlFeltOp ShlFeltOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
3747 ::mlir::OperationState __state__(location, getOperationName());
3748 build(builder, __state__, std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
3749 auto __res__ = ::llvm::dyn_cast<ShlFeltOp>(builder.create(__state__));
3750 assert(__res__ && "builder didn't return the right type");
3751 return __res__;
3752}
3753
3754ShlFeltOp ShlFeltOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
3755 return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
3756}
3757
3758void ShlFeltOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
3759 assert(operands.size() == 2u && "mismatched number of parameters");
3760 odsState.addOperands(operands);
3761 odsState.useProperties(const_cast<Properties&>(properties));
3762 odsState.addAttributes(discardableAttributes);
3763 assert(resultTypes.size() == 1u && "mismatched number of return types");
3764 odsState.addTypes(resultTypes);
3765}
3766
3767ShlFeltOp ShlFeltOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
3768 ::mlir::OperationState __state__(location, getOperationName());
3769 build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
3770 auto __res__ = ::llvm::dyn_cast<ShlFeltOp>(builder.create(__state__));
3771 assert(__res__ && "builder didn't return the right type");
3772 return __res__;
3773}
3774
3775ShlFeltOp ShlFeltOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
3776 return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
3777}
3778
3779void ShlFeltOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
3780 assert(operands.size() == 2u && "mismatched number of parameters");
3781 odsState.addOperands(operands);
3782 odsState.useProperties(const_cast<Properties &>(properties));
3783 odsState.addAttributes(discardableAttributes);
3784
3785 ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
3786 if (::mlir::succeeded(ShlFeltOp::inferReturnTypes(odsBuilder.getContext(),
3787 odsState.location, operands,
3788 odsState.attributes.getDictionary(odsState.getContext()),
3789 odsState.getRawProperties(),
3790 odsState.regions, inferredReturnTypes))) {
3791 assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
3792 odsState.addTypes(inferredReturnTypes);
3793 } else {
3794 ::llvm::report_fatal_error("Failed to infer result type(s).");
3795 }
3796}
3797
3798ShlFeltOp ShlFeltOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
3799 ::mlir::OperationState __state__(location, getOperationName());
3800 build(builder, __state__, std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
3801 auto __res__ = ::llvm::dyn_cast<ShlFeltOp>(builder.create(__state__));
3802 assert(__res__ && "builder didn't return the right type");
3803 return __res__;
3804}
3805
3806ShlFeltOp ShlFeltOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
3807 return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
3808}
3809
3810::llvm::LogicalResult ShlFeltOp::verifyInvariantsImpl() {
3811 {
3812 unsigned index = 0; (void)index;
3813 auto valueGroup0 = getODSOperands(0);
3814
3815 for (auto v : valueGroup0) {
3816 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops1(*this, v.getType(), "operand", index++)))
3817 return ::mlir::failure();
3818 }
3819 auto valueGroup1 = getODSOperands(1);
3820
3821 for (auto v : valueGroup1) {
3822 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops1(*this, v.getType(), "operand", index++)))
3823 return ::mlir::failure();
3824 }
3825 }
3826 {
3827 unsigned index = 0; (void)index;
3828 auto valueGroup0 = getODSResults(0);
3829
3830 for (auto v : valueGroup0) {
3831 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops2(*this, v.getType(), "result", index++)))
3832 return ::mlir::failure();
3833 }
3834 }
3835 if (!((::llzk::typesUnify((*this->getODSOperands(0).begin()).getType(), (*this->getODSOperands(1).begin()).getType()))))
3836 return emitOpError("failed to verify that rhs type matches with lhs type");
3837 if (!((::llzk::typesUnify((*this->getODSOperands(0).begin()).getType(), (*this->getODSResults(0).begin()).getType()))))
3838 return emitOpError("failed to verify that result type matches with lhs type");
3839 if (!((::llzk::typesUnify((*this->getODSOperands(1).begin()).getType(), (*this->getODSResults(0).begin()).getType()))))
3840 return emitOpError("failed to verify that result type matches with rhs type");
3841 return ::mlir::success();
3842}
3843
3844::llvm::LogicalResult ShlFeltOp::verifyInvariants() {
3845 return verifyInvariantsImpl();
3846}
3847
3848::mlir::ParseResult ShlFeltOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
3849 ::mlir::OpAsmParser::UnresolvedOperand lhsRawOperand{};
3850 ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> lhsOperands(&lhsRawOperand, 1); ::llvm::SMLoc lhsOperandsLoc;
3851 (void)lhsOperandsLoc;
3852 ::mlir::OpAsmParser::UnresolvedOperand rhsRawOperand{};
3853 ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> rhsOperands(&rhsRawOperand, 1); ::llvm::SMLoc rhsOperandsLoc;
3854 (void)rhsOperandsLoc;
3855 ::mlir::Type lhsRawType{};
3856 ::llvm::ArrayRef<::mlir::Type> lhsTypes(&lhsRawType, 1);
3857 ::mlir::Type rhsRawType{};
3858 ::llvm::ArrayRef<::mlir::Type> rhsTypes(&rhsRawType, 1);
3859
3860 lhsOperandsLoc = parser.getCurrentLocation();
3861 if (parser.parseOperand(lhsRawOperand))
3862 return ::mlir::failure();
3863 if (parser.parseComma())
3864 return ::mlir::failure();
3865
3866 rhsOperandsLoc = parser.getCurrentLocation();
3867 if (parser.parseOperand(rhsRawOperand))
3868 return ::mlir::failure();
3869 {
3870 auto odsResult = parseInferredOrParsedType(parser, lhsRawType, true);
3871 if (odsResult) return ::mlir::failure();
3872 }
3873 {
3874 auto odsResult = parseInferredOrParsedType(parser, rhsRawType, false);
3875 if (odsResult) return ::mlir::failure();
3876 }
3877 {
3878 auto loc = parser.getCurrentLocation();(void)loc;
3879 if (parser.parseOptionalAttrDict(result.attributes))
3880 return ::mlir::failure();
3881 if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() {
3882 return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op ";
3883 })))
3884 return ::mlir::failure();
3885 }
3886 if (parser.resolveOperands(lhsOperands, lhsTypes, lhsOperandsLoc, result.operands))
3887 return ::mlir::failure();
3888 if (parser.resolveOperands(rhsOperands, rhsTypes, rhsOperandsLoc, result.operands))
3889 return ::mlir::failure();
3890
3891 ::llvm::SmallVector<::mlir::Type> inferredReturnTypes;
3892 if (::mlir::failed(ShlFeltOp::inferReturnTypes(parser.getContext(),
3893 result.location, result.operands,
3894 result.attributes.getDictionary(parser.getContext()),
3895 result.getRawProperties(),
3896 result.regions, inferredReturnTypes)))
3897 return ::mlir::failure();
3898 result.addTypes(inferredReturnTypes);
3899 return ::mlir::success();
3900}
3901
3902void ShlFeltOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
3903 _odsPrinter << ' ';
3904 _odsPrinter << getLhs();
3905 _odsPrinter << ",";
3906 _odsPrinter << ' ';
3907 _odsPrinter << getRhs();
3908 printInferredOrParsedType(_odsPrinter, *this, getLhs().getType(), true);
3909 printInferredOrParsedType(_odsPrinter, *this, getRhs().getType(), false);
3910 ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
3911 _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
3912}
3913
3914void ShlFeltOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
3915}
3916
3917 ::llvm::LogicalResult
3918 ShlFeltOp::inferReturnTypes(::mlir::MLIRContext *context,
3919 std::optional<::mlir::Location> location,
3920 ::mlir::ValueRange operands, ::mlir::DictionaryAttr attributes,
3921 ::mlir::PropertyRef properties, ::mlir::RegionRange regions,
3922 ::llvm::SmallVectorImpl<::mlir::Type> &inferredReturnTypes) {
3923 ShlFeltOp::Adaptor adaptor(operands, attributes, properties, regions);
3924 return ShlFeltOp::inferReturnTypes(context,
3925 location, adaptor, inferredReturnTypes);
3926 }
3927
3928
3929::llvm::LogicalResult ShlFeltOp::inferReturnTypes(
3930 mlir::MLIRContext *context, std::optional<mlir::Location> loc, Adaptor adaptor,
3931 llvm::SmallVectorImpl<mlir::Type> &inferred
3932) {
3933 inferred.resize(1);
3934 auto value = adaptor.getLhs();
3935 inferred[0] = value ? value.getType() : FeltType::get(context, mlir::StringAttr());
3936 return mlir::success();
3937}
3938
3939bool ShlFeltOp::isCompatibleReturnTypes(mlir::TypeRange l, mlir::TypeRange r) {
3940 return l == r;
3941}
3942
3943} // namespace llzk::felt
3944MLIR_DEFINE_EXPLICIT_TYPE_ID(::llzk::felt::ShlFeltOp)
3945
3946namespace llzk::felt {
3947
3948
3949//===----------------------------------------------------------------------===//
3950// ::llzk::felt::ShrFeltOp definitions
3951//===----------------------------------------------------------------------===//
3952
3953namespace detail {
3954
3955ShrFeltOpGenericAdaptorBase::ShrFeltOpGenericAdaptorBase(ShrFeltOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
3956
3957
3958} // namespace detail
3960
3961::llvm::LogicalResult ShrFeltOpAdaptor::verify(::mlir::Location loc) {
3962 return ::mlir::success();
3963}
3964
3965::llvm::LogicalResult ShrFeltOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
3966 ::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
3967 if (!dict) {
3968 emitError() << "expected DictionaryAttr to set properties";
3969 return ::mlir::failure();
3970 }
3971 return ::mlir::success();
3972}
3973
3974::mlir::Attribute ShrFeltOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
3975 ::mlir::SmallVector<::mlir::NamedAttribute> attrs;
3976 ::mlir::Builder odsBuilder{ctx};
3977
3978 if (!attrs.empty())
3979 return odsBuilder.getDictionaryAttr(attrs);
3980 return {};
3981}
3982
3983llvm::hash_code ShrFeltOp::computePropertiesHash(const Properties &prop) {
3984 using llvm::hash_value;
3985 return llvm::hash_combine();
3986}
3987
3988std::optional<mlir::Attribute> ShrFeltOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
3989 return std::nullopt;
3990}
3991
3992void ShrFeltOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
3993}
3994
3995void ShrFeltOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
3996}
3997
3998::llvm::LogicalResult ShrFeltOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
3999 return ::mlir::success();
4000}
4001
4002void ShrFeltOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs) {
4003 odsState.addOperands(lhs);
4004 odsState.addOperands(rhs);
4005 odsState.addTypes(result);
4006}
4007
4008ShrFeltOp ShrFeltOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs) {
4009 ::mlir::OperationState __state__(location, getOperationName());
4010 build(builder, __state__, std::forward<decltype(result)>(result), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs));
4011 auto __res__ = ::llvm::dyn_cast<ShrFeltOp>(builder.create(__state__));
4012 assert(__res__ && "builder didn't return the right type");
4013 return __res__;
4014}
4015
4016ShrFeltOp ShrFeltOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs) {
4017 return create(builder, builder.getLoc(), std::forward<decltype(result)>(result), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs));
4018}
4019
4020void ShrFeltOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value lhs, ::mlir::Value rhs) {
4021 odsState.addOperands(lhs);
4022 odsState.addOperands(rhs);
4023
4024 ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
4025 if (::mlir::succeeded(ShrFeltOp::inferReturnTypes(odsBuilder.getContext(),
4026 odsState.location, odsState.operands,
4027 odsState.attributes.getDictionary(odsState.getContext()),
4028 odsState.getRawProperties(),
4029 odsState.regions, inferredReturnTypes)))
4030 odsState.addTypes(inferredReturnTypes);
4031 else
4032 ::mlir::detail::reportFatalInferReturnTypesError(odsState);
4033
4034}
4035
4036ShrFeltOp ShrFeltOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value lhs, ::mlir::Value rhs) {
4037 ::mlir::OperationState __state__(location, getOperationName());
4038 build(builder, __state__, std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs));
4039 auto __res__ = ::llvm::dyn_cast<ShrFeltOp>(builder.create(__state__));
4040 assert(__res__ && "builder didn't return the right type");
4041 return __res__;
4042}
4043
4044ShrFeltOp ShrFeltOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value lhs, ::mlir::Value rhs) {
4045 return create(builder, builder.getLoc(), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs));
4046}
4047
4048void ShrFeltOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs) {
4049 odsState.addOperands(lhs);
4050 odsState.addOperands(rhs);
4051 assert(resultTypes.size() == 1u && "mismatched number of results");
4052 odsState.addTypes(resultTypes);
4053}
4054
4055ShrFeltOp ShrFeltOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs) {
4056 ::mlir::OperationState __state__(location, getOperationName());
4057 build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs));
4058 auto __res__ = ::llvm::dyn_cast<ShrFeltOp>(builder.create(__state__));
4059 assert(__res__ && "builder didn't return the right type");
4060 return __res__;
4061}
4062
4063ShrFeltOp ShrFeltOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs) {
4064 return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs));
4065}
4066
4067void ShrFeltOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
4068 assert(operands.size() == 2u && "mismatched number of parameters");
4069 odsState.addOperands(operands);
4070 odsState.addAttributes(attributes);
4071 assert(resultTypes.size() == 1u && "mismatched number of return types");
4072 odsState.addTypes(resultTypes);
4073}
4074
4075ShrFeltOp ShrFeltOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
4076 ::mlir::OperationState __state__(location, getOperationName());
4077 build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
4078 auto __res__ = ::llvm::dyn_cast<ShrFeltOp>(builder.create(__state__));
4079 assert(__res__ && "builder didn't return the right type");
4080 return __res__;
4081}
4082
4083ShrFeltOp ShrFeltOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
4084 return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
4085}
4086
4087void ShrFeltOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
4088 assert(operands.size() == 2u && "mismatched number of parameters");
4089 odsState.addOperands(operands);
4090 odsState.addAttributes(attributes);
4091
4092 ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
4093 if (::mlir::succeeded(ShrFeltOp::inferReturnTypes(odsBuilder.getContext(),
4094 odsState.location, operands,
4095 odsState.attributes.getDictionary(odsState.getContext()),
4096 odsState.getRawProperties(),
4097 odsState.regions, inferredReturnTypes))) {
4098 assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
4099 odsState.addTypes(inferredReturnTypes);
4100 } else {
4101 ::llvm::report_fatal_error("Failed to infer result type(s).");
4102 }
4103}
4104
4105ShrFeltOp ShrFeltOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
4106 ::mlir::OperationState __state__(location, getOperationName());
4107 build(builder, __state__, std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
4108 auto __res__ = ::llvm::dyn_cast<ShrFeltOp>(builder.create(__state__));
4109 assert(__res__ && "builder didn't return the right type");
4110 return __res__;
4111}
4112
4113ShrFeltOp ShrFeltOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
4114 return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
4115}
4116
4117void ShrFeltOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
4118 assert(operands.size() == 2u && "mismatched number of parameters");
4119 odsState.addOperands(operands);
4120 odsState.useProperties(const_cast<Properties&>(properties));
4121 odsState.addAttributes(discardableAttributes);
4122 assert(resultTypes.size() == 1u && "mismatched number of return types");
4123 odsState.addTypes(resultTypes);
4124}
4125
4126ShrFeltOp ShrFeltOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
4127 ::mlir::OperationState __state__(location, getOperationName());
4128 build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
4129 auto __res__ = ::llvm::dyn_cast<ShrFeltOp>(builder.create(__state__));
4130 assert(__res__ && "builder didn't return the right type");
4131 return __res__;
4132}
4133
4134ShrFeltOp ShrFeltOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
4135 return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
4136}
4137
4138void ShrFeltOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
4139 assert(operands.size() == 2u && "mismatched number of parameters");
4140 odsState.addOperands(operands);
4141 odsState.useProperties(const_cast<Properties &>(properties));
4142 odsState.addAttributes(discardableAttributes);
4143
4144 ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
4145 if (::mlir::succeeded(ShrFeltOp::inferReturnTypes(odsBuilder.getContext(),
4146 odsState.location, operands,
4147 odsState.attributes.getDictionary(odsState.getContext()),
4148 odsState.getRawProperties(),
4149 odsState.regions, inferredReturnTypes))) {
4150 assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
4151 odsState.addTypes(inferredReturnTypes);
4152 } else {
4153 ::llvm::report_fatal_error("Failed to infer result type(s).");
4154 }
4155}
4156
4157ShrFeltOp ShrFeltOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
4158 ::mlir::OperationState __state__(location, getOperationName());
4159 build(builder, __state__, std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
4160 auto __res__ = ::llvm::dyn_cast<ShrFeltOp>(builder.create(__state__));
4161 assert(__res__ && "builder didn't return the right type");
4162 return __res__;
4163}
4164
4165ShrFeltOp ShrFeltOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
4166 return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
4167}
4168
4169::llvm::LogicalResult ShrFeltOp::verifyInvariantsImpl() {
4170 {
4171 unsigned index = 0; (void)index;
4172 auto valueGroup0 = getODSOperands(0);
4173
4174 for (auto v : valueGroup0) {
4175 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops1(*this, v.getType(), "operand", index++)))
4176 return ::mlir::failure();
4177 }
4178 auto valueGroup1 = getODSOperands(1);
4179
4180 for (auto v : valueGroup1) {
4181 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops1(*this, v.getType(), "operand", index++)))
4182 return ::mlir::failure();
4183 }
4184 }
4185 {
4186 unsigned index = 0; (void)index;
4187 auto valueGroup0 = getODSResults(0);
4188
4189 for (auto v : valueGroup0) {
4190 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops2(*this, v.getType(), "result", index++)))
4191 return ::mlir::failure();
4192 }
4193 }
4194 if (!((::llzk::typesUnify((*this->getODSOperands(0).begin()).getType(), (*this->getODSOperands(1).begin()).getType()))))
4195 return emitOpError("failed to verify that rhs type matches with lhs type");
4196 if (!((::llzk::typesUnify((*this->getODSOperands(0).begin()).getType(), (*this->getODSResults(0).begin()).getType()))))
4197 return emitOpError("failed to verify that result type matches with lhs type");
4198 if (!((::llzk::typesUnify((*this->getODSOperands(1).begin()).getType(), (*this->getODSResults(0).begin()).getType()))))
4199 return emitOpError("failed to verify that result type matches with rhs type");
4200 return ::mlir::success();
4201}
4202
4203::llvm::LogicalResult ShrFeltOp::verifyInvariants() {
4204 return verifyInvariantsImpl();
4205}
4206
4207::mlir::ParseResult ShrFeltOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
4208 ::mlir::OpAsmParser::UnresolvedOperand lhsRawOperand{};
4209 ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> lhsOperands(&lhsRawOperand, 1); ::llvm::SMLoc lhsOperandsLoc;
4210 (void)lhsOperandsLoc;
4211 ::mlir::OpAsmParser::UnresolvedOperand rhsRawOperand{};
4212 ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> rhsOperands(&rhsRawOperand, 1); ::llvm::SMLoc rhsOperandsLoc;
4213 (void)rhsOperandsLoc;
4214 ::mlir::Type lhsRawType{};
4215 ::llvm::ArrayRef<::mlir::Type> lhsTypes(&lhsRawType, 1);
4216 ::mlir::Type rhsRawType{};
4217 ::llvm::ArrayRef<::mlir::Type> rhsTypes(&rhsRawType, 1);
4218
4219 lhsOperandsLoc = parser.getCurrentLocation();
4220 if (parser.parseOperand(lhsRawOperand))
4221 return ::mlir::failure();
4222 if (parser.parseComma())
4223 return ::mlir::failure();
4224
4225 rhsOperandsLoc = parser.getCurrentLocation();
4226 if (parser.parseOperand(rhsRawOperand))
4227 return ::mlir::failure();
4228 {
4229 auto odsResult = parseInferredOrParsedType(parser, lhsRawType, true);
4230 if (odsResult) return ::mlir::failure();
4231 }
4232 {
4233 auto odsResult = parseInferredOrParsedType(parser, rhsRawType, false);
4234 if (odsResult) return ::mlir::failure();
4235 }
4236 {
4237 auto loc = parser.getCurrentLocation();(void)loc;
4238 if (parser.parseOptionalAttrDict(result.attributes))
4239 return ::mlir::failure();
4240 if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() {
4241 return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op ";
4242 })))
4243 return ::mlir::failure();
4244 }
4245 if (parser.resolveOperands(lhsOperands, lhsTypes, lhsOperandsLoc, result.operands))
4246 return ::mlir::failure();
4247 if (parser.resolveOperands(rhsOperands, rhsTypes, rhsOperandsLoc, result.operands))
4248 return ::mlir::failure();
4249
4250 ::llvm::SmallVector<::mlir::Type> inferredReturnTypes;
4251 if (::mlir::failed(ShrFeltOp::inferReturnTypes(parser.getContext(),
4252 result.location, result.operands,
4253 result.attributes.getDictionary(parser.getContext()),
4254 result.getRawProperties(),
4255 result.regions, inferredReturnTypes)))
4256 return ::mlir::failure();
4257 result.addTypes(inferredReturnTypes);
4258 return ::mlir::success();
4259}
4260
4261void ShrFeltOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
4262 _odsPrinter << ' ';
4263 _odsPrinter << getLhs();
4264 _odsPrinter << ",";
4265 _odsPrinter << ' ';
4266 _odsPrinter << getRhs();
4267 printInferredOrParsedType(_odsPrinter, *this, getLhs().getType(), true);
4268 printInferredOrParsedType(_odsPrinter, *this, getRhs().getType(), false);
4269 ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
4270 _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
4271}
4272
4273void ShrFeltOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
4274}
4275
4276 ::llvm::LogicalResult
4277 ShrFeltOp::inferReturnTypes(::mlir::MLIRContext *context,
4278 std::optional<::mlir::Location> location,
4279 ::mlir::ValueRange operands, ::mlir::DictionaryAttr attributes,
4280 ::mlir::PropertyRef properties, ::mlir::RegionRange regions,
4281 ::llvm::SmallVectorImpl<::mlir::Type> &inferredReturnTypes) {
4282 ShrFeltOp::Adaptor adaptor(operands, attributes, properties, regions);
4283 return ShrFeltOp::inferReturnTypes(context,
4284 location, adaptor, inferredReturnTypes);
4285 }
4286
4287
4288::llvm::LogicalResult ShrFeltOp::inferReturnTypes(
4289 mlir::MLIRContext *context, std::optional<mlir::Location> loc, Adaptor adaptor,
4290 llvm::SmallVectorImpl<mlir::Type> &inferred
4291) {
4292 inferred.resize(1);
4293 auto value = adaptor.getLhs();
4294 inferred[0] = value ? value.getType() : FeltType::get(context, mlir::StringAttr());
4295 return mlir::success();
4296}
4297
4298bool ShrFeltOp::isCompatibleReturnTypes(mlir::TypeRange l, mlir::TypeRange r) {
4299 return l == r;
4300}
4301
4302} // namespace llzk::felt
4303MLIR_DEFINE_EXPLICIT_TYPE_ID(::llzk::felt::ShrFeltOp)
4304
4305namespace llzk::felt {
4306
4307
4308//===----------------------------------------------------------------------===//
4309// ::llzk::felt::SignedIntDivFeltOp definitions
4310//===----------------------------------------------------------------------===//
4311
4312namespace detail {
4313
4315
4316
4317} // namespace detail
4319
4320::llvm::LogicalResult SignedIntDivFeltOpAdaptor::verify(::mlir::Location loc) {
4321 return ::mlir::success();
4322}
4323
4324::llvm::LogicalResult SignedIntDivFeltOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
4325 ::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
4326 if (!dict) {
4327 emitError() << "expected DictionaryAttr to set properties";
4328 return ::mlir::failure();
4329 }
4330 return ::mlir::success();
4331}
4332
4333::mlir::Attribute SignedIntDivFeltOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
4334 ::mlir::SmallVector<::mlir::NamedAttribute> attrs;
4335 ::mlir::Builder odsBuilder{ctx};
4336
4337 if (!attrs.empty())
4338 return odsBuilder.getDictionaryAttr(attrs);
4339 return {};
4340}
4341
4343 using llvm::hash_value;
4344 return llvm::hash_combine();
4345}
4346
4347std::optional<mlir::Attribute> SignedIntDivFeltOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
4348 return std::nullopt;
4349}
4350
4351void SignedIntDivFeltOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
4352}
4353
4354void SignedIntDivFeltOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
4355}
4356
4357::llvm::LogicalResult SignedIntDivFeltOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
4358 return ::mlir::success();
4359}
4360
4361void SignedIntDivFeltOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs) {
4362 odsState.addOperands(lhs);
4363 odsState.addOperands(rhs);
4364 odsState.addTypes(result);
4365}
4366
4367SignedIntDivFeltOp SignedIntDivFeltOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs) {
4368 ::mlir::OperationState __state__(location, getOperationName());
4369 build(builder, __state__, std::forward<decltype(result)>(result), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs));
4370 auto __res__ = ::llvm::dyn_cast<SignedIntDivFeltOp>(builder.create(__state__));
4371 assert(__res__ && "builder didn't return the right type");
4372 return __res__;
4373}
4374
4375SignedIntDivFeltOp SignedIntDivFeltOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs) {
4376 return create(builder, builder.getLoc(), std::forward<decltype(result)>(result), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs));
4377}
4378
4379void SignedIntDivFeltOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value lhs, ::mlir::Value rhs) {
4380 odsState.addOperands(lhs);
4381 odsState.addOperands(rhs);
4382
4383 ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
4384 if (::mlir::succeeded(SignedIntDivFeltOp::inferReturnTypes(odsBuilder.getContext(),
4385 odsState.location, odsState.operands,
4386 odsState.attributes.getDictionary(odsState.getContext()),
4387 odsState.getRawProperties(),
4388 odsState.regions, inferredReturnTypes)))
4389 odsState.addTypes(inferredReturnTypes);
4390 else
4391 ::mlir::detail::reportFatalInferReturnTypesError(odsState);
4392
4393}
4394
4395SignedIntDivFeltOp SignedIntDivFeltOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value lhs, ::mlir::Value rhs) {
4396 ::mlir::OperationState __state__(location, getOperationName());
4397 build(builder, __state__, std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs));
4398 auto __res__ = ::llvm::dyn_cast<SignedIntDivFeltOp>(builder.create(__state__));
4399 assert(__res__ && "builder didn't return the right type");
4400 return __res__;
4401}
4402
4403SignedIntDivFeltOp SignedIntDivFeltOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value lhs, ::mlir::Value rhs) {
4404 return create(builder, builder.getLoc(), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs));
4405}
4406
4407void SignedIntDivFeltOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs) {
4408 odsState.addOperands(lhs);
4409 odsState.addOperands(rhs);
4410 assert(resultTypes.size() == 1u && "mismatched number of results");
4411 odsState.addTypes(resultTypes);
4412}
4413
4414SignedIntDivFeltOp SignedIntDivFeltOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs) {
4415 ::mlir::OperationState __state__(location, getOperationName());
4416 build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs));
4417 auto __res__ = ::llvm::dyn_cast<SignedIntDivFeltOp>(builder.create(__state__));
4418 assert(__res__ && "builder didn't return the right type");
4419 return __res__;
4420}
4421
4422SignedIntDivFeltOp SignedIntDivFeltOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs) {
4423 return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs));
4424}
4425
4426void SignedIntDivFeltOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
4427 assert(operands.size() == 2u && "mismatched number of parameters");
4428 odsState.addOperands(operands);
4429 odsState.addAttributes(attributes);
4430 assert(resultTypes.size() == 1u && "mismatched number of return types");
4431 odsState.addTypes(resultTypes);
4432}
4433
4434SignedIntDivFeltOp SignedIntDivFeltOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
4435 ::mlir::OperationState __state__(location, getOperationName());
4436 build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
4437 auto __res__ = ::llvm::dyn_cast<SignedIntDivFeltOp>(builder.create(__state__));
4438 assert(__res__ && "builder didn't return the right type");
4439 return __res__;
4440}
4441
4442SignedIntDivFeltOp SignedIntDivFeltOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
4443 return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
4444}
4445
4446void SignedIntDivFeltOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
4447 assert(operands.size() == 2u && "mismatched number of parameters");
4448 odsState.addOperands(operands);
4449 odsState.addAttributes(attributes);
4450
4451 ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
4452 if (::mlir::succeeded(SignedIntDivFeltOp::inferReturnTypes(odsBuilder.getContext(),
4453 odsState.location, operands,
4454 odsState.attributes.getDictionary(odsState.getContext()),
4455 odsState.getRawProperties(),
4456 odsState.regions, inferredReturnTypes))) {
4457 assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
4458 odsState.addTypes(inferredReturnTypes);
4459 } else {
4460 ::llvm::report_fatal_error("Failed to infer result type(s).");
4461 }
4462}
4463
4464SignedIntDivFeltOp SignedIntDivFeltOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
4465 ::mlir::OperationState __state__(location, getOperationName());
4466 build(builder, __state__, std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
4467 auto __res__ = ::llvm::dyn_cast<SignedIntDivFeltOp>(builder.create(__state__));
4468 assert(__res__ && "builder didn't return the right type");
4469 return __res__;
4470}
4471
4472SignedIntDivFeltOp SignedIntDivFeltOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
4473 return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
4474}
4475
4476void SignedIntDivFeltOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
4477 assert(operands.size() == 2u && "mismatched number of parameters");
4478 odsState.addOperands(operands);
4479 odsState.useProperties(const_cast<Properties&>(properties));
4480 odsState.addAttributes(discardableAttributes);
4481 assert(resultTypes.size() == 1u && "mismatched number of return types");
4482 odsState.addTypes(resultTypes);
4483}
4484
4485SignedIntDivFeltOp SignedIntDivFeltOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
4486 ::mlir::OperationState __state__(location, getOperationName());
4487 build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
4488 auto __res__ = ::llvm::dyn_cast<SignedIntDivFeltOp>(builder.create(__state__));
4489 assert(__res__ && "builder didn't return the right type");
4490 return __res__;
4491}
4492
4493SignedIntDivFeltOp SignedIntDivFeltOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
4494 return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
4495}
4496
4497void SignedIntDivFeltOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
4498 assert(operands.size() == 2u && "mismatched number of parameters");
4499 odsState.addOperands(operands);
4500 odsState.useProperties(const_cast<Properties &>(properties));
4501 odsState.addAttributes(discardableAttributes);
4502
4503 ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
4504 if (::mlir::succeeded(SignedIntDivFeltOp::inferReturnTypes(odsBuilder.getContext(),
4505 odsState.location, operands,
4506 odsState.attributes.getDictionary(odsState.getContext()),
4507 odsState.getRawProperties(),
4508 odsState.regions, inferredReturnTypes))) {
4509 assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
4510 odsState.addTypes(inferredReturnTypes);
4511 } else {
4512 ::llvm::report_fatal_error("Failed to infer result type(s).");
4513 }
4514}
4515
4516SignedIntDivFeltOp SignedIntDivFeltOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
4517 ::mlir::OperationState __state__(location, getOperationName());
4518 build(builder, __state__, std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
4519 auto __res__ = ::llvm::dyn_cast<SignedIntDivFeltOp>(builder.create(__state__));
4520 assert(__res__ && "builder didn't return the right type");
4521 return __res__;
4522}
4523
4524SignedIntDivFeltOp SignedIntDivFeltOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
4525 return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
4526}
4527
4529 {
4530 unsigned index = 0; (void)index;
4531 auto valueGroup0 = getODSOperands(0);
4532
4533 for (auto v : valueGroup0) {
4534 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops1(*this, v.getType(), "operand", index++)))
4535 return ::mlir::failure();
4536 }
4537 auto valueGroup1 = getODSOperands(1);
4538
4539 for (auto v : valueGroup1) {
4540 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops1(*this, v.getType(), "operand", index++)))
4541 return ::mlir::failure();
4542 }
4543 }
4544 {
4545 unsigned index = 0; (void)index;
4546 auto valueGroup0 = getODSResults(0);
4547
4548 for (auto v : valueGroup0) {
4549 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops2(*this, v.getType(), "result", index++)))
4550 return ::mlir::failure();
4551 }
4552 }
4553 if (!((::llzk::typesUnify((*this->getODSOperands(0).begin()).getType(), (*this->getODSOperands(1).begin()).getType()))))
4554 return emitOpError("failed to verify that rhs type matches with lhs type");
4555 if (!((::llzk::typesUnify((*this->getODSOperands(0).begin()).getType(), (*this->getODSResults(0).begin()).getType()))))
4556 return emitOpError("failed to verify that result type matches with lhs type");
4557 if (!((::llzk::typesUnify((*this->getODSOperands(1).begin()).getType(), (*this->getODSResults(0).begin()).getType()))))
4558 return emitOpError("failed to verify that result type matches with rhs type");
4559 return ::mlir::success();
4560}
4561
4563 return verifyInvariantsImpl();
4564}
4565
4566::mlir::ParseResult SignedIntDivFeltOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
4567 ::mlir::OpAsmParser::UnresolvedOperand lhsRawOperand{};
4568 ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> lhsOperands(&lhsRawOperand, 1); ::llvm::SMLoc lhsOperandsLoc;
4569 (void)lhsOperandsLoc;
4570 ::mlir::OpAsmParser::UnresolvedOperand rhsRawOperand{};
4571 ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> rhsOperands(&rhsRawOperand, 1); ::llvm::SMLoc rhsOperandsLoc;
4572 (void)rhsOperandsLoc;
4573 ::mlir::Type lhsRawType{};
4574 ::llvm::ArrayRef<::mlir::Type> lhsTypes(&lhsRawType, 1);
4575 ::mlir::Type rhsRawType{};
4576 ::llvm::ArrayRef<::mlir::Type> rhsTypes(&rhsRawType, 1);
4577
4578 lhsOperandsLoc = parser.getCurrentLocation();
4579 if (parser.parseOperand(lhsRawOperand))
4580 return ::mlir::failure();
4581 if (parser.parseComma())
4582 return ::mlir::failure();
4583
4584 rhsOperandsLoc = parser.getCurrentLocation();
4585 if (parser.parseOperand(rhsRawOperand))
4586 return ::mlir::failure();
4587 {
4588 auto odsResult = parseInferredOrParsedType(parser, lhsRawType, true);
4589 if (odsResult) return ::mlir::failure();
4590 }
4591 {
4592 auto odsResult = parseInferredOrParsedType(parser, rhsRawType, false);
4593 if (odsResult) return ::mlir::failure();
4594 }
4595 {
4596 auto loc = parser.getCurrentLocation();(void)loc;
4597 if (parser.parseOptionalAttrDict(result.attributes))
4598 return ::mlir::failure();
4599 if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() {
4600 return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op ";
4601 })))
4602 return ::mlir::failure();
4603 }
4604 if (parser.resolveOperands(lhsOperands, lhsTypes, lhsOperandsLoc, result.operands))
4605 return ::mlir::failure();
4606 if (parser.resolveOperands(rhsOperands, rhsTypes, rhsOperandsLoc, result.operands))
4607 return ::mlir::failure();
4608
4609 ::llvm::SmallVector<::mlir::Type> inferredReturnTypes;
4610 if (::mlir::failed(SignedIntDivFeltOp::inferReturnTypes(parser.getContext(),
4611 result.location, result.operands,
4612 result.attributes.getDictionary(parser.getContext()),
4613 result.getRawProperties(),
4614 result.regions, inferredReturnTypes)))
4615 return ::mlir::failure();
4616 result.addTypes(inferredReturnTypes);
4617 return ::mlir::success();
4618}
4619
4620void SignedIntDivFeltOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
4621 _odsPrinter << ' ';
4622 _odsPrinter << getLhs();
4623 _odsPrinter << ",";
4624 _odsPrinter << ' ';
4625 _odsPrinter << getRhs();
4626 printInferredOrParsedType(_odsPrinter, *this, getLhs().getType(), true);
4627 printInferredOrParsedType(_odsPrinter, *this, getRhs().getType(), false);
4628 ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
4629 _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
4630}
4631
4632void SignedIntDivFeltOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
4633}
4634
4635 ::llvm::LogicalResult
4636 SignedIntDivFeltOp::inferReturnTypes(::mlir::MLIRContext *context,
4637 std::optional<::mlir::Location> location,
4638 ::mlir::ValueRange operands, ::mlir::DictionaryAttr attributes,
4639 ::mlir::PropertyRef properties, ::mlir::RegionRange regions,
4640 ::llvm::SmallVectorImpl<::mlir::Type> &inferredReturnTypes) {
4641 SignedIntDivFeltOp::Adaptor adaptor(operands, attributes, properties, regions);
4643 location, adaptor, inferredReturnTypes);
4644 }
4645
4646
4647::llvm::LogicalResult SignedIntDivFeltOp::inferReturnTypes(
4648 mlir::MLIRContext *context, std::optional<mlir::Location> loc, Adaptor adaptor,
4649 llvm::SmallVectorImpl<mlir::Type> &inferred
4650) {
4651 inferred.resize(1);
4652 auto value = adaptor.getLhs();
4653 inferred[0] = value ? value.getType() : FeltType::get(context, mlir::StringAttr());
4654 return mlir::success();
4655}
4656
4657bool SignedIntDivFeltOp::isCompatibleReturnTypes(mlir::TypeRange l, mlir::TypeRange r) {
4658 return l == r;
4659}
4660
4661} // namespace llzk::felt
4662MLIR_DEFINE_EXPLICIT_TYPE_ID(::llzk::felt::SignedIntDivFeltOp)
4663
4664namespace llzk::felt {
4665
4666
4667//===----------------------------------------------------------------------===//
4668// ::llzk::felt::SignedModFeltOp definitions
4669//===----------------------------------------------------------------------===//
4670
4671namespace detail {
4672
4674
4675
4676} // namespace detail
4678
4679::llvm::LogicalResult SignedModFeltOpAdaptor::verify(::mlir::Location loc) {
4680 return ::mlir::success();
4681}
4682
4683::llvm::LogicalResult SignedModFeltOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
4684 ::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
4685 if (!dict) {
4686 emitError() << "expected DictionaryAttr to set properties";
4687 return ::mlir::failure();
4688 }
4689 return ::mlir::success();
4690}
4691
4692::mlir::Attribute SignedModFeltOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
4693 ::mlir::SmallVector<::mlir::NamedAttribute> attrs;
4694 ::mlir::Builder odsBuilder{ctx};
4695
4696 if (!attrs.empty())
4697 return odsBuilder.getDictionaryAttr(attrs);
4698 return {};
4699}
4700
4702 using llvm::hash_value;
4703 return llvm::hash_combine();
4704}
4705
4706std::optional<mlir::Attribute> SignedModFeltOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
4707 return std::nullopt;
4708}
4709
4710void SignedModFeltOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
4711}
4712
4713void SignedModFeltOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
4714}
4715
4716::llvm::LogicalResult SignedModFeltOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
4717 return ::mlir::success();
4718}
4719
4720void SignedModFeltOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs) {
4721 odsState.addOperands(lhs);
4722 odsState.addOperands(rhs);
4723 odsState.addTypes(result);
4724}
4725
4726SignedModFeltOp SignedModFeltOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs) {
4727 ::mlir::OperationState __state__(location, getOperationName());
4728 build(builder, __state__, std::forward<decltype(result)>(result), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs));
4729 auto __res__ = ::llvm::dyn_cast<SignedModFeltOp>(builder.create(__state__));
4730 assert(__res__ && "builder didn't return the right type");
4731 return __res__;
4732}
4733
4734SignedModFeltOp SignedModFeltOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs) {
4735 return create(builder, builder.getLoc(), std::forward<decltype(result)>(result), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs));
4736}
4737
4738void SignedModFeltOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value lhs, ::mlir::Value rhs) {
4739 odsState.addOperands(lhs);
4740 odsState.addOperands(rhs);
4741
4742 ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
4743 if (::mlir::succeeded(SignedModFeltOp::inferReturnTypes(odsBuilder.getContext(),
4744 odsState.location, odsState.operands,
4745 odsState.attributes.getDictionary(odsState.getContext()),
4746 odsState.getRawProperties(),
4747 odsState.regions, inferredReturnTypes)))
4748 odsState.addTypes(inferredReturnTypes);
4749 else
4750 ::mlir::detail::reportFatalInferReturnTypesError(odsState);
4751
4752}
4753
4754SignedModFeltOp SignedModFeltOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value lhs, ::mlir::Value rhs) {
4755 ::mlir::OperationState __state__(location, getOperationName());
4756 build(builder, __state__, std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs));
4757 auto __res__ = ::llvm::dyn_cast<SignedModFeltOp>(builder.create(__state__));
4758 assert(__res__ && "builder didn't return the right type");
4759 return __res__;
4760}
4761
4762SignedModFeltOp SignedModFeltOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value lhs, ::mlir::Value rhs) {
4763 return create(builder, builder.getLoc(), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs));
4764}
4765
4766void SignedModFeltOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs) {
4767 odsState.addOperands(lhs);
4768 odsState.addOperands(rhs);
4769 assert(resultTypes.size() == 1u && "mismatched number of results");
4770 odsState.addTypes(resultTypes);
4771}
4772
4773SignedModFeltOp SignedModFeltOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs) {
4774 ::mlir::OperationState __state__(location, getOperationName());
4775 build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs));
4776 auto __res__ = ::llvm::dyn_cast<SignedModFeltOp>(builder.create(__state__));
4777 assert(__res__ && "builder didn't return the right type");
4778 return __res__;
4779}
4780
4781SignedModFeltOp SignedModFeltOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs) {
4782 return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs));
4783}
4784
4785void SignedModFeltOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
4786 assert(operands.size() == 2u && "mismatched number of parameters");
4787 odsState.addOperands(operands);
4788 odsState.addAttributes(attributes);
4789 assert(resultTypes.size() == 1u && "mismatched number of return types");
4790 odsState.addTypes(resultTypes);
4791}
4792
4793SignedModFeltOp SignedModFeltOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
4794 ::mlir::OperationState __state__(location, getOperationName());
4795 build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
4796 auto __res__ = ::llvm::dyn_cast<SignedModFeltOp>(builder.create(__state__));
4797 assert(__res__ && "builder didn't return the right type");
4798 return __res__;
4799}
4800
4801SignedModFeltOp SignedModFeltOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
4802 return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
4803}
4804
4805void SignedModFeltOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
4806 assert(operands.size() == 2u && "mismatched number of parameters");
4807 odsState.addOperands(operands);
4808 odsState.addAttributes(attributes);
4809
4810 ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
4811 if (::mlir::succeeded(SignedModFeltOp::inferReturnTypes(odsBuilder.getContext(),
4812 odsState.location, operands,
4813 odsState.attributes.getDictionary(odsState.getContext()),
4814 odsState.getRawProperties(),
4815 odsState.regions, inferredReturnTypes))) {
4816 assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
4817 odsState.addTypes(inferredReturnTypes);
4818 } else {
4819 ::llvm::report_fatal_error("Failed to infer result type(s).");
4820 }
4821}
4822
4823SignedModFeltOp SignedModFeltOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
4824 ::mlir::OperationState __state__(location, getOperationName());
4825 build(builder, __state__, std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
4826 auto __res__ = ::llvm::dyn_cast<SignedModFeltOp>(builder.create(__state__));
4827 assert(__res__ && "builder didn't return the right type");
4828 return __res__;
4829}
4830
4831SignedModFeltOp SignedModFeltOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
4832 return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
4833}
4834
4835void SignedModFeltOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
4836 assert(operands.size() == 2u && "mismatched number of parameters");
4837 odsState.addOperands(operands);
4838 odsState.useProperties(const_cast<Properties&>(properties));
4839 odsState.addAttributes(discardableAttributes);
4840 assert(resultTypes.size() == 1u && "mismatched number of return types");
4841 odsState.addTypes(resultTypes);
4842}
4843
4844SignedModFeltOp SignedModFeltOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
4845 ::mlir::OperationState __state__(location, getOperationName());
4846 build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
4847 auto __res__ = ::llvm::dyn_cast<SignedModFeltOp>(builder.create(__state__));
4848 assert(__res__ && "builder didn't return the right type");
4849 return __res__;
4850}
4851
4852SignedModFeltOp SignedModFeltOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
4853 return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
4854}
4855
4856void SignedModFeltOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
4857 assert(operands.size() == 2u && "mismatched number of parameters");
4858 odsState.addOperands(operands);
4859 odsState.useProperties(const_cast<Properties &>(properties));
4860 odsState.addAttributes(discardableAttributes);
4861
4862 ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
4863 if (::mlir::succeeded(SignedModFeltOp::inferReturnTypes(odsBuilder.getContext(),
4864 odsState.location, operands,
4865 odsState.attributes.getDictionary(odsState.getContext()),
4866 odsState.getRawProperties(),
4867 odsState.regions, inferredReturnTypes))) {
4868 assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
4869 odsState.addTypes(inferredReturnTypes);
4870 } else {
4871 ::llvm::report_fatal_error("Failed to infer result type(s).");
4872 }
4873}
4874
4875SignedModFeltOp SignedModFeltOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
4876 ::mlir::OperationState __state__(location, getOperationName());
4877 build(builder, __state__, std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
4878 auto __res__ = ::llvm::dyn_cast<SignedModFeltOp>(builder.create(__state__));
4879 assert(__res__ && "builder didn't return the right type");
4880 return __res__;
4881}
4882
4883SignedModFeltOp SignedModFeltOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
4884 return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
4885}
4886
4888 {
4889 unsigned index = 0; (void)index;
4890 auto valueGroup0 = getODSOperands(0);
4891
4892 for (auto v : valueGroup0) {
4893 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops1(*this, v.getType(), "operand", index++)))
4894 return ::mlir::failure();
4895 }
4896 auto valueGroup1 = getODSOperands(1);
4897
4898 for (auto v : valueGroup1) {
4899 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops1(*this, v.getType(), "operand", index++)))
4900 return ::mlir::failure();
4901 }
4902 }
4903 {
4904 unsigned index = 0; (void)index;
4905 auto valueGroup0 = getODSResults(0);
4906
4907 for (auto v : valueGroup0) {
4908 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops2(*this, v.getType(), "result", index++)))
4909 return ::mlir::failure();
4910 }
4911 }
4912 if (!((::llzk::typesUnify((*this->getODSOperands(0).begin()).getType(), (*this->getODSOperands(1).begin()).getType()))))
4913 return emitOpError("failed to verify that rhs type matches with lhs type");
4914 if (!((::llzk::typesUnify((*this->getODSOperands(0).begin()).getType(), (*this->getODSResults(0).begin()).getType()))))
4915 return emitOpError("failed to verify that result type matches with lhs type");
4916 if (!((::llzk::typesUnify((*this->getODSOperands(1).begin()).getType(), (*this->getODSResults(0).begin()).getType()))))
4917 return emitOpError("failed to verify that result type matches with rhs type");
4918 return ::mlir::success();
4919}
4920
4921::llvm::LogicalResult SignedModFeltOp::verifyInvariants() {
4922 return verifyInvariantsImpl();
4923}
4924
4925::mlir::ParseResult SignedModFeltOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
4926 ::mlir::OpAsmParser::UnresolvedOperand lhsRawOperand{};
4927 ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> lhsOperands(&lhsRawOperand, 1); ::llvm::SMLoc lhsOperandsLoc;
4928 (void)lhsOperandsLoc;
4929 ::mlir::OpAsmParser::UnresolvedOperand rhsRawOperand{};
4930 ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> rhsOperands(&rhsRawOperand, 1); ::llvm::SMLoc rhsOperandsLoc;
4931 (void)rhsOperandsLoc;
4932 ::mlir::Type lhsRawType{};
4933 ::llvm::ArrayRef<::mlir::Type> lhsTypes(&lhsRawType, 1);
4934 ::mlir::Type rhsRawType{};
4935 ::llvm::ArrayRef<::mlir::Type> rhsTypes(&rhsRawType, 1);
4936
4937 lhsOperandsLoc = parser.getCurrentLocation();
4938 if (parser.parseOperand(lhsRawOperand))
4939 return ::mlir::failure();
4940 if (parser.parseComma())
4941 return ::mlir::failure();
4942
4943 rhsOperandsLoc = parser.getCurrentLocation();
4944 if (parser.parseOperand(rhsRawOperand))
4945 return ::mlir::failure();
4946 {
4947 auto odsResult = parseInferredOrParsedType(parser, lhsRawType, true);
4948 if (odsResult) return ::mlir::failure();
4949 }
4950 {
4951 auto odsResult = parseInferredOrParsedType(parser, rhsRawType, false);
4952 if (odsResult) return ::mlir::failure();
4953 }
4954 {
4955 auto loc = parser.getCurrentLocation();(void)loc;
4956 if (parser.parseOptionalAttrDict(result.attributes))
4957 return ::mlir::failure();
4958 if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() {
4959 return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op ";
4960 })))
4961 return ::mlir::failure();
4962 }
4963 if (parser.resolveOperands(lhsOperands, lhsTypes, lhsOperandsLoc, result.operands))
4964 return ::mlir::failure();
4965 if (parser.resolveOperands(rhsOperands, rhsTypes, rhsOperandsLoc, result.operands))
4966 return ::mlir::failure();
4967
4968 ::llvm::SmallVector<::mlir::Type> inferredReturnTypes;
4969 if (::mlir::failed(SignedModFeltOp::inferReturnTypes(parser.getContext(),
4970 result.location, result.operands,
4971 result.attributes.getDictionary(parser.getContext()),
4972 result.getRawProperties(),
4973 result.regions, inferredReturnTypes)))
4974 return ::mlir::failure();
4975 result.addTypes(inferredReturnTypes);
4976 return ::mlir::success();
4977}
4978
4979void SignedModFeltOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
4980 _odsPrinter << ' ';
4981 _odsPrinter << getLhs();
4982 _odsPrinter << ",";
4983 _odsPrinter << ' ';
4984 _odsPrinter << getRhs();
4985 printInferredOrParsedType(_odsPrinter, *this, getLhs().getType(), true);
4986 printInferredOrParsedType(_odsPrinter, *this, getRhs().getType(), false);
4987 ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
4988 _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
4989}
4990
4991void SignedModFeltOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
4992}
4993
4994 ::llvm::LogicalResult
4995 SignedModFeltOp::inferReturnTypes(::mlir::MLIRContext *context,
4996 std::optional<::mlir::Location> location,
4997 ::mlir::ValueRange operands, ::mlir::DictionaryAttr attributes,
4998 ::mlir::PropertyRef properties, ::mlir::RegionRange regions,
4999 ::llvm::SmallVectorImpl<::mlir::Type> &inferredReturnTypes) {
5000 SignedModFeltOp::Adaptor adaptor(operands, attributes, properties, regions);
5001 return SignedModFeltOp::inferReturnTypes(context,
5002 location, adaptor, inferredReturnTypes);
5003 }
5004
5005
5006::llvm::LogicalResult SignedModFeltOp::inferReturnTypes(
5007 mlir::MLIRContext *context, std::optional<mlir::Location> loc, Adaptor adaptor,
5008 llvm::SmallVectorImpl<mlir::Type> &inferred
5009) {
5010 inferred.resize(1);
5011 auto value = adaptor.getLhs();
5012 inferred[0] = value ? value.getType() : FeltType::get(context, mlir::StringAttr());
5013 return mlir::success();
5014}
5015
5016bool SignedModFeltOp::isCompatibleReturnTypes(mlir::TypeRange l, mlir::TypeRange r) {
5017 return l == r;
5018}
5019
5020} // namespace llzk::felt
5021MLIR_DEFINE_EXPLICIT_TYPE_ID(::llzk::felt::SignedModFeltOp)
5022
5023namespace llzk::felt {
5024
5025
5026//===----------------------------------------------------------------------===//
5027// ::llzk::felt::SubFeltOp definitions
5028//===----------------------------------------------------------------------===//
5029
5030namespace detail {
5031
5032SubFeltOpGenericAdaptorBase::SubFeltOpGenericAdaptorBase(SubFeltOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
5033
5034
5035} // namespace detail
5037
5038::llvm::LogicalResult SubFeltOpAdaptor::verify(::mlir::Location loc) {
5039 return ::mlir::success();
5040}
5041
5042::llvm::LogicalResult SubFeltOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
5043 ::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
5044 if (!dict) {
5045 emitError() << "expected DictionaryAttr to set properties";
5046 return ::mlir::failure();
5047 }
5048 return ::mlir::success();
5049}
5050
5051::mlir::Attribute SubFeltOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
5052 ::mlir::SmallVector<::mlir::NamedAttribute> attrs;
5053 ::mlir::Builder odsBuilder{ctx};
5054
5055 if (!attrs.empty())
5056 return odsBuilder.getDictionaryAttr(attrs);
5057 return {};
5058}
5059
5060llvm::hash_code SubFeltOp::computePropertiesHash(const Properties &prop) {
5061 using llvm::hash_value;
5062 return llvm::hash_combine();
5063}
5064
5065std::optional<mlir::Attribute> SubFeltOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
5066 return std::nullopt;
5067}
5068
5069void SubFeltOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
5070}
5071
5072void SubFeltOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
5073}
5074
5075::llvm::LogicalResult SubFeltOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
5076 return ::mlir::success();
5077}
5078
5079void SubFeltOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs) {
5080 odsState.addOperands(lhs);
5081 odsState.addOperands(rhs);
5082 odsState.addTypes(result);
5083}
5084
5085SubFeltOp SubFeltOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs) {
5086 ::mlir::OperationState __state__(location, getOperationName());
5087 build(builder, __state__, std::forward<decltype(result)>(result), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs));
5088 auto __res__ = ::llvm::dyn_cast<SubFeltOp>(builder.create(__state__));
5089 assert(__res__ && "builder didn't return the right type");
5090 return __res__;
5091}
5092
5093SubFeltOp SubFeltOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs) {
5094 return create(builder, builder.getLoc(), std::forward<decltype(result)>(result), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs));
5095}
5096
5097void SubFeltOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value lhs, ::mlir::Value rhs) {
5098 odsState.addOperands(lhs);
5099 odsState.addOperands(rhs);
5100
5101 ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
5102 if (::mlir::succeeded(SubFeltOp::inferReturnTypes(odsBuilder.getContext(),
5103 odsState.location, odsState.operands,
5104 odsState.attributes.getDictionary(odsState.getContext()),
5105 odsState.getRawProperties(),
5106 odsState.regions, inferredReturnTypes)))
5107 odsState.addTypes(inferredReturnTypes);
5108 else
5109 ::mlir::detail::reportFatalInferReturnTypesError(odsState);
5110
5111}
5112
5113SubFeltOp SubFeltOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value lhs, ::mlir::Value rhs) {
5114 ::mlir::OperationState __state__(location, getOperationName());
5115 build(builder, __state__, std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs));
5116 auto __res__ = ::llvm::dyn_cast<SubFeltOp>(builder.create(__state__));
5117 assert(__res__ && "builder didn't return the right type");
5118 return __res__;
5119}
5120
5121SubFeltOp SubFeltOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value lhs, ::mlir::Value rhs) {
5122 return create(builder, builder.getLoc(), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs));
5123}
5124
5125void SubFeltOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs) {
5126 odsState.addOperands(lhs);
5127 odsState.addOperands(rhs);
5128 assert(resultTypes.size() == 1u && "mismatched number of results");
5129 odsState.addTypes(resultTypes);
5130}
5131
5132SubFeltOp SubFeltOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs) {
5133 ::mlir::OperationState __state__(location, getOperationName());
5134 build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs));
5135 auto __res__ = ::llvm::dyn_cast<SubFeltOp>(builder.create(__state__));
5136 assert(__res__ && "builder didn't return the right type");
5137 return __res__;
5138}
5139
5140SubFeltOp SubFeltOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs) {
5141 return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs));
5142}
5143
5144void SubFeltOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
5145 assert(operands.size() == 2u && "mismatched number of parameters");
5146 odsState.addOperands(operands);
5147 odsState.addAttributes(attributes);
5148 assert(resultTypes.size() == 1u && "mismatched number of return types");
5149 odsState.addTypes(resultTypes);
5150}
5151
5152SubFeltOp SubFeltOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
5153 ::mlir::OperationState __state__(location, getOperationName());
5154 build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
5155 auto __res__ = ::llvm::dyn_cast<SubFeltOp>(builder.create(__state__));
5156 assert(__res__ && "builder didn't return the right type");
5157 return __res__;
5158}
5159
5160SubFeltOp SubFeltOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
5161 return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
5162}
5163
5164void SubFeltOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
5165 assert(operands.size() == 2u && "mismatched number of parameters");
5166 odsState.addOperands(operands);
5167 odsState.addAttributes(attributes);
5168
5169 ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
5170 if (::mlir::succeeded(SubFeltOp::inferReturnTypes(odsBuilder.getContext(),
5171 odsState.location, operands,
5172 odsState.attributes.getDictionary(odsState.getContext()),
5173 odsState.getRawProperties(),
5174 odsState.regions, inferredReturnTypes))) {
5175 assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
5176 odsState.addTypes(inferredReturnTypes);
5177 } else {
5178 ::llvm::report_fatal_error("Failed to infer result type(s).");
5179 }
5180}
5181
5182SubFeltOp SubFeltOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
5183 ::mlir::OperationState __state__(location, getOperationName());
5184 build(builder, __state__, std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
5185 auto __res__ = ::llvm::dyn_cast<SubFeltOp>(builder.create(__state__));
5186 assert(__res__ && "builder didn't return the right type");
5187 return __res__;
5188}
5189
5190SubFeltOp SubFeltOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
5191 return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
5192}
5193
5194void SubFeltOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
5195 assert(operands.size() == 2u && "mismatched number of parameters");
5196 odsState.addOperands(operands);
5197 odsState.useProperties(const_cast<Properties&>(properties));
5198 odsState.addAttributes(discardableAttributes);
5199 assert(resultTypes.size() == 1u && "mismatched number of return types");
5200 odsState.addTypes(resultTypes);
5201}
5202
5203SubFeltOp SubFeltOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
5204 ::mlir::OperationState __state__(location, getOperationName());
5205 build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
5206 auto __res__ = ::llvm::dyn_cast<SubFeltOp>(builder.create(__state__));
5207 assert(__res__ && "builder didn't return the right type");
5208 return __res__;
5209}
5210
5211SubFeltOp SubFeltOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
5212 return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
5213}
5214
5215void SubFeltOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
5216 assert(operands.size() == 2u && "mismatched number of parameters");
5217 odsState.addOperands(operands);
5218 odsState.useProperties(const_cast<Properties &>(properties));
5219 odsState.addAttributes(discardableAttributes);
5220
5221 ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
5222 if (::mlir::succeeded(SubFeltOp::inferReturnTypes(odsBuilder.getContext(),
5223 odsState.location, operands,
5224 odsState.attributes.getDictionary(odsState.getContext()),
5225 odsState.getRawProperties(),
5226 odsState.regions, inferredReturnTypes))) {
5227 assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
5228 odsState.addTypes(inferredReturnTypes);
5229 } else {
5230 ::llvm::report_fatal_error("Failed to infer result type(s).");
5231 }
5232}
5233
5234SubFeltOp SubFeltOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
5235 ::mlir::OperationState __state__(location, getOperationName());
5236 build(builder, __state__, std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
5237 auto __res__ = ::llvm::dyn_cast<SubFeltOp>(builder.create(__state__));
5238 assert(__res__ && "builder didn't return the right type");
5239 return __res__;
5240}
5241
5242SubFeltOp SubFeltOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
5243 return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
5244}
5245
5246::llvm::LogicalResult SubFeltOp::verifyInvariantsImpl() {
5247 {
5248 unsigned index = 0; (void)index;
5249 auto valueGroup0 = getODSOperands(0);
5250
5251 for (auto v : valueGroup0) {
5252 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops1(*this, v.getType(), "operand", index++)))
5253 return ::mlir::failure();
5254 }
5255 auto valueGroup1 = getODSOperands(1);
5256
5257 for (auto v : valueGroup1) {
5258 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops1(*this, v.getType(), "operand", index++)))
5259 return ::mlir::failure();
5260 }
5261 }
5262 {
5263 unsigned index = 0; (void)index;
5264 auto valueGroup0 = getODSResults(0);
5265
5266 for (auto v : valueGroup0) {
5267 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops2(*this, v.getType(), "result", index++)))
5268 return ::mlir::failure();
5269 }
5270 }
5271 if (!((::llzk::typesUnify((*this->getODSOperands(0).begin()).getType(), (*this->getODSOperands(1).begin()).getType()))))
5272 return emitOpError("failed to verify that rhs type matches with lhs type");
5273 if (!((::llzk::typesUnify((*this->getODSOperands(0).begin()).getType(), (*this->getODSResults(0).begin()).getType()))))
5274 return emitOpError("failed to verify that result type matches with lhs type");
5275 if (!((::llzk::typesUnify((*this->getODSOperands(1).begin()).getType(), (*this->getODSResults(0).begin()).getType()))))
5276 return emitOpError("failed to verify that result type matches with rhs type");
5277 return ::mlir::success();
5278}
5279
5280::llvm::LogicalResult SubFeltOp::verifyInvariants() {
5281 return verifyInvariantsImpl();
5282}
5283
5284::mlir::ParseResult SubFeltOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
5285 ::mlir::OpAsmParser::UnresolvedOperand lhsRawOperand{};
5286 ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> lhsOperands(&lhsRawOperand, 1); ::llvm::SMLoc lhsOperandsLoc;
5287 (void)lhsOperandsLoc;
5288 ::mlir::OpAsmParser::UnresolvedOperand rhsRawOperand{};
5289 ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> rhsOperands(&rhsRawOperand, 1); ::llvm::SMLoc rhsOperandsLoc;
5290 (void)rhsOperandsLoc;
5291 ::mlir::Type lhsRawType{};
5292 ::llvm::ArrayRef<::mlir::Type> lhsTypes(&lhsRawType, 1);
5293 ::mlir::Type rhsRawType{};
5294 ::llvm::ArrayRef<::mlir::Type> rhsTypes(&rhsRawType, 1);
5295
5296 lhsOperandsLoc = parser.getCurrentLocation();
5297 if (parser.parseOperand(lhsRawOperand))
5298 return ::mlir::failure();
5299 if (parser.parseComma())
5300 return ::mlir::failure();
5301
5302 rhsOperandsLoc = parser.getCurrentLocation();
5303 if (parser.parseOperand(rhsRawOperand))
5304 return ::mlir::failure();
5305 {
5306 auto odsResult = parseInferredOrParsedType(parser, lhsRawType, true);
5307 if (odsResult) return ::mlir::failure();
5308 }
5309 {
5310 auto odsResult = parseInferredOrParsedType(parser, rhsRawType, false);
5311 if (odsResult) return ::mlir::failure();
5312 }
5313 {
5314 auto loc = parser.getCurrentLocation();(void)loc;
5315 if (parser.parseOptionalAttrDict(result.attributes))
5316 return ::mlir::failure();
5317 if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() {
5318 return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op ";
5319 })))
5320 return ::mlir::failure();
5321 }
5322 if (parser.resolveOperands(lhsOperands, lhsTypes, lhsOperandsLoc, result.operands))
5323 return ::mlir::failure();
5324 if (parser.resolveOperands(rhsOperands, rhsTypes, rhsOperandsLoc, result.operands))
5325 return ::mlir::failure();
5326
5327 ::llvm::SmallVector<::mlir::Type> inferredReturnTypes;
5328 if (::mlir::failed(SubFeltOp::inferReturnTypes(parser.getContext(),
5329 result.location, result.operands,
5330 result.attributes.getDictionary(parser.getContext()),
5331 result.getRawProperties(),
5332 result.regions, inferredReturnTypes)))
5333 return ::mlir::failure();
5334 result.addTypes(inferredReturnTypes);
5335 return ::mlir::success();
5336}
5337
5338void SubFeltOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
5339 _odsPrinter << ' ';
5340 _odsPrinter << getLhs();
5341 _odsPrinter << ",";
5342 _odsPrinter << ' ';
5343 _odsPrinter << getRhs();
5344 printInferredOrParsedType(_odsPrinter, *this, getLhs().getType(), true);
5345 printInferredOrParsedType(_odsPrinter, *this, getRhs().getType(), false);
5346 ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
5347 _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
5348}
5349
5350void SubFeltOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
5351}
5352
5353 ::llvm::LogicalResult
5354 SubFeltOp::inferReturnTypes(::mlir::MLIRContext *context,
5355 std::optional<::mlir::Location> location,
5356 ::mlir::ValueRange operands, ::mlir::DictionaryAttr attributes,
5357 ::mlir::PropertyRef properties, ::mlir::RegionRange regions,
5358 ::llvm::SmallVectorImpl<::mlir::Type> &inferredReturnTypes) {
5359 SubFeltOp::Adaptor adaptor(operands, attributes, properties, regions);
5360 return SubFeltOp::inferReturnTypes(context,
5361 location, adaptor, inferredReturnTypes);
5362 }
5363
5364
5365::llvm::LogicalResult SubFeltOp::inferReturnTypes(
5366 mlir::MLIRContext *context, std::optional<mlir::Location> loc, Adaptor adaptor,
5367 llvm::SmallVectorImpl<mlir::Type> &inferred
5368) {
5369 inferred.resize(1);
5370 auto value = adaptor.getLhs();
5371 inferred[0] = value ? value.getType() : FeltType::get(context, mlir::StringAttr());
5372 return mlir::success();
5373}
5374
5375bool SubFeltOp::isCompatibleReturnTypes(mlir::TypeRange l, mlir::TypeRange r) {
5376 return l == r;
5377}
5378
5379} // namespace llzk::felt
5380MLIR_DEFINE_EXPLICIT_TYPE_ID(::llzk::felt::SubFeltOp)
5381
5382namespace llzk::felt {
5383
5384
5385//===----------------------------------------------------------------------===//
5386// ::llzk::felt::UnsignedIntDivFeltOp definitions
5387//===----------------------------------------------------------------------===//
5388
5389namespace detail {
5390
5392
5393
5394} // namespace detail
5396
5397::llvm::LogicalResult UnsignedIntDivFeltOpAdaptor::verify(::mlir::Location loc) {
5398 return ::mlir::success();
5399}
5400
5401::llvm::LogicalResult UnsignedIntDivFeltOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
5402 ::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
5403 if (!dict) {
5404 emitError() << "expected DictionaryAttr to set properties";
5405 return ::mlir::failure();
5406 }
5407 return ::mlir::success();
5408}
5409
5410::mlir::Attribute UnsignedIntDivFeltOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
5411 ::mlir::SmallVector<::mlir::NamedAttribute> attrs;
5412 ::mlir::Builder odsBuilder{ctx};
5413
5414 if (!attrs.empty())
5415 return odsBuilder.getDictionaryAttr(attrs);
5416 return {};
5417}
5418
5420 using llvm::hash_value;
5421 return llvm::hash_combine();
5422}
5423
5424std::optional<mlir::Attribute> UnsignedIntDivFeltOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
5425 return std::nullopt;
5426}
5427
5428void UnsignedIntDivFeltOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
5429}
5430
5431void UnsignedIntDivFeltOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
5432}
5433
5434::llvm::LogicalResult UnsignedIntDivFeltOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
5435 return ::mlir::success();
5436}
5437
5438void UnsignedIntDivFeltOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs) {
5439 odsState.addOperands(lhs);
5440 odsState.addOperands(rhs);
5441 odsState.addTypes(result);
5442}
5443
5444UnsignedIntDivFeltOp UnsignedIntDivFeltOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs) {
5445 ::mlir::OperationState __state__(location, getOperationName());
5446 build(builder, __state__, std::forward<decltype(result)>(result), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs));
5447 auto __res__ = ::llvm::dyn_cast<UnsignedIntDivFeltOp>(builder.create(__state__));
5448 assert(__res__ && "builder didn't return the right type");
5449 return __res__;
5450}
5451
5452UnsignedIntDivFeltOp UnsignedIntDivFeltOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs) {
5453 return create(builder, builder.getLoc(), std::forward<decltype(result)>(result), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs));
5454}
5455
5456void UnsignedIntDivFeltOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value lhs, ::mlir::Value rhs) {
5457 odsState.addOperands(lhs);
5458 odsState.addOperands(rhs);
5459
5460 ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
5461 if (::mlir::succeeded(UnsignedIntDivFeltOp::inferReturnTypes(odsBuilder.getContext(),
5462 odsState.location, odsState.operands,
5463 odsState.attributes.getDictionary(odsState.getContext()),
5464 odsState.getRawProperties(),
5465 odsState.regions, inferredReturnTypes)))
5466 odsState.addTypes(inferredReturnTypes);
5467 else
5468 ::mlir::detail::reportFatalInferReturnTypesError(odsState);
5469
5470}
5471
5472UnsignedIntDivFeltOp UnsignedIntDivFeltOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value lhs, ::mlir::Value rhs) {
5473 ::mlir::OperationState __state__(location, getOperationName());
5474 build(builder, __state__, std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs));
5475 auto __res__ = ::llvm::dyn_cast<UnsignedIntDivFeltOp>(builder.create(__state__));
5476 assert(__res__ && "builder didn't return the right type");
5477 return __res__;
5478}
5479
5480UnsignedIntDivFeltOp UnsignedIntDivFeltOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value lhs, ::mlir::Value rhs) {
5481 return create(builder, builder.getLoc(), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs));
5482}
5483
5484void UnsignedIntDivFeltOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs) {
5485 odsState.addOperands(lhs);
5486 odsState.addOperands(rhs);
5487 assert(resultTypes.size() == 1u && "mismatched number of results");
5488 odsState.addTypes(resultTypes);
5489}
5490
5491UnsignedIntDivFeltOp UnsignedIntDivFeltOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs) {
5492 ::mlir::OperationState __state__(location, getOperationName());
5493 build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs));
5494 auto __res__ = ::llvm::dyn_cast<UnsignedIntDivFeltOp>(builder.create(__state__));
5495 assert(__res__ && "builder didn't return the right type");
5496 return __res__;
5497}
5498
5499UnsignedIntDivFeltOp UnsignedIntDivFeltOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs) {
5500 return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs));
5501}
5502
5503void UnsignedIntDivFeltOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
5504 assert(operands.size() == 2u && "mismatched number of parameters");
5505 odsState.addOperands(operands);
5506 odsState.addAttributes(attributes);
5507 assert(resultTypes.size() == 1u && "mismatched number of return types");
5508 odsState.addTypes(resultTypes);
5509}
5510
5511UnsignedIntDivFeltOp UnsignedIntDivFeltOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
5512 ::mlir::OperationState __state__(location, getOperationName());
5513 build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
5514 auto __res__ = ::llvm::dyn_cast<UnsignedIntDivFeltOp>(builder.create(__state__));
5515 assert(__res__ && "builder didn't return the right type");
5516 return __res__;
5517}
5518
5519UnsignedIntDivFeltOp UnsignedIntDivFeltOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
5520 return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
5521}
5522
5523void UnsignedIntDivFeltOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
5524 assert(operands.size() == 2u && "mismatched number of parameters");
5525 odsState.addOperands(operands);
5526 odsState.addAttributes(attributes);
5527
5528 ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
5529 if (::mlir::succeeded(UnsignedIntDivFeltOp::inferReturnTypes(odsBuilder.getContext(),
5530 odsState.location, operands,
5531 odsState.attributes.getDictionary(odsState.getContext()),
5532 odsState.getRawProperties(),
5533 odsState.regions, inferredReturnTypes))) {
5534 assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
5535 odsState.addTypes(inferredReturnTypes);
5536 } else {
5537 ::llvm::report_fatal_error("Failed to infer result type(s).");
5538 }
5539}
5540
5541UnsignedIntDivFeltOp UnsignedIntDivFeltOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
5542 ::mlir::OperationState __state__(location, getOperationName());
5543 build(builder, __state__, std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
5544 auto __res__ = ::llvm::dyn_cast<UnsignedIntDivFeltOp>(builder.create(__state__));
5545 assert(__res__ && "builder didn't return the right type");
5546 return __res__;
5547}
5548
5549UnsignedIntDivFeltOp UnsignedIntDivFeltOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
5550 return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
5551}
5552
5553void UnsignedIntDivFeltOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
5554 assert(operands.size() == 2u && "mismatched number of parameters");
5555 odsState.addOperands(operands);
5556 odsState.useProperties(const_cast<Properties&>(properties));
5557 odsState.addAttributes(discardableAttributes);
5558 assert(resultTypes.size() == 1u && "mismatched number of return types");
5559 odsState.addTypes(resultTypes);
5560}
5561
5562UnsignedIntDivFeltOp UnsignedIntDivFeltOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
5563 ::mlir::OperationState __state__(location, getOperationName());
5564 build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
5565 auto __res__ = ::llvm::dyn_cast<UnsignedIntDivFeltOp>(builder.create(__state__));
5566 assert(__res__ && "builder didn't return the right type");
5567 return __res__;
5568}
5569
5570UnsignedIntDivFeltOp UnsignedIntDivFeltOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
5571 return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
5572}
5573
5574void UnsignedIntDivFeltOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
5575 assert(operands.size() == 2u && "mismatched number of parameters");
5576 odsState.addOperands(operands);
5577 odsState.useProperties(const_cast<Properties &>(properties));
5578 odsState.addAttributes(discardableAttributes);
5579
5580 ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
5581 if (::mlir::succeeded(UnsignedIntDivFeltOp::inferReturnTypes(odsBuilder.getContext(),
5582 odsState.location, operands,
5583 odsState.attributes.getDictionary(odsState.getContext()),
5584 odsState.getRawProperties(),
5585 odsState.regions, inferredReturnTypes))) {
5586 assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
5587 odsState.addTypes(inferredReturnTypes);
5588 } else {
5589 ::llvm::report_fatal_error("Failed to infer result type(s).");
5590 }
5591}
5592
5593UnsignedIntDivFeltOp UnsignedIntDivFeltOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
5594 ::mlir::OperationState __state__(location, getOperationName());
5595 build(builder, __state__, std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
5596 auto __res__ = ::llvm::dyn_cast<UnsignedIntDivFeltOp>(builder.create(__state__));
5597 assert(__res__ && "builder didn't return the right type");
5598 return __res__;
5599}
5600
5601UnsignedIntDivFeltOp UnsignedIntDivFeltOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
5602 return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
5603}
5604
5606 {
5607 unsigned index = 0; (void)index;
5608 auto valueGroup0 = getODSOperands(0);
5609
5610 for (auto v : valueGroup0) {
5611 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops1(*this, v.getType(), "operand", index++)))
5612 return ::mlir::failure();
5613 }
5614 auto valueGroup1 = getODSOperands(1);
5615
5616 for (auto v : valueGroup1) {
5617 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops1(*this, v.getType(), "operand", index++)))
5618 return ::mlir::failure();
5619 }
5620 }
5621 {
5622 unsigned index = 0; (void)index;
5623 auto valueGroup0 = getODSResults(0);
5624
5625 for (auto v : valueGroup0) {
5626 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops2(*this, v.getType(), "result", index++)))
5627 return ::mlir::failure();
5628 }
5629 }
5630 if (!((::llzk::typesUnify((*this->getODSOperands(0).begin()).getType(), (*this->getODSOperands(1).begin()).getType()))))
5631 return emitOpError("failed to verify that rhs type matches with lhs type");
5632 if (!((::llzk::typesUnify((*this->getODSOperands(0).begin()).getType(), (*this->getODSResults(0).begin()).getType()))))
5633 return emitOpError("failed to verify that result type matches with lhs type");
5634 if (!((::llzk::typesUnify((*this->getODSOperands(1).begin()).getType(), (*this->getODSResults(0).begin()).getType()))))
5635 return emitOpError("failed to verify that result type matches with rhs type");
5636 return ::mlir::success();
5637}
5638
5640 return verifyInvariantsImpl();
5641}
5642
5643::mlir::ParseResult UnsignedIntDivFeltOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
5644 ::mlir::OpAsmParser::UnresolvedOperand lhsRawOperand{};
5645 ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> lhsOperands(&lhsRawOperand, 1); ::llvm::SMLoc lhsOperandsLoc;
5646 (void)lhsOperandsLoc;
5647 ::mlir::OpAsmParser::UnresolvedOperand rhsRawOperand{};
5648 ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> rhsOperands(&rhsRawOperand, 1); ::llvm::SMLoc rhsOperandsLoc;
5649 (void)rhsOperandsLoc;
5650 ::mlir::Type lhsRawType{};
5651 ::llvm::ArrayRef<::mlir::Type> lhsTypes(&lhsRawType, 1);
5652 ::mlir::Type rhsRawType{};
5653 ::llvm::ArrayRef<::mlir::Type> rhsTypes(&rhsRawType, 1);
5654
5655 lhsOperandsLoc = parser.getCurrentLocation();
5656 if (parser.parseOperand(lhsRawOperand))
5657 return ::mlir::failure();
5658 if (parser.parseComma())
5659 return ::mlir::failure();
5660
5661 rhsOperandsLoc = parser.getCurrentLocation();
5662 if (parser.parseOperand(rhsRawOperand))
5663 return ::mlir::failure();
5664 {
5665 auto odsResult = parseInferredOrParsedType(parser, lhsRawType, true);
5666 if (odsResult) return ::mlir::failure();
5667 }
5668 {
5669 auto odsResult = parseInferredOrParsedType(parser, rhsRawType, false);
5670 if (odsResult) return ::mlir::failure();
5671 }
5672 {
5673 auto loc = parser.getCurrentLocation();(void)loc;
5674 if (parser.parseOptionalAttrDict(result.attributes))
5675 return ::mlir::failure();
5676 if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() {
5677 return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op ";
5678 })))
5679 return ::mlir::failure();
5680 }
5681 if (parser.resolveOperands(lhsOperands, lhsTypes, lhsOperandsLoc, result.operands))
5682 return ::mlir::failure();
5683 if (parser.resolveOperands(rhsOperands, rhsTypes, rhsOperandsLoc, result.operands))
5684 return ::mlir::failure();
5685
5686 ::llvm::SmallVector<::mlir::Type> inferredReturnTypes;
5687 if (::mlir::failed(UnsignedIntDivFeltOp::inferReturnTypes(parser.getContext(),
5688 result.location, result.operands,
5689 result.attributes.getDictionary(parser.getContext()),
5690 result.getRawProperties(),
5691 result.regions, inferredReturnTypes)))
5692 return ::mlir::failure();
5693 result.addTypes(inferredReturnTypes);
5694 return ::mlir::success();
5695}
5696
5697void UnsignedIntDivFeltOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
5698 _odsPrinter << ' ';
5699 _odsPrinter << getLhs();
5700 _odsPrinter << ",";
5701 _odsPrinter << ' ';
5702 _odsPrinter << getRhs();
5703 printInferredOrParsedType(_odsPrinter, *this, getLhs().getType(), true);
5704 printInferredOrParsedType(_odsPrinter, *this, getRhs().getType(), false);
5705 ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
5706 _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
5707}
5708
5709void UnsignedIntDivFeltOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
5710}
5711
5712 ::llvm::LogicalResult
5713 UnsignedIntDivFeltOp::inferReturnTypes(::mlir::MLIRContext *context,
5714 std::optional<::mlir::Location> location,
5715 ::mlir::ValueRange operands, ::mlir::DictionaryAttr attributes,
5716 ::mlir::PropertyRef properties, ::mlir::RegionRange regions,
5717 ::llvm::SmallVectorImpl<::mlir::Type> &inferredReturnTypes) {
5718 UnsignedIntDivFeltOp::Adaptor adaptor(operands, attributes, properties, regions);
5720 location, adaptor, inferredReturnTypes);
5721 }
5722
5723
5724::llvm::LogicalResult UnsignedIntDivFeltOp::inferReturnTypes(
5725 mlir::MLIRContext *context, std::optional<mlir::Location> loc, Adaptor adaptor,
5726 llvm::SmallVectorImpl<mlir::Type> &inferred
5727) {
5728 inferred.resize(1);
5729 auto value = adaptor.getLhs();
5730 inferred[0] = value ? value.getType() : FeltType::get(context, mlir::StringAttr());
5731 return mlir::success();
5732}
5733
5734bool UnsignedIntDivFeltOp::isCompatibleReturnTypes(mlir::TypeRange l, mlir::TypeRange r) {
5735 return l == r;
5736}
5737
5738} // namespace llzk::felt
5739MLIR_DEFINE_EXPLICIT_TYPE_ID(::llzk::felt::UnsignedIntDivFeltOp)
5740
5741namespace llzk::felt {
5742
5743
5744//===----------------------------------------------------------------------===//
5745// ::llzk::felt::UnsignedModFeltOp definitions
5746//===----------------------------------------------------------------------===//
5747
5748namespace detail {
5749
5751
5752
5753} // namespace detail
5755
5756::llvm::LogicalResult UnsignedModFeltOpAdaptor::verify(::mlir::Location loc) {
5757 return ::mlir::success();
5758}
5759
5760::llvm::LogicalResult UnsignedModFeltOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
5761 ::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
5762 if (!dict) {
5763 emitError() << "expected DictionaryAttr to set properties";
5764 return ::mlir::failure();
5765 }
5766 return ::mlir::success();
5767}
5768
5769::mlir::Attribute UnsignedModFeltOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
5770 ::mlir::SmallVector<::mlir::NamedAttribute> attrs;
5771 ::mlir::Builder odsBuilder{ctx};
5772
5773 if (!attrs.empty())
5774 return odsBuilder.getDictionaryAttr(attrs);
5775 return {};
5776}
5777
5779 using llvm::hash_value;
5780 return llvm::hash_combine();
5781}
5782
5783std::optional<mlir::Attribute> UnsignedModFeltOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
5784 return std::nullopt;
5785}
5786
5787void UnsignedModFeltOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
5788}
5789
5790void UnsignedModFeltOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
5791}
5792
5793::llvm::LogicalResult UnsignedModFeltOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
5794 return ::mlir::success();
5795}
5796
5797void UnsignedModFeltOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs) {
5798 odsState.addOperands(lhs);
5799 odsState.addOperands(rhs);
5800 odsState.addTypes(result);
5801}
5802
5803UnsignedModFeltOp UnsignedModFeltOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs) {
5804 ::mlir::OperationState __state__(location, getOperationName());
5805 build(builder, __state__, std::forward<decltype(result)>(result), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs));
5806 auto __res__ = ::llvm::dyn_cast<UnsignedModFeltOp>(builder.create(__state__));
5807 assert(__res__ && "builder didn't return the right type");
5808 return __res__;
5809}
5810
5811UnsignedModFeltOp UnsignedModFeltOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs) {
5812 return create(builder, builder.getLoc(), std::forward<decltype(result)>(result), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs));
5813}
5814
5815void UnsignedModFeltOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value lhs, ::mlir::Value rhs) {
5816 odsState.addOperands(lhs);
5817 odsState.addOperands(rhs);
5818
5819 ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
5820 if (::mlir::succeeded(UnsignedModFeltOp::inferReturnTypes(odsBuilder.getContext(),
5821 odsState.location, odsState.operands,
5822 odsState.attributes.getDictionary(odsState.getContext()),
5823 odsState.getRawProperties(),
5824 odsState.regions, inferredReturnTypes)))
5825 odsState.addTypes(inferredReturnTypes);
5826 else
5827 ::mlir::detail::reportFatalInferReturnTypesError(odsState);
5828
5829}
5830
5831UnsignedModFeltOp UnsignedModFeltOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value lhs, ::mlir::Value rhs) {
5832 ::mlir::OperationState __state__(location, getOperationName());
5833 build(builder, __state__, std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs));
5834 auto __res__ = ::llvm::dyn_cast<UnsignedModFeltOp>(builder.create(__state__));
5835 assert(__res__ && "builder didn't return the right type");
5836 return __res__;
5837}
5838
5839UnsignedModFeltOp UnsignedModFeltOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value lhs, ::mlir::Value rhs) {
5840 return create(builder, builder.getLoc(), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs));
5841}
5842
5843void UnsignedModFeltOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs) {
5844 odsState.addOperands(lhs);
5845 odsState.addOperands(rhs);
5846 assert(resultTypes.size() == 1u && "mismatched number of results");
5847 odsState.addTypes(resultTypes);
5848}
5849
5850UnsignedModFeltOp UnsignedModFeltOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs) {
5851 ::mlir::OperationState __state__(location, getOperationName());
5852 build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs));
5853 auto __res__ = ::llvm::dyn_cast<UnsignedModFeltOp>(builder.create(__state__));
5854 assert(__res__ && "builder didn't return the right type");
5855 return __res__;
5856}
5857
5858UnsignedModFeltOp UnsignedModFeltOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs) {
5859 return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs));
5860}
5861
5862void UnsignedModFeltOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
5863 assert(operands.size() == 2u && "mismatched number of parameters");
5864 odsState.addOperands(operands);
5865 odsState.addAttributes(attributes);
5866 assert(resultTypes.size() == 1u && "mismatched number of return types");
5867 odsState.addTypes(resultTypes);
5868}
5869
5870UnsignedModFeltOp UnsignedModFeltOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
5871 ::mlir::OperationState __state__(location, getOperationName());
5872 build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
5873 auto __res__ = ::llvm::dyn_cast<UnsignedModFeltOp>(builder.create(__state__));
5874 assert(__res__ && "builder didn't return the right type");
5875 return __res__;
5876}
5877
5878UnsignedModFeltOp UnsignedModFeltOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
5879 return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
5880}
5881
5882void UnsignedModFeltOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
5883 assert(operands.size() == 2u && "mismatched number of parameters");
5884 odsState.addOperands(operands);
5885 odsState.addAttributes(attributes);
5886
5887 ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
5888 if (::mlir::succeeded(UnsignedModFeltOp::inferReturnTypes(odsBuilder.getContext(),
5889 odsState.location, operands,
5890 odsState.attributes.getDictionary(odsState.getContext()),
5891 odsState.getRawProperties(),
5892 odsState.regions, inferredReturnTypes))) {
5893 assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
5894 odsState.addTypes(inferredReturnTypes);
5895 } else {
5896 ::llvm::report_fatal_error("Failed to infer result type(s).");
5897 }
5898}
5899
5900UnsignedModFeltOp UnsignedModFeltOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
5901 ::mlir::OperationState __state__(location, getOperationName());
5902 build(builder, __state__, std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
5903 auto __res__ = ::llvm::dyn_cast<UnsignedModFeltOp>(builder.create(__state__));
5904 assert(__res__ && "builder didn't return the right type");
5905 return __res__;
5906}
5907
5908UnsignedModFeltOp UnsignedModFeltOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
5909 return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
5910}
5911
5912void UnsignedModFeltOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
5913 assert(operands.size() == 2u && "mismatched number of parameters");
5914 odsState.addOperands(operands);
5915 odsState.useProperties(const_cast<Properties&>(properties));
5916 odsState.addAttributes(discardableAttributes);
5917 assert(resultTypes.size() == 1u && "mismatched number of return types");
5918 odsState.addTypes(resultTypes);
5919}
5920
5921UnsignedModFeltOp UnsignedModFeltOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
5922 ::mlir::OperationState __state__(location, getOperationName());
5923 build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
5924 auto __res__ = ::llvm::dyn_cast<UnsignedModFeltOp>(builder.create(__state__));
5925 assert(__res__ && "builder didn't return the right type");
5926 return __res__;
5927}
5928
5929UnsignedModFeltOp UnsignedModFeltOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
5930 return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
5931}
5932
5933void UnsignedModFeltOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
5934 assert(operands.size() == 2u && "mismatched number of parameters");
5935 odsState.addOperands(operands);
5936 odsState.useProperties(const_cast<Properties &>(properties));
5937 odsState.addAttributes(discardableAttributes);
5938
5939 ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
5940 if (::mlir::succeeded(UnsignedModFeltOp::inferReturnTypes(odsBuilder.getContext(),
5941 odsState.location, operands,
5942 odsState.attributes.getDictionary(odsState.getContext()),
5943 odsState.getRawProperties(),
5944 odsState.regions, inferredReturnTypes))) {
5945 assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
5946 odsState.addTypes(inferredReturnTypes);
5947 } else {
5948 ::llvm::report_fatal_error("Failed to infer result type(s).");
5949 }
5950}
5951
5952UnsignedModFeltOp UnsignedModFeltOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
5953 ::mlir::OperationState __state__(location, getOperationName());
5954 build(builder, __state__, std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
5955 auto __res__ = ::llvm::dyn_cast<UnsignedModFeltOp>(builder.create(__state__));
5956 assert(__res__ && "builder didn't return the right type");
5957 return __res__;
5958}
5959
5960UnsignedModFeltOp UnsignedModFeltOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
5961 return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
5962}
5963
5965 {
5966 unsigned index = 0; (void)index;
5967 auto valueGroup0 = getODSOperands(0);
5968
5969 for (auto v : valueGroup0) {
5970 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops1(*this, v.getType(), "operand", index++)))
5971 return ::mlir::failure();
5972 }
5973 auto valueGroup1 = getODSOperands(1);
5974
5975 for (auto v : valueGroup1) {
5976 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops1(*this, v.getType(), "operand", index++)))
5977 return ::mlir::failure();
5978 }
5979 }
5980 {
5981 unsigned index = 0; (void)index;
5982 auto valueGroup0 = getODSResults(0);
5983
5984 for (auto v : valueGroup0) {
5985 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops2(*this, v.getType(), "result", index++)))
5986 return ::mlir::failure();
5987 }
5988 }
5989 if (!((::llzk::typesUnify((*this->getODSOperands(0).begin()).getType(), (*this->getODSOperands(1).begin()).getType()))))
5990 return emitOpError("failed to verify that rhs type matches with lhs type");
5991 if (!((::llzk::typesUnify((*this->getODSOperands(0).begin()).getType(), (*this->getODSResults(0).begin()).getType()))))
5992 return emitOpError("failed to verify that result type matches with lhs type");
5993 if (!((::llzk::typesUnify((*this->getODSOperands(1).begin()).getType(), (*this->getODSResults(0).begin()).getType()))))
5994 return emitOpError("failed to verify that result type matches with rhs type");
5995 return ::mlir::success();
5996}
5997
5999 return verifyInvariantsImpl();
6000}
6001
6002::mlir::ParseResult UnsignedModFeltOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
6003 ::mlir::OpAsmParser::UnresolvedOperand lhsRawOperand{};
6004 ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> lhsOperands(&lhsRawOperand, 1); ::llvm::SMLoc lhsOperandsLoc;
6005 (void)lhsOperandsLoc;
6006 ::mlir::OpAsmParser::UnresolvedOperand rhsRawOperand{};
6007 ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> rhsOperands(&rhsRawOperand, 1); ::llvm::SMLoc rhsOperandsLoc;
6008 (void)rhsOperandsLoc;
6009 ::mlir::Type lhsRawType{};
6010 ::llvm::ArrayRef<::mlir::Type> lhsTypes(&lhsRawType, 1);
6011 ::mlir::Type rhsRawType{};
6012 ::llvm::ArrayRef<::mlir::Type> rhsTypes(&rhsRawType, 1);
6013
6014 lhsOperandsLoc = parser.getCurrentLocation();
6015 if (parser.parseOperand(lhsRawOperand))
6016 return ::mlir::failure();
6017 if (parser.parseComma())
6018 return ::mlir::failure();
6019
6020 rhsOperandsLoc = parser.getCurrentLocation();
6021 if (parser.parseOperand(rhsRawOperand))
6022 return ::mlir::failure();
6023 {
6024 auto odsResult = parseInferredOrParsedType(parser, lhsRawType, true);
6025 if (odsResult) return ::mlir::failure();
6026 }
6027 {
6028 auto odsResult = parseInferredOrParsedType(parser, rhsRawType, false);
6029 if (odsResult) return ::mlir::failure();
6030 }
6031 {
6032 auto loc = parser.getCurrentLocation();(void)loc;
6033 if (parser.parseOptionalAttrDict(result.attributes))
6034 return ::mlir::failure();
6035 if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() {
6036 return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op ";
6037 })))
6038 return ::mlir::failure();
6039 }
6040 if (parser.resolveOperands(lhsOperands, lhsTypes, lhsOperandsLoc, result.operands))
6041 return ::mlir::failure();
6042 if (parser.resolveOperands(rhsOperands, rhsTypes, rhsOperandsLoc, result.operands))
6043 return ::mlir::failure();
6044
6045 ::llvm::SmallVector<::mlir::Type> inferredReturnTypes;
6046 if (::mlir::failed(UnsignedModFeltOp::inferReturnTypes(parser.getContext(),
6047 result.location, result.operands,
6048 result.attributes.getDictionary(parser.getContext()),
6049 result.getRawProperties(),
6050 result.regions, inferredReturnTypes)))
6051 return ::mlir::failure();
6052 result.addTypes(inferredReturnTypes);
6053 return ::mlir::success();
6054}
6055
6056void UnsignedModFeltOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
6057 _odsPrinter << ' ';
6058 _odsPrinter << getLhs();
6059 _odsPrinter << ",";
6060 _odsPrinter << ' ';
6061 _odsPrinter << getRhs();
6062 printInferredOrParsedType(_odsPrinter, *this, getLhs().getType(), true);
6063 printInferredOrParsedType(_odsPrinter, *this, getRhs().getType(), false);
6064 ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
6065 _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
6066}
6067
6068void UnsignedModFeltOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
6069}
6070
6071 ::llvm::LogicalResult
6072 UnsignedModFeltOp::inferReturnTypes(::mlir::MLIRContext *context,
6073 std::optional<::mlir::Location> location,
6074 ::mlir::ValueRange operands, ::mlir::DictionaryAttr attributes,
6075 ::mlir::PropertyRef properties, ::mlir::RegionRange regions,
6076 ::llvm::SmallVectorImpl<::mlir::Type> &inferredReturnTypes) {
6077 UnsignedModFeltOp::Adaptor adaptor(operands, attributes, properties, regions);
6079 location, adaptor, inferredReturnTypes);
6080 }
6081
6082
6083::llvm::LogicalResult UnsignedModFeltOp::inferReturnTypes(
6084 mlir::MLIRContext *context, std::optional<mlir::Location> loc, Adaptor adaptor,
6085 llvm::SmallVectorImpl<mlir::Type> &inferred
6086) {
6087 inferred.resize(1);
6088 auto value = adaptor.getLhs();
6089 inferred[0] = value ? value.getType() : FeltType::get(context, mlir::StringAttr());
6090 return mlir::success();
6091}
6092
6093bool UnsignedModFeltOp::isCompatibleReturnTypes(mlir::TypeRange l, mlir::TypeRange r) {
6094 return l == r;
6095}
6096
6097} // namespace llzk::felt
6098MLIR_DEFINE_EXPLICIT_TYPE_ID(::llzk::felt::UnsignedModFeltOp)
6099
6100namespace llzk::felt {
6101
6102
6103//===----------------------------------------------------------------------===//
6104// ::llzk::felt::XorFeltOp definitions
6105//===----------------------------------------------------------------------===//
6106
6107namespace detail {
6108
6109XorFeltOpGenericAdaptorBase::XorFeltOpGenericAdaptorBase(XorFeltOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
6110
6111
6112} // namespace detail
6114
6115::llvm::LogicalResult XorFeltOpAdaptor::verify(::mlir::Location loc) {
6116 return ::mlir::success();
6117}
6118
6119::llvm::LogicalResult XorFeltOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
6120 ::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
6121 if (!dict) {
6122 emitError() << "expected DictionaryAttr to set properties";
6123 return ::mlir::failure();
6124 }
6125 return ::mlir::success();
6126}
6127
6128::mlir::Attribute XorFeltOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
6129 ::mlir::SmallVector<::mlir::NamedAttribute> attrs;
6130 ::mlir::Builder odsBuilder{ctx};
6131
6132 if (!attrs.empty())
6133 return odsBuilder.getDictionaryAttr(attrs);
6134 return {};
6135}
6136
6137llvm::hash_code XorFeltOp::computePropertiesHash(const Properties &prop) {
6138 using llvm::hash_value;
6139 return llvm::hash_combine();
6140}
6141
6142std::optional<mlir::Attribute> XorFeltOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
6143 return std::nullopt;
6144}
6145
6146void XorFeltOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
6147}
6148
6149void XorFeltOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
6150}
6151
6152::llvm::LogicalResult XorFeltOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
6153 return ::mlir::success();
6154}
6155
6156void XorFeltOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs) {
6157 odsState.addOperands(lhs);
6158 odsState.addOperands(rhs);
6159 odsState.addTypes(result);
6160}
6161
6162XorFeltOp XorFeltOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs) {
6163 ::mlir::OperationState __state__(location, getOperationName());
6164 build(builder, __state__, std::forward<decltype(result)>(result), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs));
6165 auto __res__ = ::llvm::dyn_cast<XorFeltOp>(builder.create(__state__));
6166 assert(__res__ && "builder didn't return the right type");
6167 return __res__;
6168}
6169
6170XorFeltOp XorFeltOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs) {
6171 return create(builder, builder.getLoc(), std::forward<decltype(result)>(result), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs));
6172}
6173
6174void XorFeltOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value lhs, ::mlir::Value rhs) {
6175 odsState.addOperands(lhs);
6176 odsState.addOperands(rhs);
6177
6178 ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
6179 if (::mlir::succeeded(XorFeltOp::inferReturnTypes(odsBuilder.getContext(),
6180 odsState.location, odsState.operands,
6181 odsState.attributes.getDictionary(odsState.getContext()),
6182 odsState.getRawProperties(),
6183 odsState.regions, inferredReturnTypes)))
6184 odsState.addTypes(inferredReturnTypes);
6185 else
6186 ::mlir::detail::reportFatalInferReturnTypesError(odsState);
6187
6188}
6189
6190XorFeltOp XorFeltOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value lhs, ::mlir::Value rhs) {
6191 ::mlir::OperationState __state__(location, getOperationName());
6192 build(builder, __state__, std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs));
6193 auto __res__ = ::llvm::dyn_cast<XorFeltOp>(builder.create(__state__));
6194 assert(__res__ && "builder didn't return the right type");
6195 return __res__;
6196}
6197
6198XorFeltOp XorFeltOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value lhs, ::mlir::Value rhs) {
6199 return create(builder, builder.getLoc(), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs));
6200}
6201
6202void XorFeltOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs) {
6203 odsState.addOperands(lhs);
6204 odsState.addOperands(rhs);
6205 assert(resultTypes.size() == 1u && "mismatched number of results");
6206 odsState.addTypes(resultTypes);
6207}
6208
6209XorFeltOp XorFeltOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs) {
6210 ::mlir::OperationState __state__(location, getOperationName());
6211 build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs));
6212 auto __res__ = ::llvm::dyn_cast<XorFeltOp>(builder.create(__state__));
6213 assert(__res__ && "builder didn't return the right type");
6214 return __res__;
6215}
6216
6217XorFeltOp XorFeltOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs) {
6218 return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs));
6219}
6220
6221void XorFeltOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
6222 assert(operands.size() == 2u && "mismatched number of parameters");
6223 odsState.addOperands(operands);
6224 odsState.addAttributes(attributes);
6225 assert(resultTypes.size() == 1u && "mismatched number of return types");
6226 odsState.addTypes(resultTypes);
6227}
6228
6229XorFeltOp XorFeltOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
6230 ::mlir::OperationState __state__(location, getOperationName());
6231 build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
6232 auto __res__ = ::llvm::dyn_cast<XorFeltOp>(builder.create(__state__));
6233 assert(__res__ && "builder didn't return the right type");
6234 return __res__;
6235}
6236
6237XorFeltOp XorFeltOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
6238 return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
6239}
6240
6241void XorFeltOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
6242 assert(operands.size() == 2u && "mismatched number of parameters");
6243 odsState.addOperands(operands);
6244 odsState.addAttributes(attributes);
6245
6246 ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
6247 if (::mlir::succeeded(XorFeltOp::inferReturnTypes(odsBuilder.getContext(),
6248 odsState.location, operands,
6249 odsState.attributes.getDictionary(odsState.getContext()),
6250 odsState.getRawProperties(),
6251 odsState.regions, inferredReturnTypes))) {
6252 assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
6253 odsState.addTypes(inferredReturnTypes);
6254 } else {
6255 ::llvm::report_fatal_error("Failed to infer result type(s).");
6256 }
6257}
6258
6259XorFeltOp XorFeltOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
6260 ::mlir::OperationState __state__(location, getOperationName());
6261 build(builder, __state__, std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
6262 auto __res__ = ::llvm::dyn_cast<XorFeltOp>(builder.create(__state__));
6263 assert(__res__ && "builder didn't return the right type");
6264 return __res__;
6265}
6266
6267XorFeltOp XorFeltOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
6268 return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
6269}
6270
6271void XorFeltOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
6272 assert(operands.size() == 2u && "mismatched number of parameters");
6273 odsState.addOperands(operands);
6274 odsState.useProperties(const_cast<Properties&>(properties));
6275 odsState.addAttributes(discardableAttributes);
6276 assert(resultTypes.size() == 1u && "mismatched number of return types");
6277 odsState.addTypes(resultTypes);
6278}
6279
6280XorFeltOp XorFeltOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
6281 ::mlir::OperationState __state__(location, getOperationName());
6282 build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
6283 auto __res__ = ::llvm::dyn_cast<XorFeltOp>(builder.create(__state__));
6284 assert(__res__ && "builder didn't return the right type");
6285 return __res__;
6286}
6287
6288XorFeltOp XorFeltOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
6289 return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
6290}
6291
6292void XorFeltOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
6293 assert(operands.size() == 2u && "mismatched number of parameters");
6294 odsState.addOperands(operands);
6295 odsState.useProperties(const_cast<Properties &>(properties));
6296 odsState.addAttributes(discardableAttributes);
6297
6298 ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
6299 if (::mlir::succeeded(XorFeltOp::inferReturnTypes(odsBuilder.getContext(),
6300 odsState.location, operands,
6301 odsState.attributes.getDictionary(odsState.getContext()),
6302 odsState.getRawProperties(),
6303 odsState.regions, inferredReturnTypes))) {
6304 assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
6305 odsState.addTypes(inferredReturnTypes);
6306 } else {
6307 ::llvm::report_fatal_error("Failed to infer result type(s).");
6308 }
6309}
6310
6311XorFeltOp XorFeltOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
6312 ::mlir::OperationState __state__(location, getOperationName());
6313 build(builder, __state__, std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
6314 auto __res__ = ::llvm::dyn_cast<XorFeltOp>(builder.create(__state__));
6315 assert(__res__ && "builder didn't return the right type");
6316 return __res__;
6317}
6318
6319XorFeltOp XorFeltOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
6320 return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
6321}
6322
6323::llvm::LogicalResult XorFeltOp::verifyInvariantsImpl() {
6324 {
6325 unsigned index = 0; (void)index;
6326 auto valueGroup0 = getODSOperands(0);
6327
6328 for (auto v : valueGroup0) {
6329 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops1(*this, v.getType(), "operand", index++)))
6330 return ::mlir::failure();
6331 }
6332 auto valueGroup1 = getODSOperands(1);
6333
6334 for (auto v : valueGroup1) {
6335 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops1(*this, v.getType(), "operand", index++)))
6336 return ::mlir::failure();
6337 }
6338 }
6339 {
6340 unsigned index = 0; (void)index;
6341 auto valueGroup0 = getODSResults(0);
6342
6343 for (auto v : valueGroup0) {
6344 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops2(*this, v.getType(), "result", index++)))
6345 return ::mlir::failure();
6346 }
6347 }
6348 if (!((::llzk::typesUnify((*this->getODSOperands(0).begin()).getType(), (*this->getODSOperands(1).begin()).getType()))))
6349 return emitOpError("failed to verify that rhs type matches with lhs type");
6350 if (!((::llzk::typesUnify((*this->getODSOperands(0).begin()).getType(), (*this->getODSResults(0).begin()).getType()))))
6351 return emitOpError("failed to verify that result type matches with lhs type");
6352 if (!((::llzk::typesUnify((*this->getODSOperands(1).begin()).getType(), (*this->getODSResults(0).begin()).getType()))))
6353 return emitOpError("failed to verify that result type matches with rhs type");
6354 return ::mlir::success();
6355}
6356
6357::llvm::LogicalResult XorFeltOp::verifyInvariants() {
6358 return verifyInvariantsImpl();
6359}
6360
6361::mlir::ParseResult XorFeltOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
6362 ::mlir::OpAsmParser::UnresolvedOperand lhsRawOperand{};
6363 ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> lhsOperands(&lhsRawOperand, 1); ::llvm::SMLoc lhsOperandsLoc;
6364 (void)lhsOperandsLoc;
6365 ::mlir::OpAsmParser::UnresolvedOperand rhsRawOperand{};
6366 ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> rhsOperands(&rhsRawOperand, 1); ::llvm::SMLoc rhsOperandsLoc;
6367 (void)rhsOperandsLoc;
6368 ::mlir::Type lhsRawType{};
6369 ::llvm::ArrayRef<::mlir::Type> lhsTypes(&lhsRawType, 1);
6370 ::mlir::Type rhsRawType{};
6371 ::llvm::ArrayRef<::mlir::Type> rhsTypes(&rhsRawType, 1);
6372
6373 lhsOperandsLoc = parser.getCurrentLocation();
6374 if (parser.parseOperand(lhsRawOperand))
6375 return ::mlir::failure();
6376 if (parser.parseComma())
6377 return ::mlir::failure();
6378
6379 rhsOperandsLoc = parser.getCurrentLocation();
6380 if (parser.parseOperand(rhsRawOperand))
6381 return ::mlir::failure();
6382 {
6383 auto odsResult = parseInferredOrParsedType(parser, lhsRawType, true);
6384 if (odsResult) return ::mlir::failure();
6385 }
6386 {
6387 auto odsResult = parseInferredOrParsedType(parser, rhsRawType, false);
6388 if (odsResult) return ::mlir::failure();
6389 }
6390 {
6391 auto loc = parser.getCurrentLocation();(void)loc;
6392 if (parser.parseOptionalAttrDict(result.attributes))
6393 return ::mlir::failure();
6394 if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() {
6395 return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op ";
6396 })))
6397 return ::mlir::failure();
6398 }
6399 if (parser.resolveOperands(lhsOperands, lhsTypes, lhsOperandsLoc, result.operands))
6400 return ::mlir::failure();
6401 if (parser.resolveOperands(rhsOperands, rhsTypes, rhsOperandsLoc, result.operands))
6402 return ::mlir::failure();
6403
6404 ::llvm::SmallVector<::mlir::Type> inferredReturnTypes;
6405 if (::mlir::failed(XorFeltOp::inferReturnTypes(parser.getContext(),
6406 result.location, result.operands,
6407 result.attributes.getDictionary(parser.getContext()),
6408 result.getRawProperties(),
6409 result.regions, inferredReturnTypes)))
6410 return ::mlir::failure();
6411 result.addTypes(inferredReturnTypes);
6412 return ::mlir::success();
6413}
6414
6415void XorFeltOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
6416 _odsPrinter << ' ';
6417 _odsPrinter << getLhs();
6418 _odsPrinter << ",";
6419 _odsPrinter << ' ';
6420 _odsPrinter << getRhs();
6421 printInferredOrParsedType(_odsPrinter, *this, getLhs().getType(), true);
6422 printInferredOrParsedType(_odsPrinter, *this, getRhs().getType(), false);
6423 ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
6424 _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
6425}
6426
6427void XorFeltOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
6428}
6429
6430 ::llvm::LogicalResult
6431 XorFeltOp::inferReturnTypes(::mlir::MLIRContext *context,
6432 std::optional<::mlir::Location> location,
6433 ::mlir::ValueRange operands, ::mlir::DictionaryAttr attributes,
6434 ::mlir::PropertyRef properties, ::mlir::RegionRange regions,
6435 ::llvm::SmallVectorImpl<::mlir::Type> &inferredReturnTypes) {
6436 XorFeltOp::Adaptor adaptor(operands, attributes, properties, regions);
6437 return XorFeltOp::inferReturnTypes(context,
6438 location, adaptor, inferredReturnTypes);
6439 }
6440
6441
6442::llvm::LogicalResult XorFeltOp::inferReturnTypes(
6443 mlir::MLIRContext *context, std::optional<mlir::Location> loc, Adaptor adaptor,
6444 llvm::SmallVectorImpl<mlir::Type> &inferred
6445) {
6446 inferred.resize(1);
6447 auto value = adaptor.getLhs();
6448 inferred[0] = value ? value.getType() : FeltType::get(context, mlir::StringAttr());
6449 return mlir::success();
6450}
6451
6452bool XorFeltOp::isCompatibleReturnTypes(mlir::TypeRange l, mlir::TypeRange r) {
6453 return l == r;
6454}
6455
6456} // namespace llzk::felt
6457MLIR_DEFINE_EXPLICIT_TYPE_ID(::llzk::felt::XorFeltOp)
6458
6459
6460#endif // GET_OP_CLASSES
6461
::llvm::LogicalResult verify(::mlir::Location loc)
Definition Ops.cpp.inc:90
AddFeltOpAdaptor(AddFeltOp op)
Definition Ops.cpp.inc:88
AddFeltOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:231
static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs)
Definition Ops.cpp.inc:124
::llvm::LogicalResult verifyInvariants()
Definition Ops.cpp.inc:332
::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:127
::mlir::TypedValue<::mlir::Type > getLhs()
Definition Ops.h.inc:304
static bool isCompatibleReturnTypes(::mlir::TypeRange l, ::mlir::TypeRange r)
Definition Ops.cpp.inc:427
::llvm::LogicalResult inferReturnTypes(::mlir::MLIRContext *context, ::std::optional<::mlir::Location > location, ::mlir::ValueRange operands, ::mlir::DictionaryAttr attributes, ::mlir::PropertyRef properties, ::mlir::RegionRange regions, ::llvm::SmallVectorImpl<::mlir::Type > &inferredReturnTypes)
Definition Ops.cpp.inc:406
static constexpr ::llvm::StringLiteral getOperationName()
Definition Ops.h.inc:290
static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value)
Definition Ops.cpp.inc:121
::llvm::LogicalResult verifyInvariantsImpl()
Definition Ops.cpp.inc:298
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
Definition Ops.cpp.inc:336
void print(::mlir::OpAsmPrinter &_odsPrinter)
Definition Ops.cpp.inc:390
::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop)
Definition Ops.cpp.inc:103
::mlir::Operation::result_range getODSResults(unsigned index)
Definition Ops.h.inc:326
static llvm::hash_code computePropertiesHash(const Properties &prop)
Definition Ops.cpp.inc:112
static std::optional< mlir::Attribute > getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name)
Definition Ops.cpp.inc:117
::mlir::TypedValue<::mlir::Type > getRhs()
Definition Ops.h.inc:308
FoldAdaptor::Properties Properties
Definition Ops.h.inc:284
void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect > > &effects)
Definition Ops.cpp.inc:402
AddFeltOpAdaptor Adaptor
Definition Ops.h.inc:278
::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:94
::mlir::Operation::operand_range getODSOperands(unsigned index)
Definition Ops.h.inc:298
static AddFeltOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs)
Definition Ops.cpp.inc:137
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs)
Definition Ops.cpp.inc:131
AndFeltOpAdaptor(AndFeltOp op)
Definition Ops.cpp.inc:447
::llvm::LogicalResult verify(::mlir::Location loc)
Definition Ops.cpp.inc:449
AndFeltOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:457
static constexpr ::llvm::StringLiteral getOperationName()
Definition Ops.h.inc:516
static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs)
Definition Ops.cpp.inc:483
static llvm::hash_code computePropertiesHash(const Properties &prop)
Definition Ops.cpp.inc:471
::llvm::LogicalResult verifyInvariantsImpl()
Definition Ops.cpp.inc:657
::llvm::LogicalResult inferReturnTypes(::mlir::MLIRContext *context, ::std::optional<::mlir::Location > location, ::mlir::ValueRange operands, ::mlir::DictionaryAttr attributes, ::mlir::PropertyRef properties, ::mlir::RegionRange regions, ::llvm::SmallVectorImpl<::mlir::Type > &inferredReturnTypes)
Definition Ops.cpp.inc:765
void print(::mlir::OpAsmPrinter &_odsPrinter)
Definition Ops.cpp.inc:749
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs)
Definition Ops.cpp.inc:490
::llvm::LogicalResult verifyInvariants()
Definition Ops.cpp.inc:691
::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:453
::mlir::TypedValue<::mlir::Type > getRhs()
Definition Ops.h.inc:534
::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:486
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
Definition Ops.cpp.inc:695
::mlir::Operation::operand_range getODSOperands(unsigned index)
Definition Ops.h.inc:524
static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value)
Definition Ops.cpp.inc:480
::mlir::TypedValue<::mlir::Type > getLhs()
Definition Ops.h.inc:530
static AndFeltOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs)
Definition Ops.cpp.inc:496
static std::optional< mlir::Attribute > getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name)
Definition Ops.cpp.inc:476
static bool isCompatibleReturnTypes(::mlir::TypeRange l, ::mlir::TypeRange r)
Definition Ops.cpp.inc:786
AndFeltOpAdaptor Adaptor
Definition Ops.h.inc:504
::mlir::Operation::result_range getODSResults(unsigned index)
Definition Ops.h.inc:552
void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect > > &effects)
Definition Ops.cpp.inc:761
FoldAdaptor::Properties Properties
Definition Ops.h.inc:510
::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop)
Definition Ops.cpp.inc:462
::llvm::LogicalResult verify(::mlir::Location loc)
Definition Ops.cpp.inc:808
DivFeltOpAdaptor(DivFeltOp op)
Definition Ops.cpp.inc:806
DivFeltOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:683
::mlir::Operation::result_range getODSResults(unsigned index)
Definition Ops.h.inc:778
static constexpr ::llvm::StringLiteral getOperationName()
Definition Ops.h.inc:742
::llvm::LogicalResult verifyInvariantsImpl()
Definition Ops.cpp.inc:1016
::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:845
void print(::mlir::OpAsmPrinter &_odsPrinter)
Definition Ops.cpp.inc:1108
DivFeltOpAdaptor Adaptor
Definition Ops.h.inc:730
static llvm::hash_code computePropertiesHash(const Properties &prop)
Definition Ops.cpp.inc:830
::mlir::TypedValue<::mlir::Type > getRhs()
Definition Ops.h.inc:760
static bool isCompatibleReturnTypes(::mlir::TypeRange l, ::mlir::TypeRange r)
Definition Ops.cpp.inc:1145
::mlir::TypedValue<::mlir::Type > getLhs()
Definition Ops.h.inc:756
static DivFeltOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs)
Definition Ops.cpp.inc:855
::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop)
Definition Ops.cpp.inc:821
FoldAdaptor::Properties Properties
Definition Ops.h.inc:736
::llvm::LogicalResult inferReturnTypes(::mlir::MLIRContext *context, ::std::optional<::mlir::Location > location, ::mlir::ValueRange operands, ::mlir::DictionaryAttr attributes, ::mlir::PropertyRef properties, ::mlir::RegionRange regions, ::llvm::SmallVectorImpl<::mlir::Type > &inferredReturnTypes)
Definition Ops.cpp.inc:1124
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
Definition Ops.cpp.inc:1054
void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect > > &effects)
Definition Ops.cpp.inc:1120
::llvm::LogicalResult verifyInvariants()
Definition Ops.cpp.inc:1050
::mlir::Operation::operand_range getODSOperands(unsigned index)
Definition Ops.h.inc:750
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs)
Definition Ops.cpp.inc:849
static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs)
Definition Ops.cpp.inc:842
static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value)
Definition Ops.cpp.inc:839
::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:812
static std::optional< mlir::Attribute > getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name)
Definition Ops.cpp.inc:835
::llvm::LogicalResult verify(::mlir::Location loc)
Definition Ops.cpp.inc:1172
FeltConstantOpAdaptor(FeltConstantOp op)
Definition Ops.cpp.inc:1170
FeltConstantOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:932
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::llzk::felt::FeltConstAttr value)
Definition Ops.cpp.inc:1269
void writeProperties(::mlir::DialectBytecodeWriter &writer)
Definition Ops.cpp.inc:1259
FeltConstantOpAdaptor Adaptor
Definition Ops.h.inc:971
::llvm::LogicalResult canonicalize(FeltConstantOp op, ::mlir::PatternRewriter &rewriter)
Replaces a constant's raw value with its canonical field representative.
Definition Ops.cpp:125
FoldAdaptor::Properties Properties
Definition Ops.h.inc:975
void print(::mlir::OpAsmPrinter &_odsPrinter)
Definition Ops.cpp.inc:1508
static constexpr ::llvm::StringLiteral getOperationName()
Definition Ops.h.inc:993
static void getCanonicalizationPatterns(::mlir::RewritePatternSet &results, ::mlir::MLIRContext *context)
Definition Ops.cpp.inc:1476
::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state)
Definition Ops.cpp.inc:1252
static std::optional< mlir::Attribute > getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name)
Definition Ops.cpp.inc:1226
static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs)
Definition Ops.cpp.inc:1239
::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:1181
::llvm::LogicalResult verifyInvariantsImpl()
Definition Ops.cpp.inc:1452
void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect > > &effects)
Definition Ops.cpp.inc:1516
::llzk::felt::FeltConstAttr getValueAttr()
Definition Ops.h.inc:1030
static FeltConstantOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::llzk::felt::FeltConstAttr value)
Definition Ops.cpp.inc:1274
::mlir::Operation::result_range getODSResults(unsigned index)
Definition Ops.h.inc:1011
static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value)
Definition Ops.cpp.inc:1232
::mlir::StringAttr getValueAttrName()
Definition Ops.h.inc:985
static llvm::hash_code computePropertiesHash(const Properties &prop)
Definition Ops.cpp.inc:1220
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
Definition Ops.cpp.inc:1480
::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:1243
::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop)
Definition Ops.cpp.inc:1204
::llvm::LogicalResult verifyInvariants()
Definition Ops.cpp.inc:1472
::llvm::LogicalResult inferReturnTypes(::mlir::MLIRContext *context, ::std::optional<::mlir::Location > location, ::mlir::ValueRange operands, ::mlir::DictionaryAttr attributes, ::mlir::PropertyRef properties, ::mlir::RegionRange regions, ::llvm::SmallVectorImpl<::mlir::Type > &inferredReturnTypes)
Definition Ops.cpp.inc:1520
::llzk::felt::FeltConstAttr getValue()
Definition Ops.cpp.inc:1264
static FeltType get(::mlir::MLIRContext *context, ::mlir::StringAttr fieldName)
Definition Types.cpp.inc:69
InvFeltOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:1143
::llvm::LogicalResult verify(::mlir::Location loc)
Definition Ops.cpp.inc:1550
InvFeltOpAdaptor Adaptor
Definition Ops.h.inc:1186
static InvFeltOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value operand)
Definition Ops.cpp.inc:1596
::mlir::TypedValue<::mlir::Type > getOperand()
Definition Ops.h.inc:1211
::mlir::Operation::result_range getODSResults(unsigned index)
Definition Ops.h.inc:1224
void print(::mlir::OpAsmPrinter &_odsPrinter)
Definition Ops.cpp.inc:1820
::llvm::LogicalResult verifyInvariants()
Definition Ops.cpp.inc:1779
FoldAdaptor::Properties Properties
Definition Ops.h.inc:1191
static llvm::hash_code computePropertiesHash(const Properties &prop)
Definition Ops.cpp.inc:1572
static constexpr ::llvm::StringLiteral getOperationName()
Definition Ops.h.inc:1197
static std::optional< mlir::Attribute > getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name)
Definition Ops.cpp.inc:1577
::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:1554
::llvm::LogicalResult inferReturnTypes(::mlir::MLIRContext *context, ::std::optional<::mlir::Location > location, ::mlir::ValueRange operands, ::mlir::DictionaryAttr attributes, ::mlir::PropertyRef properties, ::mlir::RegionRange regions, ::llvm::SmallVectorImpl<::mlir::Type > &inferredReturnTypes)
Definition Ops.cpp.inc:1832
static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs)
Definition Ops.cpp.inc:1584
::mlir::Operation::operand_range getODSOperands(unsigned index)
Definition Ops.h.inc:1205
static bool isCompatibleReturnTypes(::mlir::TypeRange l, ::mlir::TypeRange r)
Definition Ops.cpp.inc:1853
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value operand)
Definition Ops.cpp.inc:1591
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
Definition Ops.cpp.inc:1783
void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect > > &effects)
Definition Ops.cpp.inc:1828
::llvm::LogicalResult verifyInvariantsImpl()
Definition Ops.cpp.inc:1755
static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value)
Definition Ops.cpp.inc:1581
::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:1587
::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop)
Definition Ops.cpp.inc:1563
MulFeltOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:1355
::llvm::LogicalResult verify(::mlir::Location loc)
Definition Ops.cpp.inc:1875
void print(::mlir::OpAsmPrinter &_odsPrinter)
Definition Ops.cpp.inc:2175
static std::optional< mlir::Attribute > getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name)
Definition Ops.cpp.inc:1902
::mlir::TypedValue<::mlir::Type > getLhs()
Definition Ops.h.inc:1428
::llvm::LogicalResult verifyInvariantsImpl()
Definition Ops.cpp.inc:2083
::llvm::LogicalResult inferReturnTypes(::mlir::MLIRContext *context, ::std::optional<::mlir::Location > location, ::mlir::ValueRange operands, ::mlir::DictionaryAttr attributes, ::mlir::PropertyRef properties, ::mlir::RegionRange regions, ::llvm::SmallVectorImpl<::mlir::Type > &inferredReturnTypes)
Definition Ops.cpp.inc:2191
::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop)
Definition Ops.cpp.inc:1888
::mlir::TypedValue<::mlir::Type > getRhs()
Definition Ops.h.inc:1432
static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs)
Definition Ops.cpp.inc:1909
static llvm::hash_code computePropertiesHash(const Properties &prop)
Definition Ops.cpp.inc:1897
MulFeltOpAdaptor Adaptor
Definition Ops.h.inc:1402
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs)
Definition Ops.cpp.inc:1916
FoldAdaptor::Properties Properties
Definition Ops.h.inc:1408
static MulFeltOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs)
Definition Ops.cpp.inc:1922
static constexpr ::llvm::StringLiteral getOperationName()
Definition Ops.h.inc:1414
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
Definition Ops.cpp.inc:2121
void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect > > &effects)
Definition Ops.cpp.inc:2187
::mlir::Operation::result_range getODSResults(unsigned index)
Definition Ops.h.inc:1450
::llvm::LogicalResult verifyInvariants()
Definition Ops.cpp.inc:2117
::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:1912
static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value)
Definition Ops.cpp.inc:1906
static bool isCompatibleReturnTypes(::mlir::TypeRange l, ::mlir::TypeRange r)
Definition Ops.cpp.inc:2212
::mlir::Operation::operand_range getODSOperands(unsigned index)
Definition Ops.h.inc:1422
::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:1879
NegFeltOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:1580
::llvm::LogicalResult verify(::mlir::Location loc)
Definition Ops.cpp.inc:2234
::llvm::LogicalResult verifyInvariantsImpl()
Definition Ops.cpp.inc:2439
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value operand)
Definition Ops.cpp.inc:2275
::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:2271
void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect > > &effects)
Definition Ops.cpp.inc:2512
FoldAdaptor::Properties Properties
Definition Ops.h.inc:1628
::llvm::LogicalResult verifyInvariants()
Definition Ops.cpp.inc:2463
static llvm::hash_code computePropertiesHash(const Properties &prop)
Definition Ops.cpp.inc:2256
::mlir::TypedValue<::mlir::Type > getOperand()
Definition Ops.h.inc:1648
static NegFeltOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value operand)
Definition Ops.cpp.inc:2280
static std::optional< mlir::Attribute > getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name)
Definition Ops.cpp.inc:2261
static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value)
Definition Ops.cpp.inc:2265
static bool isCompatibleReturnTypes(::mlir::TypeRange l, ::mlir::TypeRange r)
Definition Ops.cpp.inc:2537
::llvm::LogicalResult inferReturnTypes(::mlir::MLIRContext *context, ::std::optional<::mlir::Location > location, ::mlir::ValueRange operands, ::mlir::DictionaryAttr attributes, ::mlir::PropertyRef properties, ::mlir::RegionRange regions, ::llvm::SmallVectorImpl<::mlir::Type > &inferredReturnTypes)
Definition Ops.cpp.inc:2516
::mlir::Operation::result_range getODSResults(unsigned index)
Definition Ops.h.inc:1661
NegFeltOpAdaptor Adaptor
Definition Ops.h.inc:1623
void print(::mlir::OpAsmPrinter &_odsPrinter)
Definition Ops.cpp.inc:2504
::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop)
Definition Ops.cpp.inc:2247
static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs)
Definition Ops.cpp.inc:2268
::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:2238
::mlir::Operation::operand_range getODSOperands(unsigned index)
Definition Ops.h.inc:1642
static constexpr ::llvm::StringLiteral getOperationName()
Definition Ops.h.inc:1634
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
Definition Ops.cpp.inc:2467
NotFeltOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:1791
::llvm::LogicalResult verify(::mlir::Location loc)
Definition Ops.cpp.inc:2559
static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value)
Definition Ops.cpp.inc:2590
NotFeltOpAdaptor Adaptor
Definition Ops.h.inc:1834
::llvm::LogicalResult verifyInvariantsImpl()
Definition Ops.cpp.inc:2764
::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:2596
static llvm::hash_code computePropertiesHash(const Properties &prop)
Definition Ops.cpp.inc:2581
::mlir::Operation::result_range getODSResults(unsigned index)
Definition Ops.h.inc:1872
static std::optional< mlir::Attribute > getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name)
Definition Ops.cpp.inc:2586
::mlir::Operation::operand_range getODSOperands(unsigned index)
Definition Ops.h.inc:1853
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value operand)
Definition Ops.cpp.inc:2600
::mlir::TypedValue<::mlir::Type > getOperand()
Definition Ops.h.inc:1859
::llvm::LogicalResult verifyInvariants()
Definition Ops.cpp.inc:2788
static constexpr ::llvm::StringLiteral getOperationName()
Definition Ops.h.inc:1845
static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs)
Definition Ops.cpp.inc:2593
FoldAdaptor::Properties Properties
Definition Ops.h.inc:1839
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
Definition Ops.cpp.inc:2792
::llvm::LogicalResult inferReturnTypes(::mlir::MLIRContext *context, ::std::optional<::mlir::Location > location, ::mlir::ValueRange operands, ::mlir::DictionaryAttr attributes, ::mlir::PropertyRef properties, ::mlir::RegionRange regions, ::llvm::SmallVectorImpl<::mlir::Type > &inferredReturnTypes)
Definition Ops.cpp.inc:2841
void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect > > &effects)
Definition Ops.cpp.inc:2837
void print(::mlir::OpAsmPrinter &_odsPrinter)
Definition Ops.cpp.inc:2829
::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop)
Definition Ops.cpp.inc:2572
static NotFeltOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value operand)
Definition Ops.cpp.inc:2605
::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:2563
static bool isCompatibleReturnTypes(::mlir::TypeRange l, ::mlir::TypeRange r)
Definition Ops.cpp.inc:2862
OrFeltOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:2003
::llvm::LogicalResult verify(::mlir::Location loc)
Definition Ops.cpp.inc:2884
::llvm::LogicalResult inferReturnTypes(::mlir::MLIRContext *context, ::std::optional<::mlir::Location > location, ::mlir::ValueRange operands, ::mlir::DictionaryAttr attributes, ::mlir::PropertyRef properties, ::mlir::RegionRange regions, ::llvm::SmallVectorImpl<::mlir::Type > &inferredReturnTypes)
Definition Ops.cpp.inc:3200
::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop)
Definition Ops.cpp.inc:2897
static llvm::hash_code computePropertiesHash(const Properties &prop)
Definition Ops.cpp.inc:2906
static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value)
Definition Ops.cpp.inc:2915
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
Definition Ops.cpp.inc:3130
::mlir::Operation::result_range getODSResults(unsigned index)
Definition Ops.h.inc:2098
static bool isCompatibleReturnTypes(::mlir::TypeRange l, ::mlir::TypeRange r)
Definition Ops.cpp.inc:3221
::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:2888
::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:2921
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs)
Definition Ops.cpp.inc:2925
void print(::mlir::OpAsmPrinter &_odsPrinter)
Definition Ops.cpp.inc:3184
static constexpr ::llvm::StringLiteral getOperationName()
Definition Ops.h.inc:2062
FoldAdaptor::Properties Properties
Definition Ops.h.inc:2056
static OrFeltOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs)
Definition Ops.cpp.inc:2931
::mlir::Operation::operand_range getODSOperands(unsigned index)
Definition Ops.h.inc:2070
::llvm::LogicalResult verifyInvariants()
Definition Ops.cpp.inc:3126
static std::optional< mlir::Attribute > getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name)
Definition Ops.cpp.inc:2911
OrFeltOpAdaptor Adaptor
Definition Ops.h.inc:2050
::mlir::TypedValue<::mlir::Type > getRhs()
Definition Ops.h.inc:2080
::llvm::LogicalResult verifyInvariantsImpl()
Definition Ops.cpp.inc:3092
void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect > > &effects)
Definition Ops.cpp.inc:3196
::mlir::TypedValue<::mlir::Type > getLhs()
Definition Ops.h.inc:2076
static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs)
Definition Ops.cpp.inc:2918
::llvm::LogicalResult verify(::mlir::Location loc)
Definition Ops.cpp.inc:3243
PowFeltOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:2229
static constexpr ::llvm::StringLiteral getOperationName()
Definition Ops.h.inc:2288
::mlir::TypedValue<::mlir::Type > getLhs()
Definition Ops.h.inc:2302
::mlir::Operation::operand_range getODSOperands(unsigned index)
Definition Ops.h.inc:2296
void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect > > &effects)
Definition Ops.cpp.inc:3555
static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value)
Definition Ops.cpp.inc:3274
::mlir::Operation::result_range getODSResults(unsigned index)
Definition Ops.h.inc:2324
void print(::mlir::OpAsmPrinter &_odsPrinter)
Definition Ops.cpp.inc:3543
::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:3280
::mlir::TypedValue<::mlir::Type > getRhs()
Definition Ops.h.inc:2306
static bool isCompatibleReturnTypes(::mlir::TypeRange l, ::mlir::TypeRange r)
Definition Ops.cpp.inc:3580
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
Definition Ops.cpp.inc:3489
static PowFeltOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs)
Definition Ops.cpp.inc:3290
::llvm::LogicalResult verifyInvariantsImpl()
Definition Ops.cpp.inc:3451
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs)
Definition Ops.cpp.inc:3284
PowFeltOpAdaptor Adaptor
Definition Ops.h.inc:2276
::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:3247
FoldAdaptor::Properties Properties
Definition Ops.h.inc:2282
::llvm::LogicalResult verifyInvariants()
Definition Ops.cpp.inc:3485
::llvm::LogicalResult inferReturnTypes(::mlir::MLIRContext *context, ::std::optional<::mlir::Location > location, ::mlir::ValueRange operands, ::mlir::DictionaryAttr attributes, ::mlir::PropertyRef properties, ::mlir::RegionRange regions, ::llvm::SmallVectorImpl<::mlir::Type > &inferredReturnTypes)
Definition Ops.cpp.inc:3559
::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop)
Definition Ops.cpp.inc:3256
static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs)
Definition Ops.cpp.inc:3277
static std::optional< mlir::Attribute > getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name)
Definition Ops.cpp.inc:3270
static llvm::hash_code computePropertiesHash(const Properties &prop)
Definition Ops.cpp.inc:3265
::llvm::LogicalResult verify(::mlir::Location loc)
Definition Ops.cpp.inc:3602
ShlFeltOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:2455
void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect > > &effects)
Definition Ops.cpp.inc:3914
static constexpr ::llvm::StringLiteral getOperationName()
Definition Ops.h.inc:2514
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs)
Definition Ops.cpp.inc:3643
::mlir::TypedValue<::mlir::Type > getLhs()
Definition Ops.h.inc:2528
static ShlFeltOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs)
Definition Ops.cpp.inc:3649
::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:3606
static bool isCompatibleReturnTypes(::mlir::TypeRange l, ::mlir::TypeRange r)
Definition Ops.cpp.inc:3939
::mlir::TypedValue<::mlir::Type > getRhs()
Definition Ops.h.inc:2532
::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:3639
static std::optional< mlir::Attribute > getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name)
Definition Ops.cpp.inc:3629
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
Definition Ops.cpp.inc:3848
ShlFeltOpAdaptor Adaptor
Definition Ops.h.inc:2502
void print(::mlir::OpAsmPrinter &_odsPrinter)
Definition Ops.cpp.inc:3902
::llvm::LogicalResult verifyInvariantsImpl()
Definition Ops.cpp.inc:3810
::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop)
Definition Ops.cpp.inc:3615
static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs)
Definition Ops.cpp.inc:3636
static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value)
Definition Ops.cpp.inc:3633
::mlir::Operation::operand_range getODSOperands(unsigned index)
Definition Ops.h.inc:2522
static llvm::hash_code computePropertiesHash(const Properties &prop)
Definition Ops.cpp.inc:3624
::mlir::Operation::result_range getODSResults(unsigned index)
Definition Ops.h.inc:2550
::llvm::LogicalResult inferReturnTypes(::mlir::MLIRContext *context, ::std::optional<::mlir::Location > location, ::mlir::ValueRange operands, ::mlir::DictionaryAttr attributes, ::mlir::PropertyRef properties, ::mlir::RegionRange regions, ::llvm::SmallVectorImpl<::mlir::Type > &inferredReturnTypes)
Definition Ops.cpp.inc:3918
::llvm::LogicalResult verifyInvariants()
Definition Ops.cpp.inc:3844
FoldAdaptor::Properties Properties
Definition Ops.h.inc:2508
::llvm::LogicalResult verify(::mlir::Location loc)
Definition Ops.cpp.inc:3961
ShrFeltOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:2681
::llvm::LogicalResult verifyInvariants()
Definition Ops.cpp.inc:4203
static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value)
Definition Ops.cpp.inc:3992
void print(::mlir::OpAsmPrinter &_odsPrinter)
Definition Ops.cpp.inc:4261
::mlir::Operation::operand_range getODSOperands(unsigned index)
Definition Ops.h.inc:2748
::mlir::TypedValue<::mlir::Type > getRhs()
Definition Ops.h.inc:2758
FoldAdaptor::Properties Properties
Definition Ops.h.inc:2734
void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect > > &effects)
Definition Ops.cpp.inc:4273
::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:3965
ShrFeltOpAdaptor Adaptor
Definition Ops.h.inc:2728
::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop)
Definition Ops.cpp.inc:3974
::llvm::LogicalResult inferReturnTypes(::mlir::MLIRContext *context, ::std::optional<::mlir::Location > location, ::mlir::ValueRange operands, ::mlir::DictionaryAttr attributes, ::mlir::PropertyRef properties, ::mlir::RegionRange regions, ::llvm::SmallVectorImpl<::mlir::Type > &inferredReturnTypes)
Definition Ops.cpp.inc:4277
static ShrFeltOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs)
Definition Ops.cpp.inc:4008
::mlir::Operation::result_range getODSResults(unsigned index)
Definition Ops.h.inc:2776
::llvm::LogicalResult verifyInvariantsImpl()
Definition Ops.cpp.inc:4169
static constexpr ::llvm::StringLiteral getOperationName()
Definition Ops.h.inc:2740
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs)
Definition Ops.cpp.inc:4002
::mlir::TypedValue<::mlir::Type > getLhs()
Definition Ops.h.inc:2754
::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:3998
static bool isCompatibleReturnTypes(::mlir::TypeRange l, ::mlir::TypeRange r)
Definition Ops.cpp.inc:4298
static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs)
Definition Ops.cpp.inc:3995
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
Definition Ops.cpp.inc:4207
static std::optional< mlir::Attribute > getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name)
Definition Ops.cpp.inc:3988
static llvm::hash_code computePropertiesHash(const Properties &prop)
Definition Ops.cpp.inc:3983
::llvm::LogicalResult verify(::mlir::Location loc)
Definition Ops.cpp.inc:4320
SignedIntDivFeltOpAdaptor(SignedIntDivFeltOp op)
Definition Ops.cpp.inc:4318
SignedIntDivFeltOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:2907
static constexpr ::llvm::StringLiteral getOperationName()
Definition Ops.h.inc:2966
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
Definition Ops.cpp.inc:4566
::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop)
Definition Ops.cpp.inc:4333
static bool isCompatibleReturnTypes(::mlir::TypeRange l, ::mlir::TypeRange r)
Definition Ops.cpp.inc:4657
::llvm::LogicalResult verifyInvariantsImpl()
Definition Ops.cpp.inc:4528
::mlir::Operation::operand_range getODSOperands(unsigned index)
Definition Ops.h.inc:2974
FoldAdaptor::Properties Properties
Definition Ops.h.inc:2960
::mlir::Operation::result_range getODSResults(unsigned index)
Definition Ops.h.inc:3002
::mlir::TypedValue<::mlir::Type > getRhs()
Definition Ops.h.inc:2984
::mlir::TypedValue<::mlir::Type > getLhs()
Definition Ops.h.inc:2980
static llvm::hash_code computePropertiesHash(const Properties &prop)
Definition Ops.cpp.inc:4342
static SignedIntDivFeltOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs)
Definition Ops.cpp.inc:4367
::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:4357
static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value)
Definition Ops.cpp.inc:4351
::llvm::LogicalResult verifyInvariants()
Definition Ops.cpp.inc:4562
SignedIntDivFeltOpAdaptor Adaptor
Definition Ops.h.inc:2954
::llvm::LogicalResult inferReturnTypes(::mlir::MLIRContext *context, ::std::optional<::mlir::Location > location, ::mlir::ValueRange operands, ::mlir::DictionaryAttr attributes, ::mlir::PropertyRef properties, ::mlir::RegionRange regions, ::llvm::SmallVectorImpl<::mlir::Type > &inferredReturnTypes)
Definition Ops.cpp.inc:4636
static std::optional< mlir::Attribute > getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name)
Definition Ops.cpp.inc:4347
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs)
Definition Ops.cpp.inc:4361
void print(::mlir::OpAsmPrinter &_odsPrinter)
Definition Ops.cpp.inc:4620
::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:4324
void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect > > &effects)
Definition Ops.cpp.inc:4632
static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs)
Definition Ops.cpp.inc:4354
SignedModFeltOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:3133
SignedModFeltOpAdaptor(SignedModFeltOp op)
Definition Ops.cpp.inc:4677
::llvm::LogicalResult verify(::mlir::Location loc)
Definition Ops.cpp.inc:4679
static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs)
Definition Ops.cpp.inc:4713
::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:4716
FoldAdaptor::Properties Properties
Definition Ops.h.inc:3186
static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value)
Definition Ops.cpp.inc:4710
::llvm::LogicalResult inferReturnTypes(::mlir::MLIRContext *context, ::std::optional<::mlir::Location > location, ::mlir::ValueRange operands, ::mlir::DictionaryAttr attributes, ::mlir::PropertyRef properties, ::mlir::RegionRange regions, ::llvm::SmallVectorImpl<::mlir::Type > &inferredReturnTypes)
Definition Ops.cpp.inc:4995
SignedModFeltOpAdaptor Adaptor
Definition Ops.h.inc:3180
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
Definition Ops.cpp.inc:4925
::mlir::TypedValue<::mlir::Type > getRhs()
Definition Ops.h.inc:3210
static llvm::hash_code computePropertiesHash(const Properties &prop)
Definition Ops.cpp.inc:4701
static SignedModFeltOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs)
Definition Ops.cpp.inc:4726
::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop)
Definition Ops.cpp.inc:4692
void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect > > &effects)
Definition Ops.cpp.inc:4991
void print(::mlir::OpAsmPrinter &_odsPrinter)
Definition Ops.cpp.inc:4979
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs)
Definition Ops.cpp.inc:4720
::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:4683
static bool isCompatibleReturnTypes(::mlir::TypeRange l, ::mlir::TypeRange r)
Definition Ops.cpp.inc:5016
static std::optional< mlir::Attribute > getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name)
Definition Ops.cpp.inc:4706
static constexpr ::llvm::StringLiteral getOperationName()
Definition Ops.h.inc:3192
::mlir::TypedValue<::mlir::Type > getLhs()
Definition Ops.h.inc:3206
::mlir::Operation::result_range getODSResults(unsigned index)
Definition Ops.h.inc:3228
::mlir::Operation::operand_range getODSOperands(unsigned index)
Definition Ops.h.inc:3200
::llvm::LogicalResult verifyInvariantsImpl()
Definition Ops.cpp.inc:4887
::llvm::LogicalResult verifyInvariants()
Definition Ops.cpp.inc:4921
SubFeltOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:3359
::llvm::LogicalResult verify(::mlir::Location loc)
Definition Ops.cpp.inc:5038
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
Definition Ops.cpp.inc:5284
::mlir::Operation::result_range getODSResults(unsigned index)
Definition Ops.h.inc:3454
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs)
Definition Ops.cpp.inc:5079
static SubFeltOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs)
Definition Ops.cpp.inc:5085
::llvm::LogicalResult verifyInvariantsImpl()
Definition Ops.cpp.inc:5246
void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect > > &effects)
Definition Ops.cpp.inc:5350
::mlir::TypedValue<::mlir::Type > getRhs()
Definition Ops.h.inc:3436
void print(::mlir::OpAsmPrinter &_odsPrinter)
Definition Ops.cpp.inc:5338
static constexpr ::llvm::StringLiteral getOperationName()
Definition Ops.h.inc:3418
::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:5075
::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop)
Definition Ops.cpp.inc:5051
FoldAdaptor::Properties Properties
Definition Ops.h.inc:3412
static std::optional< mlir::Attribute > getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name)
Definition Ops.cpp.inc:5065
static llvm::hash_code computePropertiesHash(const Properties &prop)
Definition Ops.cpp.inc:5060
static bool isCompatibleReturnTypes(::mlir::TypeRange l, ::mlir::TypeRange r)
Definition Ops.cpp.inc:5375
::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:5042
static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value)
Definition Ops.cpp.inc:5069
static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs)
Definition Ops.cpp.inc:5072
::llvm::LogicalResult verifyInvariants()
Definition Ops.cpp.inc:5280
::mlir::TypedValue<::mlir::Type > getLhs()
Definition Ops.h.inc:3432
SubFeltOpAdaptor Adaptor
Definition Ops.h.inc:3406
::llvm::LogicalResult inferReturnTypes(::mlir::MLIRContext *context, ::std::optional<::mlir::Location > location, ::mlir::ValueRange operands, ::mlir::DictionaryAttr attributes, ::mlir::PropertyRef properties, ::mlir::RegionRange regions, ::llvm::SmallVectorImpl<::mlir::Type > &inferredReturnTypes)
Definition Ops.cpp.inc:5354
::mlir::Operation::operand_range getODSOperands(unsigned index)
Definition Ops.h.inc:3426
UnsignedIntDivFeltOpAdaptor(UnsignedIntDivFeltOp op)
Definition Ops.cpp.inc:5395
UnsignedIntDivFeltOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:3585
::llvm::LogicalResult verify(::mlir::Location loc)
Definition Ops.cpp.inc:5397
void print(::mlir::OpAsmPrinter &_odsPrinter)
Definition Ops.cpp.inc:5697
::llvm::LogicalResult inferReturnTypes(::mlir::MLIRContext *context, ::std::optional<::mlir::Location > location, ::mlir::ValueRange operands, ::mlir::DictionaryAttr attributes, ::mlir::PropertyRef properties, ::mlir::RegionRange regions, ::llvm::SmallVectorImpl<::mlir::Type > &inferredReturnTypes)
Definition Ops.cpp.inc:5713
static std::optional< mlir::Attribute > getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name)
Definition Ops.cpp.inc:5424
static UnsignedIntDivFeltOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs)
Definition Ops.cpp.inc:5444
static llvm::hash_code computePropertiesHash(const Properties &prop)
Definition Ops.cpp.inc:5419
::mlir::TypedValue<::mlir::Type > getRhs()
Definition Ops.h.inc:3662
::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:5401
::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop)
Definition Ops.cpp.inc:5410
static constexpr ::llvm::StringLiteral getOperationName()
Definition Ops.h.inc:3644
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
Definition Ops.cpp.inc:5643
UnsignedIntDivFeltOpAdaptor Adaptor
Definition Ops.h.inc:3632
void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect > > &effects)
Definition Ops.cpp.inc:5709
::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:5434
static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs)
Definition Ops.cpp.inc:5431
static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value)
Definition Ops.cpp.inc:5428
FoldAdaptor::Properties Properties
Definition Ops.h.inc:3638
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs)
Definition Ops.cpp.inc:5438
static bool isCompatibleReturnTypes(::mlir::TypeRange l, ::mlir::TypeRange r)
Definition Ops.cpp.inc:5734
::llvm::LogicalResult verifyInvariantsImpl()
Definition Ops.cpp.inc:5605
::mlir::TypedValue<::mlir::Type > getLhs()
Definition Ops.h.inc:3658
::mlir::Operation::result_range getODSResults(unsigned index)
Definition Ops.h.inc:3680
::llvm::LogicalResult verifyInvariants()
Definition Ops.cpp.inc:5639
::mlir::Operation::operand_range getODSOperands(unsigned index)
Definition Ops.h.inc:3652
::llvm::LogicalResult verify(::mlir::Location loc)
Definition Ops.cpp.inc:5756
UnsignedModFeltOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:3811
UnsignedModFeltOpAdaptor(UnsignedModFeltOp op)
Definition Ops.cpp.inc:5754
::llvm::LogicalResult inferReturnTypes(::mlir::MLIRContext *context, ::std::optional<::mlir::Location > location, ::mlir::ValueRange operands, ::mlir::DictionaryAttr attributes, ::mlir::PropertyRef properties, ::mlir::RegionRange regions, ::llvm::SmallVectorImpl<::mlir::Type > &inferredReturnTypes)
Definition Ops.cpp.inc:6072
static UnsignedModFeltOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs)
Definition Ops.cpp.inc:5803
void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect > > &effects)
Definition Ops.cpp.inc:6068
::mlir::TypedValue<::mlir::Type > getRhs()
Definition Ops.h.inc:3888
::mlir::Operation::operand_range getODSOperands(unsigned index)
Definition Ops.h.inc:3878
FoldAdaptor::Properties Properties
Definition Ops.h.inc:3864
static std::optional< mlir::Attribute > getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name)
Definition Ops.cpp.inc:5783
static bool isCompatibleReturnTypes(::mlir::TypeRange l, ::mlir::TypeRange r)
Definition Ops.cpp.inc:6093
::llvm::LogicalResult verifyInvariants()
Definition Ops.cpp.inc:5998
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
Definition Ops.cpp.inc:6002
::mlir::Operation::result_range getODSResults(unsigned index)
Definition Ops.h.inc:3906
UnsignedModFeltOpAdaptor Adaptor
Definition Ops.h.inc:3858
::llvm::LogicalResult verifyInvariantsImpl()
Definition Ops.cpp.inc:5964
::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:5760
static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value)
Definition Ops.cpp.inc:5787
::mlir::TypedValue<::mlir::Type > getLhs()
Definition Ops.h.inc:3884
void print(::mlir::OpAsmPrinter &_odsPrinter)
Definition Ops.cpp.inc:6056
static llvm::hash_code computePropertiesHash(const Properties &prop)
Definition Ops.cpp.inc:5778
::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop)
Definition Ops.cpp.inc:5769
static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs)
Definition Ops.cpp.inc:5790
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs)
Definition Ops.cpp.inc:5797
static constexpr ::llvm::StringLiteral getOperationName()
Definition Ops.h.inc:3870
::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:5793
XorFeltOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:4037
::llvm::LogicalResult verify(::mlir::Location loc)
Definition Ops.cpp.inc:6115
static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value)
Definition Ops.cpp.inc:6146
static std::optional< mlir::Attribute > getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name)
Definition Ops.cpp.inc:6142
XorFeltOpAdaptor Adaptor
Definition Ops.h.inc:4084
::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:6152
static constexpr ::llvm::StringLiteral getOperationName()
Definition Ops.h.inc:4096
static llvm::hash_code computePropertiesHash(const Properties &prop)
Definition Ops.cpp.inc:6137
::mlir::Operation::result_range getODSResults(unsigned index)
Definition Ops.h.inc:4132
::llvm::LogicalResult verifyInvariantsImpl()
Definition Ops.cpp.inc:6323
static XorFeltOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs)
Definition Ops.cpp.inc:6162
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
Definition Ops.cpp.inc:6361
::mlir::TypedValue<::mlir::Type > getLhs()
Definition Ops.h.inc:4110
::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop)
Definition Ops.cpp.inc:6128
::llvm::LogicalResult inferReturnTypes(::mlir::MLIRContext *context, ::std::optional<::mlir::Location > location, ::mlir::ValueRange operands, ::mlir::DictionaryAttr attributes, ::mlir::PropertyRef properties, ::mlir::RegionRange regions, ::llvm::SmallVectorImpl<::mlir::Type > &inferredReturnTypes)
Definition Ops.cpp.inc:6431
::llvm::LogicalResult verifyInvariants()
Definition Ops.cpp.inc:6357
::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:6119
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs)
Definition Ops.cpp.inc:6156
FoldAdaptor::Properties Properties
Definition Ops.h.inc:4090
::mlir::Operation::operand_range getODSOperands(unsigned index)
Definition Ops.h.inc:4104
void print(::mlir::OpAsmPrinter &_odsPrinter)
Definition Ops.cpp.inc:6415
::mlir::TypedValue<::mlir::Type > getRhs()
Definition Ops.h.inc:4114
static bool isCompatibleReturnTypes(::mlir::TypeRange l, ::mlir::TypeRange r)
Definition Ops.cpp.inc:6452
void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect > > &effects)
Definition Ops.cpp.inc:6427
static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs)
Definition Ops.cpp.inc:6149
::std::optional<::mlir::OperationName > odsOpName
Definition Ops.h.inc:199
AddFeltOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:203
AndFeltOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:429
::std::optional<::mlir::OperationName > odsOpName
Definition Ops.h.inc:425
DivFeltOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:655
::std::optional<::mlir::OperationName > odsOpName
Definition Ops.h.inc:651
::llzk::felt::FeltConstAttr getValueAttr()
Definition Ops.h.inc:918
::std::optional<::mlir::OperationName > odsOpName
Definition Ops.h.inc:896
FeltConstantOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:900
InvFeltOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:1116
::std::optional<::mlir::OperationName > odsOpName
Definition Ops.h.inc:1112
MulFeltOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:1327
::std::optional<::mlir::OperationName > odsOpName
Definition Ops.h.inc:1323
::std::optional<::mlir::OperationName > odsOpName
Definition Ops.h.inc:1549
NegFeltOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:1553
NotFeltOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:1764
::std::optional<::mlir::OperationName > odsOpName
Definition Ops.h.inc:1760
::std::optional<::mlir::OperationName > odsOpName
Definition Ops.h.inc:1971
OrFeltOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:1975
PowFeltOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:2201
::std::optional<::mlir::OperationName > odsOpName
Definition Ops.h.inc:2197
::std::optional<::mlir::OperationName > odsOpName
Definition Ops.h.inc:2423
ShlFeltOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:2427
ShrFeltOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:2653
::std::optional<::mlir::OperationName > odsOpName
Definition Ops.h.inc:2649
SignedIntDivFeltOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:2879
::std::optional<::mlir::OperationName > odsOpName
Definition Ops.h.inc:2875
::std::optional<::mlir::OperationName > odsOpName
Definition Ops.h.inc:3101
SignedModFeltOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:3105
SubFeltOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:3331
::std::optional<::mlir::OperationName > odsOpName
Definition Ops.h.inc:3327
UnsignedIntDivFeltOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:3557
::std::optional<::mlir::OperationName > odsOpName
Definition Ops.h.inc:3553
::std::optional<::mlir::OperationName > odsOpName
Definition Ops.h.inc:3779
UnsignedModFeltOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:3783
::std::optional<::mlir::OperationName > odsOpName
Definition Ops.h.inc:4005
XorFeltOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:4009
Common interface for binary arithmetic operations on felts.
Common interface for constant parameter-like symbol operations that can be defined within a TemplateO...
bool isValidType(Type type)
bool typesUnify(Type lhs, Type rhs, ArrayRef< StringRef > rhsReversePrefix, UnificationMap *unifications)