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;
39 return ::mlir::success();
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;
49 return ::mlir::success();
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;
59 return ::mlir::success();
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();
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();
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();
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();
117 return ::mlir::success();
126 return {std::next(getOperation()->operand_begin(), valueRange.first),
127 std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
140 return getOperation()->getOpOperand(range.first);
145 return getOperation()->getOpOperand(range.first);
154 return {std::next(getOperation()->result_begin(), valueRange.first),
155 std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
159 return ::llvm::cast<::mlir::TypedValue<::mlir::IntegerType>>(*
getODSResults(0).begin());
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);
168void AndBoolOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value lhs, ::mlir::Value rhs) {
169 odsState.addOperands(lhs);
170 odsState.addOperands(rhs);
172 ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
174 odsState.location, odsState.operands,
175 odsState.attributes.getDictionary(odsState.getContext()),
176 odsState.getRawProperties(),
177 odsState.regions, inferredReturnTypes)))
178 odsState.addTypes(inferredReturnTypes);
180 ::llvm::report_fatal_error(
"Failed to infer result type(s).");
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);
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);
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);
203 ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
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);
212 ::llvm::report_fatal_error(
"Failed to infer result type(s).");
218 unsigned index = 0; (void)index;
221 for (
auto v : valueGroup0) {
222 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops0(*
this, v.getType(),
"operand", index++)))
223 return ::mlir::failure();
227 for (
auto v : valueGroup1) {
228 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops0(*
this, v.getType(),
"operand", index++)))
229 return ::mlir::failure();
233 unsigned index = 0; (void)index;
236 for (
auto v : valueGroup0) {
237 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops1(*
this, v.getType(),
"result", index++)))
238 return ::mlir::failure();
242 return emitOpError(
"failed to verify that result type matches with lhs type");
244 return emitOpError(
"failed to verify that result type matches with rhs type");
245 return ::mlir::success();
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();
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);
272 lhsOperandsLoc = parser.getCurrentLocation();
273 if (parser.parseOperand(lhsRawOperands[0]))
274 return ::mlir::failure();
275 if (parser.parseComma())
276 return ::mlir::failure();
278 rhsOperandsLoc = parser.getCurrentLocation();
279 if (parser.parseOperand(rhsRawOperands[0]))
280 return ::mlir::failure();
283 if (odsResult) return ::mlir::failure();
287 if (odsResult) return ::mlir::failure();
290 auto loc = parser.getCurrentLocation();(void)loc;
291 if (parser.parseOptionalAttrDict(result.attributes))
292 return ::mlir::failure();
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();
311 ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
312 _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
315void AndBoolOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
345 auto attr = ::llvm::dyn_cast_or_null<::mlir::StringAttr>(
getProperties().msg);
351 return attr ? ::std::optional< ::llvm::StringRef >(attr.getValue()) : (::std::nullopt);
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();
371 return {std::next(getOperation()->operand_begin(), valueRange.first),
372 std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
376 return ::llvm::cast<::mlir::TypedValue<::mlir::IntegerType>>(*
getODSOperands(0).begin());
381 return getOperation()->getOpOperand(range.first);
390 return {std::next(getOperation()->result_begin(), valueRange.first),
391 std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
395 ::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
397 emitError() <<
"expected DictionaryAttr to set properties";
398 return ::mlir::failure();
402 auto &propStorage = prop.
msg;
403 auto attr = dict.get(
"msg");
406 emitError() <<
"expected key entry for msg in DictionaryAttr to set "
408 return ::mlir::failure();
410 auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<
decltype(propStorage)>>(attr);
412 propStorage = convertedAttr;
414 emitError() <<
"Invalid attribute `msg` in property conversion: " << attr;
415 return ::mlir::failure();
419 return ::mlir::success();
423 ::mlir::SmallVector<::mlir::NamedAttribute> attrs;
424 ::mlir::Builder odsBuilder{ctx};
427 const auto &propStorage = prop.
msg;
429 attrs.push_back(odsBuilder.getNamedAttr(
"msg",
434 return odsBuilder.getDictionaryAttr(attrs);
439 return llvm::hash_combine(
440 llvm::hash_value(prop.
msg.getAsOpaquePointer()));
451 prop.
msg = ::llvm::dyn_cast_or_null<std::remove_reference_t<
decltype(prop.
msg)>>(value);
457 if (prop.
msg) attrs.append(
"msg", prop.
msg);
460::mlir::LogicalResult
AssertOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
463 if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_Ops0(attr,
"msg", emitError)))
464 return ::mlir::failure();
466 return ::mlir::success();
470 auto &prop = state.getOrAddProperties<
Properties>(); (void)prop;
471 if (::mlir::failed(reader.readOptionalAttribute(prop.
msg)))
472 return ::mlir::failure();
473 return ::mlir::success();
477 auto &prop = getProperties(); (void)prop;
479 writer.writeOptionalAttribute(prop.
msg);
483 return ::llvm::dyn_cast_or_null<::mlir::StringAttr>(getProperties().msg);
488 return attr ? ::std::optional< ::llvm::StringRef >(attr.getValue()) : (::std::nullopt);
497 return (*this)->setAttr(
getMsgAttrName(), ::mlir::Builder((*this)->getContext()).getStringAttr(*attrValue));
502 auto &attr = getProperties().msg;
507void AssertOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value condition, ::mlir::StringAttr msg) {
508 odsState.addOperands(condition);
510 odsState.getOrAddProperties<
Properties>().msg = msg;
514void AssertOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value condition, ::mlir::StringAttr msg) {
515 odsState.addOperands(condition);
517 odsState.getOrAddProperties<
Properties>().msg = msg;
519 assert(resultTypes.size() == 0u &&
"mismatched number of results");
520 odsState.addTypes(resultTypes);
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);
532 auto tblgen_msg = getProperties().msg; (void)tblgen_msg;
534 if (::mlir::failed(__mlir_ods_local_attr_constraint_Ops0(*
this, tblgen_msg,
"msg")))
535 return ::mlir::failure();
537 unsigned index = 0; (void)index;
540 for (
auto v : valueGroup0) {
541 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops1(*
this, v.getType(),
"operand", index++)))
542 return ::mlir::failure();
545 return ::mlir::success();
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;
558 conditionOperandsLoc = parser.getCurrentLocation();
559 if (parser.parseOperand(conditionRawOperands[0]))
560 return ::mlir::failure();
561 if (::mlir::succeeded(parser.parseOptionalComma())) {
563 if (parser.parseCustomAttributeWithFallback(msgAttr, parser.getBuilder().getType<::mlir::NoneType>())) {
564 return ::mlir::failure();
569 auto loc = parser.getCurrentLocation();(void)loc;
570 if (parser.parseOptionalAttrDict(result.attributes))
571 return ::mlir::failure();
573 return parser.emitError(loc) <<
"'" << result.name.getStringRef() <<
"' op ";
575 return ::mlir::failure();
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();
589 _odsPrinter.printAttributeWithoutType(
getMsgAttr());
591 ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
592 elidedAttrs.push_back(
"msg");
593 _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
623 auto attr = ::llvm::cast<::llzk::boolean::FeltCmpPredicateAttr>(
getProperties().predicate);
629 return attr.getValue();
637 if (!tblgen_predicate)
return emitError(loc,
"'bool.cmp' op ""requires attribute 'predicate'");
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();
650 return {std::next(getOperation()->operand_begin(), valueRange.first),
651 std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
655 return ::llvm::cast<::mlir::TypedValue<::llzk::felt::FeltType>>(*
getODSOperands(0).begin());
659 return ::llvm::cast<::mlir::TypedValue<::llzk::felt::FeltType>>(*
getODSOperands(1).begin());
664 return getOperation()->getOpOperand(range.first);
669 return getOperation()->getOpOperand(range.first);
678 return {std::next(getOperation()->result_begin(), valueRange.first),
679 std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
683 return ::llvm::cast<::mlir::TypedValue<::mlir::IntegerType>>(*
getODSResults(0).begin());
687 ::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
689 emitError() <<
"expected DictionaryAttr to set properties";
690 return ::mlir::failure();
695 auto attr = dict.get(
"predicate");
698 emitError() <<
"expected key entry for predicate in DictionaryAttr to set "
700 return ::mlir::failure();
702 auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<
decltype(propStorage)>>(attr);
704 propStorage = convertedAttr;
706 emitError() <<
"Invalid attribute `predicate` in property conversion: " << attr;
707 return ::mlir::failure();
711 return ::mlir::success();
715 ::mlir::SmallVector<::mlir::NamedAttribute> attrs;
716 ::mlir::Builder odsBuilder{ctx};
719 const auto &propStorage = prop.
predicate;
721 attrs.push_back(odsBuilder.getNamedAttr(
"predicate",
726 return odsBuilder.getDictionaryAttr(attrs);
731 return llvm::hash_combine(
732 llvm::hash_value(prop.
predicate.getAsOpaquePointer()));
736 if (name ==
"predicate")
742 if (name ==
"predicate") {
743 prop.
predicate = ::llvm::dyn_cast_or_null<std::remove_reference_t<
decltype(prop.
predicate)>>(value);
752::mlir::LogicalResult
CmpOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
755 if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_Ops1(attr,
"predicate", emitError)))
756 return ::mlir::failure();
758 return ::mlir::success();
762 auto &prop = state.getOrAddProperties<
Properties>(); (void)prop;
763 if (::mlir::failed(reader.readAttribute(prop.
predicate)))
764 return ::mlir::failure();
765 return ::mlir::success();
769 auto &prop = getProperties(); (void)prop;
774 return ::llvm::cast<::llzk::boolean::FeltCmpPredicateAttr>(getProperties().predicate);
779 return attr.getValue();
787 (*this)->setAttr(
getPredicateAttrName(), ::llzk::boolean::FeltCmpPredicateAttr::get(::mlir::Builder((*this)->getContext()).getContext(), attrValue));
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);
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;
802 ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
804 odsState.location, odsState.operands,
805 odsState.attributes.getDictionary(odsState.getContext()),
806 odsState.getRawProperties(),
807 odsState.regions, inferredReturnTypes)))
808 odsState.addTypes(inferredReturnTypes);
810 ::llvm::report_fatal_error(
"Failed to infer result type(s).");
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);
822 odsState.addOperands(lhs);
823 odsState.addOperands(rhs);
824 odsState.getOrAddProperties<
Properties>().predicate = ::llzk::boolean::FeltCmpPredicateAttr::get(odsBuilder.getContext(), predicate);
825 odsState.addTypes(result);
829 odsState.addOperands(lhs);
830 odsState.addOperands(rhs);
831 odsState.getOrAddProperties<
Properties>().predicate = ::llzk::boolean::FeltCmpPredicateAttr::get(odsBuilder.getContext(), predicate);
833 ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
835 odsState.location, odsState.operands,
836 odsState.attributes.getDictionary(odsState.getContext()),
837 odsState.getRawProperties(),
838 odsState.regions, inferredReturnTypes)))
839 odsState.addTypes(inferredReturnTypes);
841 ::llvm::report_fatal_error(
"Failed to infer result type(s).");
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);
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);
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);
865 ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
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);
874 ::llvm::report_fatal_error(
"Failed to infer result type(s).");
879 auto tblgen_predicate = getProperties().predicate; (void)tblgen_predicate;
880 if (!tblgen_predicate)
return emitOpError(
"requires attribute 'predicate'");
882 if (::mlir::failed(__mlir_ods_local_attr_constraint_Ops1(*
this, tblgen_predicate,
"predicate")))
883 return ::mlir::failure();
885 unsigned index = 0; (void)index;
888 for (
auto v : valueGroup0) {
889 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops2(*
this, v.getType(),
"operand", index++)))
890 return ::mlir::failure();
894 for (
auto v : valueGroup1) {
895 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops2(*
this, v.getType(),
"operand", index++)))
896 return ::mlir::failure();
900 unsigned index = 0; (void)index;
903 for (
auto v : valueGroup0) {
904 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops1(*
this, v.getType(),
"result", index++)))
905 return ::mlir::failure();
908 return ::mlir::success();
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();
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;
932 if (parser.parseCustomAttributeWithFallback(predicateAttr, ::mlir::Type{})) {
933 return ::mlir::failure();
935 if (predicateAttr) result.getOrAddProperties<
CmpOp::Properties>().predicate = predicateAttr;
936 if (parser.parseLParen())
937 return ::mlir::failure();
939 lhsOperandsLoc = parser.getCurrentLocation();
940 if (parser.parseOperand(lhsRawOperands[0]))
941 return ::mlir::failure();
942 if (parser.parseComma())
943 return ::mlir::failure();
945 rhsOperandsLoc = parser.getCurrentLocation();
946 if (parser.parseOperand(rhsRawOperands[0]))
947 return ::mlir::failure();
948 if (parser.parseRParen())
949 return ::mlir::failure();
951 auto loc = parser.getCurrentLocation();(void)loc;
952 if (parser.parseOptionalAttrDict(result.attributes))
953 return ::mlir::failure();
955 return parser.emitError(loc) <<
"'" << result.name.getStringRef() <<
"' op ";
957 return ::mlir::failure();
959 ::mlir::Type odsBuildableType0 = parser.getBuilder().getIntegerType(1);
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();
977 ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
978 elidedAttrs.push_back(
"predicate");
979 _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
982void CmpOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
1015 return ::mlir::success();
1024 return {std::next(getOperation()->operand_begin(), valueRange.first),
1025 std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
1034 return getOperation()->getOpOperand(range.first);
1043 return {std::next(getOperation()->result_begin(), valueRange.first),
1044 std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
1048 return ::llvm::cast<::mlir::TypedValue<::mlir::IntegerType>>(*
getODSResults(0).begin());
1051void NotBoolOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value operand) {
1052 odsState.addOperands(operand);
1053 odsState.addTypes(result);
1056void NotBoolOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value operand) {
1057 odsState.addOperands(operand);
1059 ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
1061 odsState.location, odsState.operands,
1062 odsState.attributes.getDictionary(odsState.getContext()),
1063 odsState.getRawProperties(),
1064 odsState.regions, inferredReturnTypes)))
1065 odsState.addTypes(inferredReturnTypes);
1067 ::llvm::report_fatal_error(
"Failed to infer result type(s).");
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);
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);
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);
1089 ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
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);
1098 ::llvm::report_fatal_error(
"Failed to infer result type(s).");
1104 unsigned index = 0; (void)index;
1107 for (
auto v : valueGroup0) {
1108 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops0(*
this, v.getType(),
"operand", index++)))
1109 return ::mlir::failure();
1113 unsigned index = 0; (void)index;
1116 for (
auto v : valueGroup0) {
1117 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops1(*
this, v.getType(),
"result", index++)))
1118 return ::mlir::failure();
1122 return emitOpError(
"failed to verify that result type matches with operand type");
1123 return ::mlir::success();
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();
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);
1145 operandOperandsLoc = parser.getCurrentLocation();
1146 if (parser.parseOperand(operandRawOperands[0]))
1147 return ::mlir::failure();
1150 if (odsResult) return ::mlir::failure();
1153 auto loc = parser.getCurrentLocation();(void)loc;
1154 if (parser.parseOptionalAttrDict(result.attributes))
1155 return ::mlir::failure();
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();
1168 ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
1169 _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
1172void NotBoolOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
1205 return ::mlir::success();
1214 return {std::next(getOperation()->operand_begin(), valueRange.first),
1215 std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
1228 return getOperation()->getOpOperand(range.first);
1233 return getOperation()->getOpOperand(range.first);
1242 return {std::next(getOperation()->result_begin(), valueRange.first),
1243 std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
1247 return ::llvm::cast<::mlir::TypedValue<::mlir::IntegerType>>(*
getODSResults(0).begin());
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);
1256void OrBoolOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value lhs, ::mlir::Value rhs) {
1257 odsState.addOperands(lhs);
1258 odsState.addOperands(rhs);
1260 ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
1262 odsState.location, odsState.operands,
1263 odsState.attributes.getDictionary(odsState.getContext()),
1264 odsState.getRawProperties(),
1265 odsState.regions, inferredReturnTypes)))
1266 odsState.addTypes(inferredReturnTypes);
1268 ::llvm::report_fatal_error(
"Failed to infer result type(s).");
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);
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);
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);
1291 ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
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);
1300 ::llvm::report_fatal_error(
"Failed to infer result type(s).");
1306 unsigned index = 0; (void)index;
1309 for (
auto v : valueGroup0) {
1310 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops0(*
this, v.getType(),
"operand", index++)))
1311 return ::mlir::failure();
1315 for (
auto v : valueGroup1) {
1316 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops0(*
this, v.getType(),
"operand", index++)))
1317 return ::mlir::failure();
1321 unsigned index = 0; (void)index;
1324 for (
auto v : valueGroup0) {
1325 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops1(*
this, v.getType(),
"result", index++)))
1326 return ::mlir::failure();
1330 return emitOpError(
"failed to verify that result type matches with lhs type");
1332 return emitOpError(
"failed to verify that result type matches with rhs type");
1333 return ::mlir::success();
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();
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);
1360 lhsOperandsLoc = parser.getCurrentLocation();
1361 if (parser.parseOperand(lhsRawOperands[0]))
1362 return ::mlir::failure();
1363 if (parser.parseComma())
1364 return ::mlir::failure();
1366 rhsOperandsLoc = parser.getCurrentLocation();
1367 if (parser.parseOperand(rhsRawOperands[0]))
1368 return ::mlir::failure();
1371 if (odsResult) return ::mlir::failure();
1375 if (odsResult) return ::mlir::failure();
1378 auto loc = parser.getCurrentLocation();(void)loc;
1379 if (parser.parseOptionalAttrDict(result.attributes))
1380 return ::mlir::failure();
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();
1399 ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
1400 _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
1403void OrBoolOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
1436 return ::mlir::success();
1445 return {std::next(getOperation()->operand_begin(), valueRange.first),
1446 std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
1459 return getOperation()->getOpOperand(range.first);
1464 return getOperation()->getOpOperand(range.first);
1473 return {std::next(getOperation()->result_begin(), valueRange.first),
1474 std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
1478 return ::llvm::cast<::mlir::TypedValue<::mlir::IntegerType>>(*
getODSResults(0).begin());
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);
1487void XorBoolOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value lhs, ::mlir::Value rhs) {
1488 odsState.addOperands(lhs);
1489 odsState.addOperands(rhs);
1491 ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
1493 odsState.location, odsState.operands,
1494 odsState.attributes.getDictionary(odsState.getContext()),
1495 odsState.getRawProperties(),
1496 odsState.regions, inferredReturnTypes)))
1497 odsState.addTypes(inferredReturnTypes);
1499 ::llvm::report_fatal_error(
"Failed to infer result type(s).");
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);
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);
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);
1522 ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
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);
1531 ::llvm::report_fatal_error(
"Failed to infer result type(s).");
1537 unsigned index = 0; (void)index;
1540 for (
auto v : valueGroup0) {
1541 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops0(*
this, v.getType(),
"operand", index++)))
1542 return ::mlir::failure();
1546 for (
auto v : valueGroup1) {
1547 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops0(*
this, v.getType(),
"operand", index++)))
1548 return ::mlir::failure();
1552 unsigned index = 0; (void)index;
1555 for (
auto v : valueGroup0) {
1556 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops1(*
this, v.getType(),
"result", index++)))
1557 return ::mlir::failure();
1561 return emitOpError(
"failed to verify that result type matches with lhs type");
1563 return emitOpError(
"failed to verify that result type matches with rhs type");
1564 return ::mlir::success();
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();
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);
1591 lhsOperandsLoc = parser.getCurrentLocation();
1592 if (parser.parseOperand(lhsRawOperands[0]))
1593 return ::mlir::failure();
1594 if (parser.parseComma())
1595 return ::mlir::failure();
1597 rhsOperandsLoc = parser.getCurrentLocation();
1598 if (parser.parseOperand(rhsRawOperands[0]))
1599 return ::mlir::failure();
1602 if (odsResult) return ::mlir::failure();
1606 if (odsResult) return ::mlir::failure();
1609 auto loc = parser.getCurrentLocation();(void)loc;
1610 if (parser.parseOptionalAttrDict(result.attributes))
1611 return ::mlir::failure();
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();
1630 ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
1631 _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
1634void XorBoolOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
::mlir::LogicalResult verify(::mlir::Location loc)
AndBoolOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs=nullptr, const ::mlir::EmptyProperties &properties={}, ::mlir::RegionRange regions={})
AndBoolOpAdaptor(AndBoolOp op)
::mlir::ValueRange getOperands()
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs)
::mlir::LogicalResult verifyInvariants()
::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)
::mlir::Operation::operand_range getODSOperands(unsigned index)
::mlir::OpOperand & getLhsMutable()
void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect > > &effects)
::mlir::ParseResult parseInferredOrParsedType(::mlir::OpAsmParser &parser, ::mlir::Type &opType, bool isFirst)
::mlir::LogicalResult verifyInvariantsImpl()
void print(::mlir::OpAsmPrinter &_odsPrinter)
static void printInferredOrParsedType(::mlir::OpAsmPrinter &printer, ::mlir::Operation *op, ::mlir::Type opType, bool isFirst)
::mlir::OpOperand & getRhsMutable()
::mlir::Operation::result_range getODSResults(unsigned index)
::mlir::TypedValue<::mlir::IntegerType > getResult()
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index)
std::pair< unsigned, unsigned > getODSResultIndexAndLength(unsigned index)
AssertOpAdaptor(AssertOp op)
::mlir::LogicalResult verify(::mlir::Location loc)
AssertOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs=nullptr, const Properties &properties={}, ::mlir::RegionRange regions={})
::mlir::ValueRange getOperands()
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index)
::mlir::LogicalResult verifyInvariants()
static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value)
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value condition, ::mlir::StringAttr msg)
::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop)
::mlir::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
std::pair< unsigned, unsigned > getODSResultIndexAndLength(unsigned index)
::mlir::Operation::operand_range getODSOperands(unsigned index)
::mlir::StringAttr getMsgAttr()
::std::optional< ::llvm::StringRef > getMsg()
::mlir::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state)
::mlir::Attribute removeMsgAttr()
void setMsg(::std::optional<::llvm::StringRef > attrValue)
void setMsgAttr(::mlir::StringAttr attr)
::mlir::Operation::result_range getODSResults(unsigned index)
static llvm::hash_code computePropertiesHash(const Properties &prop)
::mlir::OpOperand & getConditionMutable()
void writeProperties(::mlir::DialectBytecodeWriter &writer)
void print(::mlir::OpAsmPrinter &_odsPrinter)
::mlir::LogicalResult verifyInvariantsImpl()
static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs)
FoldAdaptor::Properties Properties
::mlir::StringAttr getMsgAttrName()
::mlir::TypedValue<::mlir::IntegerType > getCondition()
::mlir::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
static std::optional< mlir::Attribute > getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name)
::mlir::LogicalResult verify(::mlir::Location loc)
CmpOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs=nullptr, const Properties &properties={}, ::mlir::RegionRange regions={})
::mlir::ValueRange getOperands()
void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect > > &effects)
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::llzk::boolean::FeltCmpPredicateAttr predicate, ::mlir::Value lhs, ::mlir::Value rhs)
::mlir::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state)
::llzk::boolean::FeltCmpPredicateAttr getPredicateAttr()
std::pair< unsigned, unsigned > getODSResultIndexAndLength(unsigned index)
static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs)
::mlir::StringAttr getPredicateAttrName()
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
::mlir::LogicalResult verifyInvariantsImpl()
static std::optional< mlir::Attribute > getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name)
::mlir::TypedValue<::llzk::felt::FeltType > getRhs()
::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)
::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop)
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index)
::llzk::boolean::FeltCmpPredicate getPredicate()
::mlir::TypedValue<::mlir::IntegerType > getResult()
::mlir::Operation::result_range getODSResults(unsigned index)
::mlir::Operation::operand_range getODSOperands(unsigned index)
void setPredicate(::llzk::boolean::FeltCmpPredicate attrValue)
::mlir::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
::mlir::OpOperand & getRhsMutable()
::mlir::LogicalResult verifyInvariants()
FoldAdaptor::Properties Properties
void setPredicateAttr(::llzk::boolean::FeltCmpPredicateAttr attr)
void print(::mlir::OpAsmPrinter &_odsPrinter)
void writeProperties(::mlir::DialectBytecodeWriter &writer)
::mlir::OpOperand & getLhsMutable()
static llvm::hash_code computePropertiesHash(const Properties &prop)
static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value)
::mlir::TypedValue<::llzk::felt::FeltType > getLhs()
::mlir::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
NotBoolOpAdaptor(NotBoolOp op)
::mlir::LogicalResult verify(::mlir::Location loc)
NotBoolOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs=nullptr, const ::mlir::EmptyProperties &properties={}, ::mlir::RegionRange regions={})
::mlir::ValueRange getOperands()
::mlir::TypedValue<::mlir::IntegerType > getResult()
static void printInferredOrParsedType(::mlir::OpAsmPrinter &printer, ::mlir::Operation *op, ::mlir::Type opType, bool isFirst)
void print(::mlir::OpAsmPrinter &_odsPrinter)
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect > > &effects)
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value operand)
::mlir::LogicalResult verifyInvariantsImpl()
::mlir::Value getOperand()
std::pair< unsigned, unsigned > getODSResultIndexAndLength(unsigned index)
::mlir::ParseResult parseInferredOrParsedType(::mlir::OpAsmParser &parser, ::mlir::Type &opType, bool isFirst)
::mlir::LogicalResult verifyInvariants()
::mlir::OpOperand & getOperandMutable()
::mlir::Operation::result_range getODSResults(unsigned index)
::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)
::mlir::Operation::operand_range getODSOperands(unsigned index)
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index)
OrBoolOpAdaptor(OrBoolOp op)
::mlir::LogicalResult verify(::mlir::Location loc)
OrBoolOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs=nullptr, const ::mlir::EmptyProperties &properties={}, ::mlir::RegionRange regions={})
::mlir::ValueRange getOperands()
::mlir::LogicalResult verifyInvariantsImpl()
::mlir::OpOperand & getLhsMutable()
void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect > > &effects)
void print(::mlir::OpAsmPrinter &_odsPrinter)
static void printInferredOrParsedType(::mlir::OpAsmPrinter &printer, ::mlir::Operation *op, ::mlir::Type opType, bool isFirst)
::mlir::ParseResult parseInferredOrParsedType(::mlir::OpAsmParser &parser, ::mlir::Type &opType, bool isFirst)
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs)
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index)
::mlir::Operation::operand_range getODSOperands(unsigned index)
::mlir::TypedValue<::mlir::IntegerType > getResult()
::mlir::Operation::result_range getODSResults(unsigned index)
::mlir::LogicalResult verifyInvariants()
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
::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)
::mlir::OpOperand & getRhsMutable()
std::pair< unsigned, unsigned > getODSResultIndexAndLength(unsigned index)
XorBoolOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs=nullptr, const ::mlir::EmptyProperties &properties={}, ::mlir::RegionRange regions={})
XorBoolOpAdaptor(XorBoolOp op)
::mlir::LogicalResult verify(::mlir::Location loc)
::mlir::ValueRange getOperands()
::mlir::TypedValue<::mlir::IntegerType > getResult()
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index)
std::pair< unsigned, unsigned > getODSResultIndexAndLength(unsigned index)
::mlir::OpOperand & getRhsMutable()
::mlir::Operation::result_range getODSResults(unsigned index)
::mlir::Operation::operand_range getODSOperands(unsigned index)
::mlir::LogicalResult verifyInvariantsImpl()
void print(::mlir::OpAsmPrinter &_odsPrinter)
::mlir::LogicalResult verifyInvariants()
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs)
static void printInferredOrParsedType(::mlir::OpAsmPrinter &printer, ::mlir::Operation *op, ::mlir::Type opType, bool isFirst)
::mlir::OpOperand & getLhsMutable()
void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect > > &effects)
::mlir::ParseResult parseInferredOrParsedType(::mlir::OpAsmParser &parser, ::mlir::Type &opType, bool isFirst)
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
::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)
AndBoolOpGenericAdaptorBase(::mlir::DictionaryAttr attrs=nullptr, const ::mlir::EmptyProperties &properties={}, ::mlir::RegionRange regions={})
::mlir::RegionRange odsRegions
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize)
::mlir::DictionaryAttr odsAttrs
::std::optional<::mlir::OperationName > odsOpName
::mlir::DictionaryAttr getAttributes()
const Properties & getProperties()
::std::optional<::mlir::OperationName > odsOpName
::mlir::StringAttr getMsgAttr()
::mlir::DictionaryAttr getAttributes()
::mlir::DictionaryAttr odsAttrs
::mlir::RegionRange odsRegions
AssertOpGenericAdaptorBase(::mlir::DictionaryAttr attrs=nullptr, const Properties &properties={}, ::mlir::RegionRange regions={})
::std::optional< ::llvm::StringRef > getMsg()
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize)
::mlir::RegionRange odsRegions
::std::optional<::mlir::OperationName > odsOpName
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize)
::mlir::DictionaryAttr odsAttrs
::llzk::boolean::FeltCmpPredicate getPredicate()
::mlir::DictionaryAttr getAttributes()
const Properties & getProperties()
::llzk::boolean::FeltCmpPredicateAttr getPredicateAttr()
CmpOpGenericAdaptorBase(::mlir::DictionaryAttr attrs=nullptr, const Properties &properties={}, ::mlir::RegionRange regions={})
::mlir::DictionaryAttr odsAttrs
::mlir::RegionRange odsRegions
NotBoolOpGenericAdaptorBase(::mlir::DictionaryAttr attrs=nullptr, const ::mlir::EmptyProperties &properties={}, ::mlir::RegionRange regions={})
::mlir::DictionaryAttr getAttributes()
::std::optional<::mlir::OperationName > odsOpName
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize)
::mlir::RegionRange odsRegions
OrBoolOpGenericAdaptorBase(::mlir::DictionaryAttr attrs=nullptr, const ::mlir::EmptyProperties &properties={}, ::mlir::RegionRange regions={})
::mlir::DictionaryAttr getAttributes()
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize)
::mlir::DictionaryAttr odsAttrs
::std::optional<::mlir::OperationName > odsOpName
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize)
::mlir::DictionaryAttr odsAttrs
::mlir::DictionaryAttr getAttributes()
XorBoolOpGenericAdaptorBase(::mlir::DictionaryAttr attrs=nullptr, const ::mlir::EmptyProperties &properties={}, ::mlir::RegionRange regions={})
::mlir::RegionRange odsRegions
::std::optional<::mlir::OperationName > odsOpName
bool typesUnify(Type lhs, Type rhs, ArrayRef< StringRef > rhsReversePrefix, UnificationMap *unifications)