LLZK 2.0.0
An open-source IR for Zero Knowledge (ZK) circuits
Loading...
Searching...
No Matches
Ops.cpp.inc
Go to the documentation of this file.
1/*===- TableGen'erated file -------------------------------------*- C++ -*-===*\
2|* *|
3|* Op Definitions *|
4|* *|
5|* Automatically generated file, do not edit! *|
6|* From: Ops.td *|
7|* *|
8\*===----------------------------------------------------------------------===*/
9
10#ifdef GET_OP_LIST
11#undef GET_OP_LIST
12
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 if (!((::llzk::typesUnify((*this->getODSOperands(0).begin()).getType(), (*this->getODSOperands(1).begin()).getType()))))
750 return emitOpError("failed to verify that rhs type matches with lhs type");
751 return ::mlir::success();
752}
753
754::llvm::LogicalResult CmpOp::verifyInvariants() {
755 return verifyInvariantsImpl();
756}
757
758::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) {
759 inferredReturnTypes.resize(1);
760 ::mlir::Builder odsBuilder(context);
761 ::mlir::Type odsInferredType0 = odsBuilder.getIntegerType(1);
762 inferredReturnTypes[0] = odsInferredType0;
763 return ::mlir::success();
764}
765
766::mlir::ParseResult CmpOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
767 ::llzk::boolean::FeltCmpPredicateAttr predicateAttr;
768 ::mlir::OpAsmParser::UnresolvedOperand lhsRawOperand{};
769 ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> lhsOperands(&lhsRawOperand, 1); ::llvm::SMLoc lhsOperandsLoc;
770 (void)lhsOperandsLoc;
771 ::mlir::OpAsmParser::UnresolvedOperand rhsRawOperand{};
772 ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> rhsOperands(&rhsRawOperand, 1); ::llvm::SMLoc rhsOperandsLoc;
773 (void)rhsOperandsLoc;
774 ::mlir::Type lhsRawType{};
775 ::llvm::ArrayRef<::mlir::Type> lhsTypes(&lhsRawType, 1);
776 ::mlir::Type rhsRawType{};
777 ::llvm::ArrayRef<::mlir::Type> rhsTypes(&rhsRawType, 1);
778
779 if (parser.parseCustomAttributeWithFallback(predicateAttr, ::mlir::Type{})) {
780 return ::mlir::failure();
781 }
782 if (predicateAttr) result.getOrAddProperties<CmpOp::Properties>().predicate = predicateAttr;
783 if (parser.parseLParen())
784 return ::mlir::failure();
785
786 lhsOperandsLoc = parser.getCurrentLocation();
787 if (parser.parseOperand(lhsRawOperand))
788 return ::mlir::failure();
789 if (parser.parseComma())
790 return ::mlir::failure();
791
792 rhsOperandsLoc = parser.getCurrentLocation();
793 if (parser.parseOperand(rhsRawOperand))
794 return ::mlir::failure();
795 if (parser.parseRParen())
796 return ::mlir::failure();
797 {
798 auto odsResult = parseInferredOrParsedType(parser, lhsRawType, true);
799 if (odsResult) return ::mlir::failure();
800 }
801 {
802 auto odsResult = parseInferredOrParsedType(parser, rhsRawType, false);
803 if (odsResult) return ::mlir::failure();
804 }
805 {
806 auto loc = parser.getCurrentLocation();(void)loc;
807 if (parser.parseOptionalAttrDict(result.attributes))
808 return ::mlir::failure();
809 if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() {
810 return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op ";
811 })))
812 return ::mlir::failure();
813 }
814 ::mlir::Type odsBuildableType0 = parser.getBuilder().getIntegerType(1);
815 result.addTypes(odsBuildableType0);
816 if (parser.resolveOperands(lhsOperands, lhsTypes, lhsOperandsLoc, result.operands))
817 return ::mlir::failure();
818 if (parser.resolveOperands(rhsOperands, rhsTypes, rhsOperandsLoc, result.operands))
819 return ::mlir::failure();
820 return ::mlir::success();
821}
822
823void CmpOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
824_odsPrinter.printStrippedAttrOrType(getPredicateAttr());
825 _odsPrinter << "(";
826 _odsPrinter << getLhs();
827 _odsPrinter << ",";
828 _odsPrinter << ' ';
829 _odsPrinter << getRhs();
830 _odsPrinter << ")";
831 printInferredOrParsedType(_odsPrinter, *this, getLhs().getType(), true);
832 printInferredOrParsedType(_odsPrinter, *this, getRhs().getType(), false);
833 ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
834 elidedAttrs.push_back("predicate");
835 _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
836}
837
838void CmpOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
839}
840
841} // namespace boolean
842} // namespace llzk
843MLIR_DEFINE_EXPLICIT_TYPE_ID(::llzk::boolean::CmpOp)
844
845namespace llzk {
846namespace boolean {
847
848//===----------------------------------------------------------------------===//
849// ::llzk::boolean::NotBoolOp definitions
850//===----------------------------------------------------------------------===//
851
852namespace detail {
853} // namespace detail
855
856::llvm::LogicalResult NotBoolOpAdaptor::verify(::mlir::Location loc) {
857 return ::mlir::success();
858}
859
860void NotBoolOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value operand) {
861 odsState.addOperands(operand);
862 odsState.addTypes(result);
863}
864
865void NotBoolOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value operand) {
866 odsState.addOperands(operand);
867
868 ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
869 if (::mlir::succeeded(NotBoolOp::inferReturnTypes(odsBuilder.getContext(),
870 odsState.location, odsState.operands,
871 odsState.attributes.getDictionary(odsState.getContext()),
872 odsState.getRawProperties(),
873 odsState.regions, inferredReturnTypes)))
874 odsState.addTypes(inferredReturnTypes);
875 else
876 ::mlir::detail::reportFatalInferReturnTypesError(odsState);
877
878}
879
880void NotBoolOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value operand) {
881 odsState.addOperands(operand);
882 assert(resultTypes.size() == 1u && "mismatched number of results");
883 odsState.addTypes(resultTypes);
884}
885
886void NotBoolOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
887 assert(operands.size() == 1u && "mismatched number of parameters");
888 odsState.addOperands(operands);
889 odsState.addAttributes(attributes);
890 assert(resultTypes.size() == 1u && "mismatched number of return types");
891 odsState.addTypes(resultTypes);
892}
893
894void NotBoolOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
895 assert(operands.size() == 1u && "mismatched number of parameters");
896 odsState.addOperands(operands);
897 odsState.addAttributes(attributes);
898
899 ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
900 if (::mlir::succeeded(NotBoolOp::inferReturnTypes(odsBuilder.getContext(),
901 odsState.location, operands,
902 odsState.attributes.getDictionary(odsState.getContext()),
903 odsState.getRawProperties(),
904 odsState.regions, inferredReturnTypes))) {
905 assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
906 odsState.addTypes(inferredReturnTypes);
907 } else {
908 ::llvm::report_fatal_error("Failed to infer result type(s).");
909 }
910}
911
912::llvm::LogicalResult NotBoolOp::verifyInvariantsImpl() {
913 {
914 unsigned index = 0; (void)index;
915 auto valueGroup0 = getODSOperands(0);
916
917 for (auto v : valueGroup0) {
918 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops1(*this, v.getType(), "operand", index++)))
919 return ::mlir::failure();
920 }
921 }
922 {
923 unsigned index = 0; (void)index;
924 auto valueGroup0 = getODSResults(0);
925
926 for (auto v : valueGroup0) {
927 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops2(*this, v.getType(), "result", index++)))
928 return ::mlir::failure();
929 }
930 }
931 if (!((::llzk::typesUnify((*this->getODSOperands(0).begin()).getType(), (*this->getODSResults(0).begin()).getType()))))
932 return emitOpError("failed to verify that result type matches with operand type");
933 return ::mlir::success();
934}
935
936::llvm::LogicalResult NotBoolOp::verifyInvariants() {
937 return verifyInvariantsImpl();
938}
939
940::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) {
941 inferredReturnTypes.resize(1);
942 ::mlir::Builder odsBuilder(context);
943 ::mlir::Type odsInferredType0 = odsBuilder.getIntegerType(1);
944 inferredReturnTypes[0] = odsInferredType0;
945 return ::mlir::success();
946}
947
948::mlir::ParseResult NotBoolOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
949 ::mlir::OpAsmParser::UnresolvedOperand operandRawOperand{};
950 ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> operandOperands(&operandRawOperand, 1); ::llvm::SMLoc operandOperandsLoc;
951 (void)operandOperandsLoc;
952 ::mlir::Type operandRawType{};
953 ::llvm::ArrayRef<::mlir::Type> operandTypes(&operandRawType, 1);
954
955 operandOperandsLoc = parser.getCurrentLocation();
956 if (parser.parseOperand(operandRawOperand))
957 return ::mlir::failure();
958 {
959 auto odsResult = parseInferredOrParsedType(parser, operandRawType, true);
960 if (odsResult) return ::mlir::failure();
961 }
962 {
963 auto loc = parser.getCurrentLocation();(void)loc;
964 if (parser.parseOptionalAttrDict(result.attributes))
965 return ::mlir::failure();
966 }
967 ::mlir::Type odsBuildableType0 = parser.getBuilder().getIntegerType(1);
968 result.addTypes(odsBuildableType0);
969 if (parser.resolveOperands(operandOperands, operandTypes, operandOperandsLoc, result.operands))
970 return ::mlir::failure();
971 return ::mlir::success();
972}
973
974void NotBoolOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
975 _odsPrinter << ' ';
976 _odsPrinter << getOperand();
977 printInferredOrParsedType(_odsPrinter, *this, getOperand().getType(), true);
978 ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
979 _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
980}
981
982void NotBoolOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
983}
984
985} // namespace boolean
986} // namespace llzk
987MLIR_DEFINE_EXPLICIT_TYPE_ID(::llzk::boolean::NotBoolOp)
988
989namespace llzk {
990namespace boolean {
991
992//===----------------------------------------------------------------------===//
993// ::llzk::boolean::OrBoolOp definitions
994//===----------------------------------------------------------------------===//
995
996namespace detail {
997} // namespace detail
999
1000::llvm::LogicalResult OrBoolOpAdaptor::verify(::mlir::Location loc) {
1001 return ::mlir::success();
1002}
1003
1004void OrBoolOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs) {
1005 odsState.addOperands(lhs);
1006 odsState.addOperands(rhs);
1007 odsState.addTypes(result);
1008}
1009
1010void OrBoolOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value lhs, ::mlir::Value rhs) {
1011 odsState.addOperands(lhs);
1012 odsState.addOperands(rhs);
1013
1014 ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
1015 if (::mlir::succeeded(OrBoolOp::inferReturnTypes(odsBuilder.getContext(),
1016 odsState.location, odsState.operands,
1017 odsState.attributes.getDictionary(odsState.getContext()),
1018 odsState.getRawProperties(),
1019 odsState.regions, inferredReturnTypes)))
1020 odsState.addTypes(inferredReturnTypes);
1021 else
1022 ::mlir::detail::reportFatalInferReturnTypesError(odsState);
1023
1024}
1025
1026void OrBoolOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs) {
1027 odsState.addOperands(lhs);
1028 odsState.addOperands(rhs);
1029 assert(resultTypes.size() == 1u && "mismatched number of results");
1030 odsState.addTypes(resultTypes);
1031}
1032
1033void OrBoolOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
1034 assert(operands.size() == 2u && "mismatched number of parameters");
1035 odsState.addOperands(operands);
1036 odsState.addAttributes(attributes);
1037 assert(resultTypes.size() == 1u && "mismatched number of return types");
1038 odsState.addTypes(resultTypes);
1039}
1040
1041void OrBoolOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
1042 assert(operands.size() == 2u && "mismatched number of parameters");
1043 odsState.addOperands(operands);
1044 odsState.addAttributes(attributes);
1045
1046 ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
1047 if (::mlir::succeeded(OrBoolOp::inferReturnTypes(odsBuilder.getContext(),
1048 odsState.location, operands,
1049 odsState.attributes.getDictionary(odsState.getContext()),
1050 odsState.getRawProperties(),
1051 odsState.regions, inferredReturnTypes))) {
1052 assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
1053 odsState.addTypes(inferredReturnTypes);
1054 } else {
1055 ::llvm::report_fatal_error("Failed to infer result type(s).");
1056 }
1057}
1058
1059::llvm::LogicalResult OrBoolOp::verifyInvariantsImpl() {
1060 {
1061 unsigned index = 0; (void)index;
1062 auto valueGroup0 = getODSOperands(0);
1063
1064 for (auto v : valueGroup0) {
1065 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops1(*this, v.getType(), "operand", index++)))
1066 return ::mlir::failure();
1067 }
1068 auto valueGroup1 = getODSOperands(1);
1069
1070 for (auto v : valueGroup1) {
1071 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops1(*this, v.getType(), "operand", index++)))
1072 return ::mlir::failure();
1073 }
1074 }
1075 {
1076 unsigned index = 0; (void)index;
1077 auto valueGroup0 = getODSResults(0);
1078
1079 for (auto v : valueGroup0) {
1080 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops2(*this, v.getType(), "result", index++)))
1081 return ::mlir::failure();
1082 }
1083 }
1084 if (!((::llzk::typesUnify((*this->getODSOperands(0).begin()).getType(), (*this->getODSResults(0).begin()).getType()))))
1085 return emitOpError("failed to verify that result type matches with lhs type");
1086 if (!((::llzk::typesUnify((*this->getODSOperands(1).begin()).getType(), (*this->getODSResults(0).begin()).getType()))))
1087 return emitOpError("failed to verify that result type matches with rhs type");
1088 return ::mlir::success();
1089}
1090
1091::llvm::LogicalResult OrBoolOp::verifyInvariants() {
1092 return verifyInvariantsImpl();
1093}
1094
1095::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) {
1096 inferredReturnTypes.resize(1);
1097 ::mlir::Builder odsBuilder(context);
1098 ::mlir::Type odsInferredType0 = odsBuilder.getIntegerType(1);
1099 inferredReturnTypes[0] = odsInferredType0;
1100 return ::mlir::success();
1101}
1102
1103::mlir::ParseResult OrBoolOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
1104 ::mlir::OpAsmParser::UnresolvedOperand lhsRawOperand{};
1105 ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> lhsOperands(&lhsRawOperand, 1); ::llvm::SMLoc lhsOperandsLoc;
1106 (void)lhsOperandsLoc;
1107 ::mlir::OpAsmParser::UnresolvedOperand rhsRawOperand{};
1108 ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> rhsOperands(&rhsRawOperand, 1); ::llvm::SMLoc rhsOperandsLoc;
1109 (void)rhsOperandsLoc;
1110 ::mlir::Type lhsRawType{};
1111 ::llvm::ArrayRef<::mlir::Type> lhsTypes(&lhsRawType, 1);
1112 ::mlir::Type rhsRawType{};
1113 ::llvm::ArrayRef<::mlir::Type> rhsTypes(&rhsRawType, 1);
1114
1115 lhsOperandsLoc = parser.getCurrentLocation();
1116 if (parser.parseOperand(lhsRawOperand))
1117 return ::mlir::failure();
1118 if (parser.parseComma())
1119 return ::mlir::failure();
1120
1121 rhsOperandsLoc = parser.getCurrentLocation();
1122 if (parser.parseOperand(rhsRawOperand))
1123 return ::mlir::failure();
1124 {
1125 auto odsResult = parseInferredOrParsedType(parser, lhsRawType, true);
1126 if (odsResult) return ::mlir::failure();
1127 }
1128 {
1129 auto odsResult = parseInferredOrParsedType(parser, rhsRawType, false);
1130 if (odsResult) return ::mlir::failure();
1131 }
1132 {
1133 auto loc = parser.getCurrentLocation();(void)loc;
1134 if (parser.parseOptionalAttrDict(result.attributes))
1135 return ::mlir::failure();
1136 }
1137 ::mlir::Type odsBuildableType0 = parser.getBuilder().getIntegerType(1);
1138 result.addTypes(odsBuildableType0);
1139 if (parser.resolveOperands(lhsOperands, lhsTypes, lhsOperandsLoc, result.operands))
1140 return ::mlir::failure();
1141 if (parser.resolveOperands(rhsOperands, rhsTypes, rhsOperandsLoc, result.operands))
1142 return ::mlir::failure();
1143 return ::mlir::success();
1144}
1145
1146void OrBoolOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
1147 _odsPrinter << ' ';
1148 _odsPrinter << getLhs();
1149 _odsPrinter << ",";
1150 _odsPrinter << ' ';
1151 _odsPrinter << getRhs();
1152 printInferredOrParsedType(_odsPrinter, *this, getLhs().getType(), true);
1153 printInferredOrParsedType(_odsPrinter, *this, getRhs().getType(), false);
1154 ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
1155 _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
1156}
1157
1158void OrBoolOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
1159}
1160
1161} // namespace boolean
1162} // namespace llzk
1163MLIR_DEFINE_EXPLICIT_TYPE_ID(::llzk::boolean::OrBoolOp)
1164
1165namespace llzk {
1166namespace boolean {
1167
1168//===----------------------------------------------------------------------===//
1169// ::llzk::boolean::XorBoolOp definitions
1170//===----------------------------------------------------------------------===//
1171
1172namespace detail {
1173} // namespace detail
1175
1176::llvm::LogicalResult XorBoolOpAdaptor::verify(::mlir::Location loc) {
1177 return ::mlir::success();
1178}
1179
1180void XorBoolOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs) {
1181 odsState.addOperands(lhs);
1182 odsState.addOperands(rhs);
1183 odsState.addTypes(result);
1184}
1185
1186void XorBoolOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value lhs, ::mlir::Value rhs) {
1187 odsState.addOperands(lhs);
1188 odsState.addOperands(rhs);
1189
1190 ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
1191 if (::mlir::succeeded(XorBoolOp::inferReturnTypes(odsBuilder.getContext(),
1192 odsState.location, odsState.operands,
1193 odsState.attributes.getDictionary(odsState.getContext()),
1194 odsState.getRawProperties(),
1195 odsState.regions, inferredReturnTypes)))
1196 odsState.addTypes(inferredReturnTypes);
1197 else
1198 ::mlir::detail::reportFatalInferReturnTypesError(odsState);
1199
1200}
1201
1202void XorBoolOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs) {
1203 odsState.addOperands(lhs);
1204 odsState.addOperands(rhs);
1205 assert(resultTypes.size() == 1u && "mismatched number of results");
1206 odsState.addTypes(resultTypes);
1207}
1208
1209void XorBoolOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
1210 assert(operands.size() == 2u && "mismatched number of parameters");
1211 odsState.addOperands(operands);
1212 odsState.addAttributes(attributes);
1213 assert(resultTypes.size() == 1u && "mismatched number of return types");
1214 odsState.addTypes(resultTypes);
1215}
1216
1217void XorBoolOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
1218 assert(operands.size() == 2u && "mismatched number of parameters");
1219 odsState.addOperands(operands);
1220 odsState.addAttributes(attributes);
1221
1222 ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
1223 if (::mlir::succeeded(XorBoolOp::inferReturnTypes(odsBuilder.getContext(),
1224 odsState.location, operands,
1225 odsState.attributes.getDictionary(odsState.getContext()),
1226 odsState.getRawProperties(),
1227 odsState.regions, inferredReturnTypes))) {
1228 assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
1229 odsState.addTypes(inferredReturnTypes);
1230 } else {
1231 ::llvm::report_fatal_error("Failed to infer result type(s).");
1232 }
1233}
1234
1235::llvm::LogicalResult XorBoolOp::verifyInvariantsImpl() {
1236 {
1237 unsigned index = 0; (void)index;
1238 auto valueGroup0 = getODSOperands(0);
1239
1240 for (auto v : valueGroup0) {
1241 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops1(*this, v.getType(), "operand", index++)))
1242 return ::mlir::failure();
1243 }
1244 auto valueGroup1 = getODSOperands(1);
1245
1246 for (auto v : valueGroup1) {
1247 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops1(*this, v.getType(), "operand", index++)))
1248 return ::mlir::failure();
1249 }
1250 }
1251 {
1252 unsigned index = 0; (void)index;
1253 auto valueGroup0 = getODSResults(0);
1254
1255 for (auto v : valueGroup0) {
1256 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops2(*this, v.getType(), "result", index++)))
1257 return ::mlir::failure();
1258 }
1259 }
1260 if (!((::llzk::typesUnify((*this->getODSOperands(0).begin()).getType(), (*this->getODSResults(0).begin()).getType()))))
1261 return emitOpError("failed to verify that result type matches with lhs type");
1262 if (!((::llzk::typesUnify((*this->getODSOperands(1).begin()).getType(), (*this->getODSResults(0).begin()).getType()))))
1263 return emitOpError("failed to verify that result type matches with rhs type");
1264 return ::mlir::success();
1265}
1266
1267::llvm::LogicalResult XorBoolOp::verifyInvariants() {
1268 return verifyInvariantsImpl();
1269}
1270
1271::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) {
1272 inferredReturnTypes.resize(1);
1273 ::mlir::Builder odsBuilder(context);
1274 ::mlir::Type odsInferredType0 = odsBuilder.getIntegerType(1);
1275 inferredReturnTypes[0] = odsInferredType0;
1276 return ::mlir::success();
1277}
1278
1279::mlir::ParseResult XorBoolOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
1280 ::mlir::OpAsmParser::UnresolvedOperand lhsRawOperand{};
1281 ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> lhsOperands(&lhsRawOperand, 1); ::llvm::SMLoc lhsOperandsLoc;
1282 (void)lhsOperandsLoc;
1283 ::mlir::OpAsmParser::UnresolvedOperand rhsRawOperand{};
1284 ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> rhsOperands(&rhsRawOperand, 1); ::llvm::SMLoc rhsOperandsLoc;
1285 (void)rhsOperandsLoc;
1286 ::mlir::Type lhsRawType{};
1287 ::llvm::ArrayRef<::mlir::Type> lhsTypes(&lhsRawType, 1);
1288 ::mlir::Type rhsRawType{};
1289 ::llvm::ArrayRef<::mlir::Type> rhsTypes(&rhsRawType, 1);
1290
1291 lhsOperandsLoc = parser.getCurrentLocation();
1292 if (parser.parseOperand(lhsRawOperand))
1293 return ::mlir::failure();
1294 if (parser.parseComma())
1295 return ::mlir::failure();
1296
1297 rhsOperandsLoc = parser.getCurrentLocation();
1298 if (parser.parseOperand(rhsRawOperand))
1299 return ::mlir::failure();
1300 {
1301 auto odsResult = parseInferredOrParsedType(parser, lhsRawType, true);
1302 if (odsResult) return ::mlir::failure();
1303 }
1304 {
1305 auto odsResult = parseInferredOrParsedType(parser, rhsRawType, false);
1306 if (odsResult) return ::mlir::failure();
1307 }
1308 {
1309 auto loc = parser.getCurrentLocation();(void)loc;
1310 if (parser.parseOptionalAttrDict(result.attributes))
1311 return ::mlir::failure();
1312 }
1313 ::mlir::Type odsBuildableType0 = parser.getBuilder().getIntegerType(1);
1314 result.addTypes(odsBuildableType0);
1315 if (parser.resolveOperands(lhsOperands, lhsTypes, lhsOperandsLoc, result.operands))
1316 return ::mlir::failure();
1317 if (parser.resolveOperands(rhsOperands, rhsTypes, rhsOperandsLoc, result.operands))
1318 return ::mlir::failure();
1319 return ::mlir::success();
1320}
1321
1322void XorBoolOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
1323 _odsPrinter << ' ';
1324 _odsPrinter << getLhs();
1325 _odsPrinter << ",";
1326 _odsPrinter << ' ';
1327 _odsPrinter << getRhs();
1328 printInferredOrParsedType(_odsPrinter, *this, getLhs().getType(), true);
1329 printInferredOrParsedType(_odsPrinter, *this, getRhs().getType(), false);
1330 ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
1331 _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
1332}
1333
1334void XorBoolOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
1335}
1336
1337} // namespace boolean
1338} // namespace llzk
1339MLIR_DEFINE_EXPLICIT_TYPE_ID(::llzk::boolean::XorBoolOp)
1340
1341
1342#endif // GET_OP_CLASSES
1343
::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
::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
::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:288
::llvm::LogicalResult verify(::mlir::Location loc)
Definition Ops.cpp.inc:285
::mlir::TypedValue<::mlir::IntegerType > getCondition()
Definition Ops.h.inc:363
::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:391
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:357
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:335
::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:341
::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:501
void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect > > &effects)
Definition Ops.cpp.inc:838
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:580
static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs)
Definition Ops.cpp.inc:576
::mlir::StringAttr getPredicateAttrName()
Definition Ops.h.inc:558
::mlir::Operation::result_range getODSResults(unsigned index)
Definition Ops.h.inc:602
::llvm::LogicalResult verifyInvariants()
Definition Ops.cpp.inc:754
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
Definition Ops.cpp.inc:766
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:621
::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:758
::mlir::Operation::operand_range getODSOperands(unsigned index)
Definition Ops.h.inc:574
FoldAdaptor::Properties Properties
Definition Ops.h.inc:552
void print(::mlir::OpAsmPrinter &_odsPrinter)
Definition Ops.cpp.inc:823
::mlir::TypedValue<::llzk::felt::FeltType > getRhs()
Definition Ops.h.inc:584
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:726
::llvm::LogicalResult verify(::mlir::Location loc)
Definition Ops.cpp.inc:856
::llvm::LogicalResult verifyInvariantsImpl()
Definition Ops.cpp.inc:912
::mlir::TypedValue<::mlir::Type > getOperand()
Definition Ops.h.inc:789
void print(::mlir::OpAsmPrinter &_odsPrinter)
Definition Ops.cpp.inc:974
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
Definition Ops.cpp.inc:948
::llvm::LogicalResult verifyInvariants()
Definition Ops.cpp.inc:936
void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect > > &effects)
Definition Ops.cpp.inc:982
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value operand)
Definition Ops.cpp.inc:860
::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:940
::mlir::Operation::operand_range getODSOperands(unsigned index)
Definition Ops.h.inc:783
::mlir::Operation::result_range getODSResults(unsigned index)
Definition Ops.h.inc:802
::llvm::LogicalResult verify(::mlir::Location loc)
Definition Ops.cpp.inc:1000
OrBoolOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs={}, const ::mlir::EmptyProperties &properties={}, ::mlir::RegionRange regions={})
Definition Ops.h.inc:891
::llvm::LogicalResult verifyInvariantsImpl()
Definition Ops.cpp.inc:1059
::mlir::Operation::operand_range getODSOperands(unsigned index)
Definition Ops.h.inc:952
void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect > > &effects)
Definition Ops.cpp.inc:1158
void print(::mlir::OpAsmPrinter &_odsPrinter)
Definition Ops.cpp.inc:1146
::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:1095
::mlir::TypedValue<::mlir::Type > getLhs()
Definition Ops.h.inc:958
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs)
Definition Ops.cpp.inc:1004
::llvm::LogicalResult verifyInvariants()
Definition Ops.cpp.inc:1091
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
Definition Ops.cpp.inc:1103
::mlir::TypedValue<::mlir::Type > getRhs()
Definition Ops.h.inc:962
::mlir::Operation::result_range getODSResults(unsigned index)
Definition Ops.h.inc:980
::llvm::LogicalResult verify(::mlir::Location loc)
Definition Ops.cpp.inc:1176
XorBoolOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs={}, const ::mlir::EmptyProperties &properties={}, ::mlir::RegionRange regions={})
Definition Ops.h.inc:1069
::llvm::LogicalResult verifyInvariantsImpl()
Definition Ops.cpp.inc:1235
::llvm::LogicalResult verifyInvariants()
Definition Ops.cpp.inc:1267
::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:1271
::mlir::Operation::operand_range getODSOperands(unsigned index)
Definition Ops.h.inc:1130
::mlir::Operation::result_range getODSResults(unsigned index)
Definition Ops.h.inc:1158
::mlir::TypedValue<::mlir::Type > getLhs()
Definition Ops.h.inc:1136
void print(::mlir::OpAsmPrinter &_odsPrinter)
Definition Ops.cpp.inc:1322
::mlir::TypedValue<::mlir::Type > getRhs()
Definition Ops.h.inc:1140
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs)
Definition Ops.cpp.inc:1180
void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect > > &effects)
Definition Ops.cpp.inc:1334
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
Definition Ops.cpp.inc:1279
::std::optional<::mlir::OperationName > odsOpName
Definition Ops.h.inc:253
AssertOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:257
::std::optional< ::llvm::StringRef > getMsg()
Definition Ops.cpp.inc:277
::llzk::boolean::FeltCmpPredicateAttr getPredicateAttr()
Definition Ops.h.inc:488
::std::optional<::mlir::OperationName > odsOpName
Definition Ops.h.inc:466
CmpOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:470
::llzk::boolean::FeltCmpPredicate getPredicate()
Definition Ops.cpp.inc:502
bool typesUnify(Type lhs, Type rhs, ArrayRef< StringRef > rhsReversePrefix, UnificationMap *unifications)