LLZK 0.1.0
Veridise's ZK Language IR
Loading...
Searching...
No Matches
Ops.cpp.inc
Go to the documentation of this file.
1/*===- TableGen'erated file -------------------------------------*- C++ -*-===*\
2|* *|
3|* Op Definitions *|
4|* *|
5|* Automatically generated file, do not edit! *|
6|* From: Ops.td *|
7|* *|
8\*===----------------------------------------------------------------------===*/
9
10#ifdef GET_OP_LIST
11#undef GET_OP_LIST
12
19#endif // GET_OP_LIST
20
21#ifdef GET_OP_CLASSES
22#undef GET_OP_CLASSES
23
24
25//===----------------------------------------------------------------------===//
26// Local Utility Method Definitions
27//===----------------------------------------------------------------------===//
28
29namespace llzk {
30namespace boolean {
31
32static ::llvm::LogicalResult __mlir_ods_local_type_constraint_Ops1(
33 ::mlir::Operation *op, ::mlir::Type type, ::llvm::StringRef valueKind,
34 unsigned valueIndex) {
35 if (!((::llvm::isa<llzk::polymorphic::TypeVarType,::mlir::IntegerType>(type)))) {
36 return op->emitOpError(valueKind) << " #" << valueIndex
37 << " must be 1-bit signless integer or type variable, but got " << type;
38 }
39 return ::mlir::success();
40}
41
42static ::llvm::LogicalResult __mlir_ods_local_type_constraint_Ops2(
43 ::mlir::Operation *op, ::mlir::Type type, ::llvm::StringRef valueKind,
44 unsigned valueIndex) {
45 if (!((type.isSignlessInteger(1)))) {
46 return op->emitOpError(valueKind) << " #" << valueIndex
47 << " must be 1-bit signless integer, but got " << type;
48 }
49 return ::mlir::success();
50}
51
52static ::llvm::LogicalResult __mlir_ods_local_type_constraint_Ops3(
53 ::mlir::Operation *op, ::mlir::Type type, ::llvm::StringRef valueKind,
54 unsigned valueIndex) {
55 if (!((::llvm::isa<::llzk::felt::FeltType>(type)))) {
56 return op->emitOpError(valueKind) << " #" << valueIndex
57 << " must be finite field element, 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<::mlir::StringAttr>(attr))))
65 return emitError() << "attribute '" << attrName
66 << "' failed to satisfy constraint: string attribute";
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}
75
76static ::llvm::LogicalResult __mlir_ods_local_attr_constraint_Ops2(
77 ::mlir::Attribute attr, ::llvm::StringRef attrName, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
78 if (attr && !((::llvm::isa<::llzk::boolean::FeltCmpPredicateAttr>(attr))))
79 return emitError() << "attribute '" << attrName
80 << "' failed to satisfy constraint: Field element comparison predicate";
81 return ::mlir::success();
82}
83static ::llvm::LogicalResult __mlir_ods_local_attr_constraint_Ops2(
84 ::mlir::Operation *op, ::mlir::Attribute attr, ::llvm::StringRef attrName) {
85 return __mlir_ods_local_attr_constraint_Ops2(attr, attrName, [op]() {
86 return op->emitOpError();
87 });
88}
89} // namespace boolean
90} // namespace llzk
91namespace llzk {
92namespace boolean {
93
94//===----------------------------------------------------------------------===//
95// ::llzk::boolean::AndBoolOp definitions
96//===----------------------------------------------------------------------===//
97
98namespace detail {
99} // namespace detail
101
102::llvm::LogicalResult AndBoolOpAdaptor::verify(::mlir::Location loc) {
103 return ::mlir::success();
104}
105
106void AndBoolOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs) {
107 odsState.addOperands(lhs);
108 odsState.addOperands(rhs);
109 odsState.addTypes(result);
110}
111
112void AndBoolOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value lhs, ::mlir::Value rhs) {
113 odsState.addOperands(lhs);
114 odsState.addOperands(rhs);
115
116 ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
117 if (::mlir::succeeded(AndBoolOp::inferReturnTypes(odsBuilder.getContext(),
118 odsState.location, odsState.operands,
119 odsState.attributes.getDictionary(odsState.getContext()),
120 odsState.getRawProperties(),
121 odsState.regions, inferredReturnTypes)))
122 odsState.addTypes(inferredReturnTypes);
123 else
124 ::mlir::detail::reportFatalInferReturnTypesError(odsState);
125
126}
127
128void AndBoolOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs) {
129 odsState.addOperands(lhs);
130 odsState.addOperands(rhs);
131 assert(resultTypes.size() == 1u && "mismatched number of results");
132 odsState.addTypes(resultTypes);
133}
134
135void AndBoolOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
136 assert(operands.size() == 2u && "mismatched number of parameters");
137 odsState.addOperands(operands);
138 odsState.addAttributes(attributes);
139 assert(resultTypes.size() == 1u && "mismatched number of return types");
140 odsState.addTypes(resultTypes);
141}
142
143void AndBoolOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
144 assert(operands.size() == 2u && "mismatched number of parameters");
145 odsState.addOperands(operands);
146 odsState.addAttributes(attributes);
147
148 ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
149 if (::mlir::succeeded(AndBoolOp::inferReturnTypes(odsBuilder.getContext(),
150 odsState.location, operands,
151 odsState.attributes.getDictionary(odsState.getContext()),
152 odsState.getRawProperties(),
153 odsState.regions, inferredReturnTypes))) {
154 assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
155 odsState.addTypes(inferredReturnTypes);
156 } else {
157 ::llvm::report_fatal_error("Failed to infer result type(s).");
158 }
159}
160
161::llvm::LogicalResult AndBoolOp::verifyInvariantsImpl() {
162 {
163 unsigned index = 0; (void)index;
164 auto valueGroup0 = getODSOperands(0);
165
166 for (auto v : valueGroup0) {
167 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops1(*this, v.getType(), "operand", index++)))
168 return ::mlir::failure();
169 }
170 auto valueGroup1 = getODSOperands(1);
171
172 for (auto v : valueGroup1) {
173 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops1(*this, v.getType(), "operand", index++)))
174 return ::mlir::failure();
175 }
176 }
177 {
178 unsigned index = 0; (void)index;
179 auto valueGroup0 = getODSResults(0);
180
181 for (auto v : valueGroup0) {
182 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops2(*this, v.getType(), "result", index++)))
183 return ::mlir::failure();
184 }
185 }
186 if (!((::llzk::typesUnify((*this->getODSOperands(0).begin()).getType(), (*this->getODSResults(0).begin()).getType()))))
187 return emitOpError("failed to verify that result type matches with lhs type");
188 if (!((::llzk::typesUnify((*this->getODSOperands(1).begin()).getType(), (*this->getODSResults(0).begin()).getType()))))
189 return emitOpError("failed to verify that result type matches with rhs type");
190 return ::mlir::success();
191}
192
193::llvm::LogicalResult AndBoolOp::verifyInvariants() {
194 return verifyInvariantsImpl();
195}
196
197::llvm::LogicalResult AndBoolOp::inferReturnTypes(::mlir::MLIRContext *context, ::std::optional<::mlir::Location> location, ::mlir::ValueRange operands, ::mlir::DictionaryAttr attributes, ::mlir::OpaqueProperties properties, ::mlir::RegionRange regions, ::llvm::SmallVectorImpl<::mlir::Type>&inferredReturnTypes) {
198 inferredReturnTypes.resize(1);
199 ::mlir::Builder odsBuilder(context);
200 ::mlir::Type odsInferredType0 = odsBuilder.getIntegerType(1);
201 inferredReturnTypes[0] = odsInferredType0;
202 return ::mlir::success();
203}
204
205::mlir::ParseResult AndBoolOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
206 ::mlir::OpAsmParser::UnresolvedOperand lhsRawOperand{};
207 ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> lhsOperands(&lhsRawOperand, 1); ::llvm::SMLoc lhsOperandsLoc;
208 (void)lhsOperandsLoc;
209 ::mlir::OpAsmParser::UnresolvedOperand rhsRawOperand{};
210 ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> rhsOperands(&rhsRawOperand, 1); ::llvm::SMLoc rhsOperandsLoc;
211 (void)rhsOperandsLoc;
212 ::mlir::Type lhsRawType{};
213 ::llvm::ArrayRef<::mlir::Type> lhsTypes(&lhsRawType, 1);
214 ::mlir::Type rhsRawType{};
215 ::llvm::ArrayRef<::mlir::Type> rhsTypes(&rhsRawType, 1);
216
217 lhsOperandsLoc = parser.getCurrentLocation();
218 if (parser.parseOperand(lhsRawOperand))
219 return ::mlir::failure();
220 if (parser.parseComma())
221 return ::mlir::failure();
222
223 rhsOperandsLoc = parser.getCurrentLocation();
224 if (parser.parseOperand(rhsRawOperand))
225 return ::mlir::failure();
226 {
227 auto odsResult = parseInferredOrParsedType(parser, lhsRawType, true);
228 if (odsResult) return ::mlir::failure();
229 }
230 {
231 auto odsResult = parseInferredOrParsedType(parser, rhsRawType, false);
232 if (odsResult) return ::mlir::failure();
233 }
234 {
235 auto loc = parser.getCurrentLocation();(void)loc;
236 if (parser.parseOptionalAttrDict(result.attributes))
237 return ::mlir::failure();
238 }
239 ::mlir::Type odsBuildableType0 = parser.getBuilder().getIntegerType(1);
240 result.addTypes(odsBuildableType0);
241 if (parser.resolveOperands(lhsOperands, lhsTypes, lhsOperandsLoc, result.operands))
242 return ::mlir::failure();
243 if (parser.resolveOperands(rhsOperands, rhsTypes, rhsOperandsLoc, result.operands))
244 return ::mlir::failure();
245 return ::mlir::success();
246}
247
248void AndBoolOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
249 _odsPrinter << ' ';
250 _odsPrinter << getLhs();
251 _odsPrinter << ",";
252 _odsPrinter << ' ';
253 _odsPrinter << getRhs();
254 printInferredOrParsedType(_odsPrinter, *this, getLhs().getType(), true);
255 printInferredOrParsedType(_odsPrinter, *this, getRhs().getType(), false);
256 ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
257 _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
258}
259
260void AndBoolOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
261}
262
263} // namespace boolean
264} // namespace llzk
265MLIR_DEFINE_EXPLICIT_TYPE_ID(::llzk::boolean::AndBoolOp)
266
267namespace llzk {
268namespace boolean {
269
270//===----------------------------------------------------------------------===//
271// ::llzk::boolean::AssertOp definitions
272//===----------------------------------------------------------------------===//
273
274namespace detail {
275AssertOpGenericAdaptorBase::AssertOpGenericAdaptorBase(AssertOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
276
277::std::optional< ::llvm::StringRef > AssertOpGenericAdaptorBase::getMsg() {
278 auto attr = getMsgAttr();
279 return attr ? ::std::optional< ::llvm::StringRef >(attr.getValue()) : (::std::nullopt);
280}
281
282} // namespace detail
284
285::llvm::LogicalResult AssertOpAdaptor::verify(::mlir::Location loc) {
286 auto tblgen_msg = getProperties().msg; (void)tblgen_msg;
287
288 if (tblgen_msg && !((::llvm::isa<::mlir::StringAttr>(tblgen_msg))))
289 return emitError(loc, "'bool.assert' op ""attribute 'msg' failed to satisfy constraint: string attribute");
290 return ::mlir::success();
291}
292
293::llvm::LogicalResult AssertOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
294 ::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
295 if (!dict) {
296 emitError() << "expected DictionaryAttr to set properties";
297 return ::mlir::failure();
298 }
299
300 {
301 auto &propStorage = prop.msg;
302 auto attr = dict.get("msg");
303 if (attr) {
304 auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
305 if (convertedAttr) {
306 propStorage = convertedAttr;
307 } else {
308 emitError() << "Invalid attribute `msg` in property conversion: " << attr;
309 return ::mlir::failure();
310 }
311 }
312 }
313 return ::mlir::success();
314}
315
316::mlir::Attribute AssertOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
317 ::mlir::SmallVector<::mlir::NamedAttribute> attrs;
318 ::mlir::Builder odsBuilder{ctx};
319
320 {
321 const auto &propStorage = prop.msg;
322 if (propStorage)
323 attrs.push_back(odsBuilder.getNamedAttr("msg",
324 propStorage));
325 }
326
327 if (!attrs.empty())
328 return odsBuilder.getDictionaryAttr(attrs);
329 return {};
330}
331
332llvm::hash_code AssertOp::computePropertiesHash(const Properties &prop) {
333 return llvm::hash_combine(
334 llvm::hash_value(prop.msg.getAsOpaquePointer()));
335}
336
337std::optional<mlir::Attribute> AssertOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
338 if (name == "msg")
339 return prop.msg;
340 return std::nullopt;
341}
342
343void AssertOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
344 if (name == "msg") {
345 prop.msg = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.msg)>>(value);
346 return;
347 }
348}
349
350void AssertOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
351 if (prop.msg) attrs.append("msg", prop.msg);
352}
353
354::llvm::LogicalResult AssertOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
355 {
356 ::mlir::Attribute attr = attrs.get(getMsgAttrName(opName));
357 if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_Ops1(attr, "msg", emitError)))
358 return ::mlir::failure();
359 }
360 return ::mlir::success();
361}
362
363::llvm::LogicalResult AssertOp::readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state) {
364 auto &prop = state.getOrAddProperties<Properties>(); (void)prop;
365 if (::mlir::failed(reader.readOptionalAttribute(prop.msg)))
366 return ::mlir::failure();
367 return ::mlir::success();
368}
369
370void AssertOp::writeProperties(::mlir::DialectBytecodeWriter &writer) {
371 auto &prop = getProperties(); (void)prop;
372
373 writer.writeOptionalAttribute(prop.msg);
374}
375
376::std::optional< ::llvm::StringRef > AssertOp::getMsg() {
377 auto attr = getMsgAttr();
378 return attr ? ::std::optional< ::llvm::StringRef >(attr.getValue()) : (::std::nullopt);
379}
380
381void AssertOp::setMsg(::std::optional<::llvm::StringRef> attrValue) {
382 auto &odsProp = getProperties().msg;
383 if (attrValue)
384 odsProp = ::mlir::Builder((*this)->getContext()).getStringAttr(*attrValue);
385 else
386 odsProp = nullptr;
387}
388
389void AssertOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value condition, /*optional*/::mlir::StringAttr msg) {
390 odsState.addOperands(condition);
391 if (msg) {
392 odsState.getOrAddProperties<Properties>().msg = msg;
393 }
394}
395
396void AssertOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value condition, /*optional*/::mlir::StringAttr msg) {
397 odsState.addOperands(condition);
398 if (msg) {
399 odsState.getOrAddProperties<Properties>().msg = msg;
400 }
401 assert(resultTypes.size() == 0u && "mismatched number of results");
402 odsState.addTypes(resultTypes);
403}
404
405void AssertOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
406 assert(operands.size() == 1u && "mismatched number of parameters");
407 odsState.addOperands(operands);
408 odsState.addAttributes(attributes);
409 assert(resultTypes.size() == 0u && "mismatched number of return types");
410 odsState.addTypes(resultTypes);
411
412 if (!attributes.empty()) {
413 ::mlir::OpaqueProperties properties =
414 &odsState.getOrAddProperties<AssertOp::Properties>();
415 std::optional<::mlir::RegisteredOperationName> info =
416 odsState.name.getRegisteredInfo();
417 if (failed(info->setOpPropertiesFromAttribute(odsState.name, properties,
418 odsState.attributes.getDictionary(odsState.getContext()), nullptr)))
419 ::llvm::report_fatal_error("Property conversion failed.");
420 }
421}
422
423::llvm::LogicalResult AssertOp::verifyInvariantsImpl() {
424 auto tblgen_msg = getProperties().msg; (void)tblgen_msg;
425
426 if (::mlir::failed(__mlir_ods_local_attr_constraint_Ops1(*this, tblgen_msg, "msg")))
427 return ::mlir::failure();
428 {
429 unsigned index = 0; (void)index;
430 auto valueGroup0 = getODSOperands(0);
431
432 for (auto v : valueGroup0) {
433 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops2(*this, v.getType(), "operand", index++)))
434 return ::mlir::failure();
435 }
436 }
437 return ::mlir::success();
438}
439
440::llvm::LogicalResult AssertOp::verifyInvariants() {
441 return verifyInvariantsImpl();
442}
443
444::mlir::ParseResult AssertOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
445 ::mlir::OpAsmParser::UnresolvedOperand conditionRawOperand{};
446 ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> conditionOperands(&conditionRawOperand, 1); ::llvm::SMLoc conditionOperandsLoc;
447 (void)conditionOperandsLoc;
448 ::mlir::StringAttr msgAttr;
449
450 conditionOperandsLoc = parser.getCurrentLocation();
451 if (parser.parseOperand(conditionRawOperand))
452 return ::mlir::failure();
453 if (::mlir::succeeded(parser.parseOptionalComma())) {
454
455 if (parser.parseCustomAttributeWithFallback(msgAttr, parser.getBuilder().getType<::mlir::NoneType>())) {
456 return ::mlir::failure();
457 }
458 if (msgAttr) result.getOrAddProperties<AssertOp::Properties>().msg = msgAttr;
459 }
460 {
461 auto loc = parser.getCurrentLocation();(void)loc;
462 if (parser.parseOptionalAttrDict(result.attributes))
463 return ::mlir::failure();
464 if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() {
465 return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op ";
466 })))
467 return ::mlir::failure();
468 }
469 ::mlir::Type odsBuildableType0 = parser.getBuilder().getIntegerType(1);
470 if (parser.resolveOperands(conditionOperands, odsBuildableType0, conditionOperandsLoc, result.operands))
471 return ::mlir::failure();
472 return ::mlir::success();
473}
474
475void AssertOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
476 _odsPrinter << ' ';
477 _odsPrinter << getCondition();
478 if (getMsgAttr()) {
479 _odsPrinter << ",";
480 _odsPrinter << ' ';
481 _odsPrinter.printAttributeWithoutType(getMsgAttr());
482 }
483 ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
484 elidedAttrs.push_back("msg");
485 _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
486}
487
488} // namespace boolean
489} // namespace llzk
490MLIR_DEFINE_EXPLICIT_TYPE_ID(::llzk::boolean::AssertOp)
491
492namespace llzk {
493namespace boolean {
494
495//===----------------------------------------------------------------------===//
496// ::llzk::boolean::CmpOp definitions
497//===----------------------------------------------------------------------===//
498
499namespace detail {
500CmpOpGenericAdaptorBase::CmpOpGenericAdaptorBase(CmpOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
501
506
507} // namespace detail
509
510::llvm::LogicalResult CmpOpAdaptor::verify(::mlir::Location loc) {
511 auto tblgen_predicate = getProperties().predicate; (void)tblgen_predicate;
512 if (!tblgen_predicate) return emitError(loc, "'bool.cmp' op ""requires attribute 'predicate'");
513
514 if (tblgen_predicate && !((::llvm::isa<::llzk::boolean::FeltCmpPredicateAttr>(tblgen_predicate))))
515 return emitError(loc, "'bool.cmp' op ""attribute 'predicate' failed to satisfy constraint: Field element comparison predicate");
516 return ::mlir::success();
517}
518
519::llvm::LogicalResult CmpOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
520 ::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
521 if (!dict) {
522 emitError() << "expected DictionaryAttr to set properties";
523 return ::mlir::failure();
524 }
525
526 {
527 auto &propStorage = prop.predicate;
528 auto attr = dict.get("predicate");
529 if (attr) {
530 auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
531 if (convertedAttr) {
532 propStorage = convertedAttr;
533 } else {
534 emitError() << "Invalid attribute `predicate` in property conversion: " << attr;
535 return ::mlir::failure();
536 }
537 }
538 }
539 return ::mlir::success();
540}
541
542::mlir::Attribute CmpOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
543 ::mlir::SmallVector<::mlir::NamedAttribute> attrs;
544 ::mlir::Builder odsBuilder{ctx};
545
546 {
547 const auto &propStorage = prop.predicate;
548 if (propStorage)
549 attrs.push_back(odsBuilder.getNamedAttr("predicate",
550 propStorage));
551 }
552
553 if (!attrs.empty())
554 return odsBuilder.getDictionaryAttr(attrs);
555 return {};
556}
557
558llvm::hash_code CmpOp::computePropertiesHash(const Properties &prop) {
559 return llvm::hash_combine(
560 llvm::hash_value(prop.predicate.getAsOpaquePointer()));
561}
562
563std::optional<mlir::Attribute> CmpOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
564 if (name == "predicate")
565 return prop.predicate;
566 return std::nullopt;
567}
568
569void CmpOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
570 if (name == "predicate") {
571 prop.predicate = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.predicate)>>(value);
572 return;
573 }
574}
575
576void CmpOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
577 if (prop.predicate) attrs.append("predicate", prop.predicate);
578}
579
580::llvm::LogicalResult CmpOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
581 {
582 ::mlir::Attribute attr = attrs.get(getPredicateAttrName(opName));
583 if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_Ops2(attr, "predicate", emitError)))
584 return ::mlir::failure();
585 }
586 return ::mlir::success();
587}
588
589::llvm::LogicalResult CmpOp::readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state) {
590 auto &prop = state.getOrAddProperties<Properties>(); (void)prop;
591 if (::mlir::failed(reader.readAttribute(prop.predicate)))
592 return ::mlir::failure();
593 return ::mlir::success();
594}
595
596void CmpOp::writeProperties(::mlir::DialectBytecodeWriter &writer) {
597 auto &prop = getProperties(); (void)prop;
598 writer.writeAttribute(prop.predicate);
599}
600
602 auto attr = getPredicateAttr();
603 return attr.getValue();
604}
605
607 getProperties().predicate = ::llzk::boolean::FeltCmpPredicateAttr::get(::mlir::Builder((*this)->getContext()).getContext(), attrValue);
608}
609
610void CmpOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::llzk::boolean::FeltCmpPredicateAttr predicate, ::mlir::Value lhs, ::mlir::Value rhs) {
611 odsState.addOperands(lhs);
612 odsState.addOperands(rhs);
613 odsState.getOrAddProperties<Properties>().predicate = predicate;
614 odsState.addTypes(result);
615}
616
617void CmpOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::llzk::boolean::FeltCmpPredicateAttr predicate, ::mlir::Value lhs, ::mlir::Value rhs) {
618 odsState.addOperands(lhs);
619 odsState.addOperands(rhs);
620 odsState.getOrAddProperties<Properties>().predicate = predicate;
621
622 ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
623 if (::mlir::succeeded(CmpOp::inferReturnTypes(odsBuilder.getContext(),
624 odsState.location, odsState.operands,
625 odsState.attributes.getDictionary(odsState.getContext()),
626 odsState.getRawProperties(),
627 odsState.regions, inferredReturnTypes)))
628 odsState.addTypes(inferredReturnTypes);
629 else
630 ::mlir::detail::reportFatalInferReturnTypesError(odsState);
631
632}
633
634void CmpOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::llzk::boolean::FeltCmpPredicateAttr predicate, ::mlir::Value lhs, ::mlir::Value rhs) {
635 odsState.addOperands(lhs);
636 odsState.addOperands(rhs);
637 odsState.getOrAddProperties<Properties>().predicate = predicate;
638 assert(resultTypes.size() == 1u && "mismatched number of results");
639 odsState.addTypes(resultTypes);
640}
641
642void CmpOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::llzk::boolean::FeltCmpPredicate predicate, ::mlir::Value lhs, ::mlir::Value rhs) {
643 odsState.addOperands(lhs);
644 odsState.addOperands(rhs);
645 odsState.getOrAddProperties<Properties>().predicate = ::llzk::boolean::FeltCmpPredicateAttr::get(odsBuilder.getContext(), predicate);
646 odsState.addTypes(result);
647}
648
649void CmpOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::llzk::boolean::FeltCmpPredicate predicate, ::mlir::Value lhs, ::mlir::Value rhs) {
650 odsState.addOperands(lhs);
651 odsState.addOperands(rhs);
652 odsState.getOrAddProperties<Properties>().predicate = ::llzk::boolean::FeltCmpPredicateAttr::get(odsBuilder.getContext(), predicate);
653
654 ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
655 if (::mlir::succeeded(CmpOp::inferReturnTypes(odsBuilder.getContext(),
656 odsState.location, odsState.operands,
657 odsState.attributes.getDictionary(odsState.getContext()),
658 odsState.getRawProperties(),
659 odsState.regions, inferredReturnTypes)))
660 odsState.addTypes(inferredReturnTypes);
661 else
662 ::mlir::detail::reportFatalInferReturnTypesError(odsState);
663
664}
665
666void CmpOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::llzk::boolean::FeltCmpPredicate predicate, ::mlir::Value lhs, ::mlir::Value rhs) {
667 odsState.addOperands(lhs);
668 odsState.addOperands(rhs);
669 odsState.getOrAddProperties<Properties>().predicate = ::llzk::boolean::FeltCmpPredicateAttr::get(odsBuilder.getContext(), predicate);
670 assert(resultTypes.size() == 1u && "mismatched number of results");
671 odsState.addTypes(resultTypes);
672}
673
674void CmpOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
675 assert(operands.size() == 2u && "mismatched number of parameters");
676 odsState.addOperands(operands);
677 odsState.addAttributes(attributes);
678 assert(resultTypes.size() == 1u && "mismatched number of return types");
679 odsState.addTypes(resultTypes);
680
681 if (!attributes.empty()) {
682 ::mlir::OpaqueProperties properties =
683 &odsState.getOrAddProperties<CmpOp::Properties>();
684 std::optional<::mlir::RegisteredOperationName> info =
685 odsState.name.getRegisteredInfo();
686 if (failed(info->setOpPropertiesFromAttribute(odsState.name, properties,
687 odsState.attributes.getDictionary(odsState.getContext()), nullptr)))
688 ::llvm::report_fatal_error("Property conversion failed.");
689 }
690}
691
692void CmpOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
693 assert(operands.size() == 2u && "mismatched number of parameters");
694 odsState.addOperands(operands);
695 odsState.addAttributes(attributes);
696
697 if (!attributes.empty()) {
698 ::mlir::OpaqueProperties properties =
699 &odsState.getOrAddProperties<CmpOp::Properties>();
700 std::optional<::mlir::RegisteredOperationName> info =
701 odsState.name.getRegisteredInfo();
702 if (failed(info->setOpPropertiesFromAttribute(odsState.name, properties,
703 odsState.attributes.getDictionary(odsState.getContext()), nullptr)))
704 ::llvm::report_fatal_error("Property conversion failed.");
705 }
706 ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
707 if (::mlir::succeeded(CmpOp::inferReturnTypes(odsBuilder.getContext(),
708 odsState.location, operands,
709 odsState.attributes.getDictionary(odsState.getContext()),
710 odsState.getRawProperties(),
711 odsState.regions, inferredReturnTypes))) {
712 assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
713 odsState.addTypes(inferredReturnTypes);
714 } else {
715 ::llvm::report_fatal_error("Failed to infer result type(s).");
716 }
717}
718
719::llvm::LogicalResult CmpOp::verifyInvariantsImpl() {
720 auto tblgen_predicate = getProperties().predicate; (void)tblgen_predicate;
721 if (!tblgen_predicate) return emitOpError("requires attribute 'predicate'");
722
723 if (::mlir::failed(__mlir_ods_local_attr_constraint_Ops2(*this, tblgen_predicate, "predicate")))
724 return ::mlir::failure();
725 {
726 unsigned index = 0; (void)index;
727 auto valueGroup0 = getODSOperands(0);
728
729 for (auto v : valueGroup0) {
730 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops3(*this, v.getType(), "operand", index++)))
731 return ::mlir::failure();
732 }
733 auto valueGroup1 = getODSOperands(1);
734
735 for (auto v : valueGroup1) {
736 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops3(*this, v.getType(), "operand", index++)))
737 return ::mlir::failure();
738 }
739 }
740 {
741 unsigned index = 0; (void)index;
742 auto valueGroup0 = getODSResults(0);
743
744 for (auto v : valueGroup0) {
745 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops2(*this, v.getType(), "result", index++)))
746 return ::mlir::failure();
747 }
748 }
749 return ::mlir::success();
750}
751
752::llvm::LogicalResult CmpOp::verifyInvariants() {
753 return verifyInvariantsImpl();
754}
755
756::llvm::LogicalResult CmpOp::inferReturnTypes(::mlir::MLIRContext *context, ::std::optional<::mlir::Location> location, ::mlir::ValueRange operands, ::mlir::DictionaryAttr attributes, ::mlir::OpaqueProperties properties, ::mlir::RegionRange regions, ::llvm::SmallVectorImpl<::mlir::Type>&inferredReturnTypes) {
757 inferredReturnTypes.resize(1);
758 ::mlir::Builder odsBuilder(context);
759 ::mlir::Type odsInferredType0 = odsBuilder.getIntegerType(1);
760 inferredReturnTypes[0] = odsInferredType0;
761 return ::mlir::success();
762}
763
764::mlir::ParseResult CmpOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
765 ::llzk::boolean::FeltCmpPredicateAttr predicateAttr;
766 ::mlir::OpAsmParser::UnresolvedOperand lhsRawOperand{};
767 ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> lhsOperands(&lhsRawOperand, 1); ::llvm::SMLoc lhsOperandsLoc;
768 (void)lhsOperandsLoc;
769 ::mlir::OpAsmParser::UnresolvedOperand rhsRawOperand{};
770 ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> rhsOperands(&rhsRawOperand, 1); ::llvm::SMLoc rhsOperandsLoc;
771 (void)rhsOperandsLoc;
772
773 if (parser.parseCustomAttributeWithFallback(predicateAttr, ::mlir::Type{})) {
774 return ::mlir::failure();
775 }
776 if (predicateAttr) result.getOrAddProperties<CmpOp::Properties>().predicate = predicateAttr;
777 if (parser.parseLParen())
778 return ::mlir::failure();
779
780 lhsOperandsLoc = parser.getCurrentLocation();
781 if (parser.parseOperand(lhsRawOperand))
782 return ::mlir::failure();
783 if (parser.parseComma())
784 return ::mlir::failure();
785
786 rhsOperandsLoc = parser.getCurrentLocation();
787 if (parser.parseOperand(rhsRawOperand))
788 return ::mlir::failure();
789 if (parser.parseRParen())
790 return ::mlir::failure();
791 {
792 auto loc = parser.getCurrentLocation();(void)loc;
793 if (parser.parseOptionalAttrDict(result.attributes))
794 return ::mlir::failure();
795 if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() {
796 return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op ";
797 })))
798 return ::mlir::failure();
799 }
800 ::mlir::Type odsBuildableType0 = parser.getBuilder().getIntegerType(1);
801 ::mlir::Type odsBuildableType1 = parser.getBuilder().getType<::llzk::felt::FeltType>();
802 result.addTypes(odsBuildableType0);
803 if (parser.resolveOperands(lhsOperands, odsBuildableType1, lhsOperandsLoc, result.operands))
804 return ::mlir::failure();
805 if (parser.resolveOperands(rhsOperands, odsBuildableType1, rhsOperandsLoc, result.operands))
806 return ::mlir::failure();
807 return ::mlir::success();
808}
809
810void CmpOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
811_odsPrinter.printStrippedAttrOrType(getPredicateAttr());
812 _odsPrinter << "(";
813 _odsPrinter << getLhs();
814 _odsPrinter << ",";
815 _odsPrinter << ' ';
816 _odsPrinter << getRhs();
817 _odsPrinter << ")";
818 ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
819 elidedAttrs.push_back("predicate");
820 _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
821}
822
823void CmpOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
824}
825
826} // namespace boolean
827} // namespace llzk
828MLIR_DEFINE_EXPLICIT_TYPE_ID(::llzk::boolean::CmpOp)
829
830namespace llzk {
831namespace boolean {
832
833//===----------------------------------------------------------------------===//
834// ::llzk::boolean::NotBoolOp definitions
835//===----------------------------------------------------------------------===//
836
837namespace detail {
838} // namespace detail
840
841::llvm::LogicalResult NotBoolOpAdaptor::verify(::mlir::Location loc) {
842 return ::mlir::success();
843}
844
845void NotBoolOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value operand) {
846 odsState.addOperands(operand);
847 odsState.addTypes(result);
848}
849
850void NotBoolOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value operand) {
851 odsState.addOperands(operand);
852
853 ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
854 if (::mlir::succeeded(NotBoolOp::inferReturnTypes(odsBuilder.getContext(),
855 odsState.location, odsState.operands,
856 odsState.attributes.getDictionary(odsState.getContext()),
857 odsState.getRawProperties(),
858 odsState.regions, inferredReturnTypes)))
859 odsState.addTypes(inferredReturnTypes);
860 else
861 ::mlir::detail::reportFatalInferReturnTypesError(odsState);
862
863}
864
865void NotBoolOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value operand) {
866 odsState.addOperands(operand);
867 assert(resultTypes.size() == 1u && "mismatched number of results");
868 odsState.addTypes(resultTypes);
869}
870
871void NotBoolOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
872 assert(operands.size() == 1u && "mismatched number of parameters");
873 odsState.addOperands(operands);
874 odsState.addAttributes(attributes);
875 assert(resultTypes.size() == 1u && "mismatched number of return types");
876 odsState.addTypes(resultTypes);
877}
878
879void NotBoolOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
880 assert(operands.size() == 1u && "mismatched number of parameters");
881 odsState.addOperands(operands);
882 odsState.addAttributes(attributes);
883
884 ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
885 if (::mlir::succeeded(NotBoolOp::inferReturnTypes(odsBuilder.getContext(),
886 odsState.location, operands,
887 odsState.attributes.getDictionary(odsState.getContext()),
888 odsState.getRawProperties(),
889 odsState.regions, inferredReturnTypes))) {
890 assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
891 odsState.addTypes(inferredReturnTypes);
892 } else {
893 ::llvm::report_fatal_error("Failed to infer result type(s).");
894 }
895}
896
897::llvm::LogicalResult NotBoolOp::verifyInvariantsImpl() {
898 {
899 unsigned index = 0; (void)index;
900 auto valueGroup0 = getODSOperands(0);
901
902 for (auto v : valueGroup0) {
903 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops1(*this, v.getType(), "operand", index++)))
904 return ::mlir::failure();
905 }
906 }
907 {
908 unsigned index = 0; (void)index;
909 auto valueGroup0 = getODSResults(0);
910
911 for (auto v : valueGroup0) {
912 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops2(*this, v.getType(), "result", index++)))
913 return ::mlir::failure();
914 }
915 }
916 if (!((::llzk::typesUnify((*this->getODSOperands(0).begin()).getType(), (*this->getODSResults(0).begin()).getType()))))
917 return emitOpError("failed to verify that result type matches with operand type");
918 return ::mlir::success();
919}
920
921::llvm::LogicalResult NotBoolOp::verifyInvariants() {
922 return verifyInvariantsImpl();
923}
924
925::llvm::LogicalResult NotBoolOp::inferReturnTypes(::mlir::MLIRContext *context, ::std::optional<::mlir::Location> location, ::mlir::ValueRange operands, ::mlir::DictionaryAttr attributes, ::mlir::OpaqueProperties properties, ::mlir::RegionRange regions, ::llvm::SmallVectorImpl<::mlir::Type>&inferredReturnTypes) {
926 inferredReturnTypes.resize(1);
927 ::mlir::Builder odsBuilder(context);
928 ::mlir::Type odsInferredType0 = odsBuilder.getIntegerType(1);
929 inferredReturnTypes[0] = odsInferredType0;
930 return ::mlir::success();
931}
932
933::mlir::ParseResult NotBoolOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
934 ::mlir::OpAsmParser::UnresolvedOperand operandRawOperand{};
935 ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> operandOperands(&operandRawOperand, 1); ::llvm::SMLoc operandOperandsLoc;
936 (void)operandOperandsLoc;
937 ::mlir::Type operandRawType{};
938 ::llvm::ArrayRef<::mlir::Type> operandTypes(&operandRawType, 1);
939
940 operandOperandsLoc = parser.getCurrentLocation();
941 if (parser.parseOperand(operandRawOperand))
942 return ::mlir::failure();
943 {
944 auto odsResult = parseInferredOrParsedType(parser, operandRawType, true);
945 if (odsResult) return ::mlir::failure();
946 }
947 {
948 auto loc = parser.getCurrentLocation();(void)loc;
949 if (parser.parseOptionalAttrDict(result.attributes))
950 return ::mlir::failure();
951 }
952 ::mlir::Type odsBuildableType0 = parser.getBuilder().getIntegerType(1);
953 result.addTypes(odsBuildableType0);
954 if (parser.resolveOperands(operandOperands, operandTypes, operandOperandsLoc, result.operands))
955 return ::mlir::failure();
956 return ::mlir::success();
957}
958
959void NotBoolOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
960 _odsPrinter << ' ';
961 _odsPrinter << getOperand();
962 printInferredOrParsedType(_odsPrinter, *this, getOperand().getType(), true);
963 ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
964 _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
965}
966
967void NotBoolOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
968}
969
970} // namespace boolean
971} // namespace llzk
972MLIR_DEFINE_EXPLICIT_TYPE_ID(::llzk::boolean::NotBoolOp)
973
974namespace llzk {
975namespace boolean {
976
977//===----------------------------------------------------------------------===//
978// ::llzk::boolean::OrBoolOp definitions
979//===----------------------------------------------------------------------===//
980
981namespace detail {
982} // namespace detail
984
985::llvm::LogicalResult OrBoolOpAdaptor::verify(::mlir::Location loc) {
986 return ::mlir::success();
987}
988
989void OrBoolOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs) {
990 odsState.addOperands(lhs);
991 odsState.addOperands(rhs);
992 odsState.addTypes(result);
993}
994
995void OrBoolOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value lhs, ::mlir::Value rhs) {
996 odsState.addOperands(lhs);
997 odsState.addOperands(rhs);
998
999 ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
1000 if (::mlir::succeeded(OrBoolOp::inferReturnTypes(odsBuilder.getContext(),
1001 odsState.location, odsState.operands,
1002 odsState.attributes.getDictionary(odsState.getContext()),
1003 odsState.getRawProperties(),
1004 odsState.regions, inferredReturnTypes)))
1005 odsState.addTypes(inferredReturnTypes);
1006 else
1007 ::mlir::detail::reportFatalInferReturnTypesError(odsState);
1008
1009}
1010
1011void OrBoolOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs) {
1012 odsState.addOperands(lhs);
1013 odsState.addOperands(rhs);
1014 assert(resultTypes.size() == 1u && "mismatched number of results");
1015 odsState.addTypes(resultTypes);
1016}
1017
1018void OrBoolOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
1019 assert(operands.size() == 2u && "mismatched number of parameters");
1020 odsState.addOperands(operands);
1021 odsState.addAttributes(attributes);
1022 assert(resultTypes.size() == 1u && "mismatched number of return types");
1023 odsState.addTypes(resultTypes);
1024}
1025
1026void OrBoolOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
1027 assert(operands.size() == 2u && "mismatched number of parameters");
1028 odsState.addOperands(operands);
1029 odsState.addAttributes(attributes);
1030
1031 ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
1032 if (::mlir::succeeded(OrBoolOp::inferReturnTypes(odsBuilder.getContext(),
1033 odsState.location, operands,
1034 odsState.attributes.getDictionary(odsState.getContext()),
1035 odsState.getRawProperties(),
1036 odsState.regions, inferredReturnTypes))) {
1037 assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
1038 odsState.addTypes(inferredReturnTypes);
1039 } else {
1040 ::llvm::report_fatal_error("Failed to infer result type(s).");
1041 }
1042}
1043
1044::llvm::LogicalResult OrBoolOp::verifyInvariantsImpl() {
1045 {
1046 unsigned index = 0; (void)index;
1047 auto valueGroup0 = getODSOperands(0);
1048
1049 for (auto v : valueGroup0) {
1050 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops1(*this, v.getType(), "operand", index++)))
1051 return ::mlir::failure();
1052 }
1053 auto valueGroup1 = getODSOperands(1);
1054
1055 for (auto v : valueGroup1) {
1056 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops1(*this, v.getType(), "operand", index++)))
1057 return ::mlir::failure();
1058 }
1059 }
1060 {
1061 unsigned index = 0; (void)index;
1062 auto valueGroup0 = getODSResults(0);
1063
1064 for (auto v : valueGroup0) {
1065 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops2(*this, v.getType(), "result", index++)))
1066 return ::mlir::failure();
1067 }
1068 }
1069 if (!((::llzk::typesUnify((*this->getODSOperands(0).begin()).getType(), (*this->getODSResults(0).begin()).getType()))))
1070 return emitOpError("failed to verify that result type matches with lhs type");
1071 if (!((::llzk::typesUnify((*this->getODSOperands(1).begin()).getType(), (*this->getODSResults(0).begin()).getType()))))
1072 return emitOpError("failed to verify that result type matches with rhs type");
1073 return ::mlir::success();
1074}
1075
1076::llvm::LogicalResult OrBoolOp::verifyInvariants() {
1077 return verifyInvariantsImpl();
1078}
1079
1080::llvm::LogicalResult OrBoolOp::inferReturnTypes(::mlir::MLIRContext *context, ::std::optional<::mlir::Location> location, ::mlir::ValueRange operands, ::mlir::DictionaryAttr attributes, ::mlir::OpaqueProperties properties, ::mlir::RegionRange regions, ::llvm::SmallVectorImpl<::mlir::Type>&inferredReturnTypes) {
1081 inferredReturnTypes.resize(1);
1082 ::mlir::Builder odsBuilder(context);
1083 ::mlir::Type odsInferredType0 = odsBuilder.getIntegerType(1);
1084 inferredReturnTypes[0] = odsInferredType0;
1085 return ::mlir::success();
1086}
1087
1088::mlir::ParseResult OrBoolOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
1089 ::mlir::OpAsmParser::UnresolvedOperand lhsRawOperand{};
1090 ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> lhsOperands(&lhsRawOperand, 1); ::llvm::SMLoc lhsOperandsLoc;
1091 (void)lhsOperandsLoc;
1092 ::mlir::OpAsmParser::UnresolvedOperand rhsRawOperand{};
1093 ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> rhsOperands(&rhsRawOperand, 1); ::llvm::SMLoc rhsOperandsLoc;
1094 (void)rhsOperandsLoc;
1095 ::mlir::Type lhsRawType{};
1096 ::llvm::ArrayRef<::mlir::Type> lhsTypes(&lhsRawType, 1);
1097 ::mlir::Type rhsRawType{};
1098 ::llvm::ArrayRef<::mlir::Type> rhsTypes(&rhsRawType, 1);
1099
1100 lhsOperandsLoc = parser.getCurrentLocation();
1101 if (parser.parseOperand(lhsRawOperand))
1102 return ::mlir::failure();
1103 if (parser.parseComma())
1104 return ::mlir::failure();
1105
1106 rhsOperandsLoc = parser.getCurrentLocation();
1107 if (parser.parseOperand(rhsRawOperand))
1108 return ::mlir::failure();
1109 {
1110 auto odsResult = parseInferredOrParsedType(parser, lhsRawType, true);
1111 if (odsResult) return ::mlir::failure();
1112 }
1113 {
1114 auto odsResult = parseInferredOrParsedType(parser, rhsRawType, false);
1115 if (odsResult) return ::mlir::failure();
1116 }
1117 {
1118 auto loc = parser.getCurrentLocation();(void)loc;
1119 if (parser.parseOptionalAttrDict(result.attributes))
1120 return ::mlir::failure();
1121 }
1122 ::mlir::Type odsBuildableType0 = parser.getBuilder().getIntegerType(1);
1123 result.addTypes(odsBuildableType0);
1124 if (parser.resolveOperands(lhsOperands, lhsTypes, lhsOperandsLoc, result.operands))
1125 return ::mlir::failure();
1126 if (parser.resolveOperands(rhsOperands, rhsTypes, rhsOperandsLoc, result.operands))
1127 return ::mlir::failure();
1128 return ::mlir::success();
1129}
1130
1131void OrBoolOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
1132 _odsPrinter << ' ';
1133 _odsPrinter << getLhs();
1134 _odsPrinter << ",";
1135 _odsPrinter << ' ';
1136 _odsPrinter << getRhs();
1137 printInferredOrParsedType(_odsPrinter, *this, getLhs().getType(), true);
1138 printInferredOrParsedType(_odsPrinter, *this, getRhs().getType(), false);
1139 ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
1140 _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
1141}
1142
1143void OrBoolOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
1144}
1145
1146} // namespace boolean
1147} // namespace llzk
1148MLIR_DEFINE_EXPLICIT_TYPE_ID(::llzk::boolean::OrBoolOp)
1149
1150namespace llzk {
1151namespace boolean {
1152
1153//===----------------------------------------------------------------------===//
1154// ::llzk::boolean::XorBoolOp definitions
1155//===----------------------------------------------------------------------===//
1156
1157namespace detail {
1158} // namespace detail
1160
1161::llvm::LogicalResult XorBoolOpAdaptor::verify(::mlir::Location loc) {
1162 return ::mlir::success();
1163}
1164
1165void XorBoolOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs) {
1166 odsState.addOperands(lhs);
1167 odsState.addOperands(rhs);
1168 odsState.addTypes(result);
1169}
1170
1171void XorBoolOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value lhs, ::mlir::Value rhs) {
1172 odsState.addOperands(lhs);
1173 odsState.addOperands(rhs);
1174
1175 ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
1176 if (::mlir::succeeded(XorBoolOp::inferReturnTypes(odsBuilder.getContext(),
1177 odsState.location, odsState.operands,
1178 odsState.attributes.getDictionary(odsState.getContext()),
1179 odsState.getRawProperties(),
1180 odsState.regions, inferredReturnTypes)))
1181 odsState.addTypes(inferredReturnTypes);
1182 else
1183 ::mlir::detail::reportFatalInferReturnTypesError(odsState);
1184
1185}
1186
1187void XorBoolOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs) {
1188 odsState.addOperands(lhs);
1189 odsState.addOperands(rhs);
1190 assert(resultTypes.size() == 1u && "mismatched number of results");
1191 odsState.addTypes(resultTypes);
1192}
1193
1194void XorBoolOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
1195 assert(operands.size() == 2u && "mismatched number of parameters");
1196 odsState.addOperands(operands);
1197 odsState.addAttributes(attributes);
1198 assert(resultTypes.size() == 1u && "mismatched number of return types");
1199 odsState.addTypes(resultTypes);
1200}
1201
1202void XorBoolOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
1203 assert(operands.size() == 2u && "mismatched number of parameters");
1204 odsState.addOperands(operands);
1205 odsState.addAttributes(attributes);
1206
1207 ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
1208 if (::mlir::succeeded(XorBoolOp::inferReturnTypes(odsBuilder.getContext(),
1209 odsState.location, operands,
1210 odsState.attributes.getDictionary(odsState.getContext()),
1211 odsState.getRawProperties(),
1212 odsState.regions, inferredReturnTypes))) {
1213 assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
1214 odsState.addTypes(inferredReturnTypes);
1215 } else {
1216 ::llvm::report_fatal_error("Failed to infer result type(s).");
1217 }
1218}
1219
1220::llvm::LogicalResult XorBoolOp::verifyInvariantsImpl() {
1221 {
1222 unsigned index = 0; (void)index;
1223 auto valueGroup0 = getODSOperands(0);
1224
1225 for (auto v : valueGroup0) {
1226 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops1(*this, v.getType(), "operand", index++)))
1227 return ::mlir::failure();
1228 }
1229 auto valueGroup1 = getODSOperands(1);
1230
1231 for (auto v : valueGroup1) {
1232 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops1(*this, v.getType(), "operand", index++)))
1233 return ::mlir::failure();
1234 }
1235 }
1236 {
1237 unsigned index = 0; (void)index;
1238 auto valueGroup0 = getODSResults(0);
1239
1240 for (auto v : valueGroup0) {
1241 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops2(*this, v.getType(), "result", index++)))
1242 return ::mlir::failure();
1243 }
1244 }
1245 if (!((::llzk::typesUnify((*this->getODSOperands(0).begin()).getType(), (*this->getODSResults(0).begin()).getType()))))
1246 return emitOpError("failed to verify that result type matches with lhs type");
1247 if (!((::llzk::typesUnify((*this->getODSOperands(1).begin()).getType(), (*this->getODSResults(0).begin()).getType()))))
1248 return emitOpError("failed to verify that result type matches with rhs type");
1249 return ::mlir::success();
1250}
1251
1252::llvm::LogicalResult XorBoolOp::verifyInvariants() {
1253 return verifyInvariantsImpl();
1254}
1255
1256::llvm::LogicalResult XorBoolOp::inferReturnTypes(::mlir::MLIRContext *context, ::std::optional<::mlir::Location> location, ::mlir::ValueRange operands, ::mlir::DictionaryAttr attributes, ::mlir::OpaqueProperties properties, ::mlir::RegionRange regions, ::llvm::SmallVectorImpl<::mlir::Type>&inferredReturnTypes) {
1257 inferredReturnTypes.resize(1);
1258 ::mlir::Builder odsBuilder(context);
1259 ::mlir::Type odsInferredType0 = odsBuilder.getIntegerType(1);
1260 inferredReturnTypes[0] = odsInferredType0;
1261 return ::mlir::success();
1262}
1263
1264::mlir::ParseResult XorBoolOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
1265 ::mlir::OpAsmParser::UnresolvedOperand lhsRawOperand{};
1266 ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> lhsOperands(&lhsRawOperand, 1); ::llvm::SMLoc lhsOperandsLoc;
1267 (void)lhsOperandsLoc;
1268 ::mlir::OpAsmParser::UnresolvedOperand rhsRawOperand{};
1269 ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> rhsOperands(&rhsRawOperand, 1); ::llvm::SMLoc rhsOperandsLoc;
1270 (void)rhsOperandsLoc;
1271 ::mlir::Type lhsRawType{};
1272 ::llvm::ArrayRef<::mlir::Type> lhsTypes(&lhsRawType, 1);
1273 ::mlir::Type rhsRawType{};
1274 ::llvm::ArrayRef<::mlir::Type> rhsTypes(&rhsRawType, 1);
1275
1276 lhsOperandsLoc = parser.getCurrentLocation();
1277 if (parser.parseOperand(lhsRawOperand))
1278 return ::mlir::failure();
1279 if (parser.parseComma())
1280 return ::mlir::failure();
1281
1282 rhsOperandsLoc = parser.getCurrentLocation();
1283 if (parser.parseOperand(rhsRawOperand))
1284 return ::mlir::failure();
1285 {
1286 auto odsResult = parseInferredOrParsedType(parser, lhsRawType, true);
1287 if (odsResult) return ::mlir::failure();
1288 }
1289 {
1290 auto odsResult = parseInferredOrParsedType(parser, rhsRawType, false);
1291 if (odsResult) return ::mlir::failure();
1292 }
1293 {
1294 auto loc = parser.getCurrentLocation();(void)loc;
1295 if (parser.parseOptionalAttrDict(result.attributes))
1296 return ::mlir::failure();
1297 }
1298 ::mlir::Type odsBuildableType0 = parser.getBuilder().getIntegerType(1);
1299 result.addTypes(odsBuildableType0);
1300 if (parser.resolveOperands(lhsOperands, lhsTypes, lhsOperandsLoc, result.operands))
1301 return ::mlir::failure();
1302 if (parser.resolveOperands(rhsOperands, rhsTypes, rhsOperandsLoc, result.operands))
1303 return ::mlir::failure();
1304 return ::mlir::success();
1305}
1306
1307void XorBoolOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
1308 _odsPrinter << ' ';
1309 _odsPrinter << getLhs();
1310 _odsPrinter << ",";
1311 _odsPrinter << ' ';
1312 _odsPrinter << getRhs();
1313 printInferredOrParsedType(_odsPrinter, *this, getLhs().getType(), true);
1314 printInferredOrParsedType(_odsPrinter, *this, getRhs().getType(), false);
1315 ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
1316 _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
1317}
1318
1319void XorBoolOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
1320}
1321
1322} // namespace boolean
1323} // namespace llzk
1324MLIR_DEFINE_EXPLICIT_TYPE_ID(::llzk::boolean::XorBoolOp)
1325
1326
1327#endif // GET_OP_CLASSES
1328
MlirStringRef name
Definition Poly.cpp:48
::llvm::LogicalResult verify(::mlir::Location loc)
Definition Ops.cpp.inc:102
AndBoolOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs={}, const ::mlir::EmptyProperties &properties={}, ::mlir::RegionRange regions={})
Definition Ops.h.inc:79
::mlir::Operation::operand_range getODSOperands(unsigned index)
Definition Ops.h.inc:140
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs)
Definition Ops.cpp.inc:106
::mlir::Operation::result_range getODSResults(unsigned index)
Definition Ops.h.inc:168
void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect > > &effects)
Definition Ops.cpp.inc:260
::mlir::ParseResult parseInferredOrParsedType(::mlir::OpAsmParser &parser, ::mlir::Type &opType, bool isFirst)
Definition Ops.h.inc:190
::llvm::LogicalResult verifyInvariants()
Definition Ops.cpp.inc:193
void print(::mlir::OpAsmPrinter &_odsPrinter)
Definition Ops.cpp.inc:248
::mlir::TypedValue<::mlir::Type > getLhs()
Definition Ops.h.inc:146
static void printInferredOrParsedType(::mlir::OpAsmPrinter &printer, ::mlir::Operation *op, ::mlir::Type opType, bool isFirst)
Definition Ops.h.inc:208
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
Definition Ops.cpp.inc:205
::mlir::TypedValue<::mlir::Type > getRhs()
Definition Ops.h.inc:150
::llvm::LogicalResult inferReturnTypes(::mlir::MLIRContext *context, ::std::optional<::mlir::Location > location, ::mlir::ValueRange operands, ::mlir::DictionaryAttr attributes, ::mlir::OpaqueProperties properties, ::mlir::RegionRange regions, ::llvm::SmallVectorImpl<::mlir::Type > &inferredReturnTypes)
Definition Ops.cpp.inc:197
::llvm::LogicalResult verifyInvariantsImpl()
Definition Ops.cpp.inc:161
AssertOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:286
::llvm::LogicalResult verify(::mlir::Location loc)
Definition Ops.cpp.inc:285
::mlir::TypedValue<::mlir::IntegerType > getCondition()
Definition Ops.h.inc:361
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
Definition Ops.cpp.inc:444
static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value)
Definition Ops.cpp.inc:343
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value condition, ::mlir::StringAttr msg)
Definition Ops.cpp.inc:389
::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop)
Definition Ops.cpp.inc:316
::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state)
Definition Ops.cpp.inc:363
::std::optional< ::llvm::StringRef > getMsg()
Definition Ops.cpp.inc:376
::mlir::StringAttr getMsgAttr()
Definition Ops.h.inc:389
void setMsg(::std::optional<::llvm::StringRef > attrValue)
Definition Ops.cpp.inc:381
static llvm::hash_code computePropertiesHash(const Properties &prop)
Definition Ops.cpp.inc:332
::mlir::Operation::operand_range getODSOperands(unsigned index)
Definition Ops.h.inc:355
void writeProperties(::mlir::DialectBytecodeWriter &writer)
Definition Ops.cpp.inc:370
void print(::mlir::OpAsmPrinter &_odsPrinter)
Definition Ops.cpp.inc:475
static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs)
Definition Ops.cpp.inc:350
FoldAdaptor::Properties Properties
Definition Ops.h.inc:333
::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:354
::llvm::LogicalResult verifyInvariants()
Definition Ops.cpp.inc:440
::mlir::StringAttr getMsgAttrName()
Definition Ops.h.inc:339
::llvm::LogicalResult verifyInvariantsImpl()
Definition Ops.cpp.inc:423
::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:293
static std::optional< mlir::Attribute > getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name)
Definition Ops.cpp.inc:337
::llvm::LogicalResult verify(::mlir::Location loc)
Definition Ops.cpp.inc:510
CmpOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:499
void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect > > &effects)
Definition Ops.cpp.inc:823
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::llzk::boolean::FeltCmpPredicateAttr predicate, ::mlir::Value lhs, ::mlir::Value rhs)
Definition Ops.cpp.inc:610
::mlir::TypedValue<::llzk::felt::FeltType > getLhs()
Definition Ops.h.inc:578
static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs)
Definition Ops.cpp.inc:576
::mlir::StringAttr getPredicateAttrName()
Definition Ops.h.inc:556
::mlir::Operation::result_range getODSResults(unsigned index)
Definition Ops.h.inc:600
::llvm::LogicalResult verifyInvariants()
Definition Ops.cpp.inc:752
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
Definition Ops.cpp.inc:764
static std::optional< mlir::Attribute > getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name)
Definition Ops.cpp.inc:563
::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop)
Definition Ops.cpp.inc:542
::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:580
::llzk::boolean::FeltCmpPredicate getPredicate()
Definition Ops.cpp.inc:601
::llvm::LogicalResult verifyInvariantsImpl()
Definition Ops.cpp.inc:719
void setPredicate(::llzk::boolean::FeltCmpPredicate attrValue)
Definition Ops.cpp.inc:606
::llzk::boolean::FeltCmpPredicateAttr getPredicateAttr()
Definition Ops.h.inc:619
::llvm::LogicalResult inferReturnTypes(::mlir::MLIRContext *context, ::std::optional<::mlir::Location > location, ::mlir::ValueRange operands, ::mlir::DictionaryAttr attributes, ::mlir::OpaqueProperties properties, ::mlir::RegionRange regions, ::llvm::SmallVectorImpl<::mlir::Type > &inferredReturnTypes)
Definition Ops.cpp.inc:756
::mlir::Operation::operand_range getODSOperands(unsigned index)
Definition Ops.h.inc:572
FoldAdaptor::Properties Properties
Definition Ops.h.inc:550
void print(::mlir::OpAsmPrinter &_odsPrinter)
Definition Ops.cpp.inc:810
::mlir::TypedValue<::llzk::felt::FeltType > getRhs()
Definition Ops.h.inc:582
void writeProperties(::mlir::DialectBytecodeWriter &writer)
Definition Ops.cpp.inc:596
static llvm::hash_code computePropertiesHash(const Properties &prop)
Definition Ops.cpp.inc:558
static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value)
Definition Ops.cpp.inc:569
::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state)
Definition Ops.cpp.inc:589
::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:519
NotBoolOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs={}, const ::mlir::EmptyProperties &properties={}, ::mlir::RegionRange regions={})
Definition Ops.h.inc:698
::llvm::LogicalResult verify(::mlir::Location loc)
Definition Ops.cpp.inc:841
static void printInferredOrParsedType(::mlir::OpAsmPrinter &printer, ::mlir::Operation *op, ::mlir::Type opType, bool isFirst)
Definition Ops.h.inc:814
::llvm::LogicalResult verifyInvariantsImpl()
Definition Ops.cpp.inc:897
::mlir::TypedValue<::mlir::Type > getOperand()
Definition Ops.h.inc:761
void print(::mlir::OpAsmPrinter &_odsPrinter)
Definition Ops.cpp.inc:959
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
Definition Ops.cpp.inc:933
::llvm::LogicalResult verifyInvariants()
Definition Ops.cpp.inc:921
void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect > > &effects)
Definition Ops.cpp.inc:967
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value operand)
Definition Ops.cpp.inc:845
::mlir::ParseResult parseInferredOrParsedType(::mlir::OpAsmParser &parser, ::mlir::Type &opType, bool isFirst)
Definition Ops.h.inc:796
::llvm::LogicalResult inferReturnTypes(::mlir::MLIRContext *context, ::std::optional<::mlir::Location > location, ::mlir::ValueRange operands, ::mlir::DictionaryAttr attributes, ::mlir::OpaqueProperties properties, ::mlir::RegionRange regions, ::llvm::SmallVectorImpl<::mlir::Type > &inferredReturnTypes)
Definition Ops.cpp.inc:925
::mlir::Operation::operand_range getODSOperands(unsigned index)
Definition Ops.h.inc:755
::mlir::Operation::result_range getODSResults(unsigned index)
Definition Ops.h.inc:774
::llvm::LogicalResult verify(::mlir::Location loc)
Definition Ops.cpp.inc:985
OrBoolOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs={}, const ::mlir::EmptyProperties &properties={}, ::mlir::RegionRange regions={})
Definition Ops.h.inc:861
::llvm::LogicalResult verifyInvariantsImpl()
Definition Ops.cpp.inc:1044
::mlir::Operation::operand_range getODSOperands(unsigned index)
Definition Ops.h.inc:922
void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect > > &effects)
Definition Ops.cpp.inc:1143
void print(::mlir::OpAsmPrinter &_odsPrinter)
Definition Ops.cpp.inc:1131
static void printInferredOrParsedType(::mlir::OpAsmPrinter &printer, ::mlir::Operation *op, ::mlir::Type opType, bool isFirst)
Definition Ops.h.inc:990
::llvm::LogicalResult inferReturnTypes(::mlir::MLIRContext *context, ::std::optional<::mlir::Location > location, ::mlir::ValueRange operands, ::mlir::DictionaryAttr attributes, ::mlir::OpaqueProperties properties, ::mlir::RegionRange regions, ::llvm::SmallVectorImpl<::mlir::Type > &inferredReturnTypes)
Definition Ops.cpp.inc:1080
::mlir::TypedValue<::mlir::Type > getLhs()
Definition Ops.h.inc:928
::mlir::ParseResult parseInferredOrParsedType(::mlir::OpAsmParser &parser, ::mlir::Type &opType, bool isFirst)
Definition Ops.h.inc:972
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs)
Definition Ops.cpp.inc:989
::llvm::LogicalResult verifyInvariants()
Definition Ops.cpp.inc:1076
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
Definition Ops.cpp.inc:1088
::mlir::TypedValue<::mlir::Type > getRhs()
Definition Ops.h.inc:932
::mlir::Operation::result_range getODSResults(unsigned index)
Definition Ops.h.inc:950
::llvm::LogicalResult verify(::mlir::Location loc)
Definition Ops.cpp.inc:1161
XorBoolOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs={}, const ::mlir::EmptyProperties &properties={}, ::mlir::RegionRange regions={})
Definition Ops.h.inc:1037
::llvm::LogicalResult verifyInvariantsImpl()
Definition Ops.cpp.inc:1220
::llvm::LogicalResult verifyInvariants()
Definition Ops.cpp.inc:1252
::llvm::LogicalResult inferReturnTypes(::mlir::MLIRContext *context, ::std::optional<::mlir::Location > location, ::mlir::ValueRange operands, ::mlir::DictionaryAttr attributes, ::mlir::OpaqueProperties properties, ::mlir::RegionRange regions, ::llvm::SmallVectorImpl<::mlir::Type > &inferredReturnTypes)
Definition Ops.cpp.inc:1256
::mlir::Operation::operand_range getODSOperands(unsigned index)
Definition Ops.h.inc:1098
::mlir::Operation::result_range getODSResults(unsigned index)
Definition Ops.h.inc:1126
::mlir::TypedValue<::mlir::Type > getLhs()
Definition Ops.h.inc:1104
void print(::mlir::OpAsmPrinter &_odsPrinter)
Definition Ops.cpp.inc:1307
::mlir::TypedValue<::mlir::Type > getRhs()
Definition Ops.h.inc:1108
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs)
Definition Ops.cpp.inc:1165
static void printInferredOrParsedType(::mlir::OpAsmPrinter &printer, ::mlir::Operation *op, ::mlir::Type opType, bool isFirst)
Definition Ops.h.inc:1166
void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect > > &effects)
Definition Ops.cpp.inc:1319
::mlir::ParseResult parseInferredOrParsedType(::mlir::OpAsmParser &parser, ::mlir::Type &opType, bool isFirst)
Definition Ops.h.inc:1148
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
Definition Ops.cpp.inc:1264
::std::optional<::mlir::OperationName > odsOpName
Definition Ops.h.inc:251
AssertOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:255
::std::optional< ::llvm::StringRef > getMsg()
Definition Ops.cpp.inc:277
::llzk::boolean::FeltCmpPredicateAttr getPredicateAttr()
Definition Ops.h.inc:486
::std::optional<::mlir::OperationName > odsOpName
Definition Ops.h.inc:464
CmpOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:468
::llzk::boolean::FeltCmpPredicate getPredicate()
Definition Ops.cpp.inc:502
bool typesUnify(Type lhs, Type rhs, ArrayRef< StringRef > rhsReversePrefix, UnificationMap *unifications)