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 ::mlir::LogicalResult __mlir_ods_local_type_constraint_Ops0(
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 ::mlir::LogicalResult __mlir_ods_local_type_constraint_Ops1(
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 ::mlir::LogicalResult __mlir_ods_local_type_constraint_Ops2(
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 ::mlir::LogicalResult __mlir_ods_local_attr_constraint_Ops0(
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 ::mlir::LogicalResult __mlir_ods_local_attr_constraint_Ops0(
70 ::mlir::Operation *op, ::mlir::Attribute attr, ::llvm::StringRef attrName) {
71 return __mlir_ods_local_attr_constraint_Ops0(attr, attrName, [op]() {
72 return op->emitOpError();
73 });
74}
75
76static ::mlir::LogicalResult __mlir_ods_local_attr_constraint_Ops1(
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 ::mlir::LogicalResult __mlir_ods_local_attr_constraint_Ops1(
84 ::mlir::Operation *op, ::mlir::Attribute attr, ::llvm::StringRef attrName) {
85 return __mlir_ods_local_attr_constraint_Ops1(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 {
99AndBoolOpGenericAdaptorBase::AndBoolOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const ::mlir::EmptyProperties &properties, ::mlir::RegionRange regions) : odsAttrs(attrs), odsRegions(regions) { if (odsAttrs)
100 odsOpName.emplace("bool.and", odsAttrs.getContext());
101}
102
103AndBoolOpGenericAdaptorBase::AndBoolOpGenericAdaptorBase(AndBoolOp op) : AndBoolOpGenericAdaptorBase(op->getAttrDictionary(), op.getProperties(), op->getRegions()) {}
104
105std::pair<unsigned, unsigned> AndBoolOpGenericAdaptorBase::getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize) {
106 return {index, 1};
107}
108
110 return odsAttrs;
111}
112
113} // namespace detail
115
116::mlir::LogicalResult AndBoolOpAdaptor::verify(::mlir::Location loc) {
117 return ::mlir::success();
118}
119
120std::pair<unsigned, unsigned> AndBoolOp::getODSOperandIndexAndLength(unsigned index) {
121 return {index, 1};
122}
123
124::mlir::Operation::operand_range AndBoolOp::getODSOperands(unsigned index) {
125 auto valueRange = getODSOperandIndexAndLength(index);
126 return {std::next(getOperation()->operand_begin(), valueRange.first),
127 std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
128}
129
130::mlir::Value AndBoolOp::getLhs() {
131 return ::llvm::cast<::mlir::Value>(*getODSOperands(0).begin());
132}
133
134::mlir::Value AndBoolOp::getRhs() {
135 return ::llvm::cast<::mlir::Value>(*getODSOperands(1).begin());
136}
137
138::mlir::OpOperand &AndBoolOp::getLhsMutable() {
139 auto range = getODSOperandIndexAndLength(0);
140 return getOperation()->getOpOperand(range.first);
141}
142
143::mlir::OpOperand &AndBoolOp::getRhsMutable() {
144 auto range = getODSOperandIndexAndLength(1);
145 return getOperation()->getOpOperand(range.first);
146}
147
148std::pair<unsigned, unsigned> AndBoolOp::getODSResultIndexAndLength(unsigned index) {
149 return {index, 1};
150}
151
152::mlir::Operation::result_range AndBoolOp::getODSResults(unsigned index) {
153 auto valueRange = getODSResultIndexAndLength(index);
154 return {std::next(getOperation()->result_begin(), valueRange.first),
155 std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
156}
157
158::mlir::TypedValue<::mlir::IntegerType> AndBoolOp::getResult() {
159 return ::llvm::cast<::mlir::TypedValue<::mlir::IntegerType>>(*getODSResults(0).begin());
160}
161
162void AndBoolOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs) {
163 odsState.addOperands(lhs);
164 odsState.addOperands(rhs);
165 odsState.addTypes(result);
166}
167
168void AndBoolOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value lhs, ::mlir::Value rhs) {
169 odsState.addOperands(lhs);
170 odsState.addOperands(rhs);
171
172 ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
173 if (::mlir::succeeded(AndBoolOp::inferReturnTypes(odsBuilder.getContext(),
174 odsState.location, odsState.operands,
175 odsState.attributes.getDictionary(odsState.getContext()),
176 odsState.getRawProperties(),
177 odsState.regions, inferredReturnTypes)))
178 odsState.addTypes(inferredReturnTypes);
179 else
180 ::llvm::report_fatal_error("Failed to infer result type(s).");
181}
182
183void AndBoolOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs) {
184 odsState.addOperands(lhs);
185 odsState.addOperands(rhs);
186 assert(resultTypes.size() == 1u && "mismatched number of results");
187 odsState.addTypes(resultTypes);
188}
189
190void AndBoolOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
191 assert(operands.size() == 2u && "mismatched number of parameters");
192 odsState.addOperands(operands);
193 odsState.addAttributes(attributes);
194 assert(resultTypes.size() == 1u && "mismatched number of return types");
195 odsState.addTypes(resultTypes);
196}
197
198void AndBoolOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
199 assert(operands.size() == 2u && "mismatched number of parameters");
200 odsState.addOperands(operands);
201 odsState.addAttributes(attributes);
202
203 ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
204 if (::mlir::succeeded(AndBoolOp::inferReturnTypes(odsBuilder.getContext(),
205 odsState.location, operands,
206 odsState.attributes.getDictionary(odsState.getContext()),
207 odsState.getRawProperties(),
208 odsState.regions, inferredReturnTypes))) {
209 assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
210 odsState.addTypes(inferredReturnTypes);
211 } else {
212 ::llvm::report_fatal_error("Failed to infer result type(s).");
213 }
214}
215
216::mlir::LogicalResult AndBoolOp::verifyInvariantsImpl() {
217 {
218 unsigned index = 0; (void)index;
219 auto valueGroup0 = getODSOperands(0);
220
221 for (auto v : valueGroup0) {
222 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops0(*this, v.getType(), "operand", index++)))
223 return ::mlir::failure();
224 }
225 auto valueGroup1 = getODSOperands(1);
226
227 for (auto v : valueGroup1) {
228 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops0(*this, v.getType(), "operand", index++)))
229 return ::mlir::failure();
230 }
231 }
232 {
233 unsigned index = 0; (void)index;
234 auto valueGroup0 = getODSResults(0);
235
236 for (auto v : valueGroup0) {
237 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops1(*this, v.getType(), "result", index++)))
238 return ::mlir::failure();
239 }
240 }
241 if (!((::llzk::typesUnify((*this->getODSOperands(0).begin()).getType(), (*this->getODSResults(0).begin()).getType()))))
242 return emitOpError("failed to verify that result type matches with lhs type");
243 if (!((::llzk::typesUnify((*this->getODSOperands(1).begin()).getType(), (*this->getODSResults(0).begin()).getType()))))
244 return emitOpError("failed to verify that result type matches with rhs type");
245 return ::mlir::success();
246}
247
248::mlir::LogicalResult AndBoolOp::verifyInvariants() {
249 return verifyInvariantsImpl();
250}
251
252::mlir::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) {
253 inferredReturnTypes.resize(1);
254 ::mlir::Builder odsBuilder(context);
255 ::mlir::Type odsInferredType0 = odsBuilder.getIntegerType(1);
256 inferredReturnTypes[0] = odsInferredType0;
257 return ::mlir::success();
258}
259
260::mlir::ParseResult AndBoolOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
261 ::mlir::OpAsmParser::UnresolvedOperand lhsRawOperands[1];
262 ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> lhsOperands(lhsRawOperands); ::llvm::SMLoc lhsOperandsLoc;
263 (void)lhsOperandsLoc;
264 ::mlir::OpAsmParser::UnresolvedOperand rhsRawOperands[1];
265 ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> rhsOperands(rhsRawOperands); ::llvm::SMLoc rhsOperandsLoc;
266 (void)rhsOperandsLoc;
267 ::mlir::Type lhsRawTypes[1];
268 ::llvm::ArrayRef<::mlir::Type> lhsTypes(lhsRawTypes);
269 ::mlir::Type rhsRawTypes[1];
270 ::llvm::ArrayRef<::mlir::Type> rhsTypes(rhsRawTypes);
271
272 lhsOperandsLoc = parser.getCurrentLocation();
273 if (parser.parseOperand(lhsRawOperands[0]))
274 return ::mlir::failure();
275 if (parser.parseComma())
276 return ::mlir::failure();
277
278 rhsOperandsLoc = parser.getCurrentLocation();
279 if (parser.parseOperand(rhsRawOperands[0]))
280 return ::mlir::failure();
281 {
282 auto odsResult = parseInferredOrParsedType(parser, lhsRawTypes[0], true);
283 if (odsResult) return ::mlir::failure();
284 }
285 {
286 auto odsResult = parseInferredOrParsedType(parser, rhsRawTypes[0], false);
287 if (odsResult) return ::mlir::failure();
288 }
289 {
290 auto loc = parser.getCurrentLocation();(void)loc;
291 if (parser.parseOptionalAttrDict(result.attributes))
292 return ::mlir::failure();
293 }
294 ::mlir::Type odsBuildableType0 = parser.getBuilder().getIntegerType(1);
295 result.addTypes(odsBuildableType0);
296 if (parser.resolveOperands(lhsOperands, lhsTypes, lhsOperandsLoc, result.operands))
297 return ::mlir::failure();
298 if (parser.resolveOperands(rhsOperands, rhsTypes, rhsOperandsLoc, result.operands))
299 return ::mlir::failure();
300 return ::mlir::success();
301}
302
303void AndBoolOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
304 _odsPrinter << ' ';
305 _odsPrinter << getLhs();
306 _odsPrinter << ",";
307 _odsPrinter << ' ';
308 _odsPrinter << getRhs();
309 printInferredOrParsedType(_odsPrinter, *this, getLhs().getType(), true);
310 printInferredOrParsedType(_odsPrinter, *this, getRhs().getType(), false);
311 ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
312 _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
313}
314
315void AndBoolOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
316}
317
318} // namespace boolean
319} // namespace llzk
320MLIR_DEFINE_EXPLICIT_TYPE_ID(::llzk::boolean::AndBoolOp)
321
322namespace llzk {
323namespace boolean {
324
325//===----------------------------------------------------------------------===//
326// ::llzk::boolean::AssertOp definitions
327//===----------------------------------------------------------------------===//
328
329namespace detail {
330AssertOpGenericAdaptorBase::AssertOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs)
331 odsOpName.emplace("bool.assert", odsAttrs.getContext());
332}
333
334AssertOpGenericAdaptorBase::AssertOpGenericAdaptorBase(AssertOp op) : AssertOpGenericAdaptorBase(op->getDiscardableAttrDictionary(), op.getProperties(), op->getRegions()) {}
335
336std::pair<unsigned, unsigned> AssertOpGenericAdaptorBase::getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize) {
337 return {index, 1};
338}
339
341 return odsAttrs;
342}
343
345 auto attr = ::llvm::dyn_cast_or_null<::mlir::StringAttr>(getProperties().msg);
346 return attr;
347}
348
349::std::optional< ::llvm::StringRef > AssertOpGenericAdaptorBase::getMsg() {
350 auto attr = getMsgAttr();
351 return attr ? ::std::optional< ::llvm::StringRef >(attr.getValue()) : (::std::nullopt);
352}
353
354} // namespace detail
356
357::mlir::LogicalResult AssertOpAdaptor::verify(::mlir::Location loc) {
358 auto tblgen_msg = getProperties().msg; (void)tblgen_msg;
359
360 if (tblgen_msg && !((::llvm::isa<::mlir::StringAttr>(tblgen_msg))))
361 return emitError(loc, "'bool.assert' op ""attribute 'msg' failed to satisfy constraint: string attribute");
362 return ::mlir::success();
363}
364
365std::pair<unsigned, unsigned> AssertOp::getODSOperandIndexAndLength(unsigned index) {
366 return {index, 1};
367}
368
369::mlir::Operation::operand_range AssertOp::getODSOperands(unsigned index) {
370 auto valueRange = getODSOperandIndexAndLength(index);
371 return {std::next(getOperation()->operand_begin(), valueRange.first),
372 std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
373}
374
375::mlir::TypedValue<::mlir::IntegerType> AssertOp::getCondition() {
376 return ::llvm::cast<::mlir::TypedValue<::mlir::IntegerType>>(*getODSOperands(0).begin());
377}
378
379::mlir::OpOperand &AssertOp::getConditionMutable() {
380 auto range = getODSOperandIndexAndLength(0);
381 return getOperation()->getOpOperand(range.first);
382}
383
384std::pair<unsigned, unsigned> AssertOp::getODSResultIndexAndLength(unsigned index) {
385 return {index, 1};
386}
387
388::mlir::Operation::result_range AssertOp::getODSResults(unsigned index) {
389 auto valueRange = getODSResultIndexAndLength(index);
390 return {std::next(getOperation()->result_begin(), valueRange.first),
391 std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
392}
393
394::mlir::LogicalResult AssertOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
395 ::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
396 if (!dict) {
397 emitError() << "expected DictionaryAttr to set properties";
398 return ::mlir::failure();
399 }
400
401 {
402 auto &propStorage = prop.msg;
403 auto attr = dict.get("msg");
404 if (attr || /*isRequired=*/false) {
405 if (!attr) {
406 emitError() << "expected key entry for msg in DictionaryAttr to set "
407 "Properties.";
408 return ::mlir::failure();
409 }
410 auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
411 if (convertedAttr) {
412 propStorage = convertedAttr;
413 } else {
414 emitError() << "Invalid attribute `msg` in property conversion: " << attr;
415 return ::mlir::failure();
416 }
417 }
418 }
419 return ::mlir::success();
420}
421
422::mlir::Attribute AssertOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
423 ::mlir::SmallVector<::mlir::NamedAttribute> attrs;
424 ::mlir::Builder odsBuilder{ctx};
425
426 {
427 const auto &propStorage = prop.msg;
428 if (propStorage)
429 attrs.push_back(odsBuilder.getNamedAttr("msg",
430 propStorage));
431 }
432
433 if (!attrs.empty())
434 return odsBuilder.getDictionaryAttr(attrs);
435 return {};
436}
437
438llvm::hash_code AssertOp::computePropertiesHash(const Properties &prop) {
439 return llvm::hash_combine(
440 llvm::hash_value(prop.msg.getAsOpaquePointer()));
441}
442
443std::optional<mlir::Attribute> AssertOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
444 if (name == "msg")
445 return prop.msg;
446 return std::nullopt;
447}
448
449void AssertOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
450 if (name == "msg") {
451 prop.msg = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.msg)>>(value);
452 return;
453 }
454}
455
456void AssertOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
457 if (prop.msg) attrs.append("msg", prop.msg);
458}
459
460::mlir::LogicalResult AssertOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
461 {
462 ::mlir::Attribute attr = attrs.get(getMsgAttrName(opName));
463 if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_Ops0(attr, "msg", emitError)))
464 return ::mlir::failure();
465 }
466 return ::mlir::success();
467}
468
469::mlir::LogicalResult AssertOp::readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state) {
470 auto &prop = state.getOrAddProperties<Properties>(); (void)prop;
471 if (::mlir::failed(reader.readOptionalAttribute(prop.msg)))
472 return ::mlir::failure();
473 return ::mlir::success();
474}
475
476void AssertOp::writeProperties(::mlir::DialectBytecodeWriter &writer) {
477 auto &prop = getProperties(); (void)prop;
478
479 writer.writeOptionalAttribute(prop.msg);
480}
481
482::mlir::StringAttr AssertOp::getMsgAttr() {
483 return ::llvm::dyn_cast_or_null<::mlir::StringAttr>(getProperties().msg);
484}
485
486::std::optional< ::llvm::StringRef > AssertOp::getMsg() {
487 auto attr = getMsgAttr();
488 return attr ? ::std::optional< ::llvm::StringRef >(attr.getValue()) : (::std::nullopt);
489}
490
491void AssertOp::setMsgAttr(::mlir::StringAttr attr) {
492 (*this)->setAttr(getMsgAttrName(), attr);
493}
494
495void AssertOp::setMsg(::std::optional<::llvm::StringRef> attrValue) {
496 if (attrValue)
497 return (*this)->setAttr(getMsgAttrName(), ::mlir::Builder((*this)->getContext()).getStringAttr(*attrValue));
498 (*this)->removeAttr(getMsgAttrName());
499}
500
501::mlir::Attribute AssertOp::removeMsgAttr() {
502 auto &attr = getProperties().msg;
503 attr = {};
504 return attr;
505}
506
507void AssertOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value condition, /*optional*/::mlir::StringAttr msg) {
508 odsState.addOperands(condition);
509 if (msg) {
510 odsState.getOrAddProperties<Properties>().msg = msg;
511 }
512}
513
514void AssertOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value condition, /*optional*/::mlir::StringAttr msg) {
515 odsState.addOperands(condition);
516 if (msg) {
517 odsState.getOrAddProperties<Properties>().msg = msg;
518 }
519 assert(resultTypes.size() == 0u && "mismatched number of results");
520 odsState.addTypes(resultTypes);
521}
522
523void AssertOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
524 assert(operands.size() == 1u && "mismatched number of parameters");
525 odsState.addOperands(operands);
526 odsState.addAttributes(attributes);
527 assert(resultTypes.size() == 0u && "mismatched number of return types");
528 odsState.addTypes(resultTypes);
529}
530
531::mlir::LogicalResult AssertOp::verifyInvariantsImpl() {
532 auto tblgen_msg = getProperties().msg; (void)tblgen_msg;
533
534 if (::mlir::failed(__mlir_ods_local_attr_constraint_Ops0(*this, tblgen_msg, "msg")))
535 return ::mlir::failure();
536 {
537 unsigned index = 0; (void)index;
538 auto valueGroup0 = getODSOperands(0);
539
540 for (auto v : valueGroup0) {
541 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops1(*this, v.getType(), "operand", index++)))
542 return ::mlir::failure();
543 }
544 }
545 return ::mlir::success();
546}
547
548::mlir::LogicalResult AssertOp::verifyInvariants() {
549 return verifyInvariantsImpl();
550}
551
552::mlir::ParseResult AssertOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
553 ::mlir::OpAsmParser::UnresolvedOperand conditionRawOperands[1];
554 ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> conditionOperands(conditionRawOperands); ::llvm::SMLoc conditionOperandsLoc;
555 (void)conditionOperandsLoc;
556 ::mlir::StringAttr msgAttr;
557
558 conditionOperandsLoc = parser.getCurrentLocation();
559 if (parser.parseOperand(conditionRawOperands[0]))
560 return ::mlir::failure();
561 if (::mlir::succeeded(parser.parseOptionalComma())) {
562
563 if (parser.parseCustomAttributeWithFallback(msgAttr, parser.getBuilder().getType<::mlir::NoneType>())) {
564 return ::mlir::failure();
565 }
566 if (msgAttr) result.getOrAddProperties<AssertOp::Properties>().msg = msgAttr;
567 }
568 {
569 auto loc = parser.getCurrentLocation();(void)loc;
570 if (parser.parseOptionalAttrDict(result.attributes))
571 return ::mlir::failure();
572 if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() {
573 return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op ";
574 })))
575 return ::mlir::failure();
576 }
577 ::mlir::Type odsBuildableType0 = parser.getBuilder().getIntegerType(1);
578 if (parser.resolveOperands(conditionOperands, odsBuildableType0, conditionOperandsLoc, result.operands))
579 return ::mlir::failure();
580 return ::mlir::success();
581}
582
583void AssertOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
584 _odsPrinter << ' ';
585 _odsPrinter << getCondition();
586 if (getMsgAttr()) {
587 _odsPrinter << ",";
588 _odsPrinter << ' ';
589 _odsPrinter.printAttributeWithoutType(getMsgAttr());
590 }
591 ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
592 elidedAttrs.push_back("msg");
593 _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
594}
595
596} // namespace boolean
597} // namespace llzk
598MLIR_DEFINE_EXPLICIT_TYPE_ID(::llzk::boolean::AssertOp)
599
600namespace llzk {
601namespace boolean {
602
603//===----------------------------------------------------------------------===//
604// ::llzk::boolean::CmpOp definitions
605//===----------------------------------------------------------------------===//
606
607namespace detail {
608CmpOpGenericAdaptorBase::CmpOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs)
609 odsOpName.emplace("bool.cmp", odsAttrs.getContext());
610}
611
612CmpOpGenericAdaptorBase::CmpOpGenericAdaptorBase(CmpOp op) : CmpOpGenericAdaptorBase(op->getDiscardableAttrDictionary(), op.getProperties(), op->getRegions()) {}
613
614std::pair<unsigned, unsigned> CmpOpGenericAdaptorBase::getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize) {
615 return {index, 1};
616}
617
619 return odsAttrs;
620}
621
622::llzk::boolean::FeltCmpPredicateAttr CmpOpGenericAdaptorBase::getPredicateAttr() {
623 auto attr = ::llvm::cast<::llzk::boolean::FeltCmpPredicateAttr>(getProperties().predicate);
624 return attr;
625}
626
631
632} // namespace detail
634
635::mlir::LogicalResult CmpOpAdaptor::verify(::mlir::Location loc) {
636 auto tblgen_predicate = getProperties().predicate; (void)tblgen_predicate;
637 if (!tblgen_predicate) return emitError(loc, "'bool.cmp' op ""requires attribute 'predicate'");
638
639 if (tblgen_predicate && !((::llvm::isa<::llzk::boolean::FeltCmpPredicateAttr>(tblgen_predicate))))
640 return emitError(loc, "'bool.cmp' op ""attribute 'predicate' failed to satisfy constraint: Field element comparison predicate");
641 return ::mlir::success();
642}
643
644std::pair<unsigned, unsigned> CmpOp::getODSOperandIndexAndLength(unsigned index) {
645 return {index, 1};
646}
647
648::mlir::Operation::operand_range CmpOp::getODSOperands(unsigned index) {
649 auto valueRange = getODSOperandIndexAndLength(index);
650 return {std::next(getOperation()->operand_begin(), valueRange.first),
651 std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
652}
653
654::mlir::TypedValue<::llzk::felt::FeltType> CmpOp::getLhs() {
655 return ::llvm::cast<::mlir::TypedValue<::llzk::felt::FeltType>>(*getODSOperands(0).begin());
656}
657
658::mlir::TypedValue<::llzk::felt::FeltType> CmpOp::getRhs() {
659 return ::llvm::cast<::mlir::TypedValue<::llzk::felt::FeltType>>(*getODSOperands(1).begin());
660}
661
662::mlir::OpOperand &CmpOp::getLhsMutable() {
663 auto range = getODSOperandIndexAndLength(0);
664 return getOperation()->getOpOperand(range.first);
665}
666
667::mlir::OpOperand &CmpOp::getRhsMutable() {
668 auto range = getODSOperandIndexAndLength(1);
669 return getOperation()->getOpOperand(range.first);
670}
671
672std::pair<unsigned, unsigned> CmpOp::getODSResultIndexAndLength(unsigned index) {
673 return {index, 1};
674}
675
676::mlir::Operation::result_range CmpOp::getODSResults(unsigned index) {
677 auto valueRange = getODSResultIndexAndLength(index);
678 return {std::next(getOperation()->result_begin(), valueRange.first),
679 std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
680}
681
682::mlir::TypedValue<::mlir::IntegerType> CmpOp::getResult() {
683 return ::llvm::cast<::mlir::TypedValue<::mlir::IntegerType>>(*getODSResults(0).begin());
684}
685
686::mlir::LogicalResult CmpOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
687 ::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
688 if (!dict) {
689 emitError() << "expected DictionaryAttr to set properties";
690 return ::mlir::failure();
691 }
692
693 {
694 auto &propStorage = prop.predicate;
695 auto attr = dict.get("predicate");
696 if (attr || /*isRequired=*/true) {
697 if (!attr) {
698 emitError() << "expected key entry for predicate in DictionaryAttr to set "
699 "Properties.";
700 return ::mlir::failure();
701 }
702 auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
703 if (convertedAttr) {
704 propStorage = convertedAttr;
705 } else {
706 emitError() << "Invalid attribute `predicate` in property conversion: " << attr;
707 return ::mlir::failure();
708 }
709 }
710 }
711 return ::mlir::success();
712}
713
714::mlir::Attribute CmpOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
715 ::mlir::SmallVector<::mlir::NamedAttribute> attrs;
716 ::mlir::Builder odsBuilder{ctx};
717
718 {
719 const auto &propStorage = prop.predicate;
720 if (propStorage)
721 attrs.push_back(odsBuilder.getNamedAttr("predicate",
722 propStorage));
723 }
724
725 if (!attrs.empty())
726 return odsBuilder.getDictionaryAttr(attrs);
727 return {};
728}
729
730llvm::hash_code CmpOp::computePropertiesHash(const Properties &prop) {
731 return llvm::hash_combine(
732 llvm::hash_value(prop.predicate.getAsOpaquePointer()));
733}
734
735std::optional<mlir::Attribute> CmpOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
736 if (name == "predicate")
737 return prop.predicate;
738 return std::nullopt;
739}
740
741void CmpOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
742 if (name == "predicate") {
743 prop.predicate = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.predicate)>>(value);
744 return;
745 }
746}
747
748void CmpOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
749 if (prop.predicate) attrs.append("predicate", prop.predicate);
750}
751
752::mlir::LogicalResult CmpOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
753 {
754 ::mlir::Attribute attr = attrs.get(getPredicateAttrName(opName));
755 if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_Ops1(attr, "predicate", emitError)))
756 return ::mlir::failure();
757 }
758 return ::mlir::success();
759}
760
761::mlir::LogicalResult CmpOp::readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state) {
762 auto &prop = state.getOrAddProperties<Properties>(); (void)prop;
763 if (::mlir::failed(reader.readAttribute(prop.predicate)))
764 return ::mlir::failure();
765 return ::mlir::success();
766}
767
768void CmpOp::writeProperties(::mlir::DialectBytecodeWriter &writer) {
769 auto &prop = getProperties(); (void)prop;
770 writer.writeAttribute(prop.predicate);
771}
772
773::llzk::boolean::FeltCmpPredicateAttr CmpOp::getPredicateAttr() {
774 return ::llvm::cast<::llzk::boolean::FeltCmpPredicateAttr>(getProperties().predicate);
775}
776
778 auto attr = getPredicateAttr();
779 return attr.getValue();
780}
781
782void CmpOp::setPredicateAttr(::llzk::boolean::FeltCmpPredicateAttr attr) {
783 (*this)->setAttr(getPredicateAttrName(), attr);
784}
785
787 (*this)->setAttr(getPredicateAttrName(), ::llzk::boolean::FeltCmpPredicateAttr::get(::mlir::Builder((*this)->getContext()).getContext(), attrValue));
788}
789
790void CmpOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::llzk::boolean::FeltCmpPredicateAttr predicate, ::mlir::Value lhs, ::mlir::Value rhs) {
791 odsState.addOperands(lhs);
792 odsState.addOperands(rhs);
793 odsState.getOrAddProperties<Properties>().predicate = predicate;
794 odsState.addTypes(result);
795}
796
797void CmpOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::llzk::boolean::FeltCmpPredicateAttr predicate, ::mlir::Value lhs, ::mlir::Value rhs) {
798 odsState.addOperands(lhs);
799 odsState.addOperands(rhs);
800 odsState.getOrAddProperties<Properties>().predicate = predicate;
801
802 ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
803 if (::mlir::succeeded(CmpOp::inferReturnTypes(odsBuilder.getContext(),
804 odsState.location, odsState.operands,
805 odsState.attributes.getDictionary(odsState.getContext()),
806 odsState.getRawProperties(),
807 odsState.regions, inferredReturnTypes)))
808 odsState.addTypes(inferredReturnTypes);
809 else
810 ::llvm::report_fatal_error("Failed to infer result type(s).");
811}
812
813void CmpOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::llzk::boolean::FeltCmpPredicateAttr predicate, ::mlir::Value lhs, ::mlir::Value rhs) {
814 odsState.addOperands(lhs);
815 odsState.addOperands(rhs);
816 odsState.getOrAddProperties<Properties>().predicate = predicate;
817 assert(resultTypes.size() == 1u && "mismatched number of results");
818 odsState.addTypes(resultTypes);
819}
820
821void CmpOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::llzk::boolean::FeltCmpPredicate predicate, ::mlir::Value lhs, ::mlir::Value rhs) {
822 odsState.addOperands(lhs);
823 odsState.addOperands(rhs);
824 odsState.getOrAddProperties<Properties>().predicate = ::llzk::boolean::FeltCmpPredicateAttr::get(odsBuilder.getContext(), predicate);
825 odsState.addTypes(result);
826}
827
828void CmpOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::llzk::boolean::FeltCmpPredicate predicate, ::mlir::Value lhs, ::mlir::Value rhs) {
829 odsState.addOperands(lhs);
830 odsState.addOperands(rhs);
831 odsState.getOrAddProperties<Properties>().predicate = ::llzk::boolean::FeltCmpPredicateAttr::get(odsBuilder.getContext(), predicate);
832
833 ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
834 if (::mlir::succeeded(CmpOp::inferReturnTypes(odsBuilder.getContext(),
835 odsState.location, odsState.operands,
836 odsState.attributes.getDictionary(odsState.getContext()),
837 odsState.getRawProperties(),
838 odsState.regions, inferredReturnTypes)))
839 odsState.addTypes(inferredReturnTypes);
840 else
841 ::llvm::report_fatal_error("Failed to infer result type(s).");
842}
843
844void CmpOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::llzk::boolean::FeltCmpPredicate predicate, ::mlir::Value lhs, ::mlir::Value rhs) {
845 odsState.addOperands(lhs);
846 odsState.addOperands(rhs);
847 odsState.getOrAddProperties<Properties>().predicate = ::llzk::boolean::FeltCmpPredicateAttr::get(odsBuilder.getContext(), predicate);
848 assert(resultTypes.size() == 1u && "mismatched number of results");
849 odsState.addTypes(resultTypes);
850}
851
852void CmpOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
853 assert(operands.size() == 2u && "mismatched number of parameters");
854 odsState.addOperands(operands);
855 odsState.addAttributes(attributes);
856 assert(resultTypes.size() == 1u && "mismatched number of return types");
857 odsState.addTypes(resultTypes);
858}
859
860void CmpOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
861 assert(operands.size() == 2u && "mismatched number of parameters");
862 odsState.addOperands(operands);
863 odsState.addAttributes(attributes);
864
865 ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
866 if (::mlir::succeeded(CmpOp::inferReturnTypes(odsBuilder.getContext(),
867 odsState.location, operands,
868 odsState.attributes.getDictionary(odsState.getContext()),
869 odsState.getRawProperties(),
870 odsState.regions, inferredReturnTypes))) {
871 assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
872 odsState.addTypes(inferredReturnTypes);
873 } else {
874 ::llvm::report_fatal_error("Failed to infer result type(s).");
875 }
876}
877
878::mlir::LogicalResult CmpOp::verifyInvariantsImpl() {
879 auto tblgen_predicate = getProperties().predicate; (void)tblgen_predicate;
880 if (!tblgen_predicate) return emitOpError("requires attribute 'predicate'");
881
882 if (::mlir::failed(__mlir_ods_local_attr_constraint_Ops1(*this, tblgen_predicate, "predicate")))
883 return ::mlir::failure();
884 {
885 unsigned index = 0; (void)index;
886 auto valueGroup0 = getODSOperands(0);
887
888 for (auto v : valueGroup0) {
889 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops2(*this, v.getType(), "operand", index++)))
890 return ::mlir::failure();
891 }
892 auto valueGroup1 = getODSOperands(1);
893
894 for (auto v : valueGroup1) {
895 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops2(*this, v.getType(), "operand", index++)))
896 return ::mlir::failure();
897 }
898 }
899 {
900 unsigned index = 0; (void)index;
901 auto valueGroup0 = getODSResults(0);
902
903 for (auto v : valueGroup0) {
904 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops1(*this, v.getType(), "result", index++)))
905 return ::mlir::failure();
906 }
907 }
908 return ::mlir::success();
909}
910
911::mlir::LogicalResult CmpOp::verifyInvariants() {
912 return verifyInvariantsImpl();
913}
914
915::mlir::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) {
916 inferredReturnTypes.resize(1);
917 ::mlir::Builder odsBuilder(context);
918 ::mlir::Type odsInferredType0 = odsBuilder.getIntegerType(1);
919 inferredReturnTypes[0] = odsInferredType0;
920 return ::mlir::success();
921}
922
923::mlir::ParseResult CmpOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
924 ::llzk::boolean::FeltCmpPredicateAttr predicateAttr;
925 ::mlir::OpAsmParser::UnresolvedOperand lhsRawOperands[1];
926 ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> lhsOperands(lhsRawOperands); ::llvm::SMLoc lhsOperandsLoc;
927 (void)lhsOperandsLoc;
928 ::mlir::OpAsmParser::UnresolvedOperand rhsRawOperands[1];
929 ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> rhsOperands(rhsRawOperands); ::llvm::SMLoc rhsOperandsLoc;
930 (void)rhsOperandsLoc;
931
932 if (parser.parseCustomAttributeWithFallback(predicateAttr, ::mlir::Type{})) {
933 return ::mlir::failure();
934 }
935 if (predicateAttr) result.getOrAddProperties<CmpOp::Properties>().predicate = predicateAttr;
936 if (parser.parseLParen())
937 return ::mlir::failure();
938
939 lhsOperandsLoc = parser.getCurrentLocation();
940 if (parser.parseOperand(lhsRawOperands[0]))
941 return ::mlir::failure();
942 if (parser.parseComma())
943 return ::mlir::failure();
944
945 rhsOperandsLoc = parser.getCurrentLocation();
946 if (parser.parseOperand(rhsRawOperands[0]))
947 return ::mlir::failure();
948 if (parser.parseRParen())
949 return ::mlir::failure();
950 {
951 auto loc = parser.getCurrentLocation();(void)loc;
952 if (parser.parseOptionalAttrDict(result.attributes))
953 return ::mlir::failure();
954 if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() {
955 return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op ";
956 })))
957 return ::mlir::failure();
958 }
959 ::mlir::Type odsBuildableType0 = parser.getBuilder().getIntegerType(1);
960 ::mlir::Type odsBuildableType1 = parser.getBuilder().getType<::llzk::felt::FeltType>();
961 result.addTypes(odsBuildableType0);
962 if (parser.resolveOperands(lhsOperands, odsBuildableType1, lhsOperandsLoc, result.operands))
963 return ::mlir::failure();
964 if (parser.resolveOperands(rhsOperands, odsBuildableType1, rhsOperandsLoc, result.operands))
965 return ::mlir::failure();
966 return ::mlir::success();
967}
968
969void CmpOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
970_odsPrinter.printStrippedAttrOrType(getPredicateAttr());
971 _odsPrinter << "(";
972 _odsPrinter << getLhs();
973 _odsPrinter << ",";
974 _odsPrinter << ' ';
975 _odsPrinter << getRhs();
976 _odsPrinter << ")";
977 ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
978 elidedAttrs.push_back("predicate");
979 _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
980}
981
982void CmpOp::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::CmpOp)
988
989namespace llzk {
990namespace boolean {
991
992//===----------------------------------------------------------------------===//
993// ::llzk::boolean::NotBoolOp definitions
994//===----------------------------------------------------------------------===//
995
996namespace detail {
997NotBoolOpGenericAdaptorBase::NotBoolOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const ::mlir::EmptyProperties &properties, ::mlir::RegionRange regions) : odsAttrs(attrs), odsRegions(regions) { if (odsAttrs)
998 odsOpName.emplace("bool.not", odsAttrs.getContext());
999}
1000
1001NotBoolOpGenericAdaptorBase::NotBoolOpGenericAdaptorBase(NotBoolOp op) : NotBoolOpGenericAdaptorBase(op->getAttrDictionary(), op.getProperties(), op->getRegions()) {}
1002
1003std::pair<unsigned, unsigned> NotBoolOpGenericAdaptorBase::getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize) {
1004 return {index, 1};
1005}
1006
1008 return odsAttrs;
1009}
1010
1011} // namespace detail
1013
1014::mlir::LogicalResult NotBoolOpAdaptor::verify(::mlir::Location loc) {
1015 return ::mlir::success();
1016}
1017
1018std::pair<unsigned, unsigned> NotBoolOp::getODSOperandIndexAndLength(unsigned index) {
1019 return {index, 1};
1020}
1021
1022::mlir::Operation::operand_range NotBoolOp::getODSOperands(unsigned index) {
1023 auto valueRange = getODSOperandIndexAndLength(index);
1024 return {std::next(getOperation()->operand_begin(), valueRange.first),
1025 std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
1026}
1027
1028::mlir::Value NotBoolOp::getOperand() {
1029 return ::llvm::cast<::mlir::Value>(*getODSOperands(0).begin());
1030}
1031
1032::mlir::OpOperand &NotBoolOp::getOperandMutable() {
1033 auto range = getODSOperandIndexAndLength(0);
1034 return getOperation()->getOpOperand(range.first);
1035}
1036
1037std::pair<unsigned, unsigned> NotBoolOp::getODSResultIndexAndLength(unsigned index) {
1038 return {index, 1};
1039}
1040
1041::mlir::Operation::result_range NotBoolOp::getODSResults(unsigned index) {
1042 auto valueRange = getODSResultIndexAndLength(index);
1043 return {std::next(getOperation()->result_begin(), valueRange.first),
1044 std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
1045}
1046
1047::mlir::TypedValue<::mlir::IntegerType> NotBoolOp::getResult() {
1048 return ::llvm::cast<::mlir::TypedValue<::mlir::IntegerType>>(*getODSResults(0).begin());
1049}
1050
1051void NotBoolOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value operand) {
1052 odsState.addOperands(operand);
1053 odsState.addTypes(result);
1054}
1055
1056void NotBoolOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value operand) {
1057 odsState.addOperands(operand);
1058
1059 ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
1060 if (::mlir::succeeded(NotBoolOp::inferReturnTypes(odsBuilder.getContext(),
1061 odsState.location, odsState.operands,
1062 odsState.attributes.getDictionary(odsState.getContext()),
1063 odsState.getRawProperties(),
1064 odsState.regions, inferredReturnTypes)))
1065 odsState.addTypes(inferredReturnTypes);
1066 else
1067 ::llvm::report_fatal_error("Failed to infer result type(s).");
1068}
1069
1070void NotBoolOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value operand) {
1071 odsState.addOperands(operand);
1072 assert(resultTypes.size() == 1u && "mismatched number of results");
1073 odsState.addTypes(resultTypes);
1074}
1075
1076void NotBoolOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
1077 assert(operands.size() == 1u && "mismatched number of parameters");
1078 odsState.addOperands(operands);
1079 odsState.addAttributes(attributes);
1080 assert(resultTypes.size() == 1u && "mismatched number of return types");
1081 odsState.addTypes(resultTypes);
1082}
1083
1084void NotBoolOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
1085 assert(operands.size() == 1u && "mismatched number of parameters");
1086 odsState.addOperands(operands);
1087 odsState.addAttributes(attributes);
1088
1089 ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
1090 if (::mlir::succeeded(NotBoolOp::inferReturnTypes(odsBuilder.getContext(),
1091 odsState.location, operands,
1092 odsState.attributes.getDictionary(odsState.getContext()),
1093 odsState.getRawProperties(),
1094 odsState.regions, inferredReturnTypes))) {
1095 assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
1096 odsState.addTypes(inferredReturnTypes);
1097 } else {
1098 ::llvm::report_fatal_error("Failed to infer result type(s).");
1099 }
1100}
1101
1102::mlir::LogicalResult NotBoolOp::verifyInvariantsImpl() {
1103 {
1104 unsigned index = 0; (void)index;
1105 auto valueGroup0 = getODSOperands(0);
1106
1107 for (auto v : valueGroup0) {
1108 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops0(*this, v.getType(), "operand", index++)))
1109 return ::mlir::failure();
1110 }
1111 }
1112 {
1113 unsigned index = 0; (void)index;
1114 auto valueGroup0 = getODSResults(0);
1115
1116 for (auto v : valueGroup0) {
1117 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops1(*this, v.getType(), "result", index++)))
1118 return ::mlir::failure();
1119 }
1120 }
1121 if (!((::llzk::typesUnify((*this->getODSOperands(0).begin()).getType(), (*this->getODSResults(0).begin()).getType()))))
1122 return emitOpError("failed to verify that result type matches with operand type");
1123 return ::mlir::success();
1124}
1125
1126::mlir::LogicalResult NotBoolOp::verifyInvariants() {
1127 return verifyInvariantsImpl();
1128}
1129
1130::mlir::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) {
1131 inferredReturnTypes.resize(1);
1132 ::mlir::Builder odsBuilder(context);
1133 ::mlir::Type odsInferredType0 = odsBuilder.getIntegerType(1);
1134 inferredReturnTypes[0] = odsInferredType0;
1135 return ::mlir::success();
1136}
1137
1138::mlir::ParseResult NotBoolOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
1139 ::mlir::OpAsmParser::UnresolvedOperand operandRawOperands[1];
1140 ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> operandOperands(operandRawOperands); ::llvm::SMLoc operandOperandsLoc;
1141 (void)operandOperandsLoc;
1142 ::mlir::Type operandRawTypes[1];
1143 ::llvm::ArrayRef<::mlir::Type> operandTypes(operandRawTypes);
1144
1145 operandOperandsLoc = parser.getCurrentLocation();
1146 if (parser.parseOperand(operandRawOperands[0]))
1147 return ::mlir::failure();
1148 {
1149 auto odsResult = parseInferredOrParsedType(parser, operandRawTypes[0], true);
1150 if (odsResult) return ::mlir::failure();
1151 }
1152 {
1153 auto loc = parser.getCurrentLocation();(void)loc;
1154 if (parser.parseOptionalAttrDict(result.attributes))
1155 return ::mlir::failure();
1156 }
1157 ::mlir::Type odsBuildableType0 = parser.getBuilder().getIntegerType(1);
1158 result.addTypes(odsBuildableType0);
1159 if (parser.resolveOperands(operandOperands, operandTypes, operandOperandsLoc, result.operands))
1160 return ::mlir::failure();
1161 return ::mlir::success();
1162}
1163
1164void NotBoolOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
1165 _odsPrinter << ' ';
1166 _odsPrinter << getOperand();
1167 printInferredOrParsedType(_odsPrinter, *this, getOperand().getType(), true);
1168 ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
1169 _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
1170}
1171
1172void NotBoolOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
1173}
1174
1175} // namespace boolean
1176} // namespace llzk
1177MLIR_DEFINE_EXPLICIT_TYPE_ID(::llzk::boolean::NotBoolOp)
1178
1179namespace llzk {
1180namespace boolean {
1181
1182//===----------------------------------------------------------------------===//
1183// ::llzk::boolean::OrBoolOp definitions
1184//===----------------------------------------------------------------------===//
1185
1186namespace detail {
1187OrBoolOpGenericAdaptorBase::OrBoolOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const ::mlir::EmptyProperties &properties, ::mlir::RegionRange regions) : odsAttrs(attrs), odsRegions(regions) { if (odsAttrs)
1188 odsOpName.emplace("bool.or", odsAttrs.getContext());
1189}
1190
1191OrBoolOpGenericAdaptorBase::OrBoolOpGenericAdaptorBase(OrBoolOp op) : OrBoolOpGenericAdaptorBase(op->getAttrDictionary(), op.getProperties(), op->getRegions()) {}
1192
1193std::pair<unsigned, unsigned> OrBoolOpGenericAdaptorBase::getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize) {
1194 return {index, 1};
1195}
1196
1198 return odsAttrs;
1199}
1200
1201} // namespace detail
1203
1204::mlir::LogicalResult OrBoolOpAdaptor::verify(::mlir::Location loc) {
1205 return ::mlir::success();
1206}
1207
1208std::pair<unsigned, unsigned> OrBoolOp::getODSOperandIndexAndLength(unsigned index) {
1209 return {index, 1};
1210}
1211
1212::mlir::Operation::operand_range OrBoolOp::getODSOperands(unsigned index) {
1213 auto valueRange = getODSOperandIndexAndLength(index);
1214 return {std::next(getOperation()->operand_begin(), valueRange.first),
1215 std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
1216}
1217
1218::mlir::Value OrBoolOp::getLhs() {
1219 return ::llvm::cast<::mlir::Value>(*getODSOperands(0).begin());
1220}
1221
1222::mlir::Value OrBoolOp::getRhs() {
1223 return ::llvm::cast<::mlir::Value>(*getODSOperands(1).begin());
1224}
1225
1226::mlir::OpOperand &OrBoolOp::getLhsMutable() {
1227 auto range = getODSOperandIndexAndLength(0);
1228 return getOperation()->getOpOperand(range.first);
1229}
1230
1231::mlir::OpOperand &OrBoolOp::getRhsMutable() {
1232 auto range = getODSOperandIndexAndLength(1);
1233 return getOperation()->getOpOperand(range.first);
1234}
1235
1236std::pair<unsigned, unsigned> OrBoolOp::getODSResultIndexAndLength(unsigned index) {
1237 return {index, 1};
1238}
1239
1240::mlir::Operation::result_range OrBoolOp::getODSResults(unsigned index) {
1241 auto valueRange = getODSResultIndexAndLength(index);
1242 return {std::next(getOperation()->result_begin(), valueRange.first),
1243 std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
1244}
1245
1246::mlir::TypedValue<::mlir::IntegerType> OrBoolOp::getResult() {
1247 return ::llvm::cast<::mlir::TypedValue<::mlir::IntegerType>>(*getODSResults(0).begin());
1248}
1249
1250void OrBoolOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs) {
1251 odsState.addOperands(lhs);
1252 odsState.addOperands(rhs);
1253 odsState.addTypes(result);
1254}
1255
1256void OrBoolOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value lhs, ::mlir::Value rhs) {
1257 odsState.addOperands(lhs);
1258 odsState.addOperands(rhs);
1259
1260 ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
1261 if (::mlir::succeeded(OrBoolOp::inferReturnTypes(odsBuilder.getContext(),
1262 odsState.location, odsState.operands,
1263 odsState.attributes.getDictionary(odsState.getContext()),
1264 odsState.getRawProperties(),
1265 odsState.regions, inferredReturnTypes)))
1266 odsState.addTypes(inferredReturnTypes);
1267 else
1268 ::llvm::report_fatal_error("Failed to infer result type(s).");
1269}
1270
1271void OrBoolOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs) {
1272 odsState.addOperands(lhs);
1273 odsState.addOperands(rhs);
1274 assert(resultTypes.size() == 1u && "mismatched number of results");
1275 odsState.addTypes(resultTypes);
1276}
1277
1278void OrBoolOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
1279 assert(operands.size() == 2u && "mismatched number of parameters");
1280 odsState.addOperands(operands);
1281 odsState.addAttributes(attributes);
1282 assert(resultTypes.size() == 1u && "mismatched number of return types");
1283 odsState.addTypes(resultTypes);
1284}
1285
1286void OrBoolOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
1287 assert(operands.size() == 2u && "mismatched number of parameters");
1288 odsState.addOperands(operands);
1289 odsState.addAttributes(attributes);
1290
1291 ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
1292 if (::mlir::succeeded(OrBoolOp::inferReturnTypes(odsBuilder.getContext(),
1293 odsState.location, operands,
1294 odsState.attributes.getDictionary(odsState.getContext()),
1295 odsState.getRawProperties(),
1296 odsState.regions, inferredReturnTypes))) {
1297 assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
1298 odsState.addTypes(inferredReturnTypes);
1299 } else {
1300 ::llvm::report_fatal_error("Failed to infer result type(s).");
1301 }
1302}
1303
1304::mlir::LogicalResult OrBoolOp::verifyInvariantsImpl() {
1305 {
1306 unsigned index = 0; (void)index;
1307 auto valueGroup0 = getODSOperands(0);
1308
1309 for (auto v : valueGroup0) {
1310 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops0(*this, v.getType(), "operand", index++)))
1311 return ::mlir::failure();
1312 }
1313 auto valueGroup1 = getODSOperands(1);
1314
1315 for (auto v : valueGroup1) {
1316 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops0(*this, v.getType(), "operand", index++)))
1317 return ::mlir::failure();
1318 }
1319 }
1320 {
1321 unsigned index = 0; (void)index;
1322 auto valueGroup0 = getODSResults(0);
1323
1324 for (auto v : valueGroup0) {
1325 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops1(*this, v.getType(), "result", index++)))
1326 return ::mlir::failure();
1327 }
1328 }
1329 if (!((::llzk::typesUnify((*this->getODSOperands(0).begin()).getType(), (*this->getODSResults(0).begin()).getType()))))
1330 return emitOpError("failed to verify that result type matches with lhs type");
1331 if (!((::llzk::typesUnify((*this->getODSOperands(1).begin()).getType(), (*this->getODSResults(0).begin()).getType()))))
1332 return emitOpError("failed to verify that result type matches with rhs type");
1333 return ::mlir::success();
1334}
1335
1336::mlir::LogicalResult OrBoolOp::verifyInvariants() {
1337 return verifyInvariantsImpl();
1338}
1339
1340::mlir::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) {
1341 inferredReturnTypes.resize(1);
1342 ::mlir::Builder odsBuilder(context);
1343 ::mlir::Type odsInferredType0 = odsBuilder.getIntegerType(1);
1344 inferredReturnTypes[0] = odsInferredType0;
1345 return ::mlir::success();
1346}
1347
1348::mlir::ParseResult OrBoolOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
1349 ::mlir::OpAsmParser::UnresolvedOperand lhsRawOperands[1];
1350 ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> lhsOperands(lhsRawOperands); ::llvm::SMLoc lhsOperandsLoc;
1351 (void)lhsOperandsLoc;
1352 ::mlir::OpAsmParser::UnresolvedOperand rhsRawOperands[1];
1353 ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> rhsOperands(rhsRawOperands); ::llvm::SMLoc rhsOperandsLoc;
1354 (void)rhsOperandsLoc;
1355 ::mlir::Type lhsRawTypes[1];
1356 ::llvm::ArrayRef<::mlir::Type> lhsTypes(lhsRawTypes);
1357 ::mlir::Type rhsRawTypes[1];
1358 ::llvm::ArrayRef<::mlir::Type> rhsTypes(rhsRawTypes);
1359
1360 lhsOperandsLoc = parser.getCurrentLocation();
1361 if (parser.parseOperand(lhsRawOperands[0]))
1362 return ::mlir::failure();
1363 if (parser.parseComma())
1364 return ::mlir::failure();
1365
1366 rhsOperandsLoc = parser.getCurrentLocation();
1367 if (parser.parseOperand(rhsRawOperands[0]))
1368 return ::mlir::failure();
1369 {
1370 auto odsResult = parseInferredOrParsedType(parser, lhsRawTypes[0], true);
1371 if (odsResult) return ::mlir::failure();
1372 }
1373 {
1374 auto odsResult = parseInferredOrParsedType(parser, rhsRawTypes[0], false);
1375 if (odsResult) return ::mlir::failure();
1376 }
1377 {
1378 auto loc = parser.getCurrentLocation();(void)loc;
1379 if (parser.parseOptionalAttrDict(result.attributes))
1380 return ::mlir::failure();
1381 }
1382 ::mlir::Type odsBuildableType0 = parser.getBuilder().getIntegerType(1);
1383 result.addTypes(odsBuildableType0);
1384 if (parser.resolveOperands(lhsOperands, lhsTypes, lhsOperandsLoc, result.operands))
1385 return ::mlir::failure();
1386 if (parser.resolveOperands(rhsOperands, rhsTypes, rhsOperandsLoc, result.operands))
1387 return ::mlir::failure();
1388 return ::mlir::success();
1389}
1390
1391void OrBoolOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
1392 _odsPrinter << ' ';
1393 _odsPrinter << getLhs();
1394 _odsPrinter << ",";
1395 _odsPrinter << ' ';
1396 _odsPrinter << getRhs();
1397 printInferredOrParsedType(_odsPrinter, *this, getLhs().getType(), true);
1398 printInferredOrParsedType(_odsPrinter, *this, getRhs().getType(), false);
1399 ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
1400 _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
1401}
1402
1403void OrBoolOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
1404}
1405
1406} // namespace boolean
1407} // namespace llzk
1408MLIR_DEFINE_EXPLICIT_TYPE_ID(::llzk::boolean::OrBoolOp)
1409
1410namespace llzk {
1411namespace boolean {
1412
1413//===----------------------------------------------------------------------===//
1414// ::llzk::boolean::XorBoolOp definitions
1415//===----------------------------------------------------------------------===//
1416
1417namespace detail {
1418XorBoolOpGenericAdaptorBase::XorBoolOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const ::mlir::EmptyProperties &properties, ::mlir::RegionRange regions) : odsAttrs(attrs), odsRegions(regions) { if (odsAttrs)
1419 odsOpName.emplace("bool.xor", odsAttrs.getContext());
1420}
1421
1422XorBoolOpGenericAdaptorBase::XorBoolOpGenericAdaptorBase(XorBoolOp op) : XorBoolOpGenericAdaptorBase(op->getAttrDictionary(), op.getProperties(), op->getRegions()) {}
1423
1424std::pair<unsigned, unsigned> XorBoolOpGenericAdaptorBase::getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize) {
1425 return {index, 1};
1426}
1427
1429 return odsAttrs;
1430}
1431
1432} // namespace detail
1434
1435::mlir::LogicalResult XorBoolOpAdaptor::verify(::mlir::Location loc) {
1436 return ::mlir::success();
1437}
1438
1439std::pair<unsigned, unsigned> XorBoolOp::getODSOperandIndexAndLength(unsigned index) {
1440 return {index, 1};
1441}
1442
1443::mlir::Operation::operand_range XorBoolOp::getODSOperands(unsigned index) {
1444 auto valueRange = getODSOperandIndexAndLength(index);
1445 return {std::next(getOperation()->operand_begin(), valueRange.first),
1446 std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
1447}
1448
1449::mlir::Value XorBoolOp::getLhs() {
1450 return ::llvm::cast<::mlir::Value>(*getODSOperands(0).begin());
1451}
1452
1453::mlir::Value XorBoolOp::getRhs() {
1454 return ::llvm::cast<::mlir::Value>(*getODSOperands(1).begin());
1455}
1456
1457::mlir::OpOperand &XorBoolOp::getLhsMutable() {
1458 auto range = getODSOperandIndexAndLength(0);
1459 return getOperation()->getOpOperand(range.first);
1460}
1461
1462::mlir::OpOperand &XorBoolOp::getRhsMutable() {
1463 auto range = getODSOperandIndexAndLength(1);
1464 return getOperation()->getOpOperand(range.first);
1465}
1466
1467std::pair<unsigned, unsigned> XorBoolOp::getODSResultIndexAndLength(unsigned index) {
1468 return {index, 1};
1469}
1470
1471::mlir::Operation::result_range XorBoolOp::getODSResults(unsigned index) {
1472 auto valueRange = getODSResultIndexAndLength(index);
1473 return {std::next(getOperation()->result_begin(), valueRange.first),
1474 std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
1475}
1476
1477::mlir::TypedValue<::mlir::IntegerType> XorBoolOp::getResult() {
1478 return ::llvm::cast<::mlir::TypedValue<::mlir::IntegerType>>(*getODSResults(0).begin());
1479}
1480
1481void XorBoolOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs) {
1482 odsState.addOperands(lhs);
1483 odsState.addOperands(rhs);
1484 odsState.addTypes(result);
1485}
1486
1487void XorBoolOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value lhs, ::mlir::Value rhs) {
1488 odsState.addOperands(lhs);
1489 odsState.addOperands(rhs);
1490
1491 ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
1492 if (::mlir::succeeded(XorBoolOp::inferReturnTypes(odsBuilder.getContext(),
1493 odsState.location, odsState.operands,
1494 odsState.attributes.getDictionary(odsState.getContext()),
1495 odsState.getRawProperties(),
1496 odsState.regions, inferredReturnTypes)))
1497 odsState.addTypes(inferredReturnTypes);
1498 else
1499 ::llvm::report_fatal_error("Failed to infer result type(s).");
1500}
1501
1502void XorBoolOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs) {
1503 odsState.addOperands(lhs);
1504 odsState.addOperands(rhs);
1505 assert(resultTypes.size() == 1u && "mismatched number of results");
1506 odsState.addTypes(resultTypes);
1507}
1508
1509void XorBoolOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
1510 assert(operands.size() == 2u && "mismatched number of parameters");
1511 odsState.addOperands(operands);
1512 odsState.addAttributes(attributes);
1513 assert(resultTypes.size() == 1u && "mismatched number of return types");
1514 odsState.addTypes(resultTypes);
1515}
1516
1517void XorBoolOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
1518 assert(operands.size() == 2u && "mismatched number of parameters");
1519 odsState.addOperands(operands);
1520 odsState.addAttributes(attributes);
1521
1522 ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
1523 if (::mlir::succeeded(XorBoolOp::inferReturnTypes(odsBuilder.getContext(),
1524 odsState.location, operands,
1525 odsState.attributes.getDictionary(odsState.getContext()),
1526 odsState.getRawProperties(),
1527 odsState.regions, inferredReturnTypes))) {
1528 assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
1529 odsState.addTypes(inferredReturnTypes);
1530 } else {
1531 ::llvm::report_fatal_error("Failed to infer result type(s).");
1532 }
1533}
1534
1535::mlir::LogicalResult XorBoolOp::verifyInvariantsImpl() {
1536 {
1537 unsigned index = 0; (void)index;
1538 auto valueGroup0 = getODSOperands(0);
1539
1540 for (auto v : valueGroup0) {
1541 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops0(*this, v.getType(), "operand", index++)))
1542 return ::mlir::failure();
1543 }
1544 auto valueGroup1 = getODSOperands(1);
1545
1546 for (auto v : valueGroup1) {
1547 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops0(*this, v.getType(), "operand", index++)))
1548 return ::mlir::failure();
1549 }
1550 }
1551 {
1552 unsigned index = 0; (void)index;
1553 auto valueGroup0 = getODSResults(0);
1554
1555 for (auto v : valueGroup0) {
1556 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops1(*this, v.getType(), "result", index++)))
1557 return ::mlir::failure();
1558 }
1559 }
1560 if (!((::llzk::typesUnify((*this->getODSOperands(0).begin()).getType(), (*this->getODSResults(0).begin()).getType()))))
1561 return emitOpError("failed to verify that result type matches with lhs type");
1562 if (!((::llzk::typesUnify((*this->getODSOperands(1).begin()).getType(), (*this->getODSResults(0).begin()).getType()))))
1563 return emitOpError("failed to verify that result type matches with rhs type");
1564 return ::mlir::success();
1565}
1566
1567::mlir::LogicalResult XorBoolOp::verifyInvariants() {
1568 return verifyInvariantsImpl();
1569}
1570
1571::mlir::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) {
1572 inferredReturnTypes.resize(1);
1573 ::mlir::Builder odsBuilder(context);
1574 ::mlir::Type odsInferredType0 = odsBuilder.getIntegerType(1);
1575 inferredReturnTypes[0] = odsInferredType0;
1576 return ::mlir::success();
1577}
1578
1579::mlir::ParseResult XorBoolOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
1580 ::mlir::OpAsmParser::UnresolvedOperand lhsRawOperands[1];
1581 ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> lhsOperands(lhsRawOperands); ::llvm::SMLoc lhsOperandsLoc;
1582 (void)lhsOperandsLoc;
1583 ::mlir::OpAsmParser::UnresolvedOperand rhsRawOperands[1];
1584 ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> rhsOperands(rhsRawOperands); ::llvm::SMLoc rhsOperandsLoc;
1585 (void)rhsOperandsLoc;
1586 ::mlir::Type lhsRawTypes[1];
1587 ::llvm::ArrayRef<::mlir::Type> lhsTypes(lhsRawTypes);
1588 ::mlir::Type rhsRawTypes[1];
1589 ::llvm::ArrayRef<::mlir::Type> rhsTypes(rhsRawTypes);
1590
1591 lhsOperandsLoc = parser.getCurrentLocation();
1592 if (parser.parseOperand(lhsRawOperands[0]))
1593 return ::mlir::failure();
1594 if (parser.parseComma())
1595 return ::mlir::failure();
1596
1597 rhsOperandsLoc = parser.getCurrentLocation();
1598 if (parser.parseOperand(rhsRawOperands[0]))
1599 return ::mlir::failure();
1600 {
1601 auto odsResult = parseInferredOrParsedType(parser, lhsRawTypes[0], true);
1602 if (odsResult) return ::mlir::failure();
1603 }
1604 {
1605 auto odsResult = parseInferredOrParsedType(parser, rhsRawTypes[0], false);
1606 if (odsResult) return ::mlir::failure();
1607 }
1608 {
1609 auto loc = parser.getCurrentLocation();(void)loc;
1610 if (parser.parseOptionalAttrDict(result.attributes))
1611 return ::mlir::failure();
1612 }
1613 ::mlir::Type odsBuildableType0 = parser.getBuilder().getIntegerType(1);
1614 result.addTypes(odsBuildableType0);
1615 if (parser.resolveOperands(lhsOperands, lhsTypes, lhsOperandsLoc, result.operands))
1616 return ::mlir::failure();
1617 if (parser.resolveOperands(rhsOperands, rhsTypes, rhsOperandsLoc, result.operands))
1618 return ::mlir::failure();
1619 return ::mlir::success();
1620}
1621
1622void XorBoolOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
1623 _odsPrinter << ' ';
1624 _odsPrinter << getLhs();
1625 _odsPrinter << ",";
1626 _odsPrinter << ' ';
1627 _odsPrinter << getRhs();
1628 printInferredOrParsedType(_odsPrinter, *this, getLhs().getType(), true);
1629 printInferredOrParsedType(_odsPrinter, *this, getRhs().getType(), false);
1630 ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
1631 _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
1632}
1633
1634void XorBoolOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
1635}
1636
1637} // namespace boolean
1638} // namespace llzk
1639MLIR_DEFINE_EXPLICIT_TYPE_ID(::llzk::boolean::XorBoolOp)
1640
1641
1642#endif // GET_OP_CLASSES
1643
::mlir::LogicalResult verify(::mlir::Location loc)
Definition Ops.cpp.inc:116
AndBoolOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs=nullptr, const ::mlir::EmptyProperties &properties={}, ::mlir::RegionRange regions={})
Definition Ops.h.inc:80
::mlir::Value getLhs()
Definition Ops.cpp.inc:130
::mlir::Value getRhs()
Definition Ops.cpp.inc:134
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs)
Definition Ops.cpp.inc:162
::mlir::LogicalResult verifyInvariants()
Definition Ops.cpp.inc:248
::mlir::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:252
::mlir::Operation::operand_range getODSOperands(unsigned index)
Definition Ops.cpp.inc:124
::mlir::OpOperand & getLhsMutable()
Definition Ops.cpp.inc:138
void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect > > &effects)
Definition Ops.cpp.inc:315
::mlir::ParseResult parseInferredOrParsedType(::mlir::OpAsmParser &parser, ::mlir::Type &opType, bool isFirst)
Definition Ops.h.inc:156
::mlir::LogicalResult verifyInvariantsImpl()
Definition Ops.cpp.inc:216
void print(::mlir::OpAsmPrinter &_odsPrinter)
Definition Ops.cpp.inc:303
static void printInferredOrParsedType(::mlir::OpAsmPrinter &printer, ::mlir::Operation *op, ::mlir::Type opType, bool isFirst)
Definition Ops.h.inc:174
::mlir::OpOperand & getRhsMutable()
Definition Ops.cpp.inc:143
::mlir::Operation::result_range getODSResults(unsigned index)
Definition Ops.cpp.inc:152
::mlir::TypedValue<::mlir::IntegerType > getResult()
Definition Ops.cpp.inc:158
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
Definition Ops.cpp.inc:260
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index)
Definition Ops.cpp.inc:120
std::pair< unsigned, unsigned > getODSResultIndexAndLength(unsigned index)
Definition Ops.cpp.inc:148
::mlir::LogicalResult verify(::mlir::Location loc)
Definition Ops.cpp.inc:357
AssertOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs=nullptr, const Properties &properties={}, ::mlir::RegionRange regions={})
Definition Ops.h.inc:240
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
Definition Ops.cpp.inc:552
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index)
Definition Ops.cpp.inc:365
::mlir::LogicalResult verifyInvariants()
Definition Ops.cpp.inc:548
static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value)
Definition Ops.cpp.inc:449
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value condition, ::mlir::StringAttr msg)
Definition Ops.cpp.inc:507
::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop)
Definition Ops.cpp.inc:422
::mlir::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:460
std::pair< unsigned, unsigned > getODSResultIndexAndLength(unsigned index)
Definition Ops.cpp.inc:384
::mlir::Operation::operand_range getODSOperands(unsigned index)
Definition Ops.cpp.inc:369
::mlir::StringAttr getMsgAttr()
Definition Ops.cpp.inc:482
::std::optional< ::llvm::StringRef > getMsg()
Definition Ops.cpp.inc:486
::mlir::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state)
Definition Ops.cpp.inc:469
::mlir::Attribute removeMsgAttr()
Definition Ops.cpp.inc:501
void setMsg(::std::optional<::llvm::StringRef > attrValue)
Definition Ops.cpp.inc:495
void setMsgAttr(::mlir::StringAttr attr)
Definition Ops.cpp.inc:491
::mlir::Operation::result_range getODSResults(unsigned index)
Definition Ops.cpp.inc:388
static llvm::hash_code computePropertiesHash(const Properties &prop)
Definition Ops.cpp.inc:438
::mlir::OpOperand & getConditionMutable()
Definition Ops.cpp.inc:379
void writeProperties(::mlir::DialectBytecodeWriter &writer)
Definition Ops.cpp.inc:476
void print(::mlir::OpAsmPrinter &_odsPrinter)
Definition Ops.cpp.inc:583
::mlir::LogicalResult verifyInvariantsImpl()
Definition Ops.cpp.inc:531
static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs)
Definition Ops.cpp.inc:456
FoldAdaptor::Properties Properties
Definition Ops.h.inc:283
::mlir::StringAttr getMsgAttrName()
Definition Ops.h.inc:289
::mlir::TypedValue<::mlir::IntegerType > getCondition()
Definition Ops.cpp.inc:375
::mlir::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:394
static std::optional< mlir::Attribute > getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name)
Definition Ops.cpp.inc:443
::mlir::LogicalResult verify(::mlir::Location loc)
Definition Ops.cpp.inc:635
CmpOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs=nullptr, const Properties &properties={}, ::mlir::RegionRange regions={})
Definition Ops.h.inc:403
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, ::llzk::boolean::FeltCmpPredicateAttr predicate, ::mlir::Value lhs, ::mlir::Value rhs)
Definition Ops.cpp.inc:790
::mlir::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state)
Definition Ops.cpp.inc:761
::llzk::boolean::FeltCmpPredicateAttr getPredicateAttr()
Definition Ops.cpp.inc:773
std::pair< unsigned, unsigned > getODSResultIndexAndLength(unsigned index)
Definition Ops.cpp.inc:672
static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs)
Definition Ops.cpp.inc:748
::mlir::StringAttr getPredicateAttrName()
Definition Ops.h.inc:456
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
Definition Ops.cpp.inc:923
::mlir::LogicalResult verifyInvariantsImpl()
Definition Ops.cpp.inc:878
static std::optional< mlir::Attribute > getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name)
Definition Ops.cpp.inc:735
::mlir::TypedValue<::llzk::felt::FeltType > getRhs()
Definition Ops.cpp.inc:658
::mlir::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:915
::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop)
Definition Ops.cpp.inc:714
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index)
Definition Ops.cpp.inc:644
::llzk::boolean::FeltCmpPredicate getPredicate()
Definition Ops.cpp.inc:777
::mlir::TypedValue<::mlir::IntegerType > getResult()
Definition Ops.cpp.inc:682
::mlir::Operation::result_range getODSResults(unsigned index)
Definition Ops.cpp.inc:676
::mlir::Operation::operand_range getODSOperands(unsigned index)
Definition Ops.cpp.inc:648
void setPredicate(::llzk::boolean::FeltCmpPredicate attrValue)
Definition Ops.cpp.inc:786
::mlir::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:752
::mlir::OpOperand & getRhsMutable()
Definition Ops.cpp.inc:667
::mlir::LogicalResult verifyInvariants()
Definition Ops.cpp.inc:911
FoldAdaptor::Properties Properties
Definition Ops.h.inc:450
void setPredicateAttr(::llzk::boolean::FeltCmpPredicateAttr attr)
Definition Ops.cpp.inc:782
void print(::mlir::OpAsmPrinter &_odsPrinter)
Definition Ops.cpp.inc:969
void writeProperties(::mlir::DialectBytecodeWriter &writer)
Definition Ops.cpp.inc:768
::mlir::OpOperand & getLhsMutable()
Definition Ops.cpp.inc:662
static llvm::hash_code computePropertiesHash(const Properties &prop)
Definition Ops.cpp.inc:730
static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value)
Definition Ops.cpp.inc:741
::mlir::TypedValue<::llzk::felt::FeltType > getLhs()
Definition Ops.cpp.inc:654
::mlir::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:686
::mlir::LogicalResult verify(::mlir::Location loc)
Definition Ops.cpp.inc:1014
NotBoolOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs=nullptr, const ::mlir::EmptyProperties &properties={}, ::mlir::RegionRange regions={})
Definition Ops.h.inc:551
::mlir::TypedValue<::mlir::IntegerType > getResult()
Definition Ops.cpp.inc:1047
static void printInferredOrParsedType(::mlir::OpAsmPrinter &printer, ::mlir::Operation *op, ::mlir::Type opType, bool isFirst)
Definition Ops.h.inc:639
void print(::mlir::OpAsmPrinter &_odsPrinter)
Definition Ops.cpp.inc:1164
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
Definition Ops.cpp.inc:1138
void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect > > &effects)
Definition Ops.cpp.inc:1172
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value operand)
Definition Ops.cpp.inc:1051
::mlir::LogicalResult verifyInvariantsImpl()
Definition Ops.cpp.inc:1102
::mlir::Value getOperand()
Definition Ops.cpp.inc:1028
std::pair< unsigned, unsigned > getODSResultIndexAndLength(unsigned index)
Definition Ops.cpp.inc:1037
::mlir::ParseResult parseInferredOrParsedType(::mlir::OpAsmParser &parser, ::mlir::Type &opType, bool isFirst)
Definition Ops.h.inc:621
::mlir::LogicalResult verifyInvariants()
Definition Ops.cpp.inc:1126
::mlir::OpOperand & getOperandMutable()
Definition Ops.cpp.inc:1032
::mlir::Operation::result_range getODSResults(unsigned index)
Definition Ops.cpp.inc:1041
::mlir::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:1130
::mlir::Operation::operand_range getODSOperands(unsigned index)
Definition Ops.cpp.inc:1022
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index)
Definition Ops.cpp.inc:1018
::mlir::LogicalResult verify(::mlir::Location loc)
Definition Ops.cpp.inc:1204
OrBoolOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs=nullptr, const ::mlir::EmptyProperties &properties={}, ::mlir::RegionRange regions={})
Definition Ops.h.inc:678
::mlir::LogicalResult verifyInvariantsImpl()
Definition Ops.cpp.inc:1304
::mlir::OpOperand & getLhsMutable()
Definition Ops.cpp.inc:1226
::mlir::Value getRhs()
Definition Ops.cpp.inc:1222
void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect > > &effects)
Definition Ops.cpp.inc:1403
::mlir::Value getLhs()
Definition Ops.cpp.inc:1218
void print(::mlir::OpAsmPrinter &_odsPrinter)
Definition Ops.cpp.inc:1391
static void printInferredOrParsedType(::mlir::OpAsmPrinter &printer, ::mlir::Operation *op, ::mlir::Type opType, bool isFirst)
Definition Ops.h.inc:772
::mlir::ParseResult parseInferredOrParsedType(::mlir::OpAsmParser &parser, ::mlir::Type &opType, bool isFirst)
Definition Ops.h.inc:754
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs)
Definition Ops.cpp.inc:1250
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index)
Definition Ops.cpp.inc:1208
::mlir::Operation::operand_range getODSOperands(unsigned index)
Definition Ops.cpp.inc:1212
::mlir::TypedValue<::mlir::IntegerType > getResult()
Definition Ops.cpp.inc:1246
::mlir::Operation::result_range getODSResults(unsigned index)
Definition Ops.cpp.inc:1240
::mlir::LogicalResult verifyInvariants()
Definition Ops.cpp.inc:1336
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
Definition Ops.cpp.inc:1348
::mlir::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:1340
::mlir::OpOperand & getRhsMutable()
Definition Ops.cpp.inc:1231
std::pair< unsigned, unsigned > getODSResultIndexAndLength(unsigned index)
Definition Ops.cpp.inc:1236
XorBoolOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs=nullptr, const ::mlir::EmptyProperties &properties={}, ::mlir::RegionRange regions={})
Definition Ops.h.inc:811
::mlir::LogicalResult verify(::mlir::Location loc)
Definition Ops.cpp.inc:1435
::mlir::TypedValue<::mlir::IntegerType > getResult()
Definition Ops.cpp.inc:1477
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index)
Definition Ops.cpp.inc:1439
std::pair< unsigned, unsigned > getODSResultIndexAndLength(unsigned index)
Definition Ops.cpp.inc:1467
::mlir::OpOperand & getRhsMutable()
Definition Ops.cpp.inc:1462
::mlir::Operation::result_range getODSResults(unsigned index)
Definition Ops.cpp.inc:1471
::mlir::Operation::operand_range getODSOperands(unsigned index)
Definition Ops.cpp.inc:1443
::mlir::LogicalResult verifyInvariantsImpl()
Definition Ops.cpp.inc:1535
void print(::mlir::OpAsmPrinter &_odsPrinter)
Definition Ops.cpp.inc:1622
::mlir::LogicalResult verifyInvariants()
Definition Ops.cpp.inc:1567
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs)
Definition Ops.cpp.inc:1481
static void printInferredOrParsedType(::mlir::OpAsmPrinter &printer, ::mlir::Operation *op, ::mlir::Type opType, bool isFirst)
Definition Ops.h.inc:905
::mlir::Value getRhs()
Definition Ops.cpp.inc:1453
::mlir::OpOperand & getLhsMutable()
Definition Ops.cpp.inc:1457
void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect > > &effects)
Definition Ops.cpp.inc:1634
::mlir::ParseResult parseInferredOrParsedType(::mlir::OpAsmParser &parser, ::mlir::Type &opType, bool isFirst)
Definition Ops.h.inc:887
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
Definition Ops.cpp.inc:1579
::mlir::Value getLhs()
Definition Ops.cpp.inc:1449
::mlir::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:1571
AndBoolOpGenericAdaptorBase(::mlir::DictionaryAttr attrs=nullptr, const ::mlir::EmptyProperties &properties={}, ::mlir::RegionRange regions={})
Definition Ops.cpp.inc:99
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize)
Definition Ops.cpp.inc:105
::std::optional<::mlir::OperationName > odsOpName
Definition Ops.h.inc:64
::std::optional<::mlir::OperationName > odsOpName
Definition Ops.h.inc:217
AssertOpGenericAdaptorBase(::mlir::DictionaryAttr attrs=nullptr, const Properties &properties={}, ::mlir::RegionRange regions={})
Definition Ops.cpp.inc:330
::std::optional< ::llvm::StringRef > getMsg()
Definition Ops.cpp.inc:349
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize)
Definition Ops.cpp.inc:336
::std::optional<::mlir::OperationName > odsOpName
Definition Ops.h.inc:380
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize)
Definition Ops.cpp.inc:614
::llzk::boolean::FeltCmpPredicate getPredicate()
Definition Ops.cpp.inc:627
::llzk::boolean::FeltCmpPredicateAttr getPredicateAttr()
Definition Ops.cpp.inc:622
CmpOpGenericAdaptorBase(::mlir::DictionaryAttr attrs=nullptr, const Properties &properties={}, ::mlir::RegionRange regions={})
Definition Ops.cpp.inc:608
NotBoolOpGenericAdaptorBase(::mlir::DictionaryAttr attrs=nullptr, const ::mlir::EmptyProperties &properties={}, ::mlir::RegionRange regions={})
Definition Ops.cpp.inc:997
::std::optional<::mlir::OperationName > odsOpName
Definition Ops.h.inc:535
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize)
Definition Ops.cpp.inc:1003
OrBoolOpGenericAdaptorBase(::mlir::DictionaryAttr attrs=nullptr, const ::mlir::EmptyProperties &properties={}, ::mlir::RegionRange regions={})
Definition Ops.cpp.inc:1187
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize)
Definition Ops.cpp.inc:1193
::std::optional<::mlir::OperationName > odsOpName
Definition Ops.h.inc:662
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize)
Definition Ops.cpp.inc:1424
XorBoolOpGenericAdaptorBase(::mlir::DictionaryAttr attrs=nullptr, const ::mlir::EmptyProperties &properties={}, ::mlir::RegionRange regions={})
Definition Ops.cpp.inc:1418
::std::optional<::mlir::OperationName > odsOpName
Definition Ops.h.inc:795
bool typesUnify(Type lhs, Type rhs, ArrayRef< StringRef > rhsReversePrefix, UnificationMap *unifications)