/*===- TableGen'erated file -------------------------------------*- C++ -*-===*\ |* *| |* Op Definitions *| |* *| |* Automatically generated file, do not edit! *| |* From: SMT.td *| |* *| \*===----------------------------------------------------------------------===*/ #ifdef GET_OP_LIST #undef GET_OP_LIST mlir::smt::AndOp, mlir::smt::ApplyFuncOp, mlir::smt::ArrayBroadcastOp, mlir::smt::ArraySelectOp, mlir::smt::ArrayStoreOp, mlir::smt::AssertOp, mlir::smt::BV2IntOp, mlir::smt::BVAShrOp, mlir::smt::BVAddOp, mlir::smt::BVAndOp, mlir::smt::BVCmpOp, mlir::smt::BVConstantOp, mlir::smt::BVLShrOp, mlir::smt::BVMulOp, mlir::smt::BVNegOp, mlir::smt::BVNotOp, mlir::smt::BVOrOp, mlir::smt::BVSDivOp, mlir::smt::BVSModOp, mlir::smt::BVSRemOp, mlir::smt::BVShlOp, mlir::smt::BVUDivOp, mlir::smt::BVURemOp, mlir::smt::BVXOrOp, mlir::smt::BoolConstantOp, mlir::smt::CheckOp, mlir::smt::ConcatOp, mlir::smt::DeclareFunOp, mlir::smt::DistinctOp, mlir::smt::EqOp, mlir::smt::ExistsOp, mlir::smt::ExtractOp, mlir::smt::ForallOp, mlir::smt::ImpliesOp, mlir::smt::Int2BVOp, mlir::smt::IntAbsOp, mlir::smt::IntAddOp, mlir::smt::IntCmpOp, mlir::smt::IntConstantOp, mlir::smt::IntDivOp, mlir::smt::IntModOp, mlir::smt::IntMulOp, mlir::smt::IntSubOp, mlir::smt::IteOp, mlir::smt::NotOp, mlir::smt::OrOp, mlir::smt::PopOp, mlir::smt::PushOp, mlir::smt::RepeatOp, mlir::smt::ResetOp, mlir::smt::SetLogicOp, mlir::smt::SolverOp, mlir::smt::XOrOp, mlir::smt::YieldOp #endif // GET_OP_LIST #ifdef GET_OP_CLASSES #undef GET_OP_CLASSES //===----------------------------------------------------------------------===// // Local Utility Method Definitions //===----------------------------------------------------------------------===// static ::llvm::LogicalResult __mlir_ods_local_type_constraint_SMT1( ::mlir::Operation *op, ::mlir::Type type, ::llvm::StringRef valueKind, unsigned valueIndex) { if (!((::llvm::isa(type)))) { return op->emitOpError(valueKind) << " #" << valueIndex << " must be variadic of , but got " << type; } return ::mlir::success(); } static ::llvm::LogicalResult __mlir_ods_local_type_constraint_SMT2( ::mlir::Operation *op, ::mlir::Type type, ::llvm::StringRef valueKind, unsigned valueIndex) { if (!((::llvm::isa(type)))) { return op->emitOpError(valueKind) << " #" << valueIndex << " must be , but got " << type; } return ::mlir::success(); } static ::llvm::LogicalResult __mlir_ods_local_type_constraint_SMT3( ::mlir::Operation *op, ::mlir::Type type, ::llvm::StringRef valueKind, unsigned valueIndex) { if (!((::llvm::isa(type)))) { return op->emitOpError(valueKind) << " #" << valueIndex << " must be , but got " << type; } return ::mlir::success(); } static ::llvm::LogicalResult __mlir_ods_local_type_constraint_SMT4( ::mlir::Operation *op, ::mlir::Type type, ::llvm::StringRef valueKind, unsigned valueIndex) { if (!((smt::isAnyNonFuncSMTValueType(type)))) { return op->emitOpError(valueKind) << " #" << valueIndex << " must be variadic of any non-function SMT value type, but got " << type; } return ::mlir::success(); } static ::llvm::LogicalResult __mlir_ods_local_type_constraint_SMT5( ::mlir::Operation *op, ::mlir::Type type, ::llvm::StringRef valueKind, unsigned valueIndex) { if (!((smt::isAnyNonFuncSMTValueType(type)))) { return op->emitOpError(valueKind) << " #" << valueIndex << " must be any non-function SMT value type, but got " << type; } return ::mlir::success(); } static ::llvm::LogicalResult __mlir_ods_local_type_constraint_SMT6( ::mlir::Operation *op, ::mlir::Type type, ::llvm::StringRef valueKind, unsigned valueIndex) { if (!((smt::isAnySMTValueType(type)))) { return op->emitOpError(valueKind) << " #" << valueIndex << " must be any SMT value type, but got " << type; } return ::mlir::success(); } static ::llvm::LogicalResult __mlir_ods_local_type_constraint_SMT7( ::mlir::Operation *op, ::mlir::Type type, ::llvm::StringRef valueKind, unsigned valueIndex) { if (!((::llvm::isa(type)))) { return op->emitOpError(valueKind) << " #" << valueIndex << " must be , but got " << type; } return ::mlir::success(); } static ::llvm::LogicalResult __mlir_ods_local_type_constraint_SMT8( ::mlir::Operation *op, ::mlir::Type type, ::llvm::StringRef valueKind, unsigned valueIndex) { if (!((::llvm::isa(type)))) { return op->emitOpError(valueKind) << " #" << valueIndex << " must be , but got " << type; } return ::mlir::success(); } static ::llvm::LogicalResult __mlir_ods_local_type_constraint_SMT9( ::mlir::Operation *op, ::mlir::Type type, ::llvm::StringRef valueKind, unsigned valueIndex) { if (!((::llvm::isa(type)))) { return op->emitOpError(valueKind) << " #" << valueIndex << " must be , but got " << type; } return ::mlir::success(); } static ::llvm::LogicalResult __mlir_ods_local_type_constraint_SMT10( ::mlir::Operation *op, ::mlir::Type type, ::llvm::StringRef valueKind, unsigned valueIndex) { if (!(!((::llvm::isa<::mlir::TokenType>(type))))) { return op->emitOpError(valueKind) << " #" << valueIndex << " must be variadic of any non-token type, but got " << type; } return ::mlir::success(); } static ::llvm::LogicalResult __mlir_ods_local_type_constraint_SMT11( ::mlir::Operation *op, ::mlir::Type type, ::llvm::StringRef valueKind, unsigned valueIndex) { if (!((::llvm::isa(type)))) { return op->emitOpError(valueKind) << " #" << valueIndex << " must be variadic of , but got " << type; } return ::mlir::success(); } static ::llvm::LogicalResult __mlir_ods_local_type_constraint_SMT12( ::mlir::Operation *op, ::mlir::Type type, ::llvm::StringRef valueKind, unsigned valueIndex) { if (!(!((smt::isAnySMTValueType(type))))) { return op->emitOpError(valueKind) << " #" << valueIndex << " must be variadic of any non-smt type, but got " << type; } return ::mlir::success(); } static ::llvm::LogicalResult __mlir_ods_local_attr_constraint_SMT1( ::mlir::Attribute attr, ::llvm::StringRef attrName, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) { if (attr && !((::llvm::isa<::mlir::UnitAttr>(attr)))) return emitError() << "attribute '" << attrName << "' failed to satisfy constraint: unit attribute"; return ::mlir::success(); } static ::llvm::LogicalResult __mlir_ods_local_attr_constraint_SMT1( ::mlir::Operation *op, ::mlir::Attribute attr, ::llvm::StringRef attrName) { return __mlir_ods_local_attr_constraint_SMT1(attr, attrName, [op]() { return op->emitOpError(); }); } static ::llvm::LogicalResult __mlir_ods_local_attr_constraint_SMT2( ::mlir::Attribute attr, ::llvm::StringRef attrName, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) { if (attr && !((::llvm::isa(attr)))) return emitError() << "attribute '" << attrName << "' failed to satisfy constraint: smt bit-vector comparison predicate"; return ::mlir::success(); } static ::llvm::LogicalResult __mlir_ods_local_attr_constraint_SMT2( ::mlir::Operation *op, ::mlir::Attribute attr, ::llvm::StringRef attrName) { return __mlir_ods_local_attr_constraint_SMT2(attr, attrName, [op]() { return op->emitOpError(); }); } static ::llvm::LogicalResult __mlir_ods_local_attr_constraint_SMT3( ::mlir::Attribute attr, ::llvm::StringRef attrName, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) { if (attr && !((::llvm::isa(attr)))) return emitError() << "attribute '" << attrName << "' failed to satisfy constraint: "; return ::mlir::success(); } static ::llvm::LogicalResult __mlir_ods_local_attr_constraint_SMT3( ::mlir::Operation *op, ::mlir::Attribute attr, ::llvm::StringRef attrName) { return __mlir_ods_local_attr_constraint_SMT3(attr, attrName, [op]() { return op->emitOpError(); }); } static ::llvm::LogicalResult __mlir_ods_local_attr_constraint_SMT4( ::mlir::Attribute attr, ::llvm::StringRef attrName, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) { if (attr && !((::llvm::isa<::mlir::BoolAttr>(attr)))) return emitError() << "attribute '" << attrName << "' failed to satisfy constraint: bool attribute"; return ::mlir::success(); } static ::llvm::LogicalResult __mlir_ods_local_attr_constraint_SMT4( ::mlir::Operation *op, ::mlir::Attribute attr, ::llvm::StringRef attrName) { return __mlir_ods_local_attr_constraint_SMT4(attr, attrName, [op]() { return op->emitOpError(); }); } static ::llvm::LogicalResult __mlir_ods_local_attr_constraint_SMT5( ::mlir::Attribute attr, ::llvm::StringRef attrName, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) { if (attr && !((::llvm::isa<::mlir::StringAttr>(attr)))) return emitError() << "attribute '" << attrName << "' failed to satisfy constraint: string attribute"; return ::mlir::success(); } static ::llvm::LogicalResult __mlir_ods_local_attr_constraint_SMT5( ::mlir::Operation *op, ::mlir::Attribute attr, ::llvm::StringRef attrName) { return __mlir_ods_local_attr_constraint_SMT5(attr, attrName, [op]() { return op->emitOpError(); }); } static ::llvm::LogicalResult __mlir_ods_local_attr_constraint_SMT6( ::mlir::Attribute attr, ::llvm::StringRef attrName, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) { if (attr && !(((::llvm::isa<::mlir::IntegerAttr>(attr))) && ((::llvm::cast<::mlir::IntegerAttr>(attr).getType().isSignlessInteger(32))))) return emitError() << "attribute '" << attrName << "' failed to satisfy constraint: 32-bit signless integer attribute"; return ::mlir::success(); } static ::llvm::LogicalResult __mlir_ods_local_attr_constraint_SMT6( ::mlir::Operation *op, ::mlir::Attribute attr, ::llvm::StringRef attrName) { return __mlir_ods_local_attr_constraint_SMT6(attr, attrName, [op]() { return op->emitOpError(); }); } static ::llvm::LogicalResult __mlir_ods_local_attr_constraint_SMT7( ::mlir::Attribute attr, ::llvm::StringRef attrName, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) { if (attr && !(((::llvm::isa<::mlir::ArrayAttr>(attr))) && (::llvm::all_of(::llvm::cast<::mlir::ArrayAttr>(attr), [&](::mlir::Attribute attr) { return attr && ((::llvm::isa<::mlir::StringAttr>(attr))); })))) return emitError() << "attribute '" << attrName << "' failed to satisfy constraint: string array attribute"; return ::mlir::success(); } static ::llvm::LogicalResult __mlir_ods_local_attr_constraint_SMT7( ::mlir::Operation *op, ::mlir::Attribute attr, ::llvm::StringRef attrName) { return __mlir_ods_local_attr_constraint_SMT7(attr, attrName, [op]() { return op->emitOpError(); }); } static ::llvm::LogicalResult __mlir_ods_local_attr_constraint_SMT8( ::mlir::Attribute attr, ::llvm::StringRef attrName, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) { if (attr && !((::llvm::isa(attr)))) return emitError() << "attribute '" << attrName << "' failed to satisfy constraint: smt comparison predicate for integers"; return ::mlir::success(); } static ::llvm::LogicalResult __mlir_ods_local_attr_constraint_SMT8( ::mlir::Operation *op, ::mlir::Attribute attr, ::llvm::StringRef attrName) { return __mlir_ods_local_attr_constraint_SMT8(attr, attrName, [op]() { return op->emitOpError(); }); } static ::llvm::LogicalResult __mlir_ods_local_attr_constraint_SMT9( ::mlir::Attribute attr, ::llvm::StringRef attrName, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) { if (attr && !((::llvm::isa<::mlir::IntegerAttr>(attr)))) return emitError() << "attribute '" << attrName << "' failed to satisfy constraint: arbitrary integer attribute"; return ::mlir::success(); } static ::llvm::LogicalResult __mlir_ods_local_attr_constraint_SMT9( ::mlir::Operation *op, ::mlir::Attribute attr, ::llvm::StringRef attrName) { return __mlir_ods_local_attr_constraint_SMT9(attr, attrName, [op]() { return op->emitOpError(); }); } static ::llvm::LogicalResult __mlir_ods_local_attr_constraint_SMT10( ::mlir::Attribute attr, ::llvm::StringRef attrName, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) { if (attr && !((((::llvm::isa<::mlir::IntegerAttr>(attr))) && ((::llvm::cast<::mlir::IntegerAttr>(attr).getType().isSignlessInteger(32)))) && ((!::llvm::cast<::mlir::IntegerAttr>(attr).getValue().isNegative())))) return emitError() << "attribute '" << attrName << "' failed to satisfy constraint: 32-bit signless integer attribute whose value is non-negative"; return ::mlir::success(); } static ::llvm::LogicalResult __mlir_ods_local_attr_constraint_SMT10( ::mlir::Operation *op, ::mlir::Attribute attr, ::llvm::StringRef attrName) { return __mlir_ods_local_attr_constraint_SMT10(attr, attrName, [op]() { return op->emitOpError(); }); } static ::llvm::LogicalResult __mlir_ods_local_region_constraint_SMT1( ::mlir::Operation *op, ::mlir::Region ®ion, ::llvm::StringRef regionName, unsigned regionIndex) { if (!((::llvm::hasNItems(region, 1)))) { return op->emitOpError("region #") << regionIndex << (regionName.empty() ? " " : " ('" + regionName + "') ") << "failed to verify constraint: region with 1 blocks"; } return ::mlir::success(); } namespace mlir::smt { //===----------------------------------------------------------------------===// // mlir::smt::AndOp definitions //===----------------------------------------------------------------------===// namespace detail { AndOpGenericAdaptorBase::AndOpGenericAdaptorBase(AndOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {} std::pair AndOpGenericAdaptorBase::getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize) { bool isVariadic[] = {true}; int prevVariadicCount = 0; for (unsigned i = 0; i < index; ++i) if (isVariadic[i]) ++prevVariadicCount; // Calculate how many dynamic values a static variadic operand corresponds to. // This assumes all static variadic operands have the same dynamic value count. int variadicSize = (odsOperandsSize - 0) / 1; // `index` passed in as the parameter is the static index which counts each // operand (variadic or not) as size 1. So here for each previous static variadic // operand, we need to offset by (variadicSize - 1) to get where the dynamic // value pack for this static operand starts. int start = index + (variadicSize - 1) * prevVariadicCount; int size = isVariadic[index] ? variadicSize : 1; return {start, size}; } } // namespace detail AndOpAdaptor::AndOpAdaptor(AndOp op) : AndOpGenericAdaptor(op->getOperands(), op) {} ::llvm::LogicalResult AndOpAdaptor::verify(::mlir::Location loc) { return ::mlir::success(); } std::pair AndOp::getODSOperandIndexAndLength(unsigned index) { bool isVariadic[] = {true}; int prevVariadicCount = 0; for (unsigned i = 0; i < index; ++i) if (isVariadic[i]) ++prevVariadicCount; // Calculate how many dynamic values a static variadic operand corresponds to. // This assumes all static variadic operands have the same dynamic value count. int variadicSize = (getOperation()->getNumOperands() - 0) / 1; // `index` passed in as the parameter is the static index which counts each // operand (variadic or not) as size 1. So here for each previous static variadic // operand, we need to offset by (variadicSize - 1) to get where the dynamic // value pack for this static operand starts. int start = index + (variadicSize - 1) * prevVariadicCount; int size = isVariadic[index] ? variadicSize : 1; return {start, size}; } ::mlir::MutableOperandRange AndOp::getInputsMutable() { auto range = getODSOperandIndexAndLength(0); auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second); return mutableRange; } ::llvm::LogicalResult AndOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) { ::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr); if (!dict) { emitError() << "expected DictionaryAttr to set properties"; return ::mlir::failure(); } return ::mlir::success(); } ::mlir::Attribute AndOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) { ::mlir::SmallVector<::mlir::NamedAttribute> attrs; ::mlir::Builder odsBuilder{ctx}; if (!attrs.empty()) return odsBuilder.getDictionaryAttr(attrs); return {}; } llvm::hash_code AndOp::computePropertiesHash(const Properties &prop) { using llvm::hash_value; return llvm::hash_combine(); } std::optional AndOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) { return std::nullopt; } void AndOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) { } void AndOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) { } ::llvm::LogicalResult AndOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) { return ::mlir::success(); } void AndOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, mlir::Value lhs, mlir::Value rhs) { build(odsBuilder, odsState, ValueRange{lhs, rhs}); } AndOp AndOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, mlir::Value lhs, mlir::Value rhs) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(lhs), std::forward(rhs)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } AndOp AndOp::create(::mlir::ImplicitLocOpBuilder &builder, mlir::Value lhs, mlir::Value rhs) { return create(builder, builder.getLoc(), std::forward(lhs), std::forward(rhs)); } void AndOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::ValueRange inputs) { odsState.addOperands(inputs); odsState.addTypes(result); } AndOp AndOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::ValueRange inputs) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(result), std::forward(inputs)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } AndOp AndOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::ValueRange inputs) { return create(builder, builder.getLoc(), std::forward(result), std::forward(inputs)); } void AndOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { odsState.addOperands(operands); odsState.addAttributes(attributes); assert(resultTypes.size() == 1u && "mismatched number of return types"); odsState.addTypes(resultTypes); } AndOp AndOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(resultTypes), std::forward(operands), std::forward(attributes)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } AndOp AndOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { return create(builder, builder.getLoc(), std::forward(resultTypes), std::forward(operands), std::forward(attributes)); } void AndOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { odsState.addOperands(operands); odsState.addAttributes(attributes); ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes; if (::mlir::succeeded(AndOp::inferReturnTypes(odsBuilder.getContext(), odsState.location, operands, odsState.attributes.getDictionary(odsState.getContext()), odsState.getRawProperties(), odsState.regions, inferredReturnTypes))) { assert(inferredReturnTypes.size() == 1u && "mismatched number of return types"); odsState.addTypes(inferredReturnTypes); } else { ::llvm::report_fatal_error("Failed to infer result type(s)."); } } AndOp AndOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(operands), std::forward(attributes)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } AndOp AndOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { return create(builder, builder.getLoc(), std::forward(operands), std::forward(attributes)); } void AndOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { odsState.addOperands(operands); odsState.useProperties(const_cast(properties)); odsState.addAttributes(discardableAttributes); assert(resultTypes.size() == 1u && "mismatched number of return types"); odsState.addTypes(resultTypes); } AndOp AndOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(resultTypes), std::forward(operands), std::forward(properties), std::forward(discardableAttributes)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } AndOp AndOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { return create(builder, builder.getLoc(), std::forward(resultTypes), std::forward(operands), std::forward(properties), std::forward(discardableAttributes)); } void AndOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { odsState.addOperands(operands); odsState.useProperties(const_cast(properties)); odsState.addAttributes(discardableAttributes); ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes; if (::mlir::succeeded(AndOp::inferReturnTypes(odsBuilder.getContext(), odsState.location, operands, odsState.attributes.getDictionary(odsState.getContext()), odsState.getRawProperties(), odsState.regions, inferredReturnTypes))) { assert(inferredReturnTypes.size() == 1u && "mismatched number of return types"); odsState.addTypes(inferredReturnTypes); } else { ::llvm::report_fatal_error("Failed to infer result type(s)."); } } AndOp AndOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(operands), std::forward(properties), std::forward(discardableAttributes)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } AndOp AndOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { return create(builder, builder.getLoc(), std::forward(operands), std::forward(properties), std::forward(discardableAttributes)); } ::llvm::LogicalResult AndOp::verifyInvariantsImpl() { { unsigned index = 0; (void)index; auto valueGroup0 = getODSOperands(0); for (auto v : valueGroup0) { if (::mlir::failed(__mlir_ods_local_type_constraint_SMT1(*this, v.getType(), "operand", index++))) return ::mlir::failure(); } } { unsigned index = 0; (void)index; auto valueGroup0 = getODSResults(0); for (auto v : valueGroup0) { if (::mlir::failed(__mlir_ods_local_type_constraint_SMT2(*this, v.getType(), "result", index++))) return ::mlir::failure(); } } return ::mlir::success(); } ::llvm::LogicalResult AndOp::verifyInvariants() { return verifyInvariantsImpl(); } ::llvm::LogicalResult AndOp::inferReturnTypes(::mlir::MLIRContext *context, ::std::optional<::mlir::Location> location, ::mlir::ValueRange operands, ::mlir::DictionaryAttr attributes, ::mlir::PropertyRef properties, ::mlir::RegionRange regions, ::llvm::SmallVectorImpl<::mlir::Type>&inferredReturnTypes) { inferredReturnTypes.resize(1); ::mlir::Builder odsBuilder(context); ::mlir::Type odsInferredType0 = odsBuilder.getType(); inferredReturnTypes[0] = odsInferredType0; return ::mlir::success(); } ::mlir::ParseResult AndOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) { ::llvm::SmallVector<::mlir::OpAsmParser::UnresolvedOperand, 4> inputsOperands; ::llvm::SMLoc inputsOperandsLoc; (void)inputsOperandsLoc; inputsOperandsLoc = parser.getCurrentLocation(); if (parser.parseOperandList(inputsOperands)) return ::mlir::failure(); { auto loc = parser.getCurrentLocation();(void)loc; if (parser.parseOptionalAttrDict(result.attributes)) return ::mlir::failure(); if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() { return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op "; }))) return ::mlir::failure(); } ::mlir::Type odsBuildableType0 = parser.getBuilder().getType(); result.addTypes(odsBuildableType0); if (parser.resolveOperands(inputsOperands, odsBuildableType0, inputsOperandsLoc, result.operands)) return ::mlir::failure(); return ::mlir::success(); } void AndOp::print(::mlir::OpAsmPrinter &_odsPrinter) { _odsPrinter << ' '; _odsPrinter << getInputs(); ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs; _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs); } void AndOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) { } } // namespace mlir::smt MLIR_DEFINE_EXPLICIT_TYPE_ID(mlir::smt::AndOp) namespace mlir::smt { //===----------------------------------------------------------------------===// // mlir::smt::ApplyFuncOp definitions //===----------------------------------------------------------------------===// namespace detail { ApplyFuncOpGenericAdaptorBase::ApplyFuncOpGenericAdaptorBase(ApplyFuncOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {} std::pair ApplyFuncOpGenericAdaptorBase::getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize) { bool isVariadic[] = {false, true}; int prevVariadicCount = 0; for (unsigned i = 0; i < index; ++i) if (isVariadic[i]) ++prevVariadicCount; // Calculate how many dynamic values a static variadic operand corresponds to. // This assumes all static variadic operands have the same dynamic value count. int variadicSize = (odsOperandsSize - 1) / 1; // `index` passed in as the parameter is the static index which counts each // operand (variadic or not) as size 1. So here for each previous static variadic // operand, we need to offset by (variadicSize - 1) to get where the dynamic // value pack for this static operand starts. int start = index + (variadicSize - 1) * prevVariadicCount; int size = isVariadic[index] ? variadicSize : 1; return {start, size}; } } // namespace detail ApplyFuncOpAdaptor::ApplyFuncOpAdaptor(ApplyFuncOp op) : ApplyFuncOpGenericAdaptor(op->getOperands(), op) {} ::llvm::LogicalResult ApplyFuncOpAdaptor::verify(::mlir::Location loc) { return ::mlir::success(); } std::pair ApplyFuncOp::getODSOperandIndexAndLength(unsigned index) { bool isVariadic[] = {false, true}; int prevVariadicCount = 0; for (unsigned i = 0; i < index; ++i) if (isVariadic[i]) ++prevVariadicCount; // Calculate how many dynamic values a static variadic operand corresponds to. // This assumes all static variadic operands have the same dynamic value count. int variadicSize = (getOperation()->getNumOperands() - 1) / 1; // `index` passed in as the parameter is the static index which counts each // operand (variadic or not) as size 1. So here for each previous static variadic // operand, we need to offset by (variadicSize - 1) to get where the dynamic // value pack for this static operand starts. int start = index + (variadicSize - 1) * prevVariadicCount; int size = isVariadic[index] ? variadicSize : 1; return {start, size}; } ::mlir::MutableOperandRange ApplyFuncOp::getArgsMutable() { auto range = getODSOperandIndexAndLength(1); auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second); return mutableRange; } ::llvm::LogicalResult ApplyFuncOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) { ::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr); if (!dict) { emitError() << "expected DictionaryAttr to set properties"; return ::mlir::failure(); } return ::mlir::success(); } ::mlir::Attribute ApplyFuncOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) { ::mlir::SmallVector<::mlir::NamedAttribute> attrs; ::mlir::Builder odsBuilder{ctx}; if (!attrs.empty()) return odsBuilder.getDictionaryAttr(attrs); return {}; } llvm::hash_code ApplyFuncOp::computePropertiesHash(const Properties &prop) { using llvm::hash_value; return llvm::hash_combine(); } std::optional ApplyFuncOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) { return std::nullopt; } void ApplyFuncOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) { } void ApplyFuncOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) { } ::llvm::LogicalResult ApplyFuncOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) { return ::mlir::success(); } void ApplyFuncOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value func, ::mlir::ValueRange args) { odsState.addOperands(func); odsState.addOperands(args); odsState.addTypes(result); } ApplyFuncOp ApplyFuncOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value func, ::mlir::ValueRange args) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(result), std::forward(func), std::forward(args)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } ApplyFuncOp ApplyFuncOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::Value func, ::mlir::ValueRange args) { return create(builder, builder.getLoc(), std::forward(result), std::forward(func), std::forward(args)); } void ApplyFuncOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value func, ::mlir::ValueRange args) { odsState.addOperands(func); odsState.addOperands(args); ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes; if (::mlir::succeeded(ApplyFuncOp::inferReturnTypes(odsBuilder.getContext(), odsState.location, odsState.operands, odsState.attributes.getDictionary(odsState.getContext()), odsState.getRawProperties(), odsState.regions, inferredReturnTypes))) odsState.addTypes(inferredReturnTypes); else ::mlir::detail::reportFatalInferReturnTypesError(odsState); } ApplyFuncOp ApplyFuncOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value func, ::mlir::ValueRange args) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(func), std::forward(args)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } ApplyFuncOp ApplyFuncOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value func, ::mlir::ValueRange args) { return create(builder, builder.getLoc(), std::forward(func), std::forward(args)); } void ApplyFuncOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value func, ::mlir::ValueRange args) { odsState.addOperands(func); odsState.addOperands(args); assert(resultTypes.size() == 1u && "mismatched number of results"); odsState.addTypes(resultTypes); } ApplyFuncOp ApplyFuncOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value func, ::mlir::ValueRange args) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(resultTypes), std::forward(func), std::forward(args)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } ApplyFuncOp ApplyFuncOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value func, ::mlir::ValueRange args) { return create(builder, builder.getLoc(), std::forward(resultTypes), std::forward(func), std::forward(args)); } void ApplyFuncOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { assert(operands.size() >= 1u && "mismatched number of parameters"); odsState.addOperands(operands); odsState.addAttributes(attributes); assert(resultTypes.size() == 1u && "mismatched number of return types"); odsState.addTypes(resultTypes); } ApplyFuncOp ApplyFuncOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(resultTypes), std::forward(operands), std::forward(attributes)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } ApplyFuncOp ApplyFuncOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { return create(builder, builder.getLoc(), std::forward(resultTypes), std::forward(operands), std::forward(attributes)); } void ApplyFuncOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { assert(operands.size() >= 1u && "mismatched number of parameters"); odsState.addOperands(operands); odsState.addAttributes(attributes); ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes; if (::mlir::succeeded(ApplyFuncOp::inferReturnTypes(odsBuilder.getContext(), odsState.location, operands, odsState.attributes.getDictionary(odsState.getContext()), odsState.getRawProperties(), odsState.regions, inferredReturnTypes))) { assert(inferredReturnTypes.size() == 1u && "mismatched number of return types"); odsState.addTypes(inferredReturnTypes); } else { ::llvm::report_fatal_error("Failed to infer result type(s)."); } } ApplyFuncOp ApplyFuncOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(operands), std::forward(attributes)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } ApplyFuncOp ApplyFuncOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { return create(builder, builder.getLoc(), std::forward(operands), std::forward(attributes)); } void ApplyFuncOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { assert(operands.size() >= 1u && "mismatched number of parameters"); odsState.addOperands(operands); odsState.useProperties(const_cast(properties)); odsState.addAttributes(discardableAttributes); assert(resultTypes.size() == 1u && "mismatched number of return types"); odsState.addTypes(resultTypes); } ApplyFuncOp ApplyFuncOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(resultTypes), std::forward(operands), std::forward(properties), std::forward(discardableAttributes)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } ApplyFuncOp ApplyFuncOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { return create(builder, builder.getLoc(), std::forward(resultTypes), std::forward(operands), std::forward(properties), std::forward(discardableAttributes)); } void ApplyFuncOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { assert(operands.size() >= 1u && "mismatched number of parameters"); odsState.addOperands(operands); odsState.useProperties(const_cast(properties)); odsState.addAttributes(discardableAttributes); ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes; if (::mlir::succeeded(ApplyFuncOp::inferReturnTypes(odsBuilder.getContext(), odsState.location, operands, odsState.attributes.getDictionary(odsState.getContext()), odsState.getRawProperties(), odsState.regions, inferredReturnTypes))) { assert(inferredReturnTypes.size() == 1u && "mismatched number of return types"); odsState.addTypes(inferredReturnTypes); } else { ::llvm::report_fatal_error("Failed to infer result type(s)."); } } ApplyFuncOp ApplyFuncOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(operands), std::forward(properties), std::forward(discardableAttributes)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } ApplyFuncOp ApplyFuncOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { return create(builder, builder.getLoc(), std::forward(operands), std::forward(properties), std::forward(discardableAttributes)); } ::llvm::LogicalResult ApplyFuncOp::verifyInvariantsImpl() { { unsigned index = 0; (void)index; auto valueGroup0 = getODSOperands(0); for (auto v : valueGroup0) { if (::mlir::failed(__mlir_ods_local_type_constraint_SMT3(*this, v.getType(), "operand", index++))) return ::mlir::failure(); } auto valueGroup1 = getODSOperands(1); for (auto v : valueGroup1) { if (::mlir::failed(__mlir_ods_local_type_constraint_SMT4(*this, v.getType(), "operand", index++))) return ::mlir::failure(); } } { unsigned index = 0; (void)index; auto valueGroup0 = getODSResults(0); for (auto v : valueGroup0) { if (::mlir::failed(__mlir_ods_local_type_constraint_SMT5(*this, v.getType(), "result", index++))) return ::mlir::failure(); } } if (!((std::equal_to<>()(cast((*this->getODSOperands(0).begin()).getType()).getRangeType(), (*this->getODSResults(0).begin()).getType())))) return emitOpError("failed to verify that summary"); if (!((llvm::equal(cast((*this->getODSOperands(0).begin()).getType()).getDomainTypes(), this->getODSOperands(1).getType())))) return emitOpError("failed to verify that summary"); return ::mlir::success(); } ::llvm::LogicalResult ApplyFuncOp::verifyInvariants() { return verifyInvariantsImpl(); } ::llvm::LogicalResult ApplyFuncOp::inferReturnTypes(::mlir::MLIRContext *context, ::std::optional<::mlir::Location> location, ::mlir::ValueRange operands, ::mlir::DictionaryAttr attributes, ::mlir::PropertyRef properties, ::mlir::RegionRange regions, ::llvm::SmallVectorImpl<::mlir::Type>&inferredReturnTypes) { inferredReturnTypes.resize(1); ::mlir::Builder odsBuilder(context); if (operands.size() <= 0) return ::mlir::failure(); ::mlir::Type odsInferredType0 = cast(operands[0].getType()).getRangeType(); inferredReturnTypes[0] = odsInferredType0; return ::mlir::success(); } ::mlir::ParseResult ApplyFuncOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) { ::mlir::OpAsmParser::UnresolvedOperand funcRawOperand{}; ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> funcOperands(&funcRawOperand, 1); ::llvm::SMLoc funcOperandsLoc; (void)funcOperandsLoc; ::llvm::SmallVector<::mlir::OpAsmParser::UnresolvedOperand, 4> argsOperands; ::llvm::SMLoc argsOperandsLoc; (void)argsOperandsLoc; ::mlir::Type funcRawType{}; ::llvm::ArrayRef<::mlir::Type> funcTypes(&funcRawType, 1); funcOperandsLoc = parser.getCurrentLocation(); if (parser.parseOperand(funcRawOperand)) return ::mlir::failure(); if (parser.parseLParen()) return ::mlir::failure(); argsOperandsLoc = parser.getCurrentLocation(); if (parser.parseOperandList(argsOperands)) return ::mlir::failure(); if (parser.parseRParen()) return ::mlir::failure(); { auto loc = parser.getCurrentLocation();(void)loc; if (parser.parseOptionalAttrDict(result.attributes)) return ::mlir::failure(); if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() { return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op "; }))) return ::mlir::failure(); } if (parser.parseColon()) return ::mlir::failure(); if (parser.parseType(funcRawType)) return ::mlir::failure(); for (::mlir::Type type : funcTypes) { (void)type; if (!((::llvm::isa(type)))) { return parser.emitError(parser.getNameLoc()) << "'func' must be , but got " << type; } } result.addTypes(cast(funcTypes[0]).getRangeType()); if (parser.resolveOperands(funcOperands, funcTypes, funcOperandsLoc, result.operands)) return ::mlir::failure(); if (parser.resolveOperands(argsOperands, cast(funcTypes[0]).getDomainTypes(), argsOperandsLoc, result.operands)) return ::mlir::failure(); return ::mlir::success(); } void ApplyFuncOp::print(::mlir::OpAsmPrinter &_odsPrinter) { _odsPrinter << ' '; _odsPrinter << getFunc(); _odsPrinter << "("; _odsPrinter << getArgs(); _odsPrinter << ")"; ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs; _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs); _odsPrinter << ' ' << ":"; _odsPrinter << ' '; _odsPrinter << getFunc().getType(); } void ApplyFuncOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) { } } // namespace mlir::smt MLIR_DEFINE_EXPLICIT_TYPE_ID(mlir::smt::ApplyFuncOp) namespace mlir::smt { //===----------------------------------------------------------------------===// // mlir::smt::ArrayBroadcastOp definitions //===----------------------------------------------------------------------===// namespace detail { ArrayBroadcastOpGenericAdaptorBase::ArrayBroadcastOpGenericAdaptorBase(ArrayBroadcastOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {} } // namespace detail ArrayBroadcastOpAdaptor::ArrayBroadcastOpAdaptor(ArrayBroadcastOp op) : ArrayBroadcastOpGenericAdaptor(op->getOperands(), op) {} ::llvm::LogicalResult ArrayBroadcastOpAdaptor::verify(::mlir::Location loc) { return ::mlir::success(); } ::llvm::LogicalResult ArrayBroadcastOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) { ::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr); if (!dict) { emitError() << "expected DictionaryAttr to set properties"; return ::mlir::failure(); } return ::mlir::success(); } ::mlir::Attribute ArrayBroadcastOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) { ::mlir::SmallVector<::mlir::NamedAttribute> attrs; ::mlir::Builder odsBuilder{ctx}; if (!attrs.empty()) return odsBuilder.getDictionaryAttr(attrs); return {}; } llvm::hash_code ArrayBroadcastOp::computePropertiesHash(const Properties &prop) { using llvm::hash_value; return llvm::hash_combine(); } std::optional ArrayBroadcastOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) { return std::nullopt; } void ArrayBroadcastOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) { } void ArrayBroadcastOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) { } ::llvm::LogicalResult ArrayBroadcastOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) { return ::mlir::success(); } void ArrayBroadcastOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value value) { odsState.addOperands(value); odsState.addTypes(result); } ArrayBroadcastOp ArrayBroadcastOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value value) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(result), std::forward(value)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } ArrayBroadcastOp ArrayBroadcastOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::Value value) { return create(builder, builder.getLoc(), std::forward(result), std::forward(value)); } void ArrayBroadcastOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value value) { odsState.addOperands(value); assert(resultTypes.size() == 1u && "mismatched number of results"); odsState.addTypes(resultTypes); } ArrayBroadcastOp ArrayBroadcastOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value value) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(resultTypes), std::forward(value)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } ArrayBroadcastOp ArrayBroadcastOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value value) { return create(builder, builder.getLoc(), std::forward(resultTypes), std::forward(value)); } void ArrayBroadcastOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { assert(operands.size() == 1u && "mismatched number of parameters"); odsState.addOperands(operands); odsState.addAttributes(attributes); assert(resultTypes.size() == 1u && "mismatched number of return types"); odsState.addTypes(resultTypes); } ArrayBroadcastOp ArrayBroadcastOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(resultTypes), std::forward(operands), std::forward(attributes)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } ArrayBroadcastOp ArrayBroadcastOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { return create(builder, builder.getLoc(), std::forward(resultTypes), std::forward(operands), std::forward(attributes)); } void ArrayBroadcastOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { assert(operands.size() == 1u && "mismatched number of parameters"); odsState.addOperands(operands); odsState.useProperties(const_cast(properties)); odsState.addAttributes(discardableAttributes); assert(resultTypes.size() == 1u && "mismatched number of return types"); odsState.addTypes(resultTypes); } ArrayBroadcastOp ArrayBroadcastOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(resultTypes), std::forward(operands), std::forward(properties), std::forward(discardableAttributes)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } ArrayBroadcastOp ArrayBroadcastOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { return create(builder, builder.getLoc(), std::forward(resultTypes), std::forward(operands), std::forward(properties), std::forward(discardableAttributes)); } ::llvm::LogicalResult ArrayBroadcastOp::verifyInvariantsImpl() { { unsigned index = 0; (void)index; auto valueGroup0 = getODSOperands(0); for (auto v : valueGroup0) { if (::mlir::failed(__mlir_ods_local_type_constraint_SMT6(*this, v.getType(), "operand", index++))) return ::mlir::failure(); } } { unsigned index = 0; (void)index; auto valueGroup0 = getODSResults(0); for (auto v : valueGroup0) { if (::mlir::failed(__mlir_ods_local_type_constraint_SMT7(*this, v.getType(), "result", index++))) return ::mlir::failure(); } } if (!((std::equal_to<>()(cast((*this->getODSResults(0).begin()).getType()).getRangeType(), (*this->getODSOperands(0).begin()).getType())))) return emitOpError("failed to verify that summary"); return ::mlir::success(); } ::llvm::LogicalResult ArrayBroadcastOp::verifyInvariants() { return verifyInvariantsImpl(); } ::mlir::ParseResult ArrayBroadcastOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) { ::mlir::OpAsmParser::UnresolvedOperand valueRawOperand{}; ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> valueOperands(&valueRawOperand, 1); ::llvm::SMLoc valueOperandsLoc; (void)valueOperandsLoc; ::mlir::Type resultRawType{}; ::llvm::ArrayRef<::mlir::Type> resultTypes(&resultRawType, 1); valueOperandsLoc = parser.getCurrentLocation(); if (parser.parseOperand(valueRawOperand)) return ::mlir::failure(); { auto loc = parser.getCurrentLocation();(void)loc; if (parser.parseOptionalAttrDict(result.attributes)) return ::mlir::failure(); if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() { return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op "; }))) return ::mlir::failure(); } if (parser.parseColon()) return ::mlir::failure(); if (parser.parseType(resultRawType)) return ::mlir::failure(); for (::mlir::Type type : resultTypes) { (void)type; if (!((::llvm::isa(type)))) { return parser.emitError(parser.getNameLoc()) << "'result' must be , but got " << type; } } result.addTypes(resultTypes); if (parser.resolveOperands(valueOperands, cast(resultTypes[0]).getRangeType(), valueOperandsLoc, result.operands)) return ::mlir::failure(); return ::mlir::success(); } void ArrayBroadcastOp::print(::mlir::OpAsmPrinter &_odsPrinter) { _odsPrinter << ' '; _odsPrinter << getValue(); ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs; _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs); _odsPrinter << ' ' << ":"; _odsPrinter << ' '; _odsPrinter << getResult().getType(); } void ArrayBroadcastOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) { } } // namespace mlir::smt MLIR_DEFINE_EXPLICIT_TYPE_ID(mlir::smt::ArrayBroadcastOp) namespace mlir::smt { //===----------------------------------------------------------------------===// // mlir::smt::ArraySelectOp definitions //===----------------------------------------------------------------------===// namespace detail { ArraySelectOpGenericAdaptorBase::ArraySelectOpGenericAdaptorBase(ArraySelectOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {} } // namespace detail ArraySelectOpAdaptor::ArraySelectOpAdaptor(ArraySelectOp op) : ArraySelectOpGenericAdaptor(op->getOperands(), op) {} ::llvm::LogicalResult ArraySelectOpAdaptor::verify(::mlir::Location loc) { return ::mlir::success(); } ::llvm::LogicalResult ArraySelectOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) { ::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr); if (!dict) { emitError() << "expected DictionaryAttr to set properties"; return ::mlir::failure(); } return ::mlir::success(); } ::mlir::Attribute ArraySelectOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) { ::mlir::SmallVector<::mlir::NamedAttribute> attrs; ::mlir::Builder odsBuilder{ctx}; if (!attrs.empty()) return odsBuilder.getDictionaryAttr(attrs); return {}; } llvm::hash_code ArraySelectOp::computePropertiesHash(const Properties &prop) { using llvm::hash_value; return llvm::hash_combine(); } std::optional ArraySelectOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) { return std::nullopt; } void ArraySelectOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) { } void ArraySelectOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) { } ::llvm::LogicalResult ArraySelectOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) { return ::mlir::success(); } void ArraySelectOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value array, ::mlir::Value index) { odsState.addOperands(array); odsState.addOperands(index); odsState.addTypes(result); } ArraySelectOp ArraySelectOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value array, ::mlir::Value index) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(result), std::forward(array), std::forward(index)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } ArraySelectOp ArraySelectOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::Value array, ::mlir::Value index) { return create(builder, builder.getLoc(), std::forward(result), std::forward(array), std::forward(index)); } void ArraySelectOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value array, ::mlir::Value index) { odsState.addOperands(array); odsState.addOperands(index); ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes; if (::mlir::succeeded(ArraySelectOp::inferReturnTypes(odsBuilder.getContext(), odsState.location, odsState.operands, odsState.attributes.getDictionary(odsState.getContext()), odsState.getRawProperties(), odsState.regions, inferredReturnTypes))) odsState.addTypes(inferredReturnTypes); else ::mlir::detail::reportFatalInferReturnTypesError(odsState); } ArraySelectOp ArraySelectOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value array, ::mlir::Value index) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(array), std::forward(index)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } ArraySelectOp ArraySelectOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value array, ::mlir::Value index) { return create(builder, builder.getLoc(), std::forward(array), std::forward(index)); } void ArraySelectOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value array, ::mlir::Value index) { odsState.addOperands(array); odsState.addOperands(index); assert(resultTypes.size() == 1u && "mismatched number of results"); odsState.addTypes(resultTypes); } ArraySelectOp ArraySelectOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value array, ::mlir::Value index) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(resultTypes), std::forward(array), std::forward(index)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } ArraySelectOp ArraySelectOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value array, ::mlir::Value index) { return create(builder, builder.getLoc(), std::forward(resultTypes), std::forward(array), std::forward(index)); } void ArraySelectOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { assert(operands.size() == 2u && "mismatched number of parameters"); odsState.addOperands(operands); odsState.addAttributes(attributes); assert(resultTypes.size() == 1u && "mismatched number of return types"); odsState.addTypes(resultTypes); } ArraySelectOp ArraySelectOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(resultTypes), std::forward(operands), std::forward(attributes)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } ArraySelectOp ArraySelectOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { return create(builder, builder.getLoc(), std::forward(resultTypes), std::forward(operands), std::forward(attributes)); } void ArraySelectOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { assert(operands.size() == 2u && "mismatched number of parameters"); odsState.addOperands(operands); odsState.addAttributes(attributes); ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes; if (::mlir::succeeded(ArraySelectOp::inferReturnTypes(odsBuilder.getContext(), odsState.location, operands, odsState.attributes.getDictionary(odsState.getContext()), odsState.getRawProperties(), odsState.regions, inferredReturnTypes))) { assert(inferredReturnTypes.size() == 1u && "mismatched number of return types"); odsState.addTypes(inferredReturnTypes); } else { ::llvm::report_fatal_error("Failed to infer result type(s)."); } } ArraySelectOp ArraySelectOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(operands), std::forward(attributes)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } ArraySelectOp ArraySelectOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { return create(builder, builder.getLoc(), std::forward(operands), std::forward(attributes)); } void ArraySelectOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { assert(operands.size() == 2u && "mismatched number of parameters"); odsState.addOperands(operands); odsState.useProperties(const_cast(properties)); odsState.addAttributes(discardableAttributes); assert(resultTypes.size() == 1u && "mismatched number of return types"); odsState.addTypes(resultTypes); } ArraySelectOp ArraySelectOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(resultTypes), std::forward(operands), std::forward(properties), std::forward(discardableAttributes)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } ArraySelectOp ArraySelectOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { return create(builder, builder.getLoc(), std::forward(resultTypes), std::forward(operands), std::forward(properties), std::forward(discardableAttributes)); } void ArraySelectOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { assert(operands.size() == 2u && "mismatched number of parameters"); odsState.addOperands(operands); odsState.useProperties(const_cast(properties)); odsState.addAttributes(discardableAttributes); ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes; if (::mlir::succeeded(ArraySelectOp::inferReturnTypes(odsBuilder.getContext(), odsState.location, operands, odsState.attributes.getDictionary(odsState.getContext()), odsState.getRawProperties(), odsState.regions, inferredReturnTypes))) { assert(inferredReturnTypes.size() == 1u && "mismatched number of return types"); odsState.addTypes(inferredReturnTypes); } else { ::llvm::report_fatal_error("Failed to infer result type(s)."); } } ArraySelectOp ArraySelectOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(operands), std::forward(properties), std::forward(discardableAttributes)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } ArraySelectOp ArraySelectOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { return create(builder, builder.getLoc(), std::forward(operands), std::forward(properties), std::forward(discardableAttributes)); } ::llvm::LogicalResult ArraySelectOp::verifyInvariantsImpl() { { unsigned index = 0; (void)index; auto valueGroup0 = getODSOperands(0); for (auto v : valueGroup0) { if (::mlir::failed(__mlir_ods_local_type_constraint_SMT7(*this, v.getType(), "operand", index++))) return ::mlir::failure(); } auto valueGroup1 = getODSOperands(1); for (auto v : valueGroup1) { if (::mlir::failed(__mlir_ods_local_type_constraint_SMT6(*this, v.getType(), "operand", index++))) return ::mlir::failure(); } } { unsigned index = 0; (void)index; auto valueGroup0 = getODSResults(0); for (auto v : valueGroup0) { if (::mlir::failed(__mlir_ods_local_type_constraint_SMT6(*this, v.getType(), "result", index++))) return ::mlir::failure(); } } if (!((std::equal_to<>()(cast((*this->getODSOperands(0).begin()).getType()).getDomainType(), (*this->getODSOperands(1).begin()).getType())))) return emitOpError("failed to verify that summary"); if (!((std::equal_to<>()(cast((*this->getODSOperands(0).begin()).getType()).getRangeType(), (*this->getODSResults(0).begin()).getType())))) return emitOpError("failed to verify that summary"); return ::mlir::success(); } ::llvm::LogicalResult ArraySelectOp::verifyInvariants() { return verifyInvariantsImpl(); } ::llvm::LogicalResult ArraySelectOp::inferReturnTypes(::mlir::MLIRContext *context, ::std::optional<::mlir::Location> location, ::mlir::ValueRange operands, ::mlir::DictionaryAttr attributes, ::mlir::PropertyRef properties, ::mlir::RegionRange regions, ::llvm::SmallVectorImpl<::mlir::Type>&inferredReturnTypes) { inferredReturnTypes.resize(1); ::mlir::Builder odsBuilder(context); if (operands.size() <= 0) return ::mlir::failure(); ::mlir::Type odsInferredType0 = cast(operands[0].getType()).getRangeType(); inferredReturnTypes[0] = odsInferredType0; return ::mlir::success(); } ::mlir::ParseResult ArraySelectOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) { ::mlir::OpAsmParser::UnresolvedOperand arrayRawOperand{}; ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> arrayOperands(&arrayRawOperand, 1); ::llvm::SMLoc arrayOperandsLoc; (void)arrayOperandsLoc; ::mlir::OpAsmParser::UnresolvedOperand indexRawOperand{}; ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> indexOperands(&indexRawOperand, 1); ::llvm::SMLoc indexOperandsLoc; (void)indexOperandsLoc; ::mlir::Type arrayRawType{}; ::llvm::ArrayRef<::mlir::Type> arrayTypes(&arrayRawType, 1); arrayOperandsLoc = parser.getCurrentLocation(); if (parser.parseOperand(arrayRawOperand)) return ::mlir::failure(); if (parser.parseLSquare()) return ::mlir::failure(); indexOperandsLoc = parser.getCurrentLocation(); if (parser.parseOperand(indexRawOperand)) return ::mlir::failure(); if (parser.parseRSquare()) return ::mlir::failure(); { auto loc = parser.getCurrentLocation();(void)loc; if (parser.parseOptionalAttrDict(result.attributes)) return ::mlir::failure(); if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() { return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op "; }))) return ::mlir::failure(); } if (parser.parseColon()) return ::mlir::failure(); if (parser.parseType(arrayRawType)) return ::mlir::failure(); for (::mlir::Type type : arrayTypes) { (void)type; if (!((::llvm::isa(type)))) { return parser.emitError(parser.getNameLoc()) << "'array' must be , but got " << type; } } result.addTypes(cast(arrayTypes[0]).getRangeType()); if (parser.resolveOperands(arrayOperands, arrayTypes, arrayOperandsLoc, result.operands)) return ::mlir::failure(); if (parser.resolveOperands(indexOperands, cast(arrayTypes[0]).getDomainType(), indexOperandsLoc, result.operands)) return ::mlir::failure(); return ::mlir::success(); } void ArraySelectOp::print(::mlir::OpAsmPrinter &_odsPrinter) { _odsPrinter << ' '; _odsPrinter << getArray(); _odsPrinter << "["; _odsPrinter << getIndex(); _odsPrinter << "]"; ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs; _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs); _odsPrinter << ' ' << ":"; _odsPrinter << ' '; _odsPrinter << getArray().getType(); } void ArraySelectOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) { } } // namespace mlir::smt MLIR_DEFINE_EXPLICIT_TYPE_ID(mlir::smt::ArraySelectOp) namespace mlir::smt { //===----------------------------------------------------------------------===// // mlir::smt::ArrayStoreOp definitions //===----------------------------------------------------------------------===// namespace detail { ArrayStoreOpGenericAdaptorBase::ArrayStoreOpGenericAdaptorBase(ArrayStoreOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {} } // namespace detail ArrayStoreOpAdaptor::ArrayStoreOpAdaptor(ArrayStoreOp op) : ArrayStoreOpGenericAdaptor(op->getOperands(), op) {} ::llvm::LogicalResult ArrayStoreOpAdaptor::verify(::mlir::Location loc) { return ::mlir::success(); } ::llvm::LogicalResult ArrayStoreOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) { ::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr); if (!dict) { emitError() << "expected DictionaryAttr to set properties"; return ::mlir::failure(); } return ::mlir::success(); } ::mlir::Attribute ArrayStoreOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) { ::mlir::SmallVector<::mlir::NamedAttribute> attrs; ::mlir::Builder odsBuilder{ctx}; if (!attrs.empty()) return odsBuilder.getDictionaryAttr(attrs); return {}; } llvm::hash_code ArrayStoreOp::computePropertiesHash(const Properties &prop) { using llvm::hash_value; return llvm::hash_combine(); } std::optional ArrayStoreOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) { return std::nullopt; } void ArrayStoreOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) { } void ArrayStoreOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) { } ::llvm::LogicalResult ArrayStoreOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) { return ::mlir::success(); } void ArrayStoreOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value array, ::mlir::Value index, ::mlir::Value value) { odsState.addOperands(array); odsState.addOperands(index); odsState.addOperands(value); odsState.addTypes(result); } ArrayStoreOp ArrayStoreOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value array, ::mlir::Value index, ::mlir::Value value) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(result), std::forward(array), std::forward(index), std::forward(value)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } ArrayStoreOp ArrayStoreOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::Value array, ::mlir::Value index, ::mlir::Value value) { return create(builder, builder.getLoc(), std::forward(result), std::forward(array), std::forward(index), std::forward(value)); } void ArrayStoreOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value array, ::mlir::Value index, ::mlir::Value value) { odsState.addOperands(array); odsState.addOperands(index); odsState.addOperands(value); ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes; if (::mlir::succeeded(ArrayStoreOp::inferReturnTypes(odsBuilder.getContext(), odsState.location, odsState.operands, odsState.attributes.getDictionary(odsState.getContext()), odsState.getRawProperties(), odsState.regions, inferredReturnTypes))) odsState.addTypes(inferredReturnTypes); else ::mlir::detail::reportFatalInferReturnTypesError(odsState); } ArrayStoreOp ArrayStoreOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value array, ::mlir::Value index, ::mlir::Value value) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(array), std::forward(index), std::forward(value)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } ArrayStoreOp ArrayStoreOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value array, ::mlir::Value index, ::mlir::Value value) { return create(builder, builder.getLoc(), std::forward(array), std::forward(index), std::forward(value)); } void ArrayStoreOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value array, ::mlir::Value index, ::mlir::Value value) { odsState.addOperands(array); odsState.addOperands(index); odsState.addOperands(value); assert(resultTypes.size() == 1u && "mismatched number of results"); odsState.addTypes(resultTypes); } ArrayStoreOp ArrayStoreOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value array, ::mlir::Value index, ::mlir::Value value) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(resultTypes), std::forward(array), std::forward(index), std::forward(value)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } ArrayStoreOp ArrayStoreOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value array, ::mlir::Value index, ::mlir::Value value) { return create(builder, builder.getLoc(), std::forward(resultTypes), std::forward(array), std::forward(index), std::forward(value)); } void ArrayStoreOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { assert(operands.size() == 3u && "mismatched number of parameters"); odsState.addOperands(operands); odsState.addAttributes(attributes); assert(resultTypes.size() == 1u && "mismatched number of return types"); odsState.addTypes(resultTypes); } ArrayStoreOp ArrayStoreOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(resultTypes), std::forward(operands), std::forward(attributes)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } ArrayStoreOp ArrayStoreOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { return create(builder, builder.getLoc(), std::forward(resultTypes), std::forward(operands), std::forward(attributes)); } void ArrayStoreOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { assert(operands.size() == 3u && "mismatched number of parameters"); odsState.addOperands(operands); odsState.addAttributes(attributes); ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes; if (::mlir::succeeded(ArrayStoreOp::inferReturnTypes(odsBuilder.getContext(), odsState.location, operands, odsState.attributes.getDictionary(odsState.getContext()), odsState.getRawProperties(), odsState.regions, inferredReturnTypes))) { assert(inferredReturnTypes.size() == 1u && "mismatched number of return types"); odsState.addTypes(inferredReturnTypes); } else { ::llvm::report_fatal_error("Failed to infer result type(s)."); } } ArrayStoreOp ArrayStoreOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(operands), std::forward(attributes)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } ArrayStoreOp ArrayStoreOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { return create(builder, builder.getLoc(), std::forward(operands), std::forward(attributes)); } void ArrayStoreOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { assert(operands.size() == 3u && "mismatched number of parameters"); odsState.addOperands(operands); odsState.useProperties(const_cast(properties)); odsState.addAttributes(discardableAttributes); assert(resultTypes.size() == 1u && "mismatched number of return types"); odsState.addTypes(resultTypes); } ArrayStoreOp ArrayStoreOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(resultTypes), std::forward(operands), std::forward(properties), std::forward(discardableAttributes)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } ArrayStoreOp ArrayStoreOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { return create(builder, builder.getLoc(), std::forward(resultTypes), std::forward(operands), std::forward(properties), std::forward(discardableAttributes)); } void ArrayStoreOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { assert(operands.size() == 3u && "mismatched number of parameters"); odsState.addOperands(operands); odsState.useProperties(const_cast(properties)); odsState.addAttributes(discardableAttributes); ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes; if (::mlir::succeeded(ArrayStoreOp::inferReturnTypes(odsBuilder.getContext(), odsState.location, operands, odsState.attributes.getDictionary(odsState.getContext()), odsState.getRawProperties(), odsState.regions, inferredReturnTypes))) { assert(inferredReturnTypes.size() == 1u && "mismatched number of return types"); odsState.addTypes(inferredReturnTypes); } else { ::llvm::report_fatal_error("Failed to infer result type(s)."); } } ArrayStoreOp ArrayStoreOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(operands), std::forward(properties), std::forward(discardableAttributes)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } ArrayStoreOp ArrayStoreOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { return create(builder, builder.getLoc(), std::forward(operands), std::forward(properties), std::forward(discardableAttributes)); } ::llvm::LogicalResult ArrayStoreOp::verifyInvariantsImpl() { { unsigned index = 0; (void)index; auto valueGroup0 = getODSOperands(0); for (auto v : valueGroup0) { if (::mlir::failed(__mlir_ods_local_type_constraint_SMT7(*this, v.getType(), "operand", index++))) return ::mlir::failure(); } auto valueGroup1 = getODSOperands(1); for (auto v : valueGroup1) { if (::mlir::failed(__mlir_ods_local_type_constraint_SMT6(*this, v.getType(), "operand", index++))) return ::mlir::failure(); } auto valueGroup2 = getODSOperands(2); for (auto v : valueGroup2) { if (::mlir::failed(__mlir_ods_local_type_constraint_SMT6(*this, v.getType(), "operand", index++))) return ::mlir::failure(); } } { unsigned index = 0; (void)index; auto valueGroup0 = getODSResults(0); for (auto v : valueGroup0) { if (::mlir::failed(__mlir_ods_local_type_constraint_SMT7(*this, v.getType(), "result", index++))) return ::mlir::failure(); } } if (!((std::equal_to<>()(cast((*this->getODSOperands(0).begin()).getType()).getDomainType(), (*this->getODSOperands(1).begin()).getType())))) return emitOpError("failed to verify that summary"); if (!((std::equal_to<>()(cast((*this->getODSOperands(0).begin()).getType()).getRangeType(), (*this->getODSOperands(2).begin()).getType())))) return emitOpError("failed to verify that summary"); if (!((((*this->getODSOperands(0).begin()).getType()) == ((*this->getODSResults(0).begin()).getType()) && ((*this->getODSResults(0).begin()).getType()) == ((*this->getODSOperands(0).begin()).getType())))) return emitOpError("failed to verify that all of {array, result} have same type"); return ::mlir::success(); } ::llvm::LogicalResult ArrayStoreOp::verifyInvariants() { return verifyInvariantsImpl(); } ::llvm::LogicalResult ArrayStoreOp::inferReturnTypes(::mlir::MLIRContext *context, ::std::optional<::mlir::Location> location, ::mlir::ValueRange operands, ::mlir::DictionaryAttr attributes, ::mlir::PropertyRef properties, ::mlir::RegionRange regions, ::llvm::SmallVectorImpl<::mlir::Type>&inferredReturnTypes) { inferredReturnTypes.resize(1); ::mlir::Builder odsBuilder(context); if (operands.size() <= 0) return ::mlir::failure(); ::mlir::Type odsInferredType0 = operands[0].getType(); inferredReturnTypes[0] = odsInferredType0; return ::mlir::success(); } ::mlir::ParseResult ArrayStoreOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) { ::mlir::OpAsmParser::UnresolvedOperand arrayRawOperand{}; ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> arrayOperands(&arrayRawOperand, 1); ::llvm::SMLoc arrayOperandsLoc; (void)arrayOperandsLoc; ::mlir::OpAsmParser::UnresolvedOperand indexRawOperand{}; ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> indexOperands(&indexRawOperand, 1); ::llvm::SMLoc indexOperandsLoc; (void)indexOperandsLoc; ::mlir::OpAsmParser::UnresolvedOperand valueRawOperand{}; ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> valueOperands(&valueRawOperand, 1); ::llvm::SMLoc valueOperandsLoc; (void)valueOperandsLoc; ::mlir::Type arrayRawType{}; ::llvm::ArrayRef<::mlir::Type> arrayTypes(&arrayRawType, 1); arrayOperandsLoc = parser.getCurrentLocation(); if (parser.parseOperand(arrayRawOperand)) return ::mlir::failure(); if (parser.parseLSquare()) return ::mlir::failure(); indexOperandsLoc = parser.getCurrentLocation(); if (parser.parseOperand(indexRawOperand)) return ::mlir::failure(); if (parser.parseRSquare()) return ::mlir::failure(); if (parser.parseComma()) return ::mlir::failure(); valueOperandsLoc = parser.getCurrentLocation(); if (parser.parseOperand(valueRawOperand)) return ::mlir::failure(); { auto loc = parser.getCurrentLocation();(void)loc; if (parser.parseOptionalAttrDict(result.attributes)) return ::mlir::failure(); if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() { return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op "; }))) return ::mlir::failure(); } if (parser.parseColon()) return ::mlir::failure(); if (parser.parseType(arrayRawType)) return ::mlir::failure(); for (::mlir::Type type : arrayTypes) { (void)type; if (!((::llvm::isa(type)))) { return parser.emitError(parser.getNameLoc()) << "'array' must be , but got " << type; } } result.addTypes(arrayTypes[0]); if (parser.resolveOperands(arrayOperands, arrayTypes, arrayOperandsLoc, result.operands)) return ::mlir::failure(); if (parser.resolveOperands(indexOperands, cast(arrayTypes[0]).getDomainType(), indexOperandsLoc, result.operands)) return ::mlir::failure(); if (parser.resolveOperands(valueOperands, cast(arrayTypes[0]).getRangeType(), valueOperandsLoc, result.operands)) return ::mlir::failure(); return ::mlir::success(); } void ArrayStoreOp::print(::mlir::OpAsmPrinter &_odsPrinter) { _odsPrinter << ' '; _odsPrinter << getArray(); _odsPrinter << "["; _odsPrinter << getIndex(); _odsPrinter << "]"; _odsPrinter << ","; _odsPrinter << ' '; _odsPrinter << getValue(); ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs; _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs); _odsPrinter << ' ' << ":"; _odsPrinter << ' '; _odsPrinter << getArray().getType(); } void ArrayStoreOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) { } } // namespace mlir::smt MLIR_DEFINE_EXPLICIT_TYPE_ID(mlir::smt::ArrayStoreOp) namespace mlir::smt { //===----------------------------------------------------------------------===// // mlir::smt::AssertOp definitions //===----------------------------------------------------------------------===// namespace detail { AssertOpGenericAdaptorBase::AssertOpGenericAdaptorBase(AssertOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {} } // namespace detail AssertOpAdaptor::AssertOpAdaptor(AssertOp op) : AssertOpGenericAdaptor(op->getOperands(), op) {} ::llvm::LogicalResult AssertOpAdaptor::verify(::mlir::Location loc) { return ::mlir::success(); } ::llvm::LogicalResult AssertOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) { ::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr); if (!dict) { emitError() << "expected DictionaryAttr to set properties"; return ::mlir::failure(); } return ::mlir::success(); } ::mlir::Attribute AssertOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) { ::mlir::SmallVector<::mlir::NamedAttribute> attrs; ::mlir::Builder odsBuilder{ctx}; if (!attrs.empty()) return odsBuilder.getDictionaryAttr(attrs); return {}; } llvm::hash_code AssertOp::computePropertiesHash(const Properties &prop) { using llvm::hash_value; return llvm::hash_combine(); } std::optional AssertOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) { return std::nullopt; } void AssertOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) { } void AssertOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) { } ::llvm::LogicalResult AssertOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) { return ::mlir::success(); } void AssertOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value input) { odsState.addOperands(input); } AssertOp AssertOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value input) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(input)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } AssertOp AssertOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value input) { return create(builder, builder.getLoc(), std::forward(input)); } void AssertOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input) { odsState.addOperands(input); assert(resultTypes.size() == 0u && "mismatched number of results"); odsState.addTypes(resultTypes); } AssertOp AssertOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value input) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(resultTypes), std::forward(input)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } AssertOp AssertOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value input) { return create(builder, builder.getLoc(), std::forward(resultTypes), std::forward(input)); } void AssertOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { assert(operands.size() == 1u && "mismatched number of parameters"); odsState.addOperands(operands); odsState.addAttributes(attributes); assert(resultTypes.size() == 0u && "mismatched number of return types"); odsState.addTypes(resultTypes); } AssertOp AssertOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(resultTypes), std::forward(operands), std::forward(attributes)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } AssertOp AssertOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { return create(builder, builder.getLoc(), std::forward(resultTypes), std::forward(operands), std::forward(attributes)); } void AssertOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { assert(operands.size() == 1u && "mismatched number of parameters"); odsState.addOperands(operands); odsState.useProperties(const_cast(properties)); odsState.addAttributes(discardableAttributes); assert(resultTypes.size() == 0u && "mismatched number of return types"); odsState.addTypes(resultTypes); } AssertOp AssertOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(resultTypes), std::forward(operands), std::forward(properties), std::forward(discardableAttributes)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } AssertOp AssertOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { return create(builder, builder.getLoc(), std::forward(resultTypes), std::forward(operands), std::forward(properties), std::forward(discardableAttributes)); } ::llvm::LogicalResult AssertOp::verifyInvariantsImpl() { { unsigned index = 0; (void)index; auto valueGroup0 = getODSOperands(0); for (auto v : valueGroup0) { if (::mlir::failed(__mlir_ods_local_type_constraint_SMT2(*this, v.getType(), "operand", index++))) return ::mlir::failure(); } } return ::mlir::success(); } ::llvm::LogicalResult AssertOp::verifyInvariants() { return verifyInvariantsImpl(); } ::mlir::ParseResult AssertOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) { ::mlir::OpAsmParser::UnresolvedOperand inputRawOperand{}; ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> inputOperands(&inputRawOperand, 1); ::llvm::SMLoc inputOperandsLoc; (void)inputOperandsLoc; inputOperandsLoc = parser.getCurrentLocation(); if (parser.parseOperand(inputRawOperand)) return ::mlir::failure(); { auto loc = parser.getCurrentLocation();(void)loc; if (parser.parseOptionalAttrDict(result.attributes)) return ::mlir::failure(); if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() { return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op "; }))) return ::mlir::failure(); } ::mlir::Type odsBuildableType0 = parser.getBuilder().getType(); if (parser.resolveOperands(inputOperands, odsBuildableType0, inputOperandsLoc, result.operands)) return ::mlir::failure(); return ::mlir::success(); } void AssertOp::print(::mlir::OpAsmPrinter &_odsPrinter) { _odsPrinter << ' '; _odsPrinter << getInput(); ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs; _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs); } } // namespace mlir::smt MLIR_DEFINE_EXPLICIT_TYPE_ID(mlir::smt::AssertOp) namespace mlir::smt { //===----------------------------------------------------------------------===// // mlir::smt::BV2IntOp definitions //===----------------------------------------------------------------------===// namespace detail { BV2IntOpGenericAdaptorBase::BV2IntOpGenericAdaptorBase(BV2IntOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {} ::mlir::UnitAttr BV2IntOpGenericAdaptorBase::getIsSignedAttr() { auto attr = ::llvm::dyn_cast_or_null<::mlir::UnitAttr>(getProperties().is_signed); if (!attr) attr = ((false) ? ::mlir::Builder(odsAttrs.getContext()).getUnitAttr() : nullptr); return attr; } bool BV2IntOpGenericAdaptorBase::getIsSigned() { auto attr = getIsSignedAttr(); if (!attr) return ((false) ? ::mlir::Builder(odsAttrs.getContext()).getUnitAttr() : nullptr) != nullptr; return attr != nullptr; } } // namespace detail BV2IntOpAdaptor::BV2IntOpAdaptor(BV2IntOp op) : BV2IntOpGenericAdaptor(op->getOperands(), op) {} ::llvm::LogicalResult BV2IntOpAdaptor::verify(::mlir::Location loc) { auto tblgen_is_signed = getProperties().is_signed; (void)tblgen_is_signed; if (tblgen_is_signed && !((::llvm::isa<::mlir::UnitAttr>(tblgen_is_signed)))) return emitError(loc, "'smt.bv2int' op attribute 'is_signed' failed to satisfy constraint: unit attribute"); return ::mlir::success(); } ::llvm::LogicalResult BV2IntOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) { ::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr); if (!dict) { emitError() << "expected DictionaryAttr to set properties"; return ::mlir::failure(); } { auto &propStorage = prop.is_signed; auto attr = dict.get("is_signed"); if (attr) { auto convertedAttr = ::llvm::dyn_cast>(attr); if (convertedAttr) { propStorage = convertedAttr; } else { emitError() << "Invalid attribute `is_signed` in property conversion: " << attr; return ::mlir::failure(); } } } return ::mlir::success(); } ::mlir::Attribute BV2IntOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) { ::mlir::SmallVector<::mlir::NamedAttribute> attrs; ::mlir::Builder odsBuilder{ctx}; { const auto &propStorage = prop.is_signed; if (propStorage) attrs.push_back(odsBuilder.getNamedAttr("is_signed", propStorage)); } if (!attrs.empty()) return odsBuilder.getDictionaryAttr(attrs); return {}; } llvm::hash_code BV2IntOp::computePropertiesHash(const Properties &prop) { using llvm::hash_value; return llvm::hash_combine( llvm::hash_value(prop.is_signed.getAsOpaquePointer())); } std::optional BV2IntOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) { if (name == "is_signed") return prop.is_signed; return std::nullopt; } void BV2IntOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) { if (name == "is_signed") { prop.is_signed = ::llvm::dyn_cast_or_null>(value); return; } } void BV2IntOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) { if (prop.is_signed) attrs.append("is_signed", prop.is_signed); } ::llvm::LogicalResult BV2IntOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) { { ::mlir::Attribute attr = attrs.get(getIsSignedAttrName(opName)); if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_SMT1(attr, "is_signed", emitError))) return ::mlir::failure(); } return ::mlir::success(); } ::llvm::LogicalResult BV2IntOp::readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state) { auto &prop = state.getOrAddProperties(); (void)prop; if (::mlir::failed(reader.readOptionalAttribute(prop.is_signed))) return ::mlir::failure(); return ::mlir::success(); } void BV2IntOp::writeProperties(::mlir::DialectBytecodeWriter &writer) { auto &prop = getProperties(); (void)prop; writer.writeOptionalAttribute(prop.is_signed); } bool BV2IntOp::getIsSigned() { auto attr = getIsSignedAttr(); if (!attr) return ((false) ? ::mlir::Builder((*this)->getContext()).getUnitAttr() : nullptr) != nullptr; return attr != nullptr; } void BV2IntOp::setIsSigned(bool attrValue) { auto &odsProp = getProperties().is_signed; if (attrValue) odsProp = ((attrValue) ? ::mlir::Builder((*this)->getContext()).getUnitAttr() : nullptr); else odsProp = nullptr; } void BV2IntOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value input, /*optional*/::mlir::UnitAttr is_signed) { odsState.addOperands(input); if (is_signed) { odsState.getOrAddProperties().is_signed = is_signed; } odsState.addTypes(result); } BV2IntOp BV2IntOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value input, /*optional*/::mlir::UnitAttr is_signed) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(result), std::forward(input), std::forward(is_signed)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } BV2IntOp BV2IntOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::Value input, /*optional*/::mlir::UnitAttr is_signed) { return create(builder, builder.getLoc(), std::forward(result), std::forward(input), std::forward(is_signed)); } void BV2IntOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value input, /*optional*/::mlir::UnitAttr is_signed) { odsState.addOperands(input); if (is_signed) { odsState.getOrAddProperties().is_signed = is_signed; } ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes; if (::mlir::succeeded(BV2IntOp::inferReturnTypes(odsBuilder.getContext(), odsState.location, odsState.operands, odsState.attributes.getDictionary(odsState.getContext()), odsState.getRawProperties(), odsState.regions, inferredReturnTypes))) odsState.addTypes(inferredReturnTypes); else ::mlir::detail::reportFatalInferReturnTypesError(odsState); } BV2IntOp BV2IntOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value input, /*optional*/::mlir::UnitAttr is_signed) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(input), std::forward(is_signed)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } BV2IntOp BV2IntOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value input, /*optional*/::mlir::UnitAttr is_signed) { return create(builder, builder.getLoc(), std::forward(input), std::forward(is_signed)); } void BV2IntOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input, /*optional*/::mlir::UnitAttr is_signed) { odsState.addOperands(input); if (is_signed) { odsState.getOrAddProperties().is_signed = is_signed; } assert(resultTypes.size() == 1u && "mismatched number of results"); odsState.addTypes(resultTypes); } BV2IntOp BV2IntOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value input, /*optional*/::mlir::UnitAttr is_signed) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(resultTypes), std::forward(input), std::forward(is_signed)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } BV2IntOp BV2IntOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value input, /*optional*/::mlir::UnitAttr is_signed) { return create(builder, builder.getLoc(), std::forward(resultTypes), std::forward(input), std::forward(is_signed)); } void BV2IntOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value input, /*optional*/bool is_signed) { odsState.addOperands(input); if (is_signed) { odsState.getOrAddProperties().is_signed = ((is_signed) ? odsBuilder.getUnitAttr() : nullptr); } odsState.addTypes(result); } BV2IntOp BV2IntOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value input, /*optional*/bool is_signed) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(result), std::forward(input), std::forward(is_signed)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } BV2IntOp BV2IntOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::Value input, /*optional*/bool is_signed) { return create(builder, builder.getLoc(), std::forward(result), std::forward(input), std::forward(is_signed)); } void BV2IntOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value input, /*optional*/bool is_signed) { odsState.addOperands(input); if (is_signed) { odsState.getOrAddProperties().is_signed = ((is_signed) ? odsBuilder.getUnitAttr() : nullptr); } ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes; if (::mlir::succeeded(BV2IntOp::inferReturnTypes(odsBuilder.getContext(), odsState.location, odsState.operands, odsState.attributes.getDictionary(odsState.getContext()), odsState.getRawProperties(), odsState.regions, inferredReturnTypes))) odsState.addTypes(inferredReturnTypes); else ::mlir::detail::reportFatalInferReturnTypesError(odsState); } BV2IntOp BV2IntOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value input, /*optional*/bool is_signed) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(input), std::forward(is_signed)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } BV2IntOp BV2IntOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value input, /*optional*/bool is_signed) { return create(builder, builder.getLoc(), std::forward(input), std::forward(is_signed)); } void BV2IntOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input, /*optional*/bool is_signed) { odsState.addOperands(input); if (is_signed) { odsState.getOrAddProperties().is_signed = ((is_signed) ? odsBuilder.getUnitAttr() : nullptr); } assert(resultTypes.size() == 1u && "mismatched number of results"); odsState.addTypes(resultTypes); } BV2IntOp BV2IntOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value input, /*optional*/bool is_signed) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(resultTypes), std::forward(input), std::forward(is_signed)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } BV2IntOp BV2IntOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value input, /*optional*/bool is_signed) { return create(builder, builder.getLoc(), std::forward(resultTypes), std::forward(input), std::forward(is_signed)); } void BV2IntOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { assert(operands.size() == 1u && "mismatched number of parameters"); odsState.addOperands(operands); odsState.addAttributes(attributes); assert(resultTypes.size() == 1u && "mismatched number of return types"); odsState.addTypes(resultTypes); if (!attributes.empty()) { (void)odsState.getOrAddProperties(); ::mlir::PropertyRef properties = odsState.getRawProperties(); std::optional<::mlir::RegisteredOperationName> info = odsState.name.getRegisteredInfo(); if (failed(info->setOpPropertiesFromAttribute(odsState.name, properties, odsState.attributes.getDictionary(odsState.getContext()), nullptr))) ::llvm::report_fatal_error("Property conversion failed."); } } BV2IntOp BV2IntOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(resultTypes), std::forward(operands), std::forward(attributes)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } BV2IntOp BV2IntOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { return create(builder, builder.getLoc(), std::forward(resultTypes), std::forward(operands), std::forward(attributes)); } void BV2IntOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { assert(operands.size() == 1u && "mismatched number of parameters"); odsState.addOperands(operands); odsState.addAttributes(attributes); if (!attributes.empty()) { (void)odsState.getOrAddProperties(); ::mlir::PropertyRef properties = odsState.getRawProperties(); std::optional<::mlir::RegisteredOperationName> info = odsState.name.getRegisteredInfo(); if (failed(info->setOpPropertiesFromAttribute(odsState.name, properties, odsState.attributes.getDictionary(odsState.getContext()), nullptr))) ::llvm::report_fatal_error("Property conversion failed."); } ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes; if (::mlir::succeeded(BV2IntOp::inferReturnTypes(odsBuilder.getContext(), odsState.location, operands, odsState.attributes.getDictionary(odsState.getContext()), odsState.getRawProperties(), odsState.regions, inferredReturnTypes))) { assert(inferredReturnTypes.size() == 1u && "mismatched number of return types"); odsState.addTypes(inferredReturnTypes); } else { ::llvm::report_fatal_error("Failed to infer result type(s)."); } } BV2IntOp BV2IntOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(operands), std::forward(attributes)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } BV2IntOp BV2IntOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { return create(builder, builder.getLoc(), std::forward(operands), std::forward(attributes)); } void BV2IntOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { assert(operands.size() == 1u && "mismatched number of parameters"); odsState.addOperands(operands); odsState.useProperties(const_cast(properties)); odsState.addAttributes(discardableAttributes); assert(resultTypes.size() == 1u && "mismatched number of return types"); odsState.addTypes(resultTypes); } BV2IntOp BV2IntOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(resultTypes), std::forward(operands), std::forward(properties), std::forward(discardableAttributes)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } BV2IntOp BV2IntOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { return create(builder, builder.getLoc(), std::forward(resultTypes), std::forward(operands), std::forward(properties), std::forward(discardableAttributes)); } void BV2IntOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { assert(operands.size() == 1u && "mismatched number of parameters"); odsState.addOperands(operands); odsState.useProperties(const_cast(properties)); odsState.addAttributes(discardableAttributes); ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes; if (::mlir::succeeded(BV2IntOp::inferReturnTypes(odsBuilder.getContext(), odsState.location, operands, odsState.attributes.getDictionary(odsState.getContext()), odsState.getRawProperties(), odsState.regions, inferredReturnTypes))) { assert(inferredReturnTypes.size() == 1u && "mismatched number of return types"); odsState.addTypes(inferredReturnTypes); } else { ::llvm::report_fatal_error("Failed to infer result type(s)."); } } BV2IntOp BV2IntOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(operands), std::forward(properties), std::forward(discardableAttributes)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } BV2IntOp BV2IntOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { return create(builder, builder.getLoc(), std::forward(operands), std::forward(properties), std::forward(discardableAttributes)); } ::llvm::LogicalResult BV2IntOp::verifyInvariantsImpl() { auto tblgen_is_signed = getProperties().is_signed; (void)tblgen_is_signed; if (::mlir::failed(__mlir_ods_local_attr_constraint_SMT1(*this, tblgen_is_signed, "is_signed"))) return ::mlir::failure(); { unsigned index = 0; (void)index; auto valueGroup0 = getODSOperands(0); for (auto v : valueGroup0) { if (::mlir::failed(__mlir_ods_local_type_constraint_SMT8(*this, v.getType(), "operand", index++))) return ::mlir::failure(); } } { unsigned index = 0; (void)index; auto valueGroup0 = getODSResults(0); for (auto v : valueGroup0) { if (::mlir::failed(__mlir_ods_local_type_constraint_SMT9(*this, v.getType(), "result", index++))) return ::mlir::failure(); } } return ::mlir::success(); } ::llvm::LogicalResult BV2IntOp::verifyInvariants() { return verifyInvariantsImpl(); } ::llvm::LogicalResult BV2IntOp::inferReturnTypes(::mlir::MLIRContext *context, ::std::optional<::mlir::Location> location, ::mlir::ValueRange operands, ::mlir::DictionaryAttr attributes, ::mlir::PropertyRef properties, ::mlir::RegionRange regions, ::llvm::SmallVectorImpl<::mlir::Type>&inferredReturnTypes) { inferredReturnTypes.resize(1); ::mlir::Builder odsBuilder(context); ::mlir::Type odsInferredType0 = odsBuilder.getType(); inferredReturnTypes[0] = odsInferredType0; return ::mlir::success(); } ::mlir::ParseResult BV2IntOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) { ::mlir::OpAsmParser::UnresolvedOperand inputRawOperand{}; ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> inputOperands(&inputRawOperand, 1); ::llvm::SMLoc inputOperandsLoc; (void)inputOperandsLoc; ::mlir::Type inputRawType{}; ::llvm::ArrayRef<::mlir::Type> inputTypes(&inputRawType, 1); inputOperandsLoc = parser.getCurrentLocation(); if (parser.parseOperand(inputRawOperand)) return ::mlir::failure(); if (::mlir::succeeded(parser.parseOptionalKeyword("signed"))) { result.getOrAddProperties().is_signed = parser.getBuilder().getUnitAttr(); } { auto loc = parser.getCurrentLocation();(void)loc; if (parser.parseOptionalAttrDict(result.attributes)) return ::mlir::failure(); if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() { return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op "; }))) return ::mlir::failure(); } if (parser.parseColon()) return ::mlir::failure(); if (parser.parseType(inputRawType)) return ::mlir::failure(); ::mlir::Type odsBuildableType0 = parser.getBuilder().getType(); result.addTypes(odsBuildableType0); if (parser.resolveOperands(inputOperands, inputTypes, inputOperandsLoc, result.operands)) return ::mlir::failure(); return ::mlir::success(); } void BV2IntOp::print(::mlir::OpAsmPrinter &_odsPrinter) { _odsPrinter << ' '; _odsPrinter << getInput(); if ((getIsSignedAttr() && getIsSignedAttr() != ((false) ? ::mlir::OpBuilder((*this)->getContext()).getUnitAttr() : nullptr))) { _odsPrinter << ' ' << "signed"; } ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs; elidedAttrs.push_back("is_signed"); { ::mlir::Builder odsBuilder(getContext()); ::mlir::Attribute attr = getIsSignedAttr(); if(attr && (attr == ((false) ? odsBuilder.getUnitAttr() : nullptr))) elidedAttrs.push_back("is_signed"); } _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs); _odsPrinter << ' ' << ":"; _odsPrinter << ' '; _odsPrinter << getInput().getType(); } void BV2IntOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) { } } // namespace mlir::smt MLIR_DEFINE_EXPLICIT_TYPE_ID(mlir::smt::BV2IntOp) MLIR_DEFINE_EXPLICIT_TYPE_ID(mlir::smt::detail::BV2IntOpGenericAdaptorBase::Properties) namespace mlir::smt { //===----------------------------------------------------------------------===// // mlir::smt::BVAShrOp definitions //===----------------------------------------------------------------------===// namespace detail { BVAShrOpGenericAdaptorBase::BVAShrOpGenericAdaptorBase(BVAShrOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {} } // namespace detail BVAShrOpAdaptor::BVAShrOpAdaptor(BVAShrOp op) : BVAShrOpGenericAdaptor(op->getOperands(), op) {} ::llvm::LogicalResult BVAShrOpAdaptor::verify(::mlir::Location loc) { return ::mlir::success(); } ::llvm::LogicalResult BVAShrOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) { ::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr); if (!dict) { emitError() << "expected DictionaryAttr to set properties"; return ::mlir::failure(); } return ::mlir::success(); } ::mlir::Attribute BVAShrOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) { ::mlir::SmallVector<::mlir::NamedAttribute> attrs; ::mlir::Builder odsBuilder{ctx}; if (!attrs.empty()) return odsBuilder.getDictionaryAttr(attrs); return {}; } llvm::hash_code BVAShrOp::computePropertiesHash(const Properties &prop) { using llvm::hash_value; return llvm::hash_combine(); } std::optional BVAShrOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) { return std::nullopt; } void BVAShrOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) { } void BVAShrOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) { } ::llvm::LogicalResult BVAShrOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) { return ::mlir::success(); } void BVAShrOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs) { odsState.addOperands(lhs); odsState.addOperands(rhs); odsState.addTypes(result); } BVAShrOp BVAShrOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(result), std::forward(lhs), std::forward(rhs)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } BVAShrOp BVAShrOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs) { return create(builder, builder.getLoc(), std::forward(result), std::forward(lhs), std::forward(rhs)); } void BVAShrOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value lhs, ::mlir::Value rhs) { odsState.addOperands(lhs); odsState.addOperands(rhs); ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes; if (::mlir::succeeded(BVAShrOp::inferReturnTypes(odsBuilder.getContext(), odsState.location, odsState.operands, odsState.attributes.getDictionary(odsState.getContext()), odsState.getRawProperties(), odsState.regions, inferredReturnTypes))) odsState.addTypes(inferredReturnTypes); else ::mlir::detail::reportFatalInferReturnTypesError(odsState); } BVAShrOp BVAShrOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value lhs, ::mlir::Value rhs) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(lhs), std::forward(rhs)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } BVAShrOp BVAShrOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value lhs, ::mlir::Value rhs) { return create(builder, builder.getLoc(), std::forward(lhs), std::forward(rhs)); } void BVAShrOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs) { odsState.addOperands(lhs); odsState.addOperands(rhs); assert(resultTypes.size() == 1u && "mismatched number of results"); odsState.addTypes(resultTypes); } BVAShrOp BVAShrOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(resultTypes), std::forward(lhs), std::forward(rhs)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } BVAShrOp BVAShrOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs) { return create(builder, builder.getLoc(), std::forward(resultTypes), std::forward(lhs), std::forward(rhs)); } void BVAShrOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { assert(operands.size() == 2u && "mismatched number of parameters"); odsState.addOperands(operands); odsState.addAttributes(attributes); assert(resultTypes.size() == 1u && "mismatched number of return types"); odsState.addTypes(resultTypes); } BVAShrOp BVAShrOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(resultTypes), std::forward(operands), std::forward(attributes)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } BVAShrOp BVAShrOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { return create(builder, builder.getLoc(), std::forward(resultTypes), std::forward(operands), std::forward(attributes)); } void BVAShrOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { assert(operands.size() == 2u && "mismatched number of parameters"); odsState.addOperands(operands); odsState.addAttributes(attributes); ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes; if (::mlir::succeeded(BVAShrOp::inferReturnTypes(odsBuilder.getContext(), odsState.location, operands, odsState.attributes.getDictionary(odsState.getContext()), odsState.getRawProperties(), odsState.regions, inferredReturnTypes))) { assert(inferredReturnTypes.size() == 1u && "mismatched number of return types"); odsState.addTypes(inferredReturnTypes); } else { ::llvm::report_fatal_error("Failed to infer result type(s)."); } } BVAShrOp BVAShrOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(operands), std::forward(attributes)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } BVAShrOp BVAShrOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { return create(builder, builder.getLoc(), std::forward(operands), std::forward(attributes)); } void BVAShrOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { assert(operands.size() == 2u && "mismatched number of parameters"); odsState.addOperands(operands); odsState.useProperties(const_cast(properties)); odsState.addAttributes(discardableAttributes); assert(resultTypes.size() == 1u && "mismatched number of return types"); odsState.addTypes(resultTypes); } BVAShrOp BVAShrOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(resultTypes), std::forward(operands), std::forward(properties), std::forward(discardableAttributes)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } BVAShrOp BVAShrOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { return create(builder, builder.getLoc(), std::forward(resultTypes), std::forward(operands), std::forward(properties), std::forward(discardableAttributes)); } void BVAShrOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { assert(operands.size() == 2u && "mismatched number of parameters"); odsState.addOperands(operands); odsState.useProperties(const_cast(properties)); odsState.addAttributes(discardableAttributes); ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes; if (::mlir::succeeded(BVAShrOp::inferReturnTypes(odsBuilder.getContext(), odsState.location, operands, odsState.attributes.getDictionary(odsState.getContext()), odsState.getRawProperties(), odsState.regions, inferredReturnTypes))) { assert(inferredReturnTypes.size() == 1u && "mismatched number of return types"); odsState.addTypes(inferredReturnTypes); } else { ::llvm::report_fatal_error("Failed to infer result type(s)."); } } BVAShrOp BVAShrOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(operands), std::forward(properties), std::forward(discardableAttributes)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } BVAShrOp BVAShrOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { return create(builder, builder.getLoc(), std::forward(operands), std::forward(properties), std::forward(discardableAttributes)); } ::llvm::LogicalResult BVAShrOp::verifyInvariantsImpl() { { unsigned index = 0; (void)index; auto valueGroup0 = getODSOperands(0); for (auto v : valueGroup0) { if (::mlir::failed(__mlir_ods_local_type_constraint_SMT8(*this, v.getType(), "operand", index++))) return ::mlir::failure(); } auto valueGroup1 = getODSOperands(1); for (auto v : valueGroup1) { if (::mlir::failed(__mlir_ods_local_type_constraint_SMT8(*this, v.getType(), "operand", index++))) return ::mlir::failure(); } } { unsigned index = 0; (void)index; auto valueGroup0 = getODSResults(0); for (auto v : valueGroup0) { if (::mlir::failed(__mlir_ods_local_type_constraint_SMT8(*this, v.getType(), "result", index++))) return ::mlir::failure(); } } return ::mlir::success(); } ::llvm::LogicalResult BVAShrOp::verifyInvariants() { return verifyInvariantsImpl(); } ::llvm::LogicalResult BVAShrOp::inferReturnTypes(::mlir::MLIRContext *context, ::std::optional<::mlir::Location> location, ::mlir::ValueRange operands, ::mlir::DictionaryAttr attributes, ::mlir::PropertyRef properties, ::mlir::RegionRange regions, ::llvm::SmallVectorImpl<::mlir::Type>&inferredReturnTypes) { inferredReturnTypes.resize(1); ::mlir::Builder odsBuilder(context); if (operands.size() <= 0) return ::mlir::failure(); ::mlir::Type odsInferredType0 = operands[0].getType(); inferredReturnTypes[0] = odsInferredType0; return ::mlir::success(); } ::mlir::ParseResult BVAShrOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) { ::mlir::OpAsmParser::UnresolvedOperand lhsRawOperand{}; ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> lhsOperands(&lhsRawOperand, 1); ::llvm::SMLoc lhsOperandsLoc; (void)lhsOperandsLoc; ::mlir::OpAsmParser::UnresolvedOperand rhsRawOperand{}; ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> rhsOperands(&rhsRawOperand, 1); ::llvm::SMLoc rhsOperandsLoc; (void)rhsOperandsLoc; ::mlir::Type resultRawType{}; ::llvm::ArrayRef<::mlir::Type> resultTypes(&resultRawType, 1); lhsOperandsLoc = parser.getCurrentLocation(); if (parser.parseOperand(lhsRawOperand)) return ::mlir::failure(); if (parser.parseComma()) return ::mlir::failure(); rhsOperandsLoc = parser.getCurrentLocation(); if (parser.parseOperand(rhsRawOperand)) return ::mlir::failure(); { auto loc = parser.getCurrentLocation();(void)loc; if (parser.parseOptionalAttrDict(result.attributes)) return ::mlir::failure(); if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() { return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op "; }))) return ::mlir::failure(); } if (parser.parseColon()) return ::mlir::failure(); if (parser.parseType(resultRawType)) return ::mlir::failure(); result.addTypes(resultTypes); if (parser.resolveOperands(lhsOperands, resultTypes[0], lhsOperandsLoc, result.operands)) return ::mlir::failure(); if (parser.resolveOperands(rhsOperands, resultTypes[0], rhsOperandsLoc, result.operands)) return ::mlir::failure(); return ::mlir::success(); } void BVAShrOp::print(::mlir::OpAsmPrinter &_odsPrinter) { _odsPrinter << ' '; _odsPrinter << getLhs(); _odsPrinter << ","; _odsPrinter << ' '; _odsPrinter << getRhs(); ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs; _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs); _odsPrinter << ' ' << ":"; _odsPrinter << ' '; _odsPrinter << getResult().getType(); } void BVAShrOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) { } } // namespace mlir::smt MLIR_DEFINE_EXPLICIT_TYPE_ID(mlir::smt::BVAShrOp) namespace mlir::smt { //===----------------------------------------------------------------------===// // mlir::smt::BVAddOp definitions //===----------------------------------------------------------------------===// namespace detail { BVAddOpGenericAdaptorBase::BVAddOpGenericAdaptorBase(BVAddOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {} } // namespace detail BVAddOpAdaptor::BVAddOpAdaptor(BVAddOp op) : BVAddOpGenericAdaptor(op->getOperands(), op) {} ::llvm::LogicalResult BVAddOpAdaptor::verify(::mlir::Location loc) { return ::mlir::success(); } ::llvm::LogicalResult BVAddOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) { ::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr); if (!dict) { emitError() << "expected DictionaryAttr to set properties"; return ::mlir::failure(); } return ::mlir::success(); } ::mlir::Attribute BVAddOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) { ::mlir::SmallVector<::mlir::NamedAttribute> attrs; ::mlir::Builder odsBuilder{ctx}; if (!attrs.empty()) return odsBuilder.getDictionaryAttr(attrs); return {}; } llvm::hash_code BVAddOp::computePropertiesHash(const Properties &prop) { using llvm::hash_value; return llvm::hash_combine(); } std::optional BVAddOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) { return std::nullopt; } void BVAddOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) { } void BVAddOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) { } ::llvm::LogicalResult BVAddOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) { return ::mlir::success(); } void BVAddOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs) { odsState.addOperands(lhs); odsState.addOperands(rhs); odsState.addTypes(result); } BVAddOp BVAddOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(result), std::forward(lhs), std::forward(rhs)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } BVAddOp BVAddOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs) { return create(builder, builder.getLoc(), std::forward(result), std::forward(lhs), std::forward(rhs)); } void BVAddOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value lhs, ::mlir::Value rhs) { odsState.addOperands(lhs); odsState.addOperands(rhs); ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes; if (::mlir::succeeded(BVAddOp::inferReturnTypes(odsBuilder.getContext(), odsState.location, odsState.operands, odsState.attributes.getDictionary(odsState.getContext()), odsState.getRawProperties(), odsState.regions, inferredReturnTypes))) odsState.addTypes(inferredReturnTypes); else ::mlir::detail::reportFatalInferReturnTypesError(odsState); } BVAddOp BVAddOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value lhs, ::mlir::Value rhs) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(lhs), std::forward(rhs)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } BVAddOp BVAddOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value lhs, ::mlir::Value rhs) { return create(builder, builder.getLoc(), std::forward(lhs), std::forward(rhs)); } void BVAddOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs) { odsState.addOperands(lhs); odsState.addOperands(rhs); assert(resultTypes.size() == 1u && "mismatched number of results"); odsState.addTypes(resultTypes); } BVAddOp BVAddOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(resultTypes), std::forward(lhs), std::forward(rhs)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } BVAddOp BVAddOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs) { return create(builder, builder.getLoc(), std::forward(resultTypes), std::forward(lhs), std::forward(rhs)); } void BVAddOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { assert(operands.size() == 2u && "mismatched number of parameters"); odsState.addOperands(operands); odsState.addAttributes(attributes); assert(resultTypes.size() == 1u && "mismatched number of return types"); odsState.addTypes(resultTypes); } BVAddOp BVAddOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(resultTypes), std::forward(operands), std::forward(attributes)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } BVAddOp BVAddOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { return create(builder, builder.getLoc(), std::forward(resultTypes), std::forward(operands), std::forward(attributes)); } void BVAddOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { assert(operands.size() == 2u && "mismatched number of parameters"); odsState.addOperands(operands); odsState.addAttributes(attributes); ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes; if (::mlir::succeeded(BVAddOp::inferReturnTypes(odsBuilder.getContext(), odsState.location, operands, odsState.attributes.getDictionary(odsState.getContext()), odsState.getRawProperties(), odsState.regions, inferredReturnTypes))) { assert(inferredReturnTypes.size() == 1u && "mismatched number of return types"); odsState.addTypes(inferredReturnTypes); } else { ::llvm::report_fatal_error("Failed to infer result type(s)."); } } BVAddOp BVAddOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(operands), std::forward(attributes)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } BVAddOp BVAddOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { return create(builder, builder.getLoc(), std::forward(operands), std::forward(attributes)); } void BVAddOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { assert(operands.size() == 2u && "mismatched number of parameters"); odsState.addOperands(operands); odsState.useProperties(const_cast(properties)); odsState.addAttributes(discardableAttributes); assert(resultTypes.size() == 1u && "mismatched number of return types"); odsState.addTypes(resultTypes); } BVAddOp BVAddOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(resultTypes), std::forward(operands), std::forward(properties), std::forward(discardableAttributes)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } BVAddOp BVAddOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { return create(builder, builder.getLoc(), std::forward(resultTypes), std::forward(operands), std::forward(properties), std::forward(discardableAttributes)); } void BVAddOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { assert(operands.size() == 2u && "mismatched number of parameters"); odsState.addOperands(operands); odsState.useProperties(const_cast(properties)); odsState.addAttributes(discardableAttributes); ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes; if (::mlir::succeeded(BVAddOp::inferReturnTypes(odsBuilder.getContext(), odsState.location, operands, odsState.attributes.getDictionary(odsState.getContext()), odsState.getRawProperties(), odsState.regions, inferredReturnTypes))) { assert(inferredReturnTypes.size() == 1u && "mismatched number of return types"); odsState.addTypes(inferredReturnTypes); } else { ::llvm::report_fatal_error("Failed to infer result type(s)."); } } BVAddOp BVAddOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(operands), std::forward(properties), std::forward(discardableAttributes)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } BVAddOp BVAddOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { return create(builder, builder.getLoc(), std::forward(operands), std::forward(properties), std::forward(discardableAttributes)); } ::llvm::LogicalResult BVAddOp::verifyInvariantsImpl() { { unsigned index = 0; (void)index; auto valueGroup0 = getODSOperands(0); for (auto v : valueGroup0) { if (::mlir::failed(__mlir_ods_local_type_constraint_SMT8(*this, v.getType(), "operand", index++))) return ::mlir::failure(); } auto valueGroup1 = getODSOperands(1); for (auto v : valueGroup1) { if (::mlir::failed(__mlir_ods_local_type_constraint_SMT8(*this, v.getType(), "operand", index++))) return ::mlir::failure(); } } { unsigned index = 0; (void)index; auto valueGroup0 = getODSResults(0); for (auto v : valueGroup0) { if (::mlir::failed(__mlir_ods_local_type_constraint_SMT8(*this, v.getType(), "result", index++))) return ::mlir::failure(); } } return ::mlir::success(); } ::llvm::LogicalResult BVAddOp::verifyInvariants() { return verifyInvariantsImpl(); } ::llvm::LogicalResult BVAddOp::inferReturnTypes(::mlir::MLIRContext *context, ::std::optional<::mlir::Location> location, ::mlir::ValueRange operands, ::mlir::DictionaryAttr attributes, ::mlir::PropertyRef properties, ::mlir::RegionRange regions, ::llvm::SmallVectorImpl<::mlir::Type>&inferredReturnTypes) { inferredReturnTypes.resize(1); ::mlir::Builder odsBuilder(context); if (operands.size() <= 0) return ::mlir::failure(); ::mlir::Type odsInferredType0 = operands[0].getType(); inferredReturnTypes[0] = odsInferredType0; return ::mlir::success(); } ::mlir::ParseResult BVAddOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) { ::mlir::OpAsmParser::UnresolvedOperand lhsRawOperand{}; ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> lhsOperands(&lhsRawOperand, 1); ::llvm::SMLoc lhsOperandsLoc; (void)lhsOperandsLoc; ::mlir::OpAsmParser::UnresolvedOperand rhsRawOperand{}; ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> rhsOperands(&rhsRawOperand, 1); ::llvm::SMLoc rhsOperandsLoc; (void)rhsOperandsLoc; ::mlir::Type resultRawType{}; ::llvm::ArrayRef<::mlir::Type> resultTypes(&resultRawType, 1); lhsOperandsLoc = parser.getCurrentLocation(); if (parser.parseOperand(lhsRawOperand)) return ::mlir::failure(); if (parser.parseComma()) return ::mlir::failure(); rhsOperandsLoc = parser.getCurrentLocation(); if (parser.parseOperand(rhsRawOperand)) return ::mlir::failure(); { auto loc = parser.getCurrentLocation();(void)loc; if (parser.parseOptionalAttrDict(result.attributes)) return ::mlir::failure(); if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() { return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op "; }))) return ::mlir::failure(); } if (parser.parseColon()) return ::mlir::failure(); if (parser.parseType(resultRawType)) return ::mlir::failure(); result.addTypes(resultTypes); if (parser.resolveOperands(lhsOperands, resultTypes[0], lhsOperandsLoc, result.operands)) return ::mlir::failure(); if (parser.resolveOperands(rhsOperands, resultTypes[0], rhsOperandsLoc, result.operands)) return ::mlir::failure(); return ::mlir::success(); } void BVAddOp::print(::mlir::OpAsmPrinter &_odsPrinter) { _odsPrinter << ' '; _odsPrinter << getLhs(); _odsPrinter << ","; _odsPrinter << ' '; _odsPrinter << getRhs(); ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs; _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs); _odsPrinter << ' ' << ":"; _odsPrinter << ' '; _odsPrinter << getResult().getType(); } void BVAddOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) { } } // namespace mlir::smt MLIR_DEFINE_EXPLICIT_TYPE_ID(mlir::smt::BVAddOp) namespace mlir::smt { //===----------------------------------------------------------------------===// // mlir::smt::BVAndOp definitions //===----------------------------------------------------------------------===// namespace detail { BVAndOpGenericAdaptorBase::BVAndOpGenericAdaptorBase(BVAndOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {} } // namespace detail BVAndOpAdaptor::BVAndOpAdaptor(BVAndOp op) : BVAndOpGenericAdaptor(op->getOperands(), op) {} ::llvm::LogicalResult BVAndOpAdaptor::verify(::mlir::Location loc) { return ::mlir::success(); } ::llvm::LogicalResult BVAndOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) { ::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr); if (!dict) { emitError() << "expected DictionaryAttr to set properties"; return ::mlir::failure(); } return ::mlir::success(); } ::mlir::Attribute BVAndOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) { ::mlir::SmallVector<::mlir::NamedAttribute> attrs; ::mlir::Builder odsBuilder{ctx}; if (!attrs.empty()) return odsBuilder.getDictionaryAttr(attrs); return {}; } llvm::hash_code BVAndOp::computePropertiesHash(const Properties &prop) { using llvm::hash_value; return llvm::hash_combine(); } std::optional BVAndOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) { return std::nullopt; } void BVAndOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) { } void BVAndOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) { } ::llvm::LogicalResult BVAndOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) { return ::mlir::success(); } void BVAndOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs) { odsState.addOperands(lhs); odsState.addOperands(rhs); odsState.addTypes(result); } BVAndOp BVAndOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(result), std::forward(lhs), std::forward(rhs)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } BVAndOp BVAndOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs) { return create(builder, builder.getLoc(), std::forward(result), std::forward(lhs), std::forward(rhs)); } void BVAndOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value lhs, ::mlir::Value rhs) { odsState.addOperands(lhs); odsState.addOperands(rhs); ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes; if (::mlir::succeeded(BVAndOp::inferReturnTypes(odsBuilder.getContext(), odsState.location, odsState.operands, odsState.attributes.getDictionary(odsState.getContext()), odsState.getRawProperties(), odsState.regions, inferredReturnTypes))) odsState.addTypes(inferredReturnTypes); else ::mlir::detail::reportFatalInferReturnTypesError(odsState); } BVAndOp BVAndOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value lhs, ::mlir::Value rhs) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(lhs), std::forward(rhs)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } BVAndOp BVAndOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value lhs, ::mlir::Value rhs) { return create(builder, builder.getLoc(), std::forward(lhs), std::forward(rhs)); } void BVAndOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs) { odsState.addOperands(lhs); odsState.addOperands(rhs); assert(resultTypes.size() == 1u && "mismatched number of results"); odsState.addTypes(resultTypes); } BVAndOp BVAndOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(resultTypes), std::forward(lhs), std::forward(rhs)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } BVAndOp BVAndOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs) { return create(builder, builder.getLoc(), std::forward(resultTypes), std::forward(lhs), std::forward(rhs)); } void BVAndOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { assert(operands.size() == 2u && "mismatched number of parameters"); odsState.addOperands(operands); odsState.addAttributes(attributes); assert(resultTypes.size() == 1u && "mismatched number of return types"); odsState.addTypes(resultTypes); } BVAndOp BVAndOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(resultTypes), std::forward(operands), std::forward(attributes)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } BVAndOp BVAndOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { return create(builder, builder.getLoc(), std::forward(resultTypes), std::forward(operands), std::forward(attributes)); } void BVAndOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { assert(operands.size() == 2u && "mismatched number of parameters"); odsState.addOperands(operands); odsState.addAttributes(attributes); ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes; if (::mlir::succeeded(BVAndOp::inferReturnTypes(odsBuilder.getContext(), odsState.location, operands, odsState.attributes.getDictionary(odsState.getContext()), odsState.getRawProperties(), odsState.regions, inferredReturnTypes))) { assert(inferredReturnTypes.size() == 1u && "mismatched number of return types"); odsState.addTypes(inferredReturnTypes); } else { ::llvm::report_fatal_error("Failed to infer result type(s)."); } } BVAndOp BVAndOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(operands), std::forward(attributes)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } BVAndOp BVAndOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { return create(builder, builder.getLoc(), std::forward(operands), std::forward(attributes)); } void BVAndOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { assert(operands.size() == 2u && "mismatched number of parameters"); odsState.addOperands(operands); odsState.useProperties(const_cast(properties)); odsState.addAttributes(discardableAttributes); assert(resultTypes.size() == 1u && "mismatched number of return types"); odsState.addTypes(resultTypes); } BVAndOp BVAndOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(resultTypes), std::forward(operands), std::forward(properties), std::forward(discardableAttributes)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } BVAndOp BVAndOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { return create(builder, builder.getLoc(), std::forward(resultTypes), std::forward(operands), std::forward(properties), std::forward(discardableAttributes)); } void BVAndOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { assert(operands.size() == 2u && "mismatched number of parameters"); odsState.addOperands(operands); odsState.useProperties(const_cast(properties)); odsState.addAttributes(discardableAttributes); ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes; if (::mlir::succeeded(BVAndOp::inferReturnTypes(odsBuilder.getContext(), odsState.location, operands, odsState.attributes.getDictionary(odsState.getContext()), odsState.getRawProperties(), odsState.regions, inferredReturnTypes))) { assert(inferredReturnTypes.size() == 1u && "mismatched number of return types"); odsState.addTypes(inferredReturnTypes); } else { ::llvm::report_fatal_error("Failed to infer result type(s)."); } } BVAndOp BVAndOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(operands), std::forward(properties), std::forward(discardableAttributes)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } BVAndOp BVAndOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { return create(builder, builder.getLoc(), std::forward(operands), std::forward(properties), std::forward(discardableAttributes)); } ::llvm::LogicalResult BVAndOp::verifyInvariantsImpl() { { unsigned index = 0; (void)index; auto valueGroup0 = getODSOperands(0); for (auto v : valueGroup0) { if (::mlir::failed(__mlir_ods_local_type_constraint_SMT8(*this, v.getType(), "operand", index++))) return ::mlir::failure(); } auto valueGroup1 = getODSOperands(1); for (auto v : valueGroup1) { if (::mlir::failed(__mlir_ods_local_type_constraint_SMT8(*this, v.getType(), "operand", index++))) return ::mlir::failure(); } } { unsigned index = 0; (void)index; auto valueGroup0 = getODSResults(0); for (auto v : valueGroup0) { if (::mlir::failed(__mlir_ods_local_type_constraint_SMT8(*this, v.getType(), "result", index++))) return ::mlir::failure(); } } return ::mlir::success(); } ::llvm::LogicalResult BVAndOp::verifyInvariants() { return verifyInvariantsImpl(); } ::llvm::LogicalResult BVAndOp::inferReturnTypes(::mlir::MLIRContext *context, ::std::optional<::mlir::Location> location, ::mlir::ValueRange operands, ::mlir::DictionaryAttr attributes, ::mlir::PropertyRef properties, ::mlir::RegionRange regions, ::llvm::SmallVectorImpl<::mlir::Type>&inferredReturnTypes) { inferredReturnTypes.resize(1); ::mlir::Builder odsBuilder(context); if (operands.size() <= 0) return ::mlir::failure(); ::mlir::Type odsInferredType0 = operands[0].getType(); inferredReturnTypes[0] = odsInferredType0; return ::mlir::success(); } ::mlir::ParseResult BVAndOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) { ::mlir::OpAsmParser::UnresolvedOperand lhsRawOperand{}; ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> lhsOperands(&lhsRawOperand, 1); ::llvm::SMLoc lhsOperandsLoc; (void)lhsOperandsLoc; ::mlir::OpAsmParser::UnresolvedOperand rhsRawOperand{}; ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> rhsOperands(&rhsRawOperand, 1); ::llvm::SMLoc rhsOperandsLoc; (void)rhsOperandsLoc; ::mlir::Type resultRawType{}; ::llvm::ArrayRef<::mlir::Type> resultTypes(&resultRawType, 1); lhsOperandsLoc = parser.getCurrentLocation(); if (parser.parseOperand(lhsRawOperand)) return ::mlir::failure(); if (parser.parseComma()) return ::mlir::failure(); rhsOperandsLoc = parser.getCurrentLocation(); if (parser.parseOperand(rhsRawOperand)) return ::mlir::failure(); { auto loc = parser.getCurrentLocation();(void)loc; if (parser.parseOptionalAttrDict(result.attributes)) return ::mlir::failure(); if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() { return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op "; }))) return ::mlir::failure(); } if (parser.parseColon()) return ::mlir::failure(); if (parser.parseType(resultRawType)) return ::mlir::failure(); result.addTypes(resultTypes); if (parser.resolveOperands(lhsOperands, resultTypes[0], lhsOperandsLoc, result.operands)) return ::mlir::failure(); if (parser.resolveOperands(rhsOperands, resultTypes[0], rhsOperandsLoc, result.operands)) return ::mlir::failure(); return ::mlir::success(); } void BVAndOp::print(::mlir::OpAsmPrinter &_odsPrinter) { _odsPrinter << ' '; _odsPrinter << getLhs(); _odsPrinter << ","; _odsPrinter << ' '; _odsPrinter << getRhs(); ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs; _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs); _odsPrinter << ' ' << ":"; _odsPrinter << ' '; _odsPrinter << getResult().getType(); } void BVAndOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) { } } // namespace mlir::smt MLIR_DEFINE_EXPLICIT_TYPE_ID(mlir::smt::BVAndOp) namespace mlir::smt { //===----------------------------------------------------------------------===// // mlir::smt::BVCmpOp definitions //===----------------------------------------------------------------------===// namespace detail { BVCmpOpGenericAdaptorBase::BVCmpOpGenericAdaptorBase(BVCmpOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {} mlir::smt::BVCmpPredicate BVCmpOpGenericAdaptorBase::getPred() { auto attr = getPredAttr(); return attr.getValue(); } } // namespace detail BVCmpOpAdaptor::BVCmpOpAdaptor(BVCmpOp op) : BVCmpOpGenericAdaptor(op->getOperands(), op) {} ::llvm::LogicalResult BVCmpOpAdaptor::verify(::mlir::Location loc) { auto tblgen_pred = getProperties().pred; (void)tblgen_pred; if (!tblgen_pred) return emitError(loc, "'smt.bv.cmp' op requires attribute 'pred'"); if (tblgen_pred && !((::llvm::isa(tblgen_pred)))) return emitError(loc, "'smt.bv.cmp' op attribute 'pred' failed to satisfy constraint: smt bit-vector comparison predicate"); return ::mlir::success(); } ::llvm::LogicalResult BVCmpOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) { ::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr); if (!dict) { emitError() << "expected DictionaryAttr to set properties"; return ::mlir::failure(); } { auto &propStorage = prop.pred; auto attr = dict.get("pred"); if (attr) { auto convertedAttr = ::llvm::dyn_cast>(attr); if (convertedAttr) { propStorage = convertedAttr; } else { emitError() << "Invalid attribute `pred` in property conversion: " << attr; return ::mlir::failure(); } } } return ::mlir::success(); } ::mlir::Attribute BVCmpOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) { ::mlir::SmallVector<::mlir::NamedAttribute> attrs; ::mlir::Builder odsBuilder{ctx}; { const auto &propStorage = prop.pred; if (propStorage) attrs.push_back(odsBuilder.getNamedAttr("pred", propStorage)); } if (!attrs.empty()) return odsBuilder.getDictionaryAttr(attrs); return {}; } llvm::hash_code BVCmpOp::computePropertiesHash(const Properties &prop) { using llvm::hash_value; return llvm::hash_combine( llvm::hash_value(prop.pred.getAsOpaquePointer())); } std::optional BVCmpOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) { if (name == "pred") return prop.pred; return std::nullopt; } void BVCmpOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) { if (name == "pred") { prop.pred = ::llvm::dyn_cast_or_null>(value); return; } } void BVCmpOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) { if (prop.pred) attrs.append("pred", prop.pred); } ::llvm::LogicalResult BVCmpOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) { { ::mlir::Attribute attr = attrs.get(getPredAttrName(opName)); if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_SMT2(attr, "pred", emitError))) return ::mlir::failure(); } return ::mlir::success(); } ::llvm::LogicalResult BVCmpOp::readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state) { auto &prop = state.getOrAddProperties(); (void)prop; if (::mlir::failed(reader.readAttribute(prop.pred))) return ::mlir::failure(); return ::mlir::success(); } void BVCmpOp::writeProperties(::mlir::DialectBytecodeWriter &writer) { auto &prop = getProperties(); (void)prop; writer.writeAttribute(prop.pred); } mlir::smt::BVCmpPredicate BVCmpOp::getPred() { auto attr = getPredAttr(); return attr.getValue(); } void BVCmpOp::setPred(mlir::smt::BVCmpPredicate attrValue) { getProperties().pred = mlir::smt::BVCmpPredicateAttr::get(::mlir::Builder((*this)->getContext()).getContext(), attrValue); } void BVCmpOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, mlir::smt::BVCmpPredicateAttr pred, ::mlir::Value lhs, ::mlir::Value rhs) { odsState.addOperands(lhs); odsState.addOperands(rhs); odsState.getOrAddProperties().pred = pred; odsState.addTypes(result); } BVCmpOp BVCmpOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, mlir::smt::BVCmpPredicateAttr pred, ::mlir::Value lhs, ::mlir::Value rhs) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(result), std::forward(pred), std::forward(lhs), std::forward(rhs)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } BVCmpOp BVCmpOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, mlir::smt::BVCmpPredicateAttr pred, ::mlir::Value lhs, ::mlir::Value rhs) { return create(builder, builder.getLoc(), std::forward(result), std::forward(pred), std::forward(lhs), std::forward(rhs)); } void BVCmpOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, mlir::smt::BVCmpPredicateAttr pred, ::mlir::Value lhs, ::mlir::Value rhs) { odsState.addOperands(lhs); odsState.addOperands(rhs); odsState.getOrAddProperties().pred = pred; ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes; if (::mlir::succeeded(BVCmpOp::inferReturnTypes(odsBuilder.getContext(), odsState.location, odsState.operands, odsState.attributes.getDictionary(odsState.getContext()), odsState.getRawProperties(), odsState.regions, inferredReturnTypes))) odsState.addTypes(inferredReturnTypes); else ::mlir::detail::reportFatalInferReturnTypesError(odsState); } BVCmpOp BVCmpOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, mlir::smt::BVCmpPredicateAttr pred, ::mlir::Value lhs, ::mlir::Value rhs) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(pred), std::forward(lhs), std::forward(rhs)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } BVCmpOp BVCmpOp::create(::mlir::ImplicitLocOpBuilder &builder, mlir::smt::BVCmpPredicateAttr pred, ::mlir::Value lhs, ::mlir::Value rhs) { return create(builder, builder.getLoc(), std::forward(pred), std::forward(lhs), std::forward(rhs)); } void BVCmpOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, mlir::smt::BVCmpPredicateAttr pred, ::mlir::Value lhs, ::mlir::Value rhs) { odsState.addOperands(lhs); odsState.addOperands(rhs); odsState.getOrAddProperties().pred = pred; assert(resultTypes.size() == 1u && "mismatched number of results"); odsState.addTypes(resultTypes); } BVCmpOp BVCmpOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, mlir::smt::BVCmpPredicateAttr pred, ::mlir::Value lhs, ::mlir::Value rhs) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(resultTypes), std::forward(pred), std::forward(lhs), std::forward(rhs)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } BVCmpOp BVCmpOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, mlir::smt::BVCmpPredicateAttr pred, ::mlir::Value lhs, ::mlir::Value rhs) { return create(builder, builder.getLoc(), std::forward(resultTypes), std::forward(pred), std::forward(lhs), std::forward(rhs)); } void BVCmpOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, mlir::smt::BVCmpPredicate pred, ::mlir::Value lhs, ::mlir::Value rhs) { odsState.addOperands(lhs); odsState.addOperands(rhs); odsState.getOrAddProperties().pred = mlir::smt::BVCmpPredicateAttr::get(odsBuilder.getContext(), pred); odsState.addTypes(result); } BVCmpOp BVCmpOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, mlir::smt::BVCmpPredicate pred, ::mlir::Value lhs, ::mlir::Value rhs) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(result), std::forward(pred), std::forward(lhs), std::forward(rhs)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } BVCmpOp BVCmpOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, mlir::smt::BVCmpPredicate pred, ::mlir::Value lhs, ::mlir::Value rhs) { return create(builder, builder.getLoc(), std::forward(result), std::forward(pred), std::forward(lhs), std::forward(rhs)); } void BVCmpOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, mlir::smt::BVCmpPredicate pred, ::mlir::Value lhs, ::mlir::Value rhs) { odsState.addOperands(lhs); odsState.addOperands(rhs); odsState.getOrAddProperties().pred = mlir::smt::BVCmpPredicateAttr::get(odsBuilder.getContext(), pred); ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes; if (::mlir::succeeded(BVCmpOp::inferReturnTypes(odsBuilder.getContext(), odsState.location, odsState.operands, odsState.attributes.getDictionary(odsState.getContext()), odsState.getRawProperties(), odsState.regions, inferredReturnTypes))) odsState.addTypes(inferredReturnTypes); else ::mlir::detail::reportFatalInferReturnTypesError(odsState); } BVCmpOp BVCmpOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, mlir::smt::BVCmpPredicate pred, ::mlir::Value lhs, ::mlir::Value rhs) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(pred), std::forward(lhs), std::forward(rhs)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } BVCmpOp BVCmpOp::create(::mlir::ImplicitLocOpBuilder &builder, mlir::smt::BVCmpPredicate pred, ::mlir::Value lhs, ::mlir::Value rhs) { return create(builder, builder.getLoc(), std::forward(pred), std::forward(lhs), std::forward(rhs)); } void BVCmpOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, mlir::smt::BVCmpPredicate pred, ::mlir::Value lhs, ::mlir::Value rhs) { odsState.addOperands(lhs); odsState.addOperands(rhs); odsState.getOrAddProperties().pred = mlir::smt::BVCmpPredicateAttr::get(odsBuilder.getContext(), pred); assert(resultTypes.size() == 1u && "mismatched number of results"); odsState.addTypes(resultTypes); } BVCmpOp BVCmpOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, mlir::smt::BVCmpPredicate pred, ::mlir::Value lhs, ::mlir::Value rhs) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(resultTypes), std::forward(pred), std::forward(lhs), std::forward(rhs)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } BVCmpOp BVCmpOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, mlir::smt::BVCmpPredicate pred, ::mlir::Value lhs, ::mlir::Value rhs) { return create(builder, builder.getLoc(), std::forward(resultTypes), std::forward(pred), std::forward(lhs), std::forward(rhs)); } void BVCmpOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { assert(operands.size() == 2u && "mismatched number of parameters"); odsState.addOperands(operands); odsState.addAttributes(attributes); assert(resultTypes.size() == 1u && "mismatched number of return types"); odsState.addTypes(resultTypes); if (!attributes.empty()) { (void)odsState.getOrAddProperties(); ::mlir::PropertyRef properties = odsState.getRawProperties(); std::optional<::mlir::RegisteredOperationName> info = odsState.name.getRegisteredInfo(); if (failed(info->setOpPropertiesFromAttribute(odsState.name, properties, odsState.attributes.getDictionary(odsState.getContext()), nullptr))) ::llvm::report_fatal_error("Property conversion failed."); } } BVCmpOp BVCmpOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(resultTypes), std::forward(operands), std::forward(attributes)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } BVCmpOp BVCmpOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { return create(builder, builder.getLoc(), std::forward(resultTypes), std::forward(operands), std::forward(attributes)); } void BVCmpOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { assert(operands.size() == 2u && "mismatched number of parameters"); odsState.addOperands(operands); odsState.addAttributes(attributes); if (!attributes.empty()) { (void)odsState.getOrAddProperties(); ::mlir::PropertyRef properties = odsState.getRawProperties(); std::optional<::mlir::RegisteredOperationName> info = odsState.name.getRegisteredInfo(); if (failed(info->setOpPropertiesFromAttribute(odsState.name, properties, odsState.attributes.getDictionary(odsState.getContext()), nullptr))) ::llvm::report_fatal_error("Property conversion failed."); } ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes; if (::mlir::succeeded(BVCmpOp::inferReturnTypes(odsBuilder.getContext(), odsState.location, operands, odsState.attributes.getDictionary(odsState.getContext()), odsState.getRawProperties(), odsState.regions, inferredReturnTypes))) { assert(inferredReturnTypes.size() == 1u && "mismatched number of return types"); odsState.addTypes(inferredReturnTypes); } else { ::llvm::report_fatal_error("Failed to infer result type(s)."); } } BVCmpOp BVCmpOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(operands), std::forward(attributes)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } BVCmpOp BVCmpOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { return create(builder, builder.getLoc(), std::forward(operands), std::forward(attributes)); } void BVCmpOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { assert(operands.size() == 2u && "mismatched number of parameters"); odsState.addOperands(operands); odsState.useProperties(const_cast(properties)); odsState.addAttributes(discardableAttributes); assert(resultTypes.size() == 1u && "mismatched number of return types"); odsState.addTypes(resultTypes); } BVCmpOp BVCmpOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(resultTypes), std::forward(operands), std::forward(properties), std::forward(discardableAttributes)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } BVCmpOp BVCmpOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { return create(builder, builder.getLoc(), std::forward(resultTypes), std::forward(operands), std::forward(properties), std::forward(discardableAttributes)); } void BVCmpOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { assert(operands.size() == 2u && "mismatched number of parameters"); odsState.addOperands(operands); odsState.useProperties(const_cast(properties)); odsState.addAttributes(discardableAttributes); ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes; if (::mlir::succeeded(BVCmpOp::inferReturnTypes(odsBuilder.getContext(), odsState.location, operands, odsState.attributes.getDictionary(odsState.getContext()), odsState.getRawProperties(), odsState.regions, inferredReturnTypes))) { assert(inferredReturnTypes.size() == 1u && "mismatched number of return types"); odsState.addTypes(inferredReturnTypes); } else { ::llvm::report_fatal_error("Failed to infer result type(s)."); } } BVCmpOp BVCmpOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(operands), std::forward(properties), std::forward(discardableAttributes)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } BVCmpOp BVCmpOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { return create(builder, builder.getLoc(), std::forward(operands), std::forward(properties), std::forward(discardableAttributes)); } ::llvm::LogicalResult BVCmpOp::verifyInvariantsImpl() { auto tblgen_pred = getProperties().pred; (void)tblgen_pred; if (!tblgen_pred) return emitOpError("requires attribute 'pred'"); if (::mlir::failed(__mlir_ods_local_attr_constraint_SMT2(*this, tblgen_pred, "pred"))) return ::mlir::failure(); { unsigned index = 0; (void)index; auto valueGroup0 = getODSOperands(0); for (auto v : valueGroup0) { if (::mlir::failed(__mlir_ods_local_type_constraint_SMT8(*this, v.getType(), "operand", index++))) return ::mlir::failure(); } auto valueGroup1 = getODSOperands(1); for (auto v : valueGroup1) { if (::mlir::failed(__mlir_ods_local_type_constraint_SMT8(*this, v.getType(), "operand", index++))) return ::mlir::failure(); } } { unsigned index = 0; (void)index; auto valueGroup0 = getODSResults(0); for (auto v : valueGroup0) { if (::mlir::failed(__mlir_ods_local_type_constraint_SMT2(*this, v.getType(), "result", index++))) return ::mlir::failure(); } } return ::mlir::success(); } ::llvm::LogicalResult BVCmpOp::verifyInvariants() { return verifyInvariantsImpl(); } ::llvm::LogicalResult BVCmpOp::inferReturnTypes(::mlir::MLIRContext *context, ::std::optional<::mlir::Location> location, ::mlir::ValueRange operands, ::mlir::DictionaryAttr attributes, ::mlir::PropertyRef properties, ::mlir::RegionRange regions, ::llvm::SmallVectorImpl<::mlir::Type>&inferredReturnTypes) { inferredReturnTypes.resize(1); ::mlir::Builder odsBuilder(context); ::mlir::Type odsInferredType0 = odsBuilder.getType(); inferredReturnTypes[0] = odsInferredType0; return ::mlir::success(); } ::mlir::ParseResult BVCmpOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) { mlir::smt::BVCmpPredicateAttr predAttr; ::mlir::OpAsmParser::UnresolvedOperand lhsRawOperand{}; ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> lhsOperands(&lhsRawOperand, 1); ::llvm::SMLoc lhsOperandsLoc; (void)lhsOperandsLoc; ::mlir::OpAsmParser::UnresolvedOperand rhsRawOperand{}; ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> rhsOperands(&rhsRawOperand, 1); ::llvm::SMLoc rhsOperandsLoc; (void)rhsOperandsLoc; ::mlir::Type lhsRawType{}; ::llvm::ArrayRef<::mlir::Type> lhsTypes(&lhsRawType, 1); { ::llvm::StringRef attrStr; ::mlir::NamedAttrList attrStorage; auto loc = parser.getCurrentLocation(); if (parser.parseOptionalKeyword(&attrStr, {"slt","sle","sgt","sge","ult","ule","ugt","uge"})) { ::mlir::StringAttr attrVal; ::mlir::OptionalParseResult parseResult = parser.parseOptionalAttribute(attrVal, parser.getBuilder().getNoneType(), "pred", attrStorage); if (parseResult.has_value()) { if (failed(*parseResult)) return ::mlir::failure(); attrStr = attrVal.getValue(); } else { return parser.emitError(loc, "expected string or keyword containing one of the following enum values for attribute 'pred' [slt, sle, sgt, sge, ult, ule, ugt, uge]"); } } if (!attrStr.empty()) { auto attrOptional = mlir::smt::symbolizeBVCmpPredicate(attrStr); if (!attrOptional) return parser.emitError(loc, "invalid ") << "pred attribute specification: \"" << attrStr << '"';; predAttr = mlir::smt::BVCmpPredicateAttr::get(parser.getBuilder().getContext(), *attrOptional); result.getOrAddProperties().pred = predAttr; } } lhsOperandsLoc = parser.getCurrentLocation(); if (parser.parseOperand(lhsRawOperand)) return ::mlir::failure(); if (parser.parseComma()) return ::mlir::failure(); rhsOperandsLoc = parser.getCurrentLocation(); if (parser.parseOperand(rhsRawOperand)) return ::mlir::failure(); { auto loc = parser.getCurrentLocation();(void)loc; if (parser.parseOptionalAttrDict(result.attributes)) return ::mlir::failure(); if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() { return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op "; }))) return ::mlir::failure(); } if (parser.parseColon()) return ::mlir::failure(); if (parser.parseType(lhsRawType)) return ::mlir::failure(); ::mlir::Type odsBuildableType0 = parser.getBuilder().getType(); result.addTypes(odsBuildableType0); if (parser.resolveOperands(lhsOperands, lhsTypes, lhsOperandsLoc, result.operands)) return ::mlir::failure(); if (parser.resolveOperands(rhsOperands, lhsTypes[0], rhsOperandsLoc, result.operands)) return ::mlir::failure(); return ::mlir::success(); } void BVCmpOp::print(::mlir::OpAsmPrinter &_odsPrinter) { _odsPrinter << ' '; { auto caseValue = getPred(); auto caseValueStr = stringifyBVCmpPredicate(caseValue); _odsPrinter << caseValueStr; } _odsPrinter << ' '; _odsPrinter << getLhs(); _odsPrinter << ","; _odsPrinter << ' '; _odsPrinter << getRhs(); ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs; elidedAttrs.push_back("pred"); _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs); _odsPrinter << ' ' << ":"; _odsPrinter << ' '; _odsPrinter << getLhs().getType(); } void BVCmpOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) { } } // namespace mlir::smt MLIR_DEFINE_EXPLICIT_TYPE_ID(mlir::smt::BVCmpOp) MLIR_DEFINE_EXPLICIT_TYPE_ID(mlir::smt::detail::BVCmpOpGenericAdaptorBase::Properties) namespace mlir::smt { //===----------------------------------------------------------------------===// // mlir::smt::BVConstantOp definitions //===----------------------------------------------------------------------===// namespace detail { BVConstantOpGenericAdaptorBase::BVConstantOpGenericAdaptorBase(BVConstantOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {} mlir::smt::BitVectorAttr BVConstantOpGenericAdaptorBase::getValue() { auto attr = getValueAttr(); return ::llvm::cast(attr); } } // namespace detail BVConstantOpAdaptor::BVConstantOpAdaptor(BVConstantOp op) : BVConstantOpGenericAdaptor(op->getOperands(), op) {} ::llvm::LogicalResult BVConstantOpAdaptor::verify(::mlir::Location loc) { auto tblgen_value = getProperties().value; (void)tblgen_value; if (!tblgen_value) return emitError(loc, "'smt.bv.constant' op requires attribute 'value'"); if (tblgen_value && !((::llvm::isa(tblgen_value)))) return emitError(loc, "'smt.bv.constant' op attribute 'value' failed to satisfy constraint: "); return ::mlir::success(); } ::llvm::LogicalResult BVConstantOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) { ::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr); if (!dict) { emitError() << "expected DictionaryAttr to set properties"; return ::mlir::failure(); } { auto &propStorage = prop.value; auto attr = dict.get("value"); if (attr) { auto convertedAttr = ::llvm::dyn_cast>(attr); if (convertedAttr) { propStorage = convertedAttr; } else { emitError() << "Invalid attribute `value` in property conversion: " << attr; return ::mlir::failure(); } } } return ::mlir::success(); } ::mlir::Attribute BVConstantOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) { ::mlir::SmallVector<::mlir::NamedAttribute> attrs; ::mlir::Builder odsBuilder{ctx}; { const auto &propStorage = prop.value; if (propStorage) attrs.push_back(odsBuilder.getNamedAttr("value", propStorage)); } if (!attrs.empty()) return odsBuilder.getDictionaryAttr(attrs); return {}; } llvm::hash_code BVConstantOp::computePropertiesHash(const Properties &prop) { using llvm::hash_value; return llvm::hash_combine( llvm::hash_value(prop.value.getAsOpaquePointer())); } std::optional BVConstantOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) { if (name == "value") return prop.value; return std::nullopt; } void BVConstantOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) { if (name == "value") { prop.value = ::llvm::dyn_cast_or_null>(value); return; } } void BVConstantOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) { if (prop.value) attrs.append("value", prop.value); } ::llvm::LogicalResult BVConstantOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) { { ::mlir::Attribute attr = attrs.get(getValueAttrName(opName)); if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_SMT3(attr, "value", emitError))) return ::mlir::failure(); } return ::mlir::success(); } ::llvm::LogicalResult BVConstantOp::readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state) { auto &prop = state.getOrAddProperties(); (void)prop; if (::mlir::failed(reader.readAttribute(prop.value))) return ::mlir::failure(); return ::mlir::success(); } void BVConstantOp::writeProperties(::mlir::DialectBytecodeWriter &writer) { auto &prop = getProperties(); (void)prop; writer.writeAttribute(prop.value); } mlir::smt::BitVectorAttr BVConstantOp::getValue() { auto attr = getValueAttr(); return ::llvm::cast(attr); } void BVConstantOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, const llvm::APInt &value) { build(odsBuilder, odsState, BitVectorAttr::get(odsBuilder.getContext(), value)); } BVConstantOp BVConstantOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, const llvm::APInt &value) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(value)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } BVConstantOp BVConstantOp::create(::mlir::ImplicitLocOpBuilder &builder, const llvm::APInt &value) { return create(builder, builder.getLoc(), std::forward(value)); } void BVConstantOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, uint64_t value, unsigned width) { build(odsBuilder, odsState, BitVectorAttr::get(odsBuilder.getContext(), value, width)); } BVConstantOp BVConstantOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, uint64_t value, unsigned width) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(value), std::forward(width)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } BVConstantOp BVConstantOp::create(::mlir::ImplicitLocOpBuilder &builder, uint64_t value, unsigned width) { return create(builder, builder.getLoc(), std::forward(value), std::forward(width)); } void BVConstantOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, mlir::smt::BitVectorAttr value) { odsState.getOrAddProperties().value = value; odsState.addTypes(result); } BVConstantOp BVConstantOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, mlir::smt::BitVectorAttr value) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(result), std::forward(value)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } BVConstantOp BVConstantOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, mlir::smt::BitVectorAttr value) { return create(builder, builder.getLoc(), std::forward(result), std::forward(value)); } void BVConstantOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, mlir::smt::BitVectorAttr value) { odsState.getOrAddProperties().value = value; ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes; if (::mlir::succeeded(BVConstantOp::inferReturnTypes(odsBuilder.getContext(), odsState.location, odsState.operands, odsState.attributes.getDictionary(odsState.getContext()), odsState.getRawProperties(), odsState.regions, inferredReturnTypes))) odsState.addTypes(inferredReturnTypes); else ::mlir::detail::reportFatalInferReturnTypesError(odsState); } BVConstantOp BVConstantOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, mlir::smt::BitVectorAttr value) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(value)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } BVConstantOp BVConstantOp::create(::mlir::ImplicitLocOpBuilder &builder, mlir::smt::BitVectorAttr value) { return create(builder, builder.getLoc(), std::forward(value)); } void BVConstantOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, mlir::smt::BitVectorAttr value) { odsState.getOrAddProperties().value = value; assert(resultTypes.size() == 1u && "mismatched number of results"); odsState.addTypes(resultTypes); } BVConstantOp BVConstantOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, mlir::smt::BitVectorAttr value) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(resultTypes), std::forward(value)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } BVConstantOp BVConstantOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, mlir::smt::BitVectorAttr value) { return create(builder, builder.getLoc(), std::forward(resultTypes), std::forward(value)); } void BVConstantOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { assert(operands.size() == 0u && "mismatched number of parameters"); odsState.addOperands(operands); odsState.addAttributes(attributes); assert(resultTypes.size() == 1u && "mismatched number of return types"); odsState.addTypes(resultTypes); if (!attributes.empty()) { (void)odsState.getOrAddProperties(); ::mlir::PropertyRef properties = odsState.getRawProperties(); std::optional<::mlir::RegisteredOperationName> info = odsState.name.getRegisteredInfo(); if (failed(info->setOpPropertiesFromAttribute(odsState.name, properties, odsState.attributes.getDictionary(odsState.getContext()), nullptr))) ::llvm::report_fatal_error("Property conversion failed."); } } BVConstantOp BVConstantOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(resultTypes), std::forward(operands), std::forward(attributes)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } BVConstantOp BVConstantOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { return create(builder, builder.getLoc(), std::forward(resultTypes), std::forward(operands), std::forward(attributes)); } void BVConstantOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { assert(operands.size() == 0u && "mismatched number of parameters"); odsState.addOperands(operands); odsState.addAttributes(attributes); if (!attributes.empty()) { (void)odsState.getOrAddProperties(); ::mlir::PropertyRef properties = odsState.getRawProperties(); std::optional<::mlir::RegisteredOperationName> info = odsState.name.getRegisteredInfo(); if (failed(info->setOpPropertiesFromAttribute(odsState.name, properties, odsState.attributes.getDictionary(odsState.getContext()), nullptr))) ::llvm::report_fatal_error("Property conversion failed."); } ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes; if (::mlir::succeeded(BVConstantOp::inferReturnTypes(odsBuilder.getContext(), odsState.location, operands, odsState.attributes.getDictionary(odsState.getContext()), odsState.getRawProperties(), odsState.regions, inferredReturnTypes))) { assert(inferredReturnTypes.size() == 1u && "mismatched number of return types"); odsState.addTypes(inferredReturnTypes); } else { ::llvm::report_fatal_error("Failed to infer result type(s)."); } } BVConstantOp BVConstantOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(operands), std::forward(attributes)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } BVConstantOp BVConstantOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { return create(builder, builder.getLoc(), std::forward(operands), std::forward(attributes)); } void BVConstantOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { assert(operands.size() == 0u && "mismatched number of parameters"); odsState.addOperands(operands); odsState.useProperties(const_cast(properties)); odsState.addAttributes(discardableAttributes); assert(resultTypes.size() == 1u && "mismatched number of return types"); odsState.addTypes(resultTypes); } BVConstantOp BVConstantOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(resultTypes), std::forward(operands), std::forward(properties), std::forward(discardableAttributes)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } BVConstantOp BVConstantOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { return create(builder, builder.getLoc(), std::forward(resultTypes), std::forward(operands), std::forward(properties), std::forward(discardableAttributes)); } void BVConstantOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { assert(operands.size() == 0u && "mismatched number of parameters"); odsState.addOperands(operands); odsState.useProperties(const_cast(properties)); odsState.addAttributes(discardableAttributes); ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes; if (::mlir::succeeded(BVConstantOp::inferReturnTypes(odsBuilder.getContext(), odsState.location, operands, odsState.attributes.getDictionary(odsState.getContext()), odsState.getRawProperties(), odsState.regions, inferredReturnTypes))) { assert(inferredReturnTypes.size() == 1u && "mismatched number of return types"); odsState.addTypes(inferredReturnTypes); } else { ::llvm::report_fatal_error("Failed to infer result type(s)."); } } BVConstantOp BVConstantOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(operands), std::forward(properties), std::forward(discardableAttributes)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } BVConstantOp BVConstantOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { return create(builder, builder.getLoc(), std::forward(operands), std::forward(properties), std::forward(discardableAttributes)); } ::llvm::LogicalResult BVConstantOp::verifyInvariantsImpl() { auto tblgen_value = getProperties().value; (void)tblgen_value; if (!tblgen_value) return emitOpError("requires attribute 'value'"); if (::mlir::failed(__mlir_ods_local_attr_constraint_SMT3(*this, tblgen_value, "value"))) return ::mlir::failure(); { unsigned index = 0; (void)index; auto valueGroup0 = getODSResults(0); for (auto v : valueGroup0) { if (::mlir::failed(__mlir_ods_local_type_constraint_SMT8(*this, v.getType(), "result", index++))) return ::mlir::failure(); } } return ::mlir::success(); } ::llvm::LogicalResult BVConstantOp::verifyInvariants() { return verifyInvariantsImpl(); } ::mlir::ParseResult BVConstantOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) { mlir::smt::BitVectorAttr valueAttr; if (parser.parseAttribute(valueAttr, ::mlir::Type{})) return ::mlir::failure(); if (valueAttr) result.getOrAddProperties().value = valueAttr; { auto loc = parser.getCurrentLocation();(void)loc; if (parser.parseOptionalAttrDict(result.attributes)) return ::mlir::failure(); if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() { return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op "; }))) return ::mlir::failure(); } ::llvm::SmallVector<::mlir::Type> inferredReturnTypes; if (::mlir::failed(BVConstantOp::inferReturnTypes(parser.getContext(), result.location, result.operands, result.attributes.getDictionary(parser.getContext()), result.getRawProperties(), result.regions, inferredReturnTypes))) return ::mlir::failure(); result.addTypes(inferredReturnTypes); return ::mlir::success(); } void BVConstantOp::print(::mlir::OpAsmPrinter &_odsPrinter) { _odsPrinter << ' '; _odsPrinter.printAttribute(getValueAttr()); ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs; elidedAttrs.push_back("value"); _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs); } void BVConstantOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) { } } // namespace mlir::smt MLIR_DEFINE_EXPLICIT_TYPE_ID(mlir::smt::BVConstantOp) MLIR_DEFINE_EXPLICIT_TYPE_ID(mlir::smt::detail::BVConstantOpGenericAdaptorBase::Properties) namespace mlir::smt { //===----------------------------------------------------------------------===// // mlir::smt::BVLShrOp definitions //===----------------------------------------------------------------------===// namespace detail { BVLShrOpGenericAdaptorBase::BVLShrOpGenericAdaptorBase(BVLShrOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {} } // namespace detail BVLShrOpAdaptor::BVLShrOpAdaptor(BVLShrOp op) : BVLShrOpGenericAdaptor(op->getOperands(), op) {} ::llvm::LogicalResult BVLShrOpAdaptor::verify(::mlir::Location loc) { return ::mlir::success(); } ::llvm::LogicalResult BVLShrOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) { ::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr); if (!dict) { emitError() << "expected DictionaryAttr to set properties"; return ::mlir::failure(); } return ::mlir::success(); } ::mlir::Attribute BVLShrOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) { ::mlir::SmallVector<::mlir::NamedAttribute> attrs; ::mlir::Builder odsBuilder{ctx}; if (!attrs.empty()) return odsBuilder.getDictionaryAttr(attrs); return {}; } llvm::hash_code BVLShrOp::computePropertiesHash(const Properties &prop) { using llvm::hash_value; return llvm::hash_combine(); } std::optional BVLShrOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) { return std::nullopt; } void BVLShrOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) { } void BVLShrOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) { } ::llvm::LogicalResult BVLShrOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) { return ::mlir::success(); } void BVLShrOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs) { odsState.addOperands(lhs); odsState.addOperands(rhs); odsState.addTypes(result); } BVLShrOp BVLShrOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(result), std::forward(lhs), std::forward(rhs)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } BVLShrOp BVLShrOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs) { return create(builder, builder.getLoc(), std::forward(result), std::forward(lhs), std::forward(rhs)); } void BVLShrOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value lhs, ::mlir::Value rhs) { odsState.addOperands(lhs); odsState.addOperands(rhs); ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes; if (::mlir::succeeded(BVLShrOp::inferReturnTypes(odsBuilder.getContext(), odsState.location, odsState.operands, odsState.attributes.getDictionary(odsState.getContext()), odsState.getRawProperties(), odsState.regions, inferredReturnTypes))) odsState.addTypes(inferredReturnTypes); else ::mlir::detail::reportFatalInferReturnTypesError(odsState); } BVLShrOp BVLShrOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value lhs, ::mlir::Value rhs) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(lhs), std::forward(rhs)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } BVLShrOp BVLShrOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value lhs, ::mlir::Value rhs) { return create(builder, builder.getLoc(), std::forward(lhs), std::forward(rhs)); } void BVLShrOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs) { odsState.addOperands(lhs); odsState.addOperands(rhs); assert(resultTypes.size() == 1u && "mismatched number of results"); odsState.addTypes(resultTypes); } BVLShrOp BVLShrOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(resultTypes), std::forward(lhs), std::forward(rhs)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } BVLShrOp BVLShrOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs) { return create(builder, builder.getLoc(), std::forward(resultTypes), std::forward(lhs), std::forward(rhs)); } void BVLShrOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { assert(operands.size() == 2u && "mismatched number of parameters"); odsState.addOperands(operands); odsState.addAttributes(attributes); assert(resultTypes.size() == 1u && "mismatched number of return types"); odsState.addTypes(resultTypes); } BVLShrOp BVLShrOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(resultTypes), std::forward(operands), std::forward(attributes)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } BVLShrOp BVLShrOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { return create(builder, builder.getLoc(), std::forward(resultTypes), std::forward(operands), std::forward(attributes)); } void BVLShrOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { assert(operands.size() == 2u && "mismatched number of parameters"); odsState.addOperands(operands); odsState.addAttributes(attributes); ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes; if (::mlir::succeeded(BVLShrOp::inferReturnTypes(odsBuilder.getContext(), odsState.location, operands, odsState.attributes.getDictionary(odsState.getContext()), odsState.getRawProperties(), odsState.regions, inferredReturnTypes))) { assert(inferredReturnTypes.size() == 1u && "mismatched number of return types"); odsState.addTypes(inferredReturnTypes); } else { ::llvm::report_fatal_error("Failed to infer result type(s)."); } } BVLShrOp BVLShrOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(operands), std::forward(attributes)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } BVLShrOp BVLShrOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { return create(builder, builder.getLoc(), std::forward(operands), std::forward(attributes)); } void BVLShrOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { assert(operands.size() == 2u && "mismatched number of parameters"); odsState.addOperands(operands); odsState.useProperties(const_cast(properties)); odsState.addAttributes(discardableAttributes); assert(resultTypes.size() == 1u && "mismatched number of return types"); odsState.addTypes(resultTypes); } BVLShrOp BVLShrOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(resultTypes), std::forward(operands), std::forward(properties), std::forward(discardableAttributes)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } BVLShrOp BVLShrOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { return create(builder, builder.getLoc(), std::forward(resultTypes), std::forward(operands), std::forward(properties), std::forward(discardableAttributes)); } void BVLShrOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { assert(operands.size() == 2u && "mismatched number of parameters"); odsState.addOperands(operands); odsState.useProperties(const_cast(properties)); odsState.addAttributes(discardableAttributes); ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes; if (::mlir::succeeded(BVLShrOp::inferReturnTypes(odsBuilder.getContext(), odsState.location, operands, odsState.attributes.getDictionary(odsState.getContext()), odsState.getRawProperties(), odsState.regions, inferredReturnTypes))) { assert(inferredReturnTypes.size() == 1u && "mismatched number of return types"); odsState.addTypes(inferredReturnTypes); } else { ::llvm::report_fatal_error("Failed to infer result type(s)."); } } BVLShrOp BVLShrOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(operands), std::forward(properties), std::forward(discardableAttributes)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } BVLShrOp BVLShrOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { return create(builder, builder.getLoc(), std::forward(operands), std::forward(properties), std::forward(discardableAttributes)); } ::llvm::LogicalResult BVLShrOp::verifyInvariantsImpl() { { unsigned index = 0; (void)index; auto valueGroup0 = getODSOperands(0); for (auto v : valueGroup0) { if (::mlir::failed(__mlir_ods_local_type_constraint_SMT8(*this, v.getType(), "operand", index++))) return ::mlir::failure(); } auto valueGroup1 = getODSOperands(1); for (auto v : valueGroup1) { if (::mlir::failed(__mlir_ods_local_type_constraint_SMT8(*this, v.getType(), "operand", index++))) return ::mlir::failure(); } } { unsigned index = 0; (void)index; auto valueGroup0 = getODSResults(0); for (auto v : valueGroup0) { if (::mlir::failed(__mlir_ods_local_type_constraint_SMT8(*this, v.getType(), "result", index++))) return ::mlir::failure(); } } return ::mlir::success(); } ::llvm::LogicalResult BVLShrOp::verifyInvariants() { return verifyInvariantsImpl(); } ::llvm::LogicalResult BVLShrOp::inferReturnTypes(::mlir::MLIRContext *context, ::std::optional<::mlir::Location> location, ::mlir::ValueRange operands, ::mlir::DictionaryAttr attributes, ::mlir::PropertyRef properties, ::mlir::RegionRange regions, ::llvm::SmallVectorImpl<::mlir::Type>&inferredReturnTypes) { inferredReturnTypes.resize(1); ::mlir::Builder odsBuilder(context); if (operands.size() <= 0) return ::mlir::failure(); ::mlir::Type odsInferredType0 = operands[0].getType(); inferredReturnTypes[0] = odsInferredType0; return ::mlir::success(); } ::mlir::ParseResult BVLShrOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) { ::mlir::OpAsmParser::UnresolvedOperand lhsRawOperand{}; ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> lhsOperands(&lhsRawOperand, 1); ::llvm::SMLoc lhsOperandsLoc; (void)lhsOperandsLoc; ::mlir::OpAsmParser::UnresolvedOperand rhsRawOperand{}; ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> rhsOperands(&rhsRawOperand, 1); ::llvm::SMLoc rhsOperandsLoc; (void)rhsOperandsLoc; ::mlir::Type resultRawType{}; ::llvm::ArrayRef<::mlir::Type> resultTypes(&resultRawType, 1); lhsOperandsLoc = parser.getCurrentLocation(); if (parser.parseOperand(lhsRawOperand)) return ::mlir::failure(); if (parser.parseComma()) return ::mlir::failure(); rhsOperandsLoc = parser.getCurrentLocation(); if (parser.parseOperand(rhsRawOperand)) return ::mlir::failure(); { auto loc = parser.getCurrentLocation();(void)loc; if (parser.parseOptionalAttrDict(result.attributes)) return ::mlir::failure(); if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() { return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op "; }))) return ::mlir::failure(); } if (parser.parseColon()) return ::mlir::failure(); if (parser.parseType(resultRawType)) return ::mlir::failure(); result.addTypes(resultTypes); if (parser.resolveOperands(lhsOperands, resultTypes[0], lhsOperandsLoc, result.operands)) return ::mlir::failure(); if (parser.resolveOperands(rhsOperands, resultTypes[0], rhsOperandsLoc, result.operands)) return ::mlir::failure(); return ::mlir::success(); } void BVLShrOp::print(::mlir::OpAsmPrinter &_odsPrinter) { _odsPrinter << ' '; _odsPrinter << getLhs(); _odsPrinter << ","; _odsPrinter << ' '; _odsPrinter << getRhs(); ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs; _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs); _odsPrinter << ' ' << ":"; _odsPrinter << ' '; _odsPrinter << getResult().getType(); } void BVLShrOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) { } } // namespace mlir::smt MLIR_DEFINE_EXPLICIT_TYPE_ID(mlir::smt::BVLShrOp) namespace mlir::smt { //===----------------------------------------------------------------------===// // mlir::smt::BVMulOp definitions //===----------------------------------------------------------------------===// namespace detail { BVMulOpGenericAdaptorBase::BVMulOpGenericAdaptorBase(BVMulOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {} } // namespace detail BVMulOpAdaptor::BVMulOpAdaptor(BVMulOp op) : BVMulOpGenericAdaptor(op->getOperands(), op) {} ::llvm::LogicalResult BVMulOpAdaptor::verify(::mlir::Location loc) { return ::mlir::success(); } ::llvm::LogicalResult BVMulOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) { ::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr); if (!dict) { emitError() << "expected DictionaryAttr to set properties"; return ::mlir::failure(); } return ::mlir::success(); } ::mlir::Attribute BVMulOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) { ::mlir::SmallVector<::mlir::NamedAttribute> attrs; ::mlir::Builder odsBuilder{ctx}; if (!attrs.empty()) return odsBuilder.getDictionaryAttr(attrs); return {}; } llvm::hash_code BVMulOp::computePropertiesHash(const Properties &prop) { using llvm::hash_value; return llvm::hash_combine(); } std::optional BVMulOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) { return std::nullopt; } void BVMulOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) { } void BVMulOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) { } ::llvm::LogicalResult BVMulOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) { return ::mlir::success(); } void BVMulOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs) { odsState.addOperands(lhs); odsState.addOperands(rhs); odsState.addTypes(result); } BVMulOp BVMulOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(result), std::forward(lhs), std::forward(rhs)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } BVMulOp BVMulOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs) { return create(builder, builder.getLoc(), std::forward(result), std::forward(lhs), std::forward(rhs)); } void BVMulOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value lhs, ::mlir::Value rhs) { odsState.addOperands(lhs); odsState.addOperands(rhs); ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes; if (::mlir::succeeded(BVMulOp::inferReturnTypes(odsBuilder.getContext(), odsState.location, odsState.operands, odsState.attributes.getDictionary(odsState.getContext()), odsState.getRawProperties(), odsState.regions, inferredReturnTypes))) odsState.addTypes(inferredReturnTypes); else ::mlir::detail::reportFatalInferReturnTypesError(odsState); } BVMulOp BVMulOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value lhs, ::mlir::Value rhs) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(lhs), std::forward(rhs)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } BVMulOp BVMulOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value lhs, ::mlir::Value rhs) { return create(builder, builder.getLoc(), std::forward(lhs), std::forward(rhs)); } void BVMulOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs) { odsState.addOperands(lhs); odsState.addOperands(rhs); assert(resultTypes.size() == 1u && "mismatched number of results"); odsState.addTypes(resultTypes); } BVMulOp BVMulOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(resultTypes), std::forward(lhs), std::forward(rhs)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } BVMulOp BVMulOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs) { return create(builder, builder.getLoc(), std::forward(resultTypes), std::forward(lhs), std::forward(rhs)); } void BVMulOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { assert(operands.size() == 2u && "mismatched number of parameters"); odsState.addOperands(operands); odsState.addAttributes(attributes); assert(resultTypes.size() == 1u && "mismatched number of return types"); odsState.addTypes(resultTypes); } BVMulOp BVMulOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(resultTypes), std::forward(operands), std::forward(attributes)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } BVMulOp BVMulOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { return create(builder, builder.getLoc(), std::forward(resultTypes), std::forward(operands), std::forward(attributes)); } void BVMulOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { assert(operands.size() == 2u && "mismatched number of parameters"); odsState.addOperands(operands); odsState.addAttributes(attributes); ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes; if (::mlir::succeeded(BVMulOp::inferReturnTypes(odsBuilder.getContext(), odsState.location, operands, odsState.attributes.getDictionary(odsState.getContext()), odsState.getRawProperties(), odsState.regions, inferredReturnTypes))) { assert(inferredReturnTypes.size() == 1u && "mismatched number of return types"); odsState.addTypes(inferredReturnTypes); } else { ::llvm::report_fatal_error("Failed to infer result type(s)."); } } BVMulOp BVMulOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(operands), std::forward(attributes)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } BVMulOp BVMulOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { return create(builder, builder.getLoc(), std::forward(operands), std::forward(attributes)); } void BVMulOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { assert(operands.size() == 2u && "mismatched number of parameters"); odsState.addOperands(operands); odsState.useProperties(const_cast(properties)); odsState.addAttributes(discardableAttributes); assert(resultTypes.size() == 1u && "mismatched number of return types"); odsState.addTypes(resultTypes); } BVMulOp BVMulOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(resultTypes), std::forward(operands), std::forward(properties), std::forward(discardableAttributes)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } BVMulOp BVMulOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { return create(builder, builder.getLoc(), std::forward(resultTypes), std::forward(operands), std::forward(properties), std::forward(discardableAttributes)); } void BVMulOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { assert(operands.size() == 2u && "mismatched number of parameters"); odsState.addOperands(operands); odsState.useProperties(const_cast(properties)); odsState.addAttributes(discardableAttributes); ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes; if (::mlir::succeeded(BVMulOp::inferReturnTypes(odsBuilder.getContext(), odsState.location, operands, odsState.attributes.getDictionary(odsState.getContext()), odsState.getRawProperties(), odsState.regions, inferredReturnTypes))) { assert(inferredReturnTypes.size() == 1u && "mismatched number of return types"); odsState.addTypes(inferredReturnTypes); } else { ::llvm::report_fatal_error("Failed to infer result type(s)."); } } BVMulOp BVMulOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(operands), std::forward(properties), std::forward(discardableAttributes)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } BVMulOp BVMulOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { return create(builder, builder.getLoc(), std::forward(operands), std::forward(properties), std::forward(discardableAttributes)); } ::llvm::LogicalResult BVMulOp::verifyInvariantsImpl() { { unsigned index = 0; (void)index; auto valueGroup0 = getODSOperands(0); for (auto v : valueGroup0) { if (::mlir::failed(__mlir_ods_local_type_constraint_SMT8(*this, v.getType(), "operand", index++))) return ::mlir::failure(); } auto valueGroup1 = getODSOperands(1); for (auto v : valueGroup1) { if (::mlir::failed(__mlir_ods_local_type_constraint_SMT8(*this, v.getType(), "operand", index++))) return ::mlir::failure(); } } { unsigned index = 0; (void)index; auto valueGroup0 = getODSResults(0); for (auto v : valueGroup0) { if (::mlir::failed(__mlir_ods_local_type_constraint_SMT8(*this, v.getType(), "result", index++))) return ::mlir::failure(); } } return ::mlir::success(); } ::llvm::LogicalResult BVMulOp::verifyInvariants() { return verifyInvariantsImpl(); } ::llvm::LogicalResult BVMulOp::inferReturnTypes(::mlir::MLIRContext *context, ::std::optional<::mlir::Location> location, ::mlir::ValueRange operands, ::mlir::DictionaryAttr attributes, ::mlir::PropertyRef properties, ::mlir::RegionRange regions, ::llvm::SmallVectorImpl<::mlir::Type>&inferredReturnTypes) { inferredReturnTypes.resize(1); ::mlir::Builder odsBuilder(context); if (operands.size() <= 0) return ::mlir::failure(); ::mlir::Type odsInferredType0 = operands[0].getType(); inferredReturnTypes[0] = odsInferredType0; return ::mlir::success(); } ::mlir::ParseResult BVMulOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) { ::mlir::OpAsmParser::UnresolvedOperand lhsRawOperand{}; ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> lhsOperands(&lhsRawOperand, 1); ::llvm::SMLoc lhsOperandsLoc; (void)lhsOperandsLoc; ::mlir::OpAsmParser::UnresolvedOperand rhsRawOperand{}; ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> rhsOperands(&rhsRawOperand, 1); ::llvm::SMLoc rhsOperandsLoc; (void)rhsOperandsLoc; ::mlir::Type resultRawType{}; ::llvm::ArrayRef<::mlir::Type> resultTypes(&resultRawType, 1); lhsOperandsLoc = parser.getCurrentLocation(); if (parser.parseOperand(lhsRawOperand)) return ::mlir::failure(); if (parser.parseComma()) return ::mlir::failure(); rhsOperandsLoc = parser.getCurrentLocation(); if (parser.parseOperand(rhsRawOperand)) return ::mlir::failure(); { auto loc = parser.getCurrentLocation();(void)loc; if (parser.parseOptionalAttrDict(result.attributes)) return ::mlir::failure(); if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() { return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op "; }))) return ::mlir::failure(); } if (parser.parseColon()) return ::mlir::failure(); if (parser.parseType(resultRawType)) return ::mlir::failure(); result.addTypes(resultTypes); if (parser.resolveOperands(lhsOperands, resultTypes[0], lhsOperandsLoc, result.operands)) return ::mlir::failure(); if (parser.resolveOperands(rhsOperands, resultTypes[0], rhsOperandsLoc, result.operands)) return ::mlir::failure(); return ::mlir::success(); } void BVMulOp::print(::mlir::OpAsmPrinter &_odsPrinter) { _odsPrinter << ' '; _odsPrinter << getLhs(); _odsPrinter << ","; _odsPrinter << ' '; _odsPrinter << getRhs(); ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs; _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs); _odsPrinter << ' ' << ":"; _odsPrinter << ' '; _odsPrinter << getResult().getType(); } void BVMulOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) { } } // namespace mlir::smt MLIR_DEFINE_EXPLICIT_TYPE_ID(mlir::smt::BVMulOp) namespace mlir::smt { //===----------------------------------------------------------------------===// // mlir::smt::BVNegOp definitions //===----------------------------------------------------------------------===// namespace detail { BVNegOpGenericAdaptorBase::BVNegOpGenericAdaptorBase(BVNegOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {} } // namespace detail BVNegOpAdaptor::BVNegOpAdaptor(BVNegOp op) : BVNegOpGenericAdaptor(op->getOperands(), op) {} ::llvm::LogicalResult BVNegOpAdaptor::verify(::mlir::Location loc) { return ::mlir::success(); } ::llvm::LogicalResult BVNegOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) { ::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr); if (!dict) { emitError() << "expected DictionaryAttr to set properties"; return ::mlir::failure(); } return ::mlir::success(); } ::mlir::Attribute BVNegOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) { ::mlir::SmallVector<::mlir::NamedAttribute> attrs; ::mlir::Builder odsBuilder{ctx}; if (!attrs.empty()) return odsBuilder.getDictionaryAttr(attrs); return {}; } llvm::hash_code BVNegOp::computePropertiesHash(const Properties &prop) { using llvm::hash_value; return llvm::hash_combine(); } std::optional BVNegOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) { return std::nullopt; } void BVNegOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) { } void BVNegOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) { } ::llvm::LogicalResult BVNegOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) { return ::mlir::success(); } void BVNegOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value input) { odsState.addOperands(input); odsState.addTypes(result); } BVNegOp BVNegOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value input) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(result), std::forward(input)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } BVNegOp BVNegOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::Value input) { return create(builder, builder.getLoc(), std::forward(result), std::forward(input)); } void BVNegOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value input) { odsState.addOperands(input); ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes; if (::mlir::succeeded(BVNegOp::inferReturnTypes(odsBuilder.getContext(), odsState.location, odsState.operands, odsState.attributes.getDictionary(odsState.getContext()), odsState.getRawProperties(), odsState.regions, inferredReturnTypes))) odsState.addTypes(inferredReturnTypes); else ::mlir::detail::reportFatalInferReturnTypesError(odsState); } BVNegOp BVNegOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value input) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(input)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } BVNegOp BVNegOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value input) { return create(builder, builder.getLoc(), std::forward(input)); } void BVNegOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input) { odsState.addOperands(input); assert(resultTypes.size() == 1u && "mismatched number of results"); odsState.addTypes(resultTypes); } BVNegOp BVNegOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value input) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(resultTypes), std::forward(input)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } BVNegOp BVNegOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value input) { return create(builder, builder.getLoc(), std::forward(resultTypes), std::forward(input)); } void BVNegOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { assert(operands.size() == 1u && "mismatched number of parameters"); odsState.addOperands(operands); odsState.addAttributes(attributes); assert(resultTypes.size() == 1u && "mismatched number of return types"); odsState.addTypes(resultTypes); } BVNegOp BVNegOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(resultTypes), std::forward(operands), std::forward(attributes)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } BVNegOp BVNegOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { return create(builder, builder.getLoc(), std::forward(resultTypes), std::forward(operands), std::forward(attributes)); } void BVNegOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { assert(operands.size() == 1u && "mismatched number of parameters"); odsState.addOperands(operands); odsState.addAttributes(attributes); ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes; if (::mlir::succeeded(BVNegOp::inferReturnTypes(odsBuilder.getContext(), odsState.location, operands, odsState.attributes.getDictionary(odsState.getContext()), odsState.getRawProperties(), odsState.regions, inferredReturnTypes))) { assert(inferredReturnTypes.size() == 1u && "mismatched number of return types"); odsState.addTypes(inferredReturnTypes); } else { ::llvm::report_fatal_error("Failed to infer result type(s)."); } } BVNegOp BVNegOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(operands), std::forward(attributes)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } BVNegOp BVNegOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { return create(builder, builder.getLoc(), std::forward(operands), std::forward(attributes)); } void BVNegOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { assert(operands.size() == 1u && "mismatched number of parameters"); odsState.addOperands(operands); odsState.useProperties(const_cast(properties)); odsState.addAttributes(discardableAttributes); assert(resultTypes.size() == 1u && "mismatched number of return types"); odsState.addTypes(resultTypes); } BVNegOp BVNegOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(resultTypes), std::forward(operands), std::forward(properties), std::forward(discardableAttributes)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } BVNegOp BVNegOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { return create(builder, builder.getLoc(), std::forward(resultTypes), std::forward(operands), std::forward(properties), std::forward(discardableAttributes)); } void BVNegOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { assert(operands.size() == 1u && "mismatched number of parameters"); odsState.addOperands(operands); odsState.useProperties(const_cast(properties)); odsState.addAttributes(discardableAttributes); ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes; if (::mlir::succeeded(BVNegOp::inferReturnTypes(odsBuilder.getContext(), odsState.location, operands, odsState.attributes.getDictionary(odsState.getContext()), odsState.getRawProperties(), odsState.regions, inferredReturnTypes))) { assert(inferredReturnTypes.size() == 1u && "mismatched number of return types"); odsState.addTypes(inferredReturnTypes); } else { ::llvm::report_fatal_error("Failed to infer result type(s)."); } } BVNegOp BVNegOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(operands), std::forward(properties), std::forward(discardableAttributes)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } BVNegOp BVNegOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { return create(builder, builder.getLoc(), std::forward(operands), std::forward(properties), std::forward(discardableAttributes)); } ::llvm::LogicalResult BVNegOp::verifyInvariantsImpl() { { unsigned index = 0; (void)index; auto valueGroup0 = getODSOperands(0); for (auto v : valueGroup0) { if (::mlir::failed(__mlir_ods_local_type_constraint_SMT8(*this, v.getType(), "operand", index++))) return ::mlir::failure(); } } { unsigned index = 0; (void)index; auto valueGroup0 = getODSResults(0); for (auto v : valueGroup0) { if (::mlir::failed(__mlir_ods_local_type_constraint_SMT8(*this, v.getType(), "result", index++))) return ::mlir::failure(); } } return ::mlir::success(); } ::llvm::LogicalResult BVNegOp::verifyInvariants() { return verifyInvariantsImpl(); } ::llvm::LogicalResult BVNegOp::inferReturnTypes(::mlir::MLIRContext *context, ::std::optional<::mlir::Location> location, ::mlir::ValueRange operands, ::mlir::DictionaryAttr attributes, ::mlir::PropertyRef properties, ::mlir::RegionRange regions, ::llvm::SmallVectorImpl<::mlir::Type>&inferredReturnTypes) { inferredReturnTypes.resize(1); ::mlir::Builder odsBuilder(context); if (operands.size() <= 0) return ::mlir::failure(); ::mlir::Type odsInferredType0 = operands[0].getType(); inferredReturnTypes[0] = odsInferredType0; return ::mlir::success(); } ::mlir::ParseResult BVNegOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) { ::mlir::OpAsmParser::UnresolvedOperand inputRawOperand{}; ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> inputOperands(&inputRawOperand, 1); ::llvm::SMLoc inputOperandsLoc; (void)inputOperandsLoc; ::mlir::Type resultRawType{}; ::llvm::ArrayRef<::mlir::Type> resultTypes(&resultRawType, 1); inputOperandsLoc = parser.getCurrentLocation(); if (parser.parseOperand(inputRawOperand)) return ::mlir::failure(); { auto loc = parser.getCurrentLocation();(void)loc; if (parser.parseOptionalAttrDict(result.attributes)) return ::mlir::failure(); if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() { return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op "; }))) return ::mlir::failure(); } if (parser.parseColon()) return ::mlir::failure(); if (parser.parseType(resultRawType)) return ::mlir::failure(); result.addTypes(resultTypes); if (parser.resolveOperands(inputOperands, resultTypes[0], inputOperandsLoc, result.operands)) return ::mlir::failure(); return ::mlir::success(); } void BVNegOp::print(::mlir::OpAsmPrinter &_odsPrinter) { _odsPrinter << ' '; _odsPrinter << getInput(); ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs; _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs); _odsPrinter << ' ' << ":"; _odsPrinter << ' '; _odsPrinter << getResult().getType(); } void BVNegOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) { } } // namespace mlir::smt MLIR_DEFINE_EXPLICIT_TYPE_ID(mlir::smt::BVNegOp) namespace mlir::smt { //===----------------------------------------------------------------------===// // mlir::smt::BVNotOp definitions //===----------------------------------------------------------------------===// namespace detail { BVNotOpGenericAdaptorBase::BVNotOpGenericAdaptorBase(BVNotOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {} } // namespace detail BVNotOpAdaptor::BVNotOpAdaptor(BVNotOp op) : BVNotOpGenericAdaptor(op->getOperands(), op) {} ::llvm::LogicalResult BVNotOpAdaptor::verify(::mlir::Location loc) { return ::mlir::success(); } ::llvm::LogicalResult BVNotOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) { ::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr); if (!dict) { emitError() << "expected DictionaryAttr to set properties"; return ::mlir::failure(); } return ::mlir::success(); } ::mlir::Attribute BVNotOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) { ::mlir::SmallVector<::mlir::NamedAttribute> attrs; ::mlir::Builder odsBuilder{ctx}; if (!attrs.empty()) return odsBuilder.getDictionaryAttr(attrs); return {}; } llvm::hash_code BVNotOp::computePropertiesHash(const Properties &prop) { using llvm::hash_value; return llvm::hash_combine(); } std::optional BVNotOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) { return std::nullopt; } void BVNotOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) { } void BVNotOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) { } ::llvm::LogicalResult BVNotOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) { return ::mlir::success(); } void BVNotOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value input) { odsState.addOperands(input); odsState.addTypes(result); } BVNotOp BVNotOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value input) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(result), std::forward(input)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } BVNotOp BVNotOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::Value input) { return create(builder, builder.getLoc(), std::forward(result), std::forward(input)); } void BVNotOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value input) { odsState.addOperands(input); ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes; if (::mlir::succeeded(BVNotOp::inferReturnTypes(odsBuilder.getContext(), odsState.location, odsState.operands, odsState.attributes.getDictionary(odsState.getContext()), odsState.getRawProperties(), odsState.regions, inferredReturnTypes))) odsState.addTypes(inferredReturnTypes); else ::mlir::detail::reportFatalInferReturnTypesError(odsState); } BVNotOp BVNotOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value input) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(input)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } BVNotOp BVNotOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value input) { return create(builder, builder.getLoc(), std::forward(input)); } void BVNotOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input) { odsState.addOperands(input); assert(resultTypes.size() == 1u && "mismatched number of results"); odsState.addTypes(resultTypes); } BVNotOp BVNotOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value input) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(resultTypes), std::forward(input)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } BVNotOp BVNotOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value input) { return create(builder, builder.getLoc(), std::forward(resultTypes), std::forward(input)); } void BVNotOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { assert(operands.size() == 1u && "mismatched number of parameters"); odsState.addOperands(operands); odsState.addAttributes(attributes); assert(resultTypes.size() == 1u && "mismatched number of return types"); odsState.addTypes(resultTypes); } BVNotOp BVNotOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(resultTypes), std::forward(operands), std::forward(attributes)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } BVNotOp BVNotOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { return create(builder, builder.getLoc(), std::forward(resultTypes), std::forward(operands), std::forward(attributes)); } void BVNotOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { assert(operands.size() == 1u && "mismatched number of parameters"); odsState.addOperands(operands); odsState.addAttributes(attributes); ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes; if (::mlir::succeeded(BVNotOp::inferReturnTypes(odsBuilder.getContext(), odsState.location, operands, odsState.attributes.getDictionary(odsState.getContext()), odsState.getRawProperties(), odsState.regions, inferredReturnTypes))) { assert(inferredReturnTypes.size() == 1u && "mismatched number of return types"); odsState.addTypes(inferredReturnTypes); } else { ::llvm::report_fatal_error("Failed to infer result type(s)."); } } BVNotOp BVNotOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(operands), std::forward(attributes)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } BVNotOp BVNotOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { return create(builder, builder.getLoc(), std::forward(operands), std::forward(attributes)); } void BVNotOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { assert(operands.size() == 1u && "mismatched number of parameters"); odsState.addOperands(operands); odsState.useProperties(const_cast(properties)); odsState.addAttributes(discardableAttributes); assert(resultTypes.size() == 1u && "mismatched number of return types"); odsState.addTypes(resultTypes); } BVNotOp BVNotOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(resultTypes), std::forward(operands), std::forward(properties), std::forward(discardableAttributes)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } BVNotOp BVNotOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { return create(builder, builder.getLoc(), std::forward(resultTypes), std::forward(operands), std::forward(properties), std::forward(discardableAttributes)); } void BVNotOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { assert(operands.size() == 1u && "mismatched number of parameters"); odsState.addOperands(operands); odsState.useProperties(const_cast(properties)); odsState.addAttributes(discardableAttributes); ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes; if (::mlir::succeeded(BVNotOp::inferReturnTypes(odsBuilder.getContext(), odsState.location, operands, odsState.attributes.getDictionary(odsState.getContext()), odsState.getRawProperties(), odsState.regions, inferredReturnTypes))) { assert(inferredReturnTypes.size() == 1u && "mismatched number of return types"); odsState.addTypes(inferredReturnTypes); } else { ::llvm::report_fatal_error("Failed to infer result type(s)."); } } BVNotOp BVNotOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(operands), std::forward(properties), std::forward(discardableAttributes)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } BVNotOp BVNotOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { return create(builder, builder.getLoc(), std::forward(operands), std::forward(properties), std::forward(discardableAttributes)); } ::llvm::LogicalResult BVNotOp::verifyInvariantsImpl() { { unsigned index = 0; (void)index; auto valueGroup0 = getODSOperands(0); for (auto v : valueGroup0) { if (::mlir::failed(__mlir_ods_local_type_constraint_SMT8(*this, v.getType(), "operand", index++))) return ::mlir::failure(); } } { unsigned index = 0; (void)index; auto valueGroup0 = getODSResults(0); for (auto v : valueGroup0) { if (::mlir::failed(__mlir_ods_local_type_constraint_SMT8(*this, v.getType(), "result", index++))) return ::mlir::failure(); } } return ::mlir::success(); } ::llvm::LogicalResult BVNotOp::verifyInvariants() { return verifyInvariantsImpl(); } ::llvm::LogicalResult BVNotOp::inferReturnTypes(::mlir::MLIRContext *context, ::std::optional<::mlir::Location> location, ::mlir::ValueRange operands, ::mlir::DictionaryAttr attributes, ::mlir::PropertyRef properties, ::mlir::RegionRange regions, ::llvm::SmallVectorImpl<::mlir::Type>&inferredReturnTypes) { inferredReturnTypes.resize(1); ::mlir::Builder odsBuilder(context); if (operands.size() <= 0) return ::mlir::failure(); ::mlir::Type odsInferredType0 = operands[0].getType(); inferredReturnTypes[0] = odsInferredType0; return ::mlir::success(); } ::mlir::ParseResult BVNotOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) { ::mlir::OpAsmParser::UnresolvedOperand inputRawOperand{}; ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> inputOperands(&inputRawOperand, 1); ::llvm::SMLoc inputOperandsLoc; (void)inputOperandsLoc; ::mlir::Type resultRawType{}; ::llvm::ArrayRef<::mlir::Type> resultTypes(&resultRawType, 1); inputOperandsLoc = parser.getCurrentLocation(); if (parser.parseOperand(inputRawOperand)) return ::mlir::failure(); { auto loc = parser.getCurrentLocation();(void)loc; if (parser.parseOptionalAttrDict(result.attributes)) return ::mlir::failure(); if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() { return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op "; }))) return ::mlir::failure(); } if (parser.parseColon()) return ::mlir::failure(); if (parser.parseType(resultRawType)) return ::mlir::failure(); result.addTypes(resultTypes); if (parser.resolveOperands(inputOperands, resultTypes[0], inputOperandsLoc, result.operands)) return ::mlir::failure(); return ::mlir::success(); } void BVNotOp::print(::mlir::OpAsmPrinter &_odsPrinter) { _odsPrinter << ' '; _odsPrinter << getInput(); ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs; _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs); _odsPrinter << ' ' << ":"; _odsPrinter << ' '; _odsPrinter << getResult().getType(); } void BVNotOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) { } } // namespace mlir::smt MLIR_DEFINE_EXPLICIT_TYPE_ID(mlir::smt::BVNotOp) namespace mlir::smt { //===----------------------------------------------------------------------===// // mlir::smt::BVOrOp definitions //===----------------------------------------------------------------------===// namespace detail { BVOrOpGenericAdaptorBase::BVOrOpGenericAdaptorBase(BVOrOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {} } // namespace detail BVOrOpAdaptor::BVOrOpAdaptor(BVOrOp op) : BVOrOpGenericAdaptor(op->getOperands(), op) {} ::llvm::LogicalResult BVOrOpAdaptor::verify(::mlir::Location loc) { return ::mlir::success(); } ::llvm::LogicalResult BVOrOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) { ::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr); if (!dict) { emitError() << "expected DictionaryAttr to set properties"; return ::mlir::failure(); } return ::mlir::success(); } ::mlir::Attribute BVOrOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) { ::mlir::SmallVector<::mlir::NamedAttribute> attrs; ::mlir::Builder odsBuilder{ctx}; if (!attrs.empty()) return odsBuilder.getDictionaryAttr(attrs); return {}; } llvm::hash_code BVOrOp::computePropertiesHash(const Properties &prop) { using llvm::hash_value; return llvm::hash_combine(); } std::optional BVOrOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) { return std::nullopt; } void BVOrOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) { } void BVOrOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) { } ::llvm::LogicalResult BVOrOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) { return ::mlir::success(); } void BVOrOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs) { odsState.addOperands(lhs); odsState.addOperands(rhs); odsState.addTypes(result); } BVOrOp BVOrOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(result), std::forward(lhs), std::forward(rhs)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } BVOrOp BVOrOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs) { return create(builder, builder.getLoc(), std::forward(result), std::forward(lhs), std::forward(rhs)); } void BVOrOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value lhs, ::mlir::Value rhs) { odsState.addOperands(lhs); odsState.addOperands(rhs); ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes; if (::mlir::succeeded(BVOrOp::inferReturnTypes(odsBuilder.getContext(), odsState.location, odsState.operands, odsState.attributes.getDictionary(odsState.getContext()), odsState.getRawProperties(), odsState.regions, inferredReturnTypes))) odsState.addTypes(inferredReturnTypes); else ::mlir::detail::reportFatalInferReturnTypesError(odsState); } BVOrOp BVOrOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value lhs, ::mlir::Value rhs) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(lhs), std::forward(rhs)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } BVOrOp BVOrOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value lhs, ::mlir::Value rhs) { return create(builder, builder.getLoc(), std::forward(lhs), std::forward(rhs)); } void BVOrOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs) { odsState.addOperands(lhs); odsState.addOperands(rhs); assert(resultTypes.size() == 1u && "mismatched number of results"); odsState.addTypes(resultTypes); } BVOrOp BVOrOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(resultTypes), std::forward(lhs), std::forward(rhs)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } BVOrOp BVOrOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs) { return create(builder, builder.getLoc(), std::forward(resultTypes), std::forward(lhs), std::forward(rhs)); } void BVOrOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { assert(operands.size() == 2u && "mismatched number of parameters"); odsState.addOperands(operands); odsState.addAttributes(attributes); assert(resultTypes.size() == 1u && "mismatched number of return types"); odsState.addTypes(resultTypes); } BVOrOp BVOrOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(resultTypes), std::forward(operands), std::forward(attributes)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } BVOrOp BVOrOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { return create(builder, builder.getLoc(), std::forward(resultTypes), std::forward(operands), std::forward(attributes)); } void BVOrOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { assert(operands.size() == 2u && "mismatched number of parameters"); odsState.addOperands(operands); odsState.addAttributes(attributes); ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes; if (::mlir::succeeded(BVOrOp::inferReturnTypes(odsBuilder.getContext(), odsState.location, operands, odsState.attributes.getDictionary(odsState.getContext()), odsState.getRawProperties(), odsState.regions, inferredReturnTypes))) { assert(inferredReturnTypes.size() == 1u && "mismatched number of return types"); odsState.addTypes(inferredReturnTypes); } else { ::llvm::report_fatal_error("Failed to infer result type(s)."); } } BVOrOp BVOrOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(operands), std::forward(attributes)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } BVOrOp BVOrOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { return create(builder, builder.getLoc(), std::forward(operands), std::forward(attributes)); } void BVOrOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { assert(operands.size() == 2u && "mismatched number of parameters"); odsState.addOperands(operands); odsState.useProperties(const_cast(properties)); odsState.addAttributes(discardableAttributes); assert(resultTypes.size() == 1u && "mismatched number of return types"); odsState.addTypes(resultTypes); } BVOrOp BVOrOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(resultTypes), std::forward(operands), std::forward(properties), std::forward(discardableAttributes)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } BVOrOp BVOrOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { return create(builder, builder.getLoc(), std::forward(resultTypes), std::forward(operands), std::forward(properties), std::forward(discardableAttributes)); } void BVOrOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { assert(operands.size() == 2u && "mismatched number of parameters"); odsState.addOperands(operands); odsState.useProperties(const_cast(properties)); odsState.addAttributes(discardableAttributes); ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes; if (::mlir::succeeded(BVOrOp::inferReturnTypes(odsBuilder.getContext(), odsState.location, operands, odsState.attributes.getDictionary(odsState.getContext()), odsState.getRawProperties(), odsState.regions, inferredReturnTypes))) { assert(inferredReturnTypes.size() == 1u && "mismatched number of return types"); odsState.addTypes(inferredReturnTypes); } else { ::llvm::report_fatal_error("Failed to infer result type(s)."); } } BVOrOp BVOrOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(operands), std::forward(properties), std::forward(discardableAttributes)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } BVOrOp BVOrOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { return create(builder, builder.getLoc(), std::forward(operands), std::forward(properties), std::forward(discardableAttributes)); } ::llvm::LogicalResult BVOrOp::verifyInvariantsImpl() { { unsigned index = 0; (void)index; auto valueGroup0 = getODSOperands(0); for (auto v : valueGroup0) { if (::mlir::failed(__mlir_ods_local_type_constraint_SMT8(*this, v.getType(), "operand", index++))) return ::mlir::failure(); } auto valueGroup1 = getODSOperands(1); for (auto v : valueGroup1) { if (::mlir::failed(__mlir_ods_local_type_constraint_SMT8(*this, v.getType(), "operand", index++))) return ::mlir::failure(); } } { unsigned index = 0; (void)index; auto valueGroup0 = getODSResults(0); for (auto v : valueGroup0) { if (::mlir::failed(__mlir_ods_local_type_constraint_SMT8(*this, v.getType(), "result", index++))) return ::mlir::failure(); } } return ::mlir::success(); } ::llvm::LogicalResult BVOrOp::verifyInvariants() { return verifyInvariantsImpl(); } ::llvm::LogicalResult BVOrOp::inferReturnTypes(::mlir::MLIRContext *context, ::std::optional<::mlir::Location> location, ::mlir::ValueRange operands, ::mlir::DictionaryAttr attributes, ::mlir::PropertyRef properties, ::mlir::RegionRange regions, ::llvm::SmallVectorImpl<::mlir::Type>&inferredReturnTypes) { inferredReturnTypes.resize(1); ::mlir::Builder odsBuilder(context); if (operands.size() <= 0) return ::mlir::failure(); ::mlir::Type odsInferredType0 = operands[0].getType(); inferredReturnTypes[0] = odsInferredType0; return ::mlir::success(); } ::mlir::ParseResult BVOrOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) { ::mlir::OpAsmParser::UnresolvedOperand lhsRawOperand{}; ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> lhsOperands(&lhsRawOperand, 1); ::llvm::SMLoc lhsOperandsLoc; (void)lhsOperandsLoc; ::mlir::OpAsmParser::UnresolvedOperand rhsRawOperand{}; ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> rhsOperands(&rhsRawOperand, 1); ::llvm::SMLoc rhsOperandsLoc; (void)rhsOperandsLoc; ::mlir::Type resultRawType{}; ::llvm::ArrayRef<::mlir::Type> resultTypes(&resultRawType, 1); lhsOperandsLoc = parser.getCurrentLocation(); if (parser.parseOperand(lhsRawOperand)) return ::mlir::failure(); if (parser.parseComma()) return ::mlir::failure(); rhsOperandsLoc = parser.getCurrentLocation(); if (parser.parseOperand(rhsRawOperand)) return ::mlir::failure(); { auto loc = parser.getCurrentLocation();(void)loc; if (parser.parseOptionalAttrDict(result.attributes)) return ::mlir::failure(); if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() { return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op "; }))) return ::mlir::failure(); } if (parser.parseColon()) return ::mlir::failure(); if (parser.parseType(resultRawType)) return ::mlir::failure(); result.addTypes(resultTypes); if (parser.resolveOperands(lhsOperands, resultTypes[0], lhsOperandsLoc, result.operands)) return ::mlir::failure(); if (parser.resolveOperands(rhsOperands, resultTypes[0], rhsOperandsLoc, result.operands)) return ::mlir::failure(); return ::mlir::success(); } void BVOrOp::print(::mlir::OpAsmPrinter &_odsPrinter) { _odsPrinter << ' '; _odsPrinter << getLhs(); _odsPrinter << ","; _odsPrinter << ' '; _odsPrinter << getRhs(); ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs; _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs); _odsPrinter << ' ' << ":"; _odsPrinter << ' '; _odsPrinter << getResult().getType(); } void BVOrOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) { } } // namespace mlir::smt MLIR_DEFINE_EXPLICIT_TYPE_ID(mlir::smt::BVOrOp) namespace mlir::smt { //===----------------------------------------------------------------------===// // mlir::smt::BVSDivOp definitions //===----------------------------------------------------------------------===// namespace detail { BVSDivOpGenericAdaptorBase::BVSDivOpGenericAdaptorBase(BVSDivOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {} } // namespace detail BVSDivOpAdaptor::BVSDivOpAdaptor(BVSDivOp op) : BVSDivOpGenericAdaptor(op->getOperands(), op) {} ::llvm::LogicalResult BVSDivOpAdaptor::verify(::mlir::Location loc) { return ::mlir::success(); } ::llvm::LogicalResult BVSDivOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) { ::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr); if (!dict) { emitError() << "expected DictionaryAttr to set properties"; return ::mlir::failure(); } return ::mlir::success(); } ::mlir::Attribute BVSDivOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) { ::mlir::SmallVector<::mlir::NamedAttribute> attrs; ::mlir::Builder odsBuilder{ctx}; if (!attrs.empty()) return odsBuilder.getDictionaryAttr(attrs); return {}; } llvm::hash_code BVSDivOp::computePropertiesHash(const Properties &prop) { using llvm::hash_value; return llvm::hash_combine(); } std::optional BVSDivOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) { return std::nullopt; } void BVSDivOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) { } void BVSDivOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) { } ::llvm::LogicalResult BVSDivOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) { return ::mlir::success(); } void BVSDivOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs) { odsState.addOperands(lhs); odsState.addOperands(rhs); odsState.addTypes(result); } BVSDivOp BVSDivOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(result), std::forward(lhs), std::forward(rhs)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } BVSDivOp BVSDivOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs) { return create(builder, builder.getLoc(), std::forward(result), std::forward(lhs), std::forward(rhs)); } void BVSDivOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value lhs, ::mlir::Value rhs) { odsState.addOperands(lhs); odsState.addOperands(rhs); ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes; if (::mlir::succeeded(BVSDivOp::inferReturnTypes(odsBuilder.getContext(), odsState.location, odsState.operands, odsState.attributes.getDictionary(odsState.getContext()), odsState.getRawProperties(), odsState.regions, inferredReturnTypes))) odsState.addTypes(inferredReturnTypes); else ::mlir::detail::reportFatalInferReturnTypesError(odsState); } BVSDivOp BVSDivOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value lhs, ::mlir::Value rhs) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(lhs), std::forward(rhs)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } BVSDivOp BVSDivOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value lhs, ::mlir::Value rhs) { return create(builder, builder.getLoc(), std::forward(lhs), std::forward(rhs)); } void BVSDivOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs) { odsState.addOperands(lhs); odsState.addOperands(rhs); assert(resultTypes.size() == 1u && "mismatched number of results"); odsState.addTypes(resultTypes); } BVSDivOp BVSDivOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(resultTypes), std::forward(lhs), std::forward(rhs)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } BVSDivOp BVSDivOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs) { return create(builder, builder.getLoc(), std::forward(resultTypes), std::forward(lhs), std::forward(rhs)); } void BVSDivOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { assert(operands.size() == 2u && "mismatched number of parameters"); odsState.addOperands(operands); odsState.addAttributes(attributes); assert(resultTypes.size() == 1u && "mismatched number of return types"); odsState.addTypes(resultTypes); } BVSDivOp BVSDivOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(resultTypes), std::forward(operands), std::forward(attributes)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } BVSDivOp BVSDivOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { return create(builder, builder.getLoc(), std::forward(resultTypes), std::forward(operands), std::forward(attributes)); } void BVSDivOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { assert(operands.size() == 2u && "mismatched number of parameters"); odsState.addOperands(operands); odsState.addAttributes(attributes); ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes; if (::mlir::succeeded(BVSDivOp::inferReturnTypes(odsBuilder.getContext(), odsState.location, operands, odsState.attributes.getDictionary(odsState.getContext()), odsState.getRawProperties(), odsState.regions, inferredReturnTypes))) { assert(inferredReturnTypes.size() == 1u && "mismatched number of return types"); odsState.addTypes(inferredReturnTypes); } else { ::llvm::report_fatal_error("Failed to infer result type(s)."); } } BVSDivOp BVSDivOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(operands), std::forward(attributes)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } BVSDivOp BVSDivOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { return create(builder, builder.getLoc(), std::forward(operands), std::forward(attributes)); } void BVSDivOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { assert(operands.size() == 2u && "mismatched number of parameters"); odsState.addOperands(operands); odsState.useProperties(const_cast(properties)); odsState.addAttributes(discardableAttributes); assert(resultTypes.size() == 1u && "mismatched number of return types"); odsState.addTypes(resultTypes); } BVSDivOp BVSDivOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(resultTypes), std::forward(operands), std::forward(properties), std::forward(discardableAttributes)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } BVSDivOp BVSDivOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { return create(builder, builder.getLoc(), std::forward(resultTypes), std::forward(operands), std::forward(properties), std::forward(discardableAttributes)); } void BVSDivOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { assert(operands.size() == 2u && "mismatched number of parameters"); odsState.addOperands(operands); odsState.useProperties(const_cast(properties)); odsState.addAttributes(discardableAttributes); ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes; if (::mlir::succeeded(BVSDivOp::inferReturnTypes(odsBuilder.getContext(), odsState.location, operands, odsState.attributes.getDictionary(odsState.getContext()), odsState.getRawProperties(), odsState.regions, inferredReturnTypes))) { assert(inferredReturnTypes.size() == 1u && "mismatched number of return types"); odsState.addTypes(inferredReturnTypes); } else { ::llvm::report_fatal_error("Failed to infer result type(s)."); } } BVSDivOp BVSDivOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(operands), std::forward(properties), std::forward(discardableAttributes)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } BVSDivOp BVSDivOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { return create(builder, builder.getLoc(), std::forward(operands), std::forward(properties), std::forward(discardableAttributes)); } ::llvm::LogicalResult BVSDivOp::verifyInvariantsImpl() { { unsigned index = 0; (void)index; auto valueGroup0 = getODSOperands(0); for (auto v : valueGroup0) { if (::mlir::failed(__mlir_ods_local_type_constraint_SMT8(*this, v.getType(), "operand", index++))) return ::mlir::failure(); } auto valueGroup1 = getODSOperands(1); for (auto v : valueGroup1) { if (::mlir::failed(__mlir_ods_local_type_constraint_SMT8(*this, v.getType(), "operand", index++))) return ::mlir::failure(); } } { unsigned index = 0; (void)index; auto valueGroup0 = getODSResults(0); for (auto v : valueGroup0) { if (::mlir::failed(__mlir_ods_local_type_constraint_SMT8(*this, v.getType(), "result", index++))) return ::mlir::failure(); } } return ::mlir::success(); } ::llvm::LogicalResult BVSDivOp::verifyInvariants() { return verifyInvariantsImpl(); } ::llvm::LogicalResult BVSDivOp::inferReturnTypes(::mlir::MLIRContext *context, ::std::optional<::mlir::Location> location, ::mlir::ValueRange operands, ::mlir::DictionaryAttr attributes, ::mlir::PropertyRef properties, ::mlir::RegionRange regions, ::llvm::SmallVectorImpl<::mlir::Type>&inferredReturnTypes) { inferredReturnTypes.resize(1); ::mlir::Builder odsBuilder(context); if (operands.size() <= 0) return ::mlir::failure(); ::mlir::Type odsInferredType0 = operands[0].getType(); inferredReturnTypes[0] = odsInferredType0; return ::mlir::success(); } ::mlir::ParseResult BVSDivOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) { ::mlir::OpAsmParser::UnresolvedOperand lhsRawOperand{}; ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> lhsOperands(&lhsRawOperand, 1); ::llvm::SMLoc lhsOperandsLoc; (void)lhsOperandsLoc; ::mlir::OpAsmParser::UnresolvedOperand rhsRawOperand{}; ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> rhsOperands(&rhsRawOperand, 1); ::llvm::SMLoc rhsOperandsLoc; (void)rhsOperandsLoc; ::mlir::Type resultRawType{}; ::llvm::ArrayRef<::mlir::Type> resultTypes(&resultRawType, 1); lhsOperandsLoc = parser.getCurrentLocation(); if (parser.parseOperand(lhsRawOperand)) return ::mlir::failure(); if (parser.parseComma()) return ::mlir::failure(); rhsOperandsLoc = parser.getCurrentLocation(); if (parser.parseOperand(rhsRawOperand)) return ::mlir::failure(); { auto loc = parser.getCurrentLocation();(void)loc; if (parser.parseOptionalAttrDict(result.attributes)) return ::mlir::failure(); if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() { return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op "; }))) return ::mlir::failure(); } if (parser.parseColon()) return ::mlir::failure(); if (parser.parseType(resultRawType)) return ::mlir::failure(); result.addTypes(resultTypes); if (parser.resolveOperands(lhsOperands, resultTypes[0], lhsOperandsLoc, result.operands)) return ::mlir::failure(); if (parser.resolveOperands(rhsOperands, resultTypes[0], rhsOperandsLoc, result.operands)) return ::mlir::failure(); return ::mlir::success(); } void BVSDivOp::print(::mlir::OpAsmPrinter &_odsPrinter) { _odsPrinter << ' '; _odsPrinter << getLhs(); _odsPrinter << ","; _odsPrinter << ' '; _odsPrinter << getRhs(); ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs; _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs); _odsPrinter << ' ' << ":"; _odsPrinter << ' '; _odsPrinter << getResult().getType(); } void BVSDivOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) { } } // namespace mlir::smt MLIR_DEFINE_EXPLICIT_TYPE_ID(mlir::smt::BVSDivOp) namespace mlir::smt { //===----------------------------------------------------------------------===// // mlir::smt::BVSModOp definitions //===----------------------------------------------------------------------===// namespace detail { BVSModOpGenericAdaptorBase::BVSModOpGenericAdaptorBase(BVSModOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {} } // namespace detail BVSModOpAdaptor::BVSModOpAdaptor(BVSModOp op) : BVSModOpGenericAdaptor(op->getOperands(), op) {} ::llvm::LogicalResult BVSModOpAdaptor::verify(::mlir::Location loc) { return ::mlir::success(); } ::llvm::LogicalResult BVSModOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) { ::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr); if (!dict) { emitError() << "expected DictionaryAttr to set properties"; return ::mlir::failure(); } return ::mlir::success(); } ::mlir::Attribute BVSModOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) { ::mlir::SmallVector<::mlir::NamedAttribute> attrs; ::mlir::Builder odsBuilder{ctx}; if (!attrs.empty()) return odsBuilder.getDictionaryAttr(attrs); return {}; } llvm::hash_code BVSModOp::computePropertiesHash(const Properties &prop) { using llvm::hash_value; return llvm::hash_combine(); } std::optional BVSModOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) { return std::nullopt; } void BVSModOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) { } void BVSModOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) { } ::llvm::LogicalResult BVSModOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) { return ::mlir::success(); } void BVSModOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs) { odsState.addOperands(lhs); odsState.addOperands(rhs); odsState.addTypes(result); } BVSModOp BVSModOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(result), std::forward(lhs), std::forward(rhs)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } BVSModOp BVSModOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs) { return create(builder, builder.getLoc(), std::forward(result), std::forward(lhs), std::forward(rhs)); } void BVSModOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value lhs, ::mlir::Value rhs) { odsState.addOperands(lhs); odsState.addOperands(rhs); ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes; if (::mlir::succeeded(BVSModOp::inferReturnTypes(odsBuilder.getContext(), odsState.location, odsState.operands, odsState.attributes.getDictionary(odsState.getContext()), odsState.getRawProperties(), odsState.regions, inferredReturnTypes))) odsState.addTypes(inferredReturnTypes); else ::mlir::detail::reportFatalInferReturnTypesError(odsState); } BVSModOp BVSModOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value lhs, ::mlir::Value rhs) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(lhs), std::forward(rhs)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } BVSModOp BVSModOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value lhs, ::mlir::Value rhs) { return create(builder, builder.getLoc(), std::forward(lhs), std::forward(rhs)); } void BVSModOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs) { odsState.addOperands(lhs); odsState.addOperands(rhs); assert(resultTypes.size() == 1u && "mismatched number of results"); odsState.addTypes(resultTypes); } BVSModOp BVSModOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(resultTypes), std::forward(lhs), std::forward(rhs)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } BVSModOp BVSModOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs) { return create(builder, builder.getLoc(), std::forward(resultTypes), std::forward(lhs), std::forward(rhs)); } void BVSModOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { assert(operands.size() == 2u && "mismatched number of parameters"); odsState.addOperands(operands); odsState.addAttributes(attributes); assert(resultTypes.size() == 1u && "mismatched number of return types"); odsState.addTypes(resultTypes); } BVSModOp BVSModOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(resultTypes), std::forward(operands), std::forward(attributes)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } BVSModOp BVSModOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { return create(builder, builder.getLoc(), std::forward(resultTypes), std::forward(operands), std::forward(attributes)); } void BVSModOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { assert(operands.size() == 2u && "mismatched number of parameters"); odsState.addOperands(operands); odsState.addAttributes(attributes); ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes; if (::mlir::succeeded(BVSModOp::inferReturnTypes(odsBuilder.getContext(), odsState.location, operands, odsState.attributes.getDictionary(odsState.getContext()), odsState.getRawProperties(), odsState.regions, inferredReturnTypes))) { assert(inferredReturnTypes.size() == 1u && "mismatched number of return types"); odsState.addTypes(inferredReturnTypes); } else { ::llvm::report_fatal_error("Failed to infer result type(s)."); } } BVSModOp BVSModOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(operands), std::forward(attributes)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } BVSModOp BVSModOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { return create(builder, builder.getLoc(), std::forward(operands), std::forward(attributes)); } void BVSModOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { assert(operands.size() == 2u && "mismatched number of parameters"); odsState.addOperands(operands); odsState.useProperties(const_cast(properties)); odsState.addAttributes(discardableAttributes); assert(resultTypes.size() == 1u && "mismatched number of return types"); odsState.addTypes(resultTypes); } BVSModOp BVSModOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(resultTypes), std::forward(operands), std::forward(properties), std::forward(discardableAttributes)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } BVSModOp BVSModOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { return create(builder, builder.getLoc(), std::forward(resultTypes), std::forward(operands), std::forward(properties), std::forward(discardableAttributes)); } void BVSModOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { assert(operands.size() == 2u && "mismatched number of parameters"); odsState.addOperands(operands); odsState.useProperties(const_cast(properties)); odsState.addAttributes(discardableAttributes); ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes; if (::mlir::succeeded(BVSModOp::inferReturnTypes(odsBuilder.getContext(), odsState.location, operands, odsState.attributes.getDictionary(odsState.getContext()), odsState.getRawProperties(), odsState.regions, inferredReturnTypes))) { assert(inferredReturnTypes.size() == 1u && "mismatched number of return types"); odsState.addTypes(inferredReturnTypes); } else { ::llvm::report_fatal_error("Failed to infer result type(s)."); } } BVSModOp BVSModOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(operands), std::forward(properties), std::forward(discardableAttributes)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } BVSModOp BVSModOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { return create(builder, builder.getLoc(), std::forward(operands), std::forward(properties), std::forward(discardableAttributes)); } ::llvm::LogicalResult BVSModOp::verifyInvariantsImpl() { { unsigned index = 0; (void)index; auto valueGroup0 = getODSOperands(0); for (auto v : valueGroup0) { if (::mlir::failed(__mlir_ods_local_type_constraint_SMT8(*this, v.getType(), "operand", index++))) return ::mlir::failure(); } auto valueGroup1 = getODSOperands(1); for (auto v : valueGroup1) { if (::mlir::failed(__mlir_ods_local_type_constraint_SMT8(*this, v.getType(), "operand", index++))) return ::mlir::failure(); } } { unsigned index = 0; (void)index; auto valueGroup0 = getODSResults(0); for (auto v : valueGroup0) { if (::mlir::failed(__mlir_ods_local_type_constraint_SMT8(*this, v.getType(), "result", index++))) return ::mlir::failure(); } } return ::mlir::success(); } ::llvm::LogicalResult BVSModOp::verifyInvariants() { return verifyInvariantsImpl(); } ::llvm::LogicalResult BVSModOp::inferReturnTypes(::mlir::MLIRContext *context, ::std::optional<::mlir::Location> location, ::mlir::ValueRange operands, ::mlir::DictionaryAttr attributes, ::mlir::PropertyRef properties, ::mlir::RegionRange regions, ::llvm::SmallVectorImpl<::mlir::Type>&inferredReturnTypes) { inferredReturnTypes.resize(1); ::mlir::Builder odsBuilder(context); if (operands.size() <= 0) return ::mlir::failure(); ::mlir::Type odsInferredType0 = operands[0].getType(); inferredReturnTypes[0] = odsInferredType0; return ::mlir::success(); } ::mlir::ParseResult BVSModOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) { ::mlir::OpAsmParser::UnresolvedOperand lhsRawOperand{}; ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> lhsOperands(&lhsRawOperand, 1); ::llvm::SMLoc lhsOperandsLoc; (void)lhsOperandsLoc; ::mlir::OpAsmParser::UnresolvedOperand rhsRawOperand{}; ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> rhsOperands(&rhsRawOperand, 1); ::llvm::SMLoc rhsOperandsLoc; (void)rhsOperandsLoc; ::mlir::Type resultRawType{}; ::llvm::ArrayRef<::mlir::Type> resultTypes(&resultRawType, 1); lhsOperandsLoc = parser.getCurrentLocation(); if (parser.parseOperand(lhsRawOperand)) return ::mlir::failure(); if (parser.parseComma()) return ::mlir::failure(); rhsOperandsLoc = parser.getCurrentLocation(); if (parser.parseOperand(rhsRawOperand)) return ::mlir::failure(); { auto loc = parser.getCurrentLocation();(void)loc; if (parser.parseOptionalAttrDict(result.attributes)) return ::mlir::failure(); if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() { return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op "; }))) return ::mlir::failure(); } if (parser.parseColon()) return ::mlir::failure(); if (parser.parseType(resultRawType)) return ::mlir::failure(); result.addTypes(resultTypes); if (parser.resolveOperands(lhsOperands, resultTypes[0], lhsOperandsLoc, result.operands)) return ::mlir::failure(); if (parser.resolveOperands(rhsOperands, resultTypes[0], rhsOperandsLoc, result.operands)) return ::mlir::failure(); return ::mlir::success(); } void BVSModOp::print(::mlir::OpAsmPrinter &_odsPrinter) { _odsPrinter << ' '; _odsPrinter << getLhs(); _odsPrinter << ","; _odsPrinter << ' '; _odsPrinter << getRhs(); ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs; _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs); _odsPrinter << ' ' << ":"; _odsPrinter << ' '; _odsPrinter << getResult().getType(); } void BVSModOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) { } } // namespace mlir::smt MLIR_DEFINE_EXPLICIT_TYPE_ID(mlir::smt::BVSModOp) namespace mlir::smt { //===----------------------------------------------------------------------===// // mlir::smt::BVSRemOp definitions //===----------------------------------------------------------------------===// namespace detail { BVSRemOpGenericAdaptorBase::BVSRemOpGenericAdaptorBase(BVSRemOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {} } // namespace detail BVSRemOpAdaptor::BVSRemOpAdaptor(BVSRemOp op) : BVSRemOpGenericAdaptor(op->getOperands(), op) {} ::llvm::LogicalResult BVSRemOpAdaptor::verify(::mlir::Location loc) { return ::mlir::success(); } ::llvm::LogicalResult BVSRemOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) { ::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr); if (!dict) { emitError() << "expected DictionaryAttr to set properties"; return ::mlir::failure(); } return ::mlir::success(); } ::mlir::Attribute BVSRemOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) { ::mlir::SmallVector<::mlir::NamedAttribute> attrs; ::mlir::Builder odsBuilder{ctx}; if (!attrs.empty()) return odsBuilder.getDictionaryAttr(attrs); return {}; } llvm::hash_code BVSRemOp::computePropertiesHash(const Properties &prop) { using llvm::hash_value; return llvm::hash_combine(); } std::optional BVSRemOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) { return std::nullopt; } void BVSRemOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) { } void BVSRemOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) { } ::llvm::LogicalResult BVSRemOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) { return ::mlir::success(); } void BVSRemOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs) { odsState.addOperands(lhs); odsState.addOperands(rhs); odsState.addTypes(result); } BVSRemOp BVSRemOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(result), std::forward(lhs), std::forward(rhs)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } BVSRemOp BVSRemOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs) { return create(builder, builder.getLoc(), std::forward(result), std::forward(lhs), std::forward(rhs)); } void BVSRemOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value lhs, ::mlir::Value rhs) { odsState.addOperands(lhs); odsState.addOperands(rhs); ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes; if (::mlir::succeeded(BVSRemOp::inferReturnTypes(odsBuilder.getContext(), odsState.location, odsState.operands, odsState.attributes.getDictionary(odsState.getContext()), odsState.getRawProperties(), odsState.regions, inferredReturnTypes))) odsState.addTypes(inferredReturnTypes); else ::mlir::detail::reportFatalInferReturnTypesError(odsState); } BVSRemOp BVSRemOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value lhs, ::mlir::Value rhs) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(lhs), std::forward(rhs)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } BVSRemOp BVSRemOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value lhs, ::mlir::Value rhs) { return create(builder, builder.getLoc(), std::forward(lhs), std::forward(rhs)); } void BVSRemOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs) { odsState.addOperands(lhs); odsState.addOperands(rhs); assert(resultTypes.size() == 1u && "mismatched number of results"); odsState.addTypes(resultTypes); } BVSRemOp BVSRemOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(resultTypes), std::forward(lhs), std::forward(rhs)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } BVSRemOp BVSRemOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs) { return create(builder, builder.getLoc(), std::forward(resultTypes), std::forward(lhs), std::forward(rhs)); } void BVSRemOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { assert(operands.size() == 2u && "mismatched number of parameters"); odsState.addOperands(operands); odsState.addAttributes(attributes); assert(resultTypes.size() == 1u && "mismatched number of return types"); odsState.addTypes(resultTypes); } BVSRemOp BVSRemOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(resultTypes), std::forward(operands), std::forward(attributes)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } BVSRemOp BVSRemOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { return create(builder, builder.getLoc(), std::forward(resultTypes), std::forward(operands), std::forward(attributes)); } void BVSRemOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { assert(operands.size() == 2u && "mismatched number of parameters"); odsState.addOperands(operands); odsState.addAttributes(attributes); ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes; if (::mlir::succeeded(BVSRemOp::inferReturnTypes(odsBuilder.getContext(), odsState.location, operands, odsState.attributes.getDictionary(odsState.getContext()), odsState.getRawProperties(), odsState.regions, inferredReturnTypes))) { assert(inferredReturnTypes.size() == 1u && "mismatched number of return types"); odsState.addTypes(inferredReturnTypes); } else { ::llvm::report_fatal_error("Failed to infer result type(s)."); } } BVSRemOp BVSRemOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(operands), std::forward(attributes)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } BVSRemOp BVSRemOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { return create(builder, builder.getLoc(), std::forward(operands), std::forward(attributes)); } void BVSRemOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { assert(operands.size() == 2u && "mismatched number of parameters"); odsState.addOperands(operands); odsState.useProperties(const_cast(properties)); odsState.addAttributes(discardableAttributes); assert(resultTypes.size() == 1u && "mismatched number of return types"); odsState.addTypes(resultTypes); } BVSRemOp BVSRemOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(resultTypes), std::forward(operands), std::forward(properties), std::forward(discardableAttributes)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } BVSRemOp BVSRemOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { return create(builder, builder.getLoc(), std::forward(resultTypes), std::forward(operands), std::forward(properties), std::forward(discardableAttributes)); } void BVSRemOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { assert(operands.size() == 2u && "mismatched number of parameters"); odsState.addOperands(operands); odsState.useProperties(const_cast(properties)); odsState.addAttributes(discardableAttributes); ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes; if (::mlir::succeeded(BVSRemOp::inferReturnTypes(odsBuilder.getContext(), odsState.location, operands, odsState.attributes.getDictionary(odsState.getContext()), odsState.getRawProperties(), odsState.regions, inferredReturnTypes))) { assert(inferredReturnTypes.size() == 1u && "mismatched number of return types"); odsState.addTypes(inferredReturnTypes); } else { ::llvm::report_fatal_error("Failed to infer result type(s)."); } } BVSRemOp BVSRemOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(operands), std::forward(properties), std::forward(discardableAttributes)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } BVSRemOp BVSRemOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { return create(builder, builder.getLoc(), std::forward(operands), std::forward(properties), std::forward(discardableAttributes)); } ::llvm::LogicalResult BVSRemOp::verifyInvariantsImpl() { { unsigned index = 0; (void)index; auto valueGroup0 = getODSOperands(0); for (auto v : valueGroup0) { if (::mlir::failed(__mlir_ods_local_type_constraint_SMT8(*this, v.getType(), "operand", index++))) return ::mlir::failure(); } auto valueGroup1 = getODSOperands(1); for (auto v : valueGroup1) { if (::mlir::failed(__mlir_ods_local_type_constraint_SMT8(*this, v.getType(), "operand", index++))) return ::mlir::failure(); } } { unsigned index = 0; (void)index; auto valueGroup0 = getODSResults(0); for (auto v : valueGroup0) { if (::mlir::failed(__mlir_ods_local_type_constraint_SMT8(*this, v.getType(), "result", index++))) return ::mlir::failure(); } } return ::mlir::success(); } ::llvm::LogicalResult BVSRemOp::verifyInvariants() { return verifyInvariantsImpl(); } ::llvm::LogicalResult BVSRemOp::inferReturnTypes(::mlir::MLIRContext *context, ::std::optional<::mlir::Location> location, ::mlir::ValueRange operands, ::mlir::DictionaryAttr attributes, ::mlir::PropertyRef properties, ::mlir::RegionRange regions, ::llvm::SmallVectorImpl<::mlir::Type>&inferredReturnTypes) { inferredReturnTypes.resize(1); ::mlir::Builder odsBuilder(context); if (operands.size() <= 0) return ::mlir::failure(); ::mlir::Type odsInferredType0 = operands[0].getType(); inferredReturnTypes[0] = odsInferredType0; return ::mlir::success(); } ::mlir::ParseResult BVSRemOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) { ::mlir::OpAsmParser::UnresolvedOperand lhsRawOperand{}; ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> lhsOperands(&lhsRawOperand, 1); ::llvm::SMLoc lhsOperandsLoc; (void)lhsOperandsLoc; ::mlir::OpAsmParser::UnresolvedOperand rhsRawOperand{}; ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> rhsOperands(&rhsRawOperand, 1); ::llvm::SMLoc rhsOperandsLoc; (void)rhsOperandsLoc; ::mlir::Type resultRawType{}; ::llvm::ArrayRef<::mlir::Type> resultTypes(&resultRawType, 1); lhsOperandsLoc = parser.getCurrentLocation(); if (parser.parseOperand(lhsRawOperand)) return ::mlir::failure(); if (parser.parseComma()) return ::mlir::failure(); rhsOperandsLoc = parser.getCurrentLocation(); if (parser.parseOperand(rhsRawOperand)) return ::mlir::failure(); { auto loc = parser.getCurrentLocation();(void)loc; if (parser.parseOptionalAttrDict(result.attributes)) return ::mlir::failure(); if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() { return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op "; }))) return ::mlir::failure(); } if (parser.parseColon()) return ::mlir::failure(); if (parser.parseType(resultRawType)) return ::mlir::failure(); result.addTypes(resultTypes); if (parser.resolveOperands(lhsOperands, resultTypes[0], lhsOperandsLoc, result.operands)) return ::mlir::failure(); if (parser.resolveOperands(rhsOperands, resultTypes[0], rhsOperandsLoc, result.operands)) return ::mlir::failure(); return ::mlir::success(); } void BVSRemOp::print(::mlir::OpAsmPrinter &_odsPrinter) { _odsPrinter << ' '; _odsPrinter << getLhs(); _odsPrinter << ","; _odsPrinter << ' '; _odsPrinter << getRhs(); ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs; _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs); _odsPrinter << ' ' << ":"; _odsPrinter << ' '; _odsPrinter << getResult().getType(); } void BVSRemOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) { } } // namespace mlir::smt MLIR_DEFINE_EXPLICIT_TYPE_ID(mlir::smt::BVSRemOp) namespace mlir::smt { //===----------------------------------------------------------------------===// // mlir::smt::BVShlOp definitions //===----------------------------------------------------------------------===// namespace detail { BVShlOpGenericAdaptorBase::BVShlOpGenericAdaptorBase(BVShlOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {} } // namespace detail BVShlOpAdaptor::BVShlOpAdaptor(BVShlOp op) : BVShlOpGenericAdaptor(op->getOperands(), op) {} ::llvm::LogicalResult BVShlOpAdaptor::verify(::mlir::Location loc) { return ::mlir::success(); } ::llvm::LogicalResult BVShlOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) { ::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr); if (!dict) { emitError() << "expected DictionaryAttr to set properties"; return ::mlir::failure(); } return ::mlir::success(); } ::mlir::Attribute BVShlOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) { ::mlir::SmallVector<::mlir::NamedAttribute> attrs; ::mlir::Builder odsBuilder{ctx}; if (!attrs.empty()) return odsBuilder.getDictionaryAttr(attrs); return {}; } llvm::hash_code BVShlOp::computePropertiesHash(const Properties &prop) { using llvm::hash_value; return llvm::hash_combine(); } std::optional BVShlOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) { return std::nullopt; } void BVShlOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) { } void BVShlOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) { } ::llvm::LogicalResult BVShlOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) { return ::mlir::success(); } void BVShlOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs) { odsState.addOperands(lhs); odsState.addOperands(rhs); odsState.addTypes(result); } BVShlOp BVShlOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(result), std::forward(lhs), std::forward(rhs)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } BVShlOp BVShlOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs) { return create(builder, builder.getLoc(), std::forward(result), std::forward(lhs), std::forward(rhs)); } void BVShlOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value lhs, ::mlir::Value rhs) { odsState.addOperands(lhs); odsState.addOperands(rhs); ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes; if (::mlir::succeeded(BVShlOp::inferReturnTypes(odsBuilder.getContext(), odsState.location, odsState.operands, odsState.attributes.getDictionary(odsState.getContext()), odsState.getRawProperties(), odsState.regions, inferredReturnTypes))) odsState.addTypes(inferredReturnTypes); else ::mlir::detail::reportFatalInferReturnTypesError(odsState); } BVShlOp BVShlOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value lhs, ::mlir::Value rhs) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(lhs), std::forward(rhs)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } BVShlOp BVShlOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value lhs, ::mlir::Value rhs) { return create(builder, builder.getLoc(), std::forward(lhs), std::forward(rhs)); } void BVShlOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs) { odsState.addOperands(lhs); odsState.addOperands(rhs); assert(resultTypes.size() == 1u && "mismatched number of results"); odsState.addTypes(resultTypes); } BVShlOp BVShlOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(resultTypes), std::forward(lhs), std::forward(rhs)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } BVShlOp BVShlOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs) { return create(builder, builder.getLoc(), std::forward(resultTypes), std::forward(lhs), std::forward(rhs)); } void BVShlOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { assert(operands.size() == 2u && "mismatched number of parameters"); odsState.addOperands(operands); odsState.addAttributes(attributes); assert(resultTypes.size() == 1u && "mismatched number of return types"); odsState.addTypes(resultTypes); } BVShlOp BVShlOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(resultTypes), std::forward(operands), std::forward(attributes)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } BVShlOp BVShlOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { return create(builder, builder.getLoc(), std::forward(resultTypes), std::forward(operands), std::forward(attributes)); } void BVShlOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { assert(operands.size() == 2u && "mismatched number of parameters"); odsState.addOperands(operands); odsState.addAttributes(attributes); ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes; if (::mlir::succeeded(BVShlOp::inferReturnTypes(odsBuilder.getContext(), odsState.location, operands, odsState.attributes.getDictionary(odsState.getContext()), odsState.getRawProperties(), odsState.regions, inferredReturnTypes))) { assert(inferredReturnTypes.size() == 1u && "mismatched number of return types"); odsState.addTypes(inferredReturnTypes); } else { ::llvm::report_fatal_error("Failed to infer result type(s)."); } } BVShlOp BVShlOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(operands), std::forward(attributes)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } BVShlOp BVShlOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { return create(builder, builder.getLoc(), std::forward(operands), std::forward(attributes)); } void BVShlOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { assert(operands.size() == 2u && "mismatched number of parameters"); odsState.addOperands(operands); odsState.useProperties(const_cast(properties)); odsState.addAttributes(discardableAttributes); assert(resultTypes.size() == 1u && "mismatched number of return types"); odsState.addTypes(resultTypes); } BVShlOp BVShlOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(resultTypes), std::forward(operands), std::forward(properties), std::forward(discardableAttributes)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } BVShlOp BVShlOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { return create(builder, builder.getLoc(), std::forward(resultTypes), std::forward(operands), std::forward(properties), std::forward(discardableAttributes)); } void BVShlOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { assert(operands.size() == 2u && "mismatched number of parameters"); odsState.addOperands(operands); odsState.useProperties(const_cast(properties)); odsState.addAttributes(discardableAttributes); ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes; if (::mlir::succeeded(BVShlOp::inferReturnTypes(odsBuilder.getContext(), odsState.location, operands, odsState.attributes.getDictionary(odsState.getContext()), odsState.getRawProperties(), odsState.regions, inferredReturnTypes))) { assert(inferredReturnTypes.size() == 1u && "mismatched number of return types"); odsState.addTypes(inferredReturnTypes); } else { ::llvm::report_fatal_error("Failed to infer result type(s)."); } } BVShlOp BVShlOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(operands), std::forward(properties), std::forward(discardableAttributes)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } BVShlOp BVShlOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { return create(builder, builder.getLoc(), std::forward(operands), std::forward(properties), std::forward(discardableAttributes)); } ::llvm::LogicalResult BVShlOp::verifyInvariantsImpl() { { unsigned index = 0; (void)index; auto valueGroup0 = getODSOperands(0); for (auto v : valueGroup0) { if (::mlir::failed(__mlir_ods_local_type_constraint_SMT8(*this, v.getType(), "operand", index++))) return ::mlir::failure(); } auto valueGroup1 = getODSOperands(1); for (auto v : valueGroup1) { if (::mlir::failed(__mlir_ods_local_type_constraint_SMT8(*this, v.getType(), "operand", index++))) return ::mlir::failure(); } } { unsigned index = 0; (void)index; auto valueGroup0 = getODSResults(0); for (auto v : valueGroup0) { if (::mlir::failed(__mlir_ods_local_type_constraint_SMT8(*this, v.getType(), "result", index++))) return ::mlir::failure(); } } return ::mlir::success(); } ::llvm::LogicalResult BVShlOp::verifyInvariants() { return verifyInvariantsImpl(); } ::llvm::LogicalResult BVShlOp::inferReturnTypes(::mlir::MLIRContext *context, ::std::optional<::mlir::Location> location, ::mlir::ValueRange operands, ::mlir::DictionaryAttr attributes, ::mlir::PropertyRef properties, ::mlir::RegionRange regions, ::llvm::SmallVectorImpl<::mlir::Type>&inferredReturnTypes) { inferredReturnTypes.resize(1); ::mlir::Builder odsBuilder(context); if (operands.size() <= 0) return ::mlir::failure(); ::mlir::Type odsInferredType0 = operands[0].getType(); inferredReturnTypes[0] = odsInferredType0; return ::mlir::success(); } ::mlir::ParseResult BVShlOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) { ::mlir::OpAsmParser::UnresolvedOperand lhsRawOperand{}; ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> lhsOperands(&lhsRawOperand, 1); ::llvm::SMLoc lhsOperandsLoc; (void)lhsOperandsLoc; ::mlir::OpAsmParser::UnresolvedOperand rhsRawOperand{}; ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> rhsOperands(&rhsRawOperand, 1); ::llvm::SMLoc rhsOperandsLoc; (void)rhsOperandsLoc; ::mlir::Type resultRawType{}; ::llvm::ArrayRef<::mlir::Type> resultTypes(&resultRawType, 1); lhsOperandsLoc = parser.getCurrentLocation(); if (parser.parseOperand(lhsRawOperand)) return ::mlir::failure(); if (parser.parseComma()) return ::mlir::failure(); rhsOperandsLoc = parser.getCurrentLocation(); if (parser.parseOperand(rhsRawOperand)) return ::mlir::failure(); { auto loc = parser.getCurrentLocation();(void)loc; if (parser.parseOptionalAttrDict(result.attributes)) return ::mlir::failure(); if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() { return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op "; }))) return ::mlir::failure(); } if (parser.parseColon()) return ::mlir::failure(); if (parser.parseType(resultRawType)) return ::mlir::failure(); result.addTypes(resultTypes); if (parser.resolveOperands(lhsOperands, resultTypes[0], lhsOperandsLoc, result.operands)) return ::mlir::failure(); if (parser.resolveOperands(rhsOperands, resultTypes[0], rhsOperandsLoc, result.operands)) return ::mlir::failure(); return ::mlir::success(); } void BVShlOp::print(::mlir::OpAsmPrinter &_odsPrinter) { _odsPrinter << ' '; _odsPrinter << getLhs(); _odsPrinter << ","; _odsPrinter << ' '; _odsPrinter << getRhs(); ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs; _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs); _odsPrinter << ' ' << ":"; _odsPrinter << ' '; _odsPrinter << getResult().getType(); } void BVShlOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) { } } // namespace mlir::smt MLIR_DEFINE_EXPLICIT_TYPE_ID(mlir::smt::BVShlOp) namespace mlir::smt { //===----------------------------------------------------------------------===// // mlir::smt::BVUDivOp definitions //===----------------------------------------------------------------------===// namespace detail { BVUDivOpGenericAdaptorBase::BVUDivOpGenericAdaptorBase(BVUDivOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {} } // namespace detail BVUDivOpAdaptor::BVUDivOpAdaptor(BVUDivOp op) : BVUDivOpGenericAdaptor(op->getOperands(), op) {} ::llvm::LogicalResult BVUDivOpAdaptor::verify(::mlir::Location loc) { return ::mlir::success(); } ::llvm::LogicalResult BVUDivOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) { ::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr); if (!dict) { emitError() << "expected DictionaryAttr to set properties"; return ::mlir::failure(); } return ::mlir::success(); } ::mlir::Attribute BVUDivOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) { ::mlir::SmallVector<::mlir::NamedAttribute> attrs; ::mlir::Builder odsBuilder{ctx}; if (!attrs.empty()) return odsBuilder.getDictionaryAttr(attrs); return {}; } llvm::hash_code BVUDivOp::computePropertiesHash(const Properties &prop) { using llvm::hash_value; return llvm::hash_combine(); } std::optional BVUDivOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) { return std::nullopt; } void BVUDivOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) { } void BVUDivOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) { } ::llvm::LogicalResult BVUDivOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) { return ::mlir::success(); } void BVUDivOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs) { odsState.addOperands(lhs); odsState.addOperands(rhs); odsState.addTypes(result); } BVUDivOp BVUDivOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(result), std::forward(lhs), std::forward(rhs)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } BVUDivOp BVUDivOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs) { return create(builder, builder.getLoc(), std::forward(result), std::forward(lhs), std::forward(rhs)); } void BVUDivOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value lhs, ::mlir::Value rhs) { odsState.addOperands(lhs); odsState.addOperands(rhs); ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes; if (::mlir::succeeded(BVUDivOp::inferReturnTypes(odsBuilder.getContext(), odsState.location, odsState.operands, odsState.attributes.getDictionary(odsState.getContext()), odsState.getRawProperties(), odsState.regions, inferredReturnTypes))) odsState.addTypes(inferredReturnTypes); else ::mlir::detail::reportFatalInferReturnTypesError(odsState); } BVUDivOp BVUDivOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value lhs, ::mlir::Value rhs) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(lhs), std::forward(rhs)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } BVUDivOp BVUDivOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value lhs, ::mlir::Value rhs) { return create(builder, builder.getLoc(), std::forward(lhs), std::forward(rhs)); } void BVUDivOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs) { odsState.addOperands(lhs); odsState.addOperands(rhs); assert(resultTypes.size() == 1u && "mismatched number of results"); odsState.addTypes(resultTypes); } BVUDivOp BVUDivOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(resultTypes), std::forward(lhs), std::forward(rhs)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } BVUDivOp BVUDivOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs) { return create(builder, builder.getLoc(), std::forward(resultTypes), std::forward(lhs), std::forward(rhs)); } void BVUDivOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { assert(operands.size() == 2u && "mismatched number of parameters"); odsState.addOperands(operands); odsState.addAttributes(attributes); assert(resultTypes.size() == 1u && "mismatched number of return types"); odsState.addTypes(resultTypes); } BVUDivOp BVUDivOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(resultTypes), std::forward(operands), std::forward(attributes)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } BVUDivOp BVUDivOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { return create(builder, builder.getLoc(), std::forward(resultTypes), std::forward(operands), std::forward(attributes)); } void BVUDivOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { assert(operands.size() == 2u && "mismatched number of parameters"); odsState.addOperands(operands); odsState.addAttributes(attributes); ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes; if (::mlir::succeeded(BVUDivOp::inferReturnTypes(odsBuilder.getContext(), odsState.location, operands, odsState.attributes.getDictionary(odsState.getContext()), odsState.getRawProperties(), odsState.regions, inferredReturnTypes))) { assert(inferredReturnTypes.size() == 1u && "mismatched number of return types"); odsState.addTypes(inferredReturnTypes); } else { ::llvm::report_fatal_error("Failed to infer result type(s)."); } } BVUDivOp BVUDivOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(operands), std::forward(attributes)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } BVUDivOp BVUDivOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { return create(builder, builder.getLoc(), std::forward(operands), std::forward(attributes)); } void BVUDivOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { assert(operands.size() == 2u && "mismatched number of parameters"); odsState.addOperands(operands); odsState.useProperties(const_cast(properties)); odsState.addAttributes(discardableAttributes); assert(resultTypes.size() == 1u && "mismatched number of return types"); odsState.addTypes(resultTypes); } BVUDivOp BVUDivOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(resultTypes), std::forward(operands), std::forward(properties), std::forward(discardableAttributes)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } BVUDivOp BVUDivOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { return create(builder, builder.getLoc(), std::forward(resultTypes), std::forward(operands), std::forward(properties), std::forward(discardableAttributes)); } void BVUDivOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { assert(operands.size() == 2u && "mismatched number of parameters"); odsState.addOperands(operands); odsState.useProperties(const_cast(properties)); odsState.addAttributes(discardableAttributes); ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes; if (::mlir::succeeded(BVUDivOp::inferReturnTypes(odsBuilder.getContext(), odsState.location, operands, odsState.attributes.getDictionary(odsState.getContext()), odsState.getRawProperties(), odsState.regions, inferredReturnTypes))) { assert(inferredReturnTypes.size() == 1u && "mismatched number of return types"); odsState.addTypes(inferredReturnTypes); } else { ::llvm::report_fatal_error("Failed to infer result type(s)."); } } BVUDivOp BVUDivOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(operands), std::forward(properties), std::forward(discardableAttributes)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } BVUDivOp BVUDivOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { return create(builder, builder.getLoc(), std::forward(operands), std::forward(properties), std::forward(discardableAttributes)); } ::llvm::LogicalResult BVUDivOp::verifyInvariantsImpl() { { unsigned index = 0; (void)index; auto valueGroup0 = getODSOperands(0); for (auto v : valueGroup0) { if (::mlir::failed(__mlir_ods_local_type_constraint_SMT8(*this, v.getType(), "operand", index++))) return ::mlir::failure(); } auto valueGroup1 = getODSOperands(1); for (auto v : valueGroup1) { if (::mlir::failed(__mlir_ods_local_type_constraint_SMT8(*this, v.getType(), "operand", index++))) return ::mlir::failure(); } } { unsigned index = 0; (void)index; auto valueGroup0 = getODSResults(0); for (auto v : valueGroup0) { if (::mlir::failed(__mlir_ods_local_type_constraint_SMT8(*this, v.getType(), "result", index++))) return ::mlir::failure(); } } return ::mlir::success(); } ::llvm::LogicalResult BVUDivOp::verifyInvariants() { return verifyInvariantsImpl(); } ::llvm::LogicalResult BVUDivOp::inferReturnTypes(::mlir::MLIRContext *context, ::std::optional<::mlir::Location> location, ::mlir::ValueRange operands, ::mlir::DictionaryAttr attributes, ::mlir::PropertyRef properties, ::mlir::RegionRange regions, ::llvm::SmallVectorImpl<::mlir::Type>&inferredReturnTypes) { inferredReturnTypes.resize(1); ::mlir::Builder odsBuilder(context); if (operands.size() <= 0) return ::mlir::failure(); ::mlir::Type odsInferredType0 = operands[0].getType(); inferredReturnTypes[0] = odsInferredType0; return ::mlir::success(); } ::mlir::ParseResult BVUDivOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) { ::mlir::OpAsmParser::UnresolvedOperand lhsRawOperand{}; ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> lhsOperands(&lhsRawOperand, 1); ::llvm::SMLoc lhsOperandsLoc; (void)lhsOperandsLoc; ::mlir::OpAsmParser::UnresolvedOperand rhsRawOperand{}; ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> rhsOperands(&rhsRawOperand, 1); ::llvm::SMLoc rhsOperandsLoc; (void)rhsOperandsLoc; ::mlir::Type resultRawType{}; ::llvm::ArrayRef<::mlir::Type> resultTypes(&resultRawType, 1); lhsOperandsLoc = parser.getCurrentLocation(); if (parser.parseOperand(lhsRawOperand)) return ::mlir::failure(); if (parser.parseComma()) return ::mlir::failure(); rhsOperandsLoc = parser.getCurrentLocation(); if (parser.parseOperand(rhsRawOperand)) return ::mlir::failure(); { auto loc = parser.getCurrentLocation();(void)loc; if (parser.parseOptionalAttrDict(result.attributes)) return ::mlir::failure(); if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() { return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op "; }))) return ::mlir::failure(); } if (parser.parseColon()) return ::mlir::failure(); if (parser.parseType(resultRawType)) return ::mlir::failure(); result.addTypes(resultTypes); if (parser.resolveOperands(lhsOperands, resultTypes[0], lhsOperandsLoc, result.operands)) return ::mlir::failure(); if (parser.resolveOperands(rhsOperands, resultTypes[0], rhsOperandsLoc, result.operands)) return ::mlir::failure(); return ::mlir::success(); } void BVUDivOp::print(::mlir::OpAsmPrinter &_odsPrinter) { _odsPrinter << ' '; _odsPrinter << getLhs(); _odsPrinter << ","; _odsPrinter << ' '; _odsPrinter << getRhs(); ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs; _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs); _odsPrinter << ' ' << ":"; _odsPrinter << ' '; _odsPrinter << getResult().getType(); } void BVUDivOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) { } } // namespace mlir::smt MLIR_DEFINE_EXPLICIT_TYPE_ID(mlir::smt::BVUDivOp) namespace mlir::smt { //===----------------------------------------------------------------------===// // mlir::smt::BVURemOp definitions //===----------------------------------------------------------------------===// namespace detail { BVURemOpGenericAdaptorBase::BVURemOpGenericAdaptorBase(BVURemOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {} } // namespace detail BVURemOpAdaptor::BVURemOpAdaptor(BVURemOp op) : BVURemOpGenericAdaptor(op->getOperands(), op) {} ::llvm::LogicalResult BVURemOpAdaptor::verify(::mlir::Location loc) { return ::mlir::success(); } ::llvm::LogicalResult BVURemOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) { ::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr); if (!dict) { emitError() << "expected DictionaryAttr to set properties"; return ::mlir::failure(); } return ::mlir::success(); } ::mlir::Attribute BVURemOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) { ::mlir::SmallVector<::mlir::NamedAttribute> attrs; ::mlir::Builder odsBuilder{ctx}; if (!attrs.empty()) return odsBuilder.getDictionaryAttr(attrs); return {}; } llvm::hash_code BVURemOp::computePropertiesHash(const Properties &prop) { using llvm::hash_value; return llvm::hash_combine(); } std::optional BVURemOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) { return std::nullopt; } void BVURemOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) { } void BVURemOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) { } ::llvm::LogicalResult BVURemOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) { return ::mlir::success(); } void BVURemOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs) { odsState.addOperands(lhs); odsState.addOperands(rhs); odsState.addTypes(result); } BVURemOp BVURemOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(result), std::forward(lhs), std::forward(rhs)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } BVURemOp BVURemOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs) { return create(builder, builder.getLoc(), std::forward(result), std::forward(lhs), std::forward(rhs)); } void BVURemOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value lhs, ::mlir::Value rhs) { odsState.addOperands(lhs); odsState.addOperands(rhs); ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes; if (::mlir::succeeded(BVURemOp::inferReturnTypes(odsBuilder.getContext(), odsState.location, odsState.operands, odsState.attributes.getDictionary(odsState.getContext()), odsState.getRawProperties(), odsState.regions, inferredReturnTypes))) odsState.addTypes(inferredReturnTypes); else ::mlir::detail::reportFatalInferReturnTypesError(odsState); } BVURemOp BVURemOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value lhs, ::mlir::Value rhs) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(lhs), std::forward(rhs)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } BVURemOp BVURemOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value lhs, ::mlir::Value rhs) { return create(builder, builder.getLoc(), std::forward(lhs), std::forward(rhs)); } void BVURemOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs) { odsState.addOperands(lhs); odsState.addOperands(rhs); assert(resultTypes.size() == 1u && "mismatched number of results"); odsState.addTypes(resultTypes); } BVURemOp BVURemOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(resultTypes), std::forward(lhs), std::forward(rhs)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } BVURemOp BVURemOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs) { return create(builder, builder.getLoc(), std::forward(resultTypes), std::forward(lhs), std::forward(rhs)); } void BVURemOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { assert(operands.size() == 2u && "mismatched number of parameters"); odsState.addOperands(operands); odsState.addAttributes(attributes); assert(resultTypes.size() == 1u && "mismatched number of return types"); odsState.addTypes(resultTypes); } BVURemOp BVURemOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(resultTypes), std::forward(operands), std::forward(attributes)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } BVURemOp BVURemOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { return create(builder, builder.getLoc(), std::forward(resultTypes), std::forward(operands), std::forward(attributes)); } void BVURemOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { assert(operands.size() == 2u && "mismatched number of parameters"); odsState.addOperands(operands); odsState.addAttributes(attributes); ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes; if (::mlir::succeeded(BVURemOp::inferReturnTypes(odsBuilder.getContext(), odsState.location, operands, odsState.attributes.getDictionary(odsState.getContext()), odsState.getRawProperties(), odsState.regions, inferredReturnTypes))) { assert(inferredReturnTypes.size() == 1u && "mismatched number of return types"); odsState.addTypes(inferredReturnTypes); } else { ::llvm::report_fatal_error("Failed to infer result type(s)."); } } BVURemOp BVURemOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(operands), std::forward(attributes)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } BVURemOp BVURemOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { return create(builder, builder.getLoc(), std::forward(operands), std::forward(attributes)); } void BVURemOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { assert(operands.size() == 2u && "mismatched number of parameters"); odsState.addOperands(operands); odsState.useProperties(const_cast(properties)); odsState.addAttributes(discardableAttributes); assert(resultTypes.size() == 1u && "mismatched number of return types"); odsState.addTypes(resultTypes); } BVURemOp BVURemOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(resultTypes), std::forward(operands), std::forward(properties), std::forward(discardableAttributes)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } BVURemOp BVURemOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { return create(builder, builder.getLoc(), std::forward(resultTypes), std::forward(operands), std::forward(properties), std::forward(discardableAttributes)); } void BVURemOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { assert(operands.size() == 2u && "mismatched number of parameters"); odsState.addOperands(operands); odsState.useProperties(const_cast(properties)); odsState.addAttributes(discardableAttributes); ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes; if (::mlir::succeeded(BVURemOp::inferReturnTypes(odsBuilder.getContext(), odsState.location, operands, odsState.attributes.getDictionary(odsState.getContext()), odsState.getRawProperties(), odsState.regions, inferredReturnTypes))) { assert(inferredReturnTypes.size() == 1u && "mismatched number of return types"); odsState.addTypes(inferredReturnTypes); } else { ::llvm::report_fatal_error("Failed to infer result type(s)."); } } BVURemOp BVURemOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(operands), std::forward(properties), std::forward(discardableAttributes)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } BVURemOp BVURemOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { return create(builder, builder.getLoc(), std::forward(operands), std::forward(properties), std::forward(discardableAttributes)); } ::llvm::LogicalResult BVURemOp::verifyInvariantsImpl() { { unsigned index = 0; (void)index; auto valueGroup0 = getODSOperands(0); for (auto v : valueGroup0) { if (::mlir::failed(__mlir_ods_local_type_constraint_SMT8(*this, v.getType(), "operand", index++))) return ::mlir::failure(); } auto valueGroup1 = getODSOperands(1); for (auto v : valueGroup1) { if (::mlir::failed(__mlir_ods_local_type_constraint_SMT8(*this, v.getType(), "operand", index++))) return ::mlir::failure(); } } { unsigned index = 0; (void)index; auto valueGroup0 = getODSResults(0); for (auto v : valueGroup0) { if (::mlir::failed(__mlir_ods_local_type_constraint_SMT8(*this, v.getType(), "result", index++))) return ::mlir::failure(); } } return ::mlir::success(); } ::llvm::LogicalResult BVURemOp::verifyInvariants() { return verifyInvariantsImpl(); } ::llvm::LogicalResult BVURemOp::inferReturnTypes(::mlir::MLIRContext *context, ::std::optional<::mlir::Location> location, ::mlir::ValueRange operands, ::mlir::DictionaryAttr attributes, ::mlir::PropertyRef properties, ::mlir::RegionRange regions, ::llvm::SmallVectorImpl<::mlir::Type>&inferredReturnTypes) { inferredReturnTypes.resize(1); ::mlir::Builder odsBuilder(context); if (operands.size() <= 0) return ::mlir::failure(); ::mlir::Type odsInferredType0 = operands[0].getType(); inferredReturnTypes[0] = odsInferredType0; return ::mlir::success(); } ::mlir::ParseResult BVURemOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) { ::mlir::OpAsmParser::UnresolvedOperand lhsRawOperand{}; ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> lhsOperands(&lhsRawOperand, 1); ::llvm::SMLoc lhsOperandsLoc; (void)lhsOperandsLoc; ::mlir::OpAsmParser::UnresolvedOperand rhsRawOperand{}; ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> rhsOperands(&rhsRawOperand, 1); ::llvm::SMLoc rhsOperandsLoc; (void)rhsOperandsLoc; ::mlir::Type resultRawType{}; ::llvm::ArrayRef<::mlir::Type> resultTypes(&resultRawType, 1); lhsOperandsLoc = parser.getCurrentLocation(); if (parser.parseOperand(lhsRawOperand)) return ::mlir::failure(); if (parser.parseComma()) return ::mlir::failure(); rhsOperandsLoc = parser.getCurrentLocation(); if (parser.parseOperand(rhsRawOperand)) return ::mlir::failure(); { auto loc = parser.getCurrentLocation();(void)loc; if (parser.parseOptionalAttrDict(result.attributes)) return ::mlir::failure(); if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() { return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op "; }))) return ::mlir::failure(); } if (parser.parseColon()) return ::mlir::failure(); if (parser.parseType(resultRawType)) return ::mlir::failure(); result.addTypes(resultTypes); if (parser.resolveOperands(lhsOperands, resultTypes[0], lhsOperandsLoc, result.operands)) return ::mlir::failure(); if (parser.resolveOperands(rhsOperands, resultTypes[0], rhsOperandsLoc, result.operands)) return ::mlir::failure(); return ::mlir::success(); } void BVURemOp::print(::mlir::OpAsmPrinter &_odsPrinter) { _odsPrinter << ' '; _odsPrinter << getLhs(); _odsPrinter << ","; _odsPrinter << ' '; _odsPrinter << getRhs(); ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs; _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs); _odsPrinter << ' ' << ":"; _odsPrinter << ' '; _odsPrinter << getResult().getType(); } void BVURemOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) { } } // namespace mlir::smt MLIR_DEFINE_EXPLICIT_TYPE_ID(mlir::smt::BVURemOp) namespace mlir::smt { //===----------------------------------------------------------------------===// // mlir::smt::BVXOrOp definitions //===----------------------------------------------------------------------===// namespace detail { BVXOrOpGenericAdaptorBase::BVXOrOpGenericAdaptorBase(BVXOrOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {} } // namespace detail BVXOrOpAdaptor::BVXOrOpAdaptor(BVXOrOp op) : BVXOrOpGenericAdaptor(op->getOperands(), op) {} ::llvm::LogicalResult BVXOrOpAdaptor::verify(::mlir::Location loc) { return ::mlir::success(); } ::llvm::LogicalResult BVXOrOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) { ::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr); if (!dict) { emitError() << "expected DictionaryAttr to set properties"; return ::mlir::failure(); } return ::mlir::success(); } ::mlir::Attribute BVXOrOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) { ::mlir::SmallVector<::mlir::NamedAttribute> attrs; ::mlir::Builder odsBuilder{ctx}; if (!attrs.empty()) return odsBuilder.getDictionaryAttr(attrs); return {}; } llvm::hash_code BVXOrOp::computePropertiesHash(const Properties &prop) { using llvm::hash_value; return llvm::hash_combine(); } std::optional BVXOrOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) { return std::nullopt; } void BVXOrOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) { } void BVXOrOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) { } ::llvm::LogicalResult BVXOrOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) { return ::mlir::success(); } void BVXOrOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs) { odsState.addOperands(lhs); odsState.addOperands(rhs); odsState.addTypes(result); } BVXOrOp BVXOrOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(result), std::forward(lhs), std::forward(rhs)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } BVXOrOp BVXOrOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs) { return create(builder, builder.getLoc(), std::forward(result), std::forward(lhs), std::forward(rhs)); } void BVXOrOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value lhs, ::mlir::Value rhs) { odsState.addOperands(lhs); odsState.addOperands(rhs); ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes; if (::mlir::succeeded(BVXOrOp::inferReturnTypes(odsBuilder.getContext(), odsState.location, odsState.operands, odsState.attributes.getDictionary(odsState.getContext()), odsState.getRawProperties(), odsState.regions, inferredReturnTypes))) odsState.addTypes(inferredReturnTypes); else ::mlir::detail::reportFatalInferReturnTypesError(odsState); } BVXOrOp BVXOrOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value lhs, ::mlir::Value rhs) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(lhs), std::forward(rhs)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } BVXOrOp BVXOrOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value lhs, ::mlir::Value rhs) { return create(builder, builder.getLoc(), std::forward(lhs), std::forward(rhs)); } void BVXOrOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs) { odsState.addOperands(lhs); odsState.addOperands(rhs); assert(resultTypes.size() == 1u && "mismatched number of results"); odsState.addTypes(resultTypes); } BVXOrOp BVXOrOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(resultTypes), std::forward(lhs), std::forward(rhs)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } BVXOrOp BVXOrOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs) { return create(builder, builder.getLoc(), std::forward(resultTypes), std::forward(lhs), std::forward(rhs)); } void BVXOrOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { assert(operands.size() == 2u && "mismatched number of parameters"); odsState.addOperands(operands); odsState.addAttributes(attributes); assert(resultTypes.size() == 1u && "mismatched number of return types"); odsState.addTypes(resultTypes); } BVXOrOp BVXOrOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(resultTypes), std::forward(operands), std::forward(attributes)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } BVXOrOp BVXOrOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { return create(builder, builder.getLoc(), std::forward(resultTypes), std::forward(operands), std::forward(attributes)); } void BVXOrOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { assert(operands.size() == 2u && "mismatched number of parameters"); odsState.addOperands(operands); odsState.addAttributes(attributes); ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes; if (::mlir::succeeded(BVXOrOp::inferReturnTypes(odsBuilder.getContext(), odsState.location, operands, odsState.attributes.getDictionary(odsState.getContext()), odsState.getRawProperties(), odsState.regions, inferredReturnTypes))) { assert(inferredReturnTypes.size() == 1u && "mismatched number of return types"); odsState.addTypes(inferredReturnTypes); } else { ::llvm::report_fatal_error("Failed to infer result type(s)."); } } BVXOrOp BVXOrOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(operands), std::forward(attributes)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } BVXOrOp BVXOrOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { return create(builder, builder.getLoc(), std::forward(operands), std::forward(attributes)); } void BVXOrOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { assert(operands.size() == 2u && "mismatched number of parameters"); odsState.addOperands(operands); odsState.useProperties(const_cast(properties)); odsState.addAttributes(discardableAttributes); assert(resultTypes.size() == 1u && "mismatched number of return types"); odsState.addTypes(resultTypes); } BVXOrOp BVXOrOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(resultTypes), std::forward(operands), std::forward(properties), std::forward(discardableAttributes)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } BVXOrOp BVXOrOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { return create(builder, builder.getLoc(), std::forward(resultTypes), std::forward(operands), std::forward(properties), std::forward(discardableAttributes)); } void BVXOrOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { assert(operands.size() == 2u && "mismatched number of parameters"); odsState.addOperands(operands); odsState.useProperties(const_cast(properties)); odsState.addAttributes(discardableAttributes); ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes; if (::mlir::succeeded(BVXOrOp::inferReturnTypes(odsBuilder.getContext(), odsState.location, operands, odsState.attributes.getDictionary(odsState.getContext()), odsState.getRawProperties(), odsState.regions, inferredReturnTypes))) { assert(inferredReturnTypes.size() == 1u && "mismatched number of return types"); odsState.addTypes(inferredReturnTypes); } else { ::llvm::report_fatal_error("Failed to infer result type(s)."); } } BVXOrOp BVXOrOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(operands), std::forward(properties), std::forward(discardableAttributes)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } BVXOrOp BVXOrOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { return create(builder, builder.getLoc(), std::forward(operands), std::forward(properties), std::forward(discardableAttributes)); } ::llvm::LogicalResult BVXOrOp::verifyInvariantsImpl() { { unsigned index = 0; (void)index; auto valueGroup0 = getODSOperands(0); for (auto v : valueGroup0) { if (::mlir::failed(__mlir_ods_local_type_constraint_SMT8(*this, v.getType(), "operand", index++))) return ::mlir::failure(); } auto valueGroup1 = getODSOperands(1); for (auto v : valueGroup1) { if (::mlir::failed(__mlir_ods_local_type_constraint_SMT8(*this, v.getType(), "operand", index++))) return ::mlir::failure(); } } { unsigned index = 0; (void)index; auto valueGroup0 = getODSResults(0); for (auto v : valueGroup0) { if (::mlir::failed(__mlir_ods_local_type_constraint_SMT8(*this, v.getType(), "result", index++))) return ::mlir::failure(); } } return ::mlir::success(); } ::llvm::LogicalResult BVXOrOp::verifyInvariants() { return verifyInvariantsImpl(); } ::llvm::LogicalResult BVXOrOp::inferReturnTypes(::mlir::MLIRContext *context, ::std::optional<::mlir::Location> location, ::mlir::ValueRange operands, ::mlir::DictionaryAttr attributes, ::mlir::PropertyRef properties, ::mlir::RegionRange regions, ::llvm::SmallVectorImpl<::mlir::Type>&inferredReturnTypes) { inferredReturnTypes.resize(1); ::mlir::Builder odsBuilder(context); if (operands.size() <= 0) return ::mlir::failure(); ::mlir::Type odsInferredType0 = operands[0].getType(); inferredReturnTypes[0] = odsInferredType0; return ::mlir::success(); } ::mlir::ParseResult BVXOrOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) { ::mlir::OpAsmParser::UnresolvedOperand lhsRawOperand{}; ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> lhsOperands(&lhsRawOperand, 1); ::llvm::SMLoc lhsOperandsLoc; (void)lhsOperandsLoc; ::mlir::OpAsmParser::UnresolvedOperand rhsRawOperand{}; ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> rhsOperands(&rhsRawOperand, 1); ::llvm::SMLoc rhsOperandsLoc; (void)rhsOperandsLoc; ::mlir::Type resultRawType{}; ::llvm::ArrayRef<::mlir::Type> resultTypes(&resultRawType, 1); lhsOperandsLoc = parser.getCurrentLocation(); if (parser.parseOperand(lhsRawOperand)) return ::mlir::failure(); if (parser.parseComma()) return ::mlir::failure(); rhsOperandsLoc = parser.getCurrentLocation(); if (parser.parseOperand(rhsRawOperand)) return ::mlir::failure(); { auto loc = parser.getCurrentLocation();(void)loc; if (parser.parseOptionalAttrDict(result.attributes)) return ::mlir::failure(); if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() { return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op "; }))) return ::mlir::failure(); } if (parser.parseColon()) return ::mlir::failure(); if (parser.parseType(resultRawType)) return ::mlir::failure(); result.addTypes(resultTypes); if (parser.resolveOperands(lhsOperands, resultTypes[0], lhsOperandsLoc, result.operands)) return ::mlir::failure(); if (parser.resolveOperands(rhsOperands, resultTypes[0], rhsOperandsLoc, result.operands)) return ::mlir::failure(); return ::mlir::success(); } void BVXOrOp::print(::mlir::OpAsmPrinter &_odsPrinter) { _odsPrinter << ' '; _odsPrinter << getLhs(); _odsPrinter << ","; _odsPrinter << ' '; _odsPrinter << getRhs(); ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs; _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs); _odsPrinter << ' ' << ":"; _odsPrinter << ' '; _odsPrinter << getResult().getType(); } void BVXOrOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) { } } // namespace mlir::smt MLIR_DEFINE_EXPLICIT_TYPE_ID(mlir::smt::BVXOrOp) namespace mlir::smt { //===----------------------------------------------------------------------===// // mlir::smt::BoolConstantOp definitions //===----------------------------------------------------------------------===// namespace detail { BoolConstantOpGenericAdaptorBase::BoolConstantOpGenericAdaptorBase(BoolConstantOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {} bool BoolConstantOpGenericAdaptorBase::getValue() { auto attr = getValueAttr(); return attr.getValue(); } } // namespace detail BoolConstantOpAdaptor::BoolConstantOpAdaptor(BoolConstantOp op) : BoolConstantOpGenericAdaptor(op->getOperands(), op) {} ::llvm::LogicalResult BoolConstantOpAdaptor::verify(::mlir::Location loc) { auto tblgen_value = getProperties().value; (void)tblgen_value; if (!tblgen_value) return emitError(loc, "'smt.constant' op requires attribute 'value'"); if (tblgen_value && !((::llvm::isa<::mlir::BoolAttr>(tblgen_value)))) return emitError(loc, "'smt.constant' op attribute 'value' failed to satisfy constraint: bool attribute"); return ::mlir::success(); } ::llvm::LogicalResult BoolConstantOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) { ::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr); if (!dict) { emitError() << "expected DictionaryAttr to set properties"; return ::mlir::failure(); } { auto &propStorage = prop.value; auto attr = dict.get("value"); if (attr) { auto convertedAttr = ::llvm::dyn_cast>(attr); if (convertedAttr) { propStorage = convertedAttr; } else { emitError() << "Invalid attribute `value` in property conversion: " << attr; return ::mlir::failure(); } } } return ::mlir::success(); } ::mlir::Attribute BoolConstantOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) { ::mlir::SmallVector<::mlir::NamedAttribute> attrs; ::mlir::Builder odsBuilder{ctx}; { const auto &propStorage = prop.value; if (propStorage) attrs.push_back(odsBuilder.getNamedAttr("value", propStorage)); } if (!attrs.empty()) return odsBuilder.getDictionaryAttr(attrs); return {}; } llvm::hash_code BoolConstantOp::computePropertiesHash(const Properties &prop) { using llvm::hash_value; return llvm::hash_combine( llvm::hash_value(prop.value.getAsOpaquePointer())); } std::optional BoolConstantOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) { if (name == "value") return prop.value; return std::nullopt; } void BoolConstantOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) { if (name == "value") { prop.value = ::llvm::dyn_cast_or_null>(value); return; } } void BoolConstantOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) { if (prop.value) attrs.append("value", prop.value); } ::llvm::LogicalResult BoolConstantOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) { { ::mlir::Attribute attr = attrs.get(getValueAttrName(opName)); if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_SMT4(attr, "value", emitError))) return ::mlir::failure(); } return ::mlir::success(); } ::llvm::LogicalResult BoolConstantOp::readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state) { auto &prop = state.getOrAddProperties(); (void)prop; if (::mlir::failed(reader.readAttribute(prop.value))) return ::mlir::failure(); return ::mlir::success(); } void BoolConstantOp::writeProperties(::mlir::DialectBytecodeWriter &writer) { auto &prop = getProperties(); (void)prop; writer.writeAttribute(prop.value); } bool BoolConstantOp::getValue() { auto attr = getValueAttr(); return attr.getValue(); } void BoolConstantOp::setValue(bool attrValue) { getProperties().value = ::mlir::Builder((*this)->getContext()).getBoolAttr(attrValue); } void BoolConstantOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::BoolAttr value) { odsState.getOrAddProperties().value = value; odsState.addTypes(result); } BoolConstantOp BoolConstantOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::BoolAttr value) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(result), std::forward(value)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } BoolConstantOp BoolConstantOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::BoolAttr value) { return create(builder, builder.getLoc(), std::forward(result), std::forward(value)); } void BoolConstantOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::BoolAttr value) { odsState.getOrAddProperties().value = value; ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes; if (::mlir::succeeded(BoolConstantOp::inferReturnTypes(odsBuilder.getContext(), odsState.location, odsState.operands, odsState.attributes.getDictionary(odsState.getContext()), odsState.getRawProperties(), odsState.regions, inferredReturnTypes))) odsState.addTypes(inferredReturnTypes); else ::mlir::detail::reportFatalInferReturnTypesError(odsState); } BoolConstantOp BoolConstantOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::BoolAttr value) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(value)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } BoolConstantOp BoolConstantOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::BoolAttr value) { return create(builder, builder.getLoc(), std::forward(value)); } void BoolConstantOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::BoolAttr value) { odsState.getOrAddProperties().value = value; assert(resultTypes.size() == 1u && "mismatched number of results"); odsState.addTypes(resultTypes); } BoolConstantOp BoolConstantOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::BoolAttr value) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(resultTypes), std::forward(value)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } BoolConstantOp BoolConstantOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::BoolAttr value) { return create(builder, builder.getLoc(), std::forward(resultTypes), std::forward(value)); } void BoolConstantOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, bool value) { odsState.getOrAddProperties().value = odsBuilder.getBoolAttr(value); odsState.addTypes(result); } BoolConstantOp BoolConstantOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, bool value) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(result), std::forward(value)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } BoolConstantOp BoolConstantOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, bool value) { return create(builder, builder.getLoc(), std::forward(result), std::forward(value)); } void BoolConstantOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, bool value) { odsState.getOrAddProperties().value = odsBuilder.getBoolAttr(value); ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes; if (::mlir::succeeded(BoolConstantOp::inferReturnTypes(odsBuilder.getContext(), odsState.location, odsState.operands, odsState.attributes.getDictionary(odsState.getContext()), odsState.getRawProperties(), odsState.regions, inferredReturnTypes))) odsState.addTypes(inferredReturnTypes); else ::mlir::detail::reportFatalInferReturnTypesError(odsState); } BoolConstantOp BoolConstantOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, bool value) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(value)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } BoolConstantOp BoolConstantOp::create(::mlir::ImplicitLocOpBuilder &builder, bool value) { return create(builder, builder.getLoc(), std::forward(value)); } void BoolConstantOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, bool value) { odsState.getOrAddProperties().value = odsBuilder.getBoolAttr(value); assert(resultTypes.size() == 1u && "mismatched number of results"); odsState.addTypes(resultTypes); } BoolConstantOp BoolConstantOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, bool value) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(resultTypes), std::forward(value)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } BoolConstantOp BoolConstantOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, bool value) { return create(builder, builder.getLoc(), std::forward(resultTypes), std::forward(value)); } void BoolConstantOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { assert(operands.size() == 0u && "mismatched number of parameters"); odsState.addOperands(operands); odsState.addAttributes(attributes); assert(resultTypes.size() == 1u && "mismatched number of return types"); odsState.addTypes(resultTypes); if (!attributes.empty()) { (void)odsState.getOrAddProperties(); ::mlir::PropertyRef properties = odsState.getRawProperties(); std::optional<::mlir::RegisteredOperationName> info = odsState.name.getRegisteredInfo(); if (failed(info->setOpPropertiesFromAttribute(odsState.name, properties, odsState.attributes.getDictionary(odsState.getContext()), nullptr))) ::llvm::report_fatal_error("Property conversion failed."); } } BoolConstantOp BoolConstantOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(resultTypes), std::forward(operands), std::forward(attributes)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } BoolConstantOp BoolConstantOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { return create(builder, builder.getLoc(), std::forward(resultTypes), std::forward(operands), std::forward(attributes)); } void BoolConstantOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { assert(operands.size() == 0u && "mismatched number of parameters"); odsState.addOperands(operands); odsState.addAttributes(attributes); if (!attributes.empty()) { (void)odsState.getOrAddProperties(); ::mlir::PropertyRef properties = odsState.getRawProperties(); std::optional<::mlir::RegisteredOperationName> info = odsState.name.getRegisteredInfo(); if (failed(info->setOpPropertiesFromAttribute(odsState.name, properties, odsState.attributes.getDictionary(odsState.getContext()), nullptr))) ::llvm::report_fatal_error("Property conversion failed."); } ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes; if (::mlir::succeeded(BoolConstantOp::inferReturnTypes(odsBuilder.getContext(), odsState.location, operands, odsState.attributes.getDictionary(odsState.getContext()), odsState.getRawProperties(), odsState.regions, inferredReturnTypes))) { assert(inferredReturnTypes.size() == 1u && "mismatched number of return types"); odsState.addTypes(inferredReturnTypes); } else { ::llvm::report_fatal_error("Failed to infer result type(s)."); } } BoolConstantOp BoolConstantOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(operands), std::forward(attributes)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } BoolConstantOp BoolConstantOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { return create(builder, builder.getLoc(), std::forward(operands), std::forward(attributes)); } void BoolConstantOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { assert(operands.size() == 0u && "mismatched number of parameters"); odsState.addOperands(operands); odsState.useProperties(const_cast(properties)); odsState.addAttributes(discardableAttributes); assert(resultTypes.size() == 1u && "mismatched number of return types"); odsState.addTypes(resultTypes); } BoolConstantOp BoolConstantOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(resultTypes), std::forward(operands), std::forward(properties), std::forward(discardableAttributes)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } BoolConstantOp BoolConstantOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { return create(builder, builder.getLoc(), std::forward(resultTypes), std::forward(operands), std::forward(properties), std::forward(discardableAttributes)); } void BoolConstantOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { assert(operands.size() == 0u && "mismatched number of parameters"); odsState.addOperands(operands); odsState.useProperties(const_cast(properties)); odsState.addAttributes(discardableAttributes); ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes; if (::mlir::succeeded(BoolConstantOp::inferReturnTypes(odsBuilder.getContext(), odsState.location, operands, odsState.attributes.getDictionary(odsState.getContext()), odsState.getRawProperties(), odsState.regions, inferredReturnTypes))) { assert(inferredReturnTypes.size() == 1u && "mismatched number of return types"); odsState.addTypes(inferredReturnTypes); } else { ::llvm::report_fatal_error("Failed to infer result type(s)."); } } BoolConstantOp BoolConstantOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(operands), std::forward(properties), std::forward(discardableAttributes)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } BoolConstantOp BoolConstantOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { return create(builder, builder.getLoc(), std::forward(operands), std::forward(properties), std::forward(discardableAttributes)); } ::llvm::LogicalResult BoolConstantOp::verifyInvariantsImpl() { auto tblgen_value = getProperties().value; (void)tblgen_value; if (!tblgen_value) return emitOpError("requires attribute 'value'"); if (::mlir::failed(__mlir_ods_local_attr_constraint_SMT4(*this, tblgen_value, "value"))) return ::mlir::failure(); { unsigned index = 0; (void)index; auto valueGroup0 = getODSResults(0); for (auto v : valueGroup0) { if (::mlir::failed(__mlir_ods_local_type_constraint_SMT2(*this, v.getType(), "result", index++))) return ::mlir::failure(); } } return ::mlir::success(); } ::llvm::LogicalResult BoolConstantOp::verifyInvariants() { return verifyInvariantsImpl(); } ::llvm::LogicalResult BoolConstantOp::inferReturnTypes(::mlir::MLIRContext *context, ::std::optional<::mlir::Location> location, ::mlir::ValueRange operands, ::mlir::DictionaryAttr attributes, ::mlir::PropertyRef properties, ::mlir::RegionRange regions, ::llvm::SmallVectorImpl<::mlir::Type>&inferredReturnTypes) { inferredReturnTypes.resize(1); ::mlir::Builder odsBuilder(context); ::mlir::Type odsInferredType0 = odsBuilder.getType(); inferredReturnTypes[0] = odsInferredType0; return ::mlir::success(); } ::mlir::ParseResult BoolConstantOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) { ::mlir::BoolAttr valueAttr; if (parser.parseCustomAttributeWithFallback(valueAttr, parser.getBuilder().getIntegerType(1))) { return ::mlir::failure(); } if (valueAttr) result.getOrAddProperties().value = valueAttr; { auto loc = parser.getCurrentLocation();(void)loc; if (parser.parseOptionalAttrDict(result.attributes)) return ::mlir::failure(); if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() { return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op "; }))) return ::mlir::failure(); } ::mlir::Type odsBuildableType0 = parser.getBuilder().getType(); result.addTypes(odsBuildableType0); return ::mlir::success(); } void BoolConstantOp::print(::mlir::OpAsmPrinter &_odsPrinter) { _odsPrinter << ' '; _odsPrinter.printAttributeWithoutType(getValueAttr()); ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs; elidedAttrs.push_back("value"); _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs); } void BoolConstantOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) { } } // namespace mlir::smt MLIR_DEFINE_EXPLICIT_TYPE_ID(mlir::smt::BoolConstantOp) MLIR_DEFINE_EXPLICIT_TYPE_ID(mlir::smt::detail::BoolConstantOpGenericAdaptorBase::Properties) namespace mlir::smt { //===----------------------------------------------------------------------===// // mlir::smt::CheckOp definitions //===----------------------------------------------------------------------===// namespace detail { CheckOpGenericAdaptorBase::CheckOpGenericAdaptorBase(CheckOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {} } // namespace detail CheckOpAdaptor::CheckOpAdaptor(CheckOp op) : CheckOpGenericAdaptor(op->getOperands(), op) {} ::llvm::LogicalResult CheckOpAdaptor::verify(::mlir::Location loc) { return ::mlir::success(); } std::pair CheckOp::getODSResultIndexAndLength(unsigned index) { bool isVariadic[] = {true}; int prevVariadicCount = 0; for (unsigned i = 0; i < index; ++i) if (isVariadic[i]) ++prevVariadicCount; // Calculate how many dynamic values a static variadic operand corresponds to. // This assumes all static variadic operands have the same dynamic value count. int variadicSize = (getOperation()->getNumResults() - 0) / 1; // `index` passed in as the parameter is the static index which counts each // operand (variadic or not) as size 1. So here for each previous static variadic // operand, we need to offset by (variadicSize - 1) to get where the dynamic // value pack for this static operand starts. int start = index + (variadicSize - 1) * prevVariadicCount; int size = isVariadic[index] ? variadicSize : 1; return {start, size}; } ::llvm::LogicalResult CheckOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) { ::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr); if (!dict) { emitError() << "expected DictionaryAttr to set properties"; return ::mlir::failure(); } return ::mlir::success(); } ::mlir::Attribute CheckOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) { ::mlir::SmallVector<::mlir::NamedAttribute> attrs; ::mlir::Builder odsBuilder{ctx}; if (!attrs.empty()) return odsBuilder.getDictionaryAttr(attrs); return {}; } llvm::hash_code CheckOp::computePropertiesHash(const Properties &prop) { using llvm::hash_value; return llvm::hash_combine(); } std::optional CheckOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) { return std::nullopt; } void CheckOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) { } void CheckOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) { } ::llvm::LogicalResult CheckOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) { return ::mlir::success(); } void CheckOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange results) { (void)odsState.addRegion(); (void)odsState.addRegion(); (void)odsState.addRegion(); odsState.addTypes(results); } CheckOp CheckOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange results) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(results)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } CheckOp CheckOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange results) { return create(builder, builder.getLoc(), std::forward(results)); } void CheckOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { assert(operands.size() == 0u && "mismatched number of parameters"); odsState.addOperands(operands); odsState.addAttributes(attributes); for (unsigned i = 0; i != 3; ++i) (void)odsState.addRegion(); odsState.addTypes(resultTypes); } CheckOp CheckOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(resultTypes), std::forward(operands), std::forward(attributes)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } CheckOp CheckOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { return create(builder, builder.getLoc(), std::forward(resultTypes), std::forward(operands), std::forward(attributes)); } void CheckOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { assert(operands.size() == 0u && "mismatched number of parameters"); odsState.addOperands(operands); odsState.useProperties(const_cast(properties)); odsState.addAttributes(discardableAttributes); for (unsigned i = 0; i != 3; ++i) (void)odsState.addRegion(); odsState.addTypes(resultTypes); } CheckOp CheckOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(resultTypes), std::forward(operands), std::forward(properties), std::forward(discardableAttributes)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } CheckOp CheckOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { return create(builder, builder.getLoc(), std::forward(resultTypes), std::forward(operands), std::forward(properties), std::forward(discardableAttributes)); } ::llvm::LogicalResult CheckOp::verifyInvariantsImpl() { { unsigned index = 0; (void)index; auto valueGroup0 = getODSResults(0); for (auto v : valueGroup0) { if (::mlir::failed(__mlir_ods_local_type_constraint_SMT10(*this, v.getType(), "result", index++))) return ::mlir::failure(); } } { unsigned index = 0; (void)index; for (auto ®ion : ::llvm::MutableArrayRef((*this)->getRegion(0))) if (::mlir::failed(__mlir_ods_local_region_constraint_SMT1(*this, region, "satRegion", index++))) return ::mlir::failure(); for (auto ®ion : ::llvm::MutableArrayRef((*this)->getRegion(1))) if (::mlir::failed(__mlir_ods_local_region_constraint_SMT1(*this, region, "unknownRegion", index++))) return ::mlir::failure(); for (auto ®ion : ::llvm::MutableArrayRef((*this)->getRegion(2))) if (::mlir::failed(__mlir_ods_local_region_constraint_SMT1(*this, region, "unsatRegion", index++))) return ::mlir::failure(); } return ::mlir::success(); } ::llvm::LogicalResult CheckOp::verifyInvariants() { return verifyInvariantsImpl(); } ::mlir::ParseResult CheckOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) { std::unique_ptr<::mlir::Region> satRegionRegion = std::make_unique<::mlir::Region>(); std::unique_ptr<::mlir::Region> unknownRegionRegion = std::make_unique<::mlir::Region>(); std::unique_ptr<::mlir::Region> unsatRegionRegion = std::make_unique<::mlir::Region>(); ::llvm::SmallVector<::mlir::Type, 1> resultsTypes; { auto loc = parser.getCurrentLocation();(void)loc; if (parser.parseOptionalAttrDict(result.attributes)) return ::mlir::failure(); if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() { return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op "; }))) return ::mlir::failure(); } if (parser.parseKeyword("sat")) return ::mlir::failure(); if (parser.parseRegion(*satRegionRegion)) return ::mlir::failure(); ensureTerminator(*satRegionRegion, parser.getBuilder(), result.location); if (parser.parseKeyword("unknown")) return ::mlir::failure(); if (parser.parseRegion(*unknownRegionRegion)) return ::mlir::failure(); ensureTerminator(*unknownRegionRegion, parser.getBuilder(), result.location); if (parser.parseKeyword("unsat")) return ::mlir::failure(); if (parser.parseRegion(*unsatRegionRegion)) return ::mlir::failure(); ensureTerminator(*unsatRegionRegion, parser.getBuilder(), result.location); if (::mlir::succeeded(parser.parseOptionalArrow())) { if (parser.parseTypeList(resultsTypes)) return ::mlir::failure(); } result.addRegion(std::move(satRegionRegion)); result.addRegion(std::move(unknownRegionRegion)); result.addRegion(std::move(unsatRegionRegion)); result.addTypes(resultsTypes); return ::mlir::success(); } void CheckOp::print(::mlir::OpAsmPrinter &_odsPrinter) { ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs; _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs); _odsPrinter << ' ' << "sat"; _odsPrinter << ' '; { bool printTerminator = true; if (auto *term = getSatRegion().empty() ? nullptr : getSatRegion().begin()->getTerminator()) { printTerminator = !term->getAttrDictionary().empty() || term->getNumOperands() != 0 || term->getNumResults() != 0; } _odsPrinter.printRegion(getSatRegion(), /*printEntryBlockArgs=*/true, /*printBlockTerminators=*/printTerminator); } _odsPrinter << ' ' << "unknown"; _odsPrinter << ' '; { bool printTerminator = true; if (auto *term = getUnknownRegion().empty() ? nullptr : getUnknownRegion().begin()->getTerminator()) { printTerminator = !term->getAttrDictionary().empty() || term->getNumOperands() != 0 || term->getNumResults() != 0; } _odsPrinter.printRegion(getUnknownRegion(), /*printEntryBlockArgs=*/true, /*printBlockTerminators=*/printTerminator); } _odsPrinter << ' ' << "unsat"; _odsPrinter << ' '; { bool printTerminator = true; if (auto *term = getUnsatRegion().empty() ? nullptr : getUnsatRegion().begin()->getTerminator()) { printTerminator = !term->getAttrDictionary().empty() || term->getNumOperands() != 0 || term->getNumResults() != 0; } _odsPrinter.printRegion(getUnsatRegion(), /*printEntryBlockArgs=*/true, /*printBlockTerminators=*/printTerminator); } if (!getResults().empty()) { _odsPrinter << ' ' << "->"; _odsPrinter << ' '; _odsPrinter << getResults().getTypes(); } } } // namespace mlir::smt MLIR_DEFINE_EXPLICIT_TYPE_ID(mlir::smt::CheckOp) namespace mlir::smt { //===----------------------------------------------------------------------===// // mlir::smt::ConcatOp definitions //===----------------------------------------------------------------------===// namespace detail { ConcatOpGenericAdaptorBase::ConcatOpGenericAdaptorBase(ConcatOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {} } // namespace detail ConcatOpAdaptor::ConcatOpAdaptor(ConcatOp op) : ConcatOpGenericAdaptor(op->getOperands(), op) {} ::llvm::LogicalResult ConcatOpAdaptor::verify(::mlir::Location loc) { return ::mlir::success(); } ::llvm::LogicalResult ConcatOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) { ::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr); if (!dict) { emitError() << "expected DictionaryAttr to set properties"; return ::mlir::failure(); } return ::mlir::success(); } ::mlir::Attribute ConcatOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) { ::mlir::SmallVector<::mlir::NamedAttribute> attrs; ::mlir::Builder odsBuilder{ctx}; if (!attrs.empty()) return odsBuilder.getDictionaryAttr(attrs); return {}; } llvm::hash_code ConcatOp::computePropertiesHash(const Properties &prop) { using llvm::hash_value; return llvm::hash_combine(); } std::optional ConcatOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) { return std::nullopt; } void ConcatOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) { } void ConcatOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) { } ::llvm::LogicalResult ConcatOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) { return ::mlir::success(); } void ConcatOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs) { odsState.addOperands(lhs); odsState.addOperands(rhs); odsState.addTypes(result); } ConcatOp ConcatOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(result), std::forward(lhs), std::forward(rhs)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } ConcatOp ConcatOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs) { return create(builder, builder.getLoc(), std::forward(result), std::forward(lhs), std::forward(rhs)); } void ConcatOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value lhs, ::mlir::Value rhs) { odsState.addOperands(lhs); odsState.addOperands(rhs); ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes; if (::mlir::succeeded(ConcatOp::inferReturnTypes(odsBuilder.getContext(), odsState.location, odsState.operands, odsState.attributes.getDictionary(odsState.getContext()), odsState.getRawProperties(), odsState.regions, inferredReturnTypes))) odsState.addTypes(inferredReturnTypes); else ::mlir::detail::reportFatalInferReturnTypesError(odsState); } ConcatOp ConcatOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value lhs, ::mlir::Value rhs) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(lhs), std::forward(rhs)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } ConcatOp ConcatOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value lhs, ::mlir::Value rhs) { return create(builder, builder.getLoc(), std::forward(lhs), std::forward(rhs)); } void ConcatOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs) { odsState.addOperands(lhs); odsState.addOperands(rhs); assert(resultTypes.size() == 1u && "mismatched number of results"); odsState.addTypes(resultTypes); } ConcatOp ConcatOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(resultTypes), std::forward(lhs), std::forward(rhs)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } ConcatOp ConcatOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs) { return create(builder, builder.getLoc(), std::forward(resultTypes), std::forward(lhs), std::forward(rhs)); } void ConcatOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { assert(operands.size() == 2u && "mismatched number of parameters"); odsState.addOperands(operands); odsState.addAttributes(attributes); assert(resultTypes.size() == 1u && "mismatched number of return types"); odsState.addTypes(resultTypes); } ConcatOp ConcatOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(resultTypes), std::forward(operands), std::forward(attributes)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } ConcatOp ConcatOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { return create(builder, builder.getLoc(), std::forward(resultTypes), std::forward(operands), std::forward(attributes)); } void ConcatOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { assert(operands.size() == 2u && "mismatched number of parameters"); odsState.addOperands(operands); odsState.addAttributes(attributes); ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes; if (::mlir::succeeded(ConcatOp::inferReturnTypes(odsBuilder.getContext(), odsState.location, operands, odsState.attributes.getDictionary(odsState.getContext()), odsState.getRawProperties(), odsState.regions, inferredReturnTypes))) { assert(inferredReturnTypes.size() == 1u && "mismatched number of return types"); odsState.addTypes(inferredReturnTypes); } else { ::llvm::report_fatal_error("Failed to infer result type(s)."); } } ConcatOp ConcatOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(operands), std::forward(attributes)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } ConcatOp ConcatOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { return create(builder, builder.getLoc(), std::forward(operands), std::forward(attributes)); } void ConcatOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { assert(operands.size() == 2u && "mismatched number of parameters"); odsState.addOperands(operands); odsState.useProperties(const_cast(properties)); odsState.addAttributes(discardableAttributes); assert(resultTypes.size() == 1u && "mismatched number of return types"); odsState.addTypes(resultTypes); } ConcatOp ConcatOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(resultTypes), std::forward(operands), std::forward(properties), std::forward(discardableAttributes)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } ConcatOp ConcatOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { return create(builder, builder.getLoc(), std::forward(resultTypes), std::forward(operands), std::forward(properties), std::forward(discardableAttributes)); } void ConcatOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { assert(operands.size() == 2u && "mismatched number of parameters"); odsState.addOperands(operands); odsState.useProperties(const_cast(properties)); odsState.addAttributes(discardableAttributes); ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes; if (::mlir::succeeded(ConcatOp::inferReturnTypes(odsBuilder.getContext(), odsState.location, operands, odsState.attributes.getDictionary(odsState.getContext()), odsState.getRawProperties(), odsState.regions, inferredReturnTypes))) { assert(inferredReturnTypes.size() == 1u && "mismatched number of return types"); odsState.addTypes(inferredReturnTypes); } else { ::llvm::report_fatal_error("Failed to infer result type(s)."); } } ConcatOp ConcatOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(operands), std::forward(properties), std::forward(discardableAttributes)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } ConcatOp ConcatOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { return create(builder, builder.getLoc(), std::forward(operands), std::forward(properties), std::forward(discardableAttributes)); } ::llvm::LogicalResult ConcatOp::verifyInvariantsImpl() { { unsigned index = 0; (void)index; auto valueGroup0 = getODSOperands(0); for (auto v : valueGroup0) { if (::mlir::failed(__mlir_ods_local_type_constraint_SMT8(*this, v.getType(), "operand", index++))) return ::mlir::failure(); } auto valueGroup1 = getODSOperands(1); for (auto v : valueGroup1) { if (::mlir::failed(__mlir_ods_local_type_constraint_SMT8(*this, v.getType(), "operand", index++))) return ::mlir::failure(); } } { unsigned index = 0; (void)index; auto valueGroup0 = getODSResults(0); for (auto v : valueGroup0) { if (::mlir::failed(__mlir_ods_local_type_constraint_SMT8(*this, v.getType(), "result", index++))) return ::mlir::failure(); } } return ::mlir::success(); } ::llvm::LogicalResult ConcatOp::verifyInvariants() { return verifyInvariantsImpl(); } ::mlir::ParseResult ConcatOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) { ::mlir::OpAsmParser::UnresolvedOperand lhsRawOperand{}; ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> lhsOperands(&lhsRawOperand, 1); ::llvm::SMLoc lhsOperandsLoc; (void)lhsOperandsLoc; ::mlir::OpAsmParser::UnresolvedOperand rhsRawOperand{}; ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> rhsOperands(&rhsRawOperand, 1); ::llvm::SMLoc rhsOperandsLoc; (void)rhsOperandsLoc; ::llvm::SmallVector<::mlir::Type, 1> allOperandTypes; lhsOperandsLoc = parser.getCurrentLocation(); if (parser.parseOperand(lhsRawOperand)) return ::mlir::failure(); if (parser.parseComma()) return ::mlir::failure(); rhsOperandsLoc = parser.getCurrentLocation(); if (parser.parseOperand(rhsRawOperand)) return ::mlir::failure(); { auto loc = parser.getCurrentLocation();(void)loc; if (parser.parseOptionalAttrDict(result.attributes)) return ::mlir::failure(); if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() { return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op "; }))) return ::mlir::failure(); } if (parser.parseColon()) return ::mlir::failure(); if (parser.parseTypeList(allOperandTypes)) return ::mlir::failure(); if (parser.resolveOperands(::llvm::concat(lhsOperands, rhsOperands), allOperandTypes, parser.getNameLoc(), result.operands)) return ::mlir::failure(); ::llvm::SmallVector<::mlir::Type> inferredReturnTypes; if (::mlir::failed(ConcatOp::inferReturnTypes(parser.getContext(), result.location, result.operands, result.attributes.getDictionary(parser.getContext()), result.getRawProperties(), result.regions, inferredReturnTypes))) return ::mlir::failure(); result.addTypes(inferredReturnTypes); return ::mlir::success(); } void ConcatOp::print(::mlir::OpAsmPrinter &_odsPrinter) { _odsPrinter << ' '; _odsPrinter << getLhs(); _odsPrinter << ","; _odsPrinter << ' '; _odsPrinter << getRhs(); ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs; _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs); _odsPrinter << ' ' << ":"; _odsPrinter << ' '; _odsPrinter << getOperation()->getOperandTypes(); } void ConcatOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) { } } // namespace mlir::smt MLIR_DEFINE_EXPLICIT_TYPE_ID(mlir::smt::ConcatOp) namespace mlir::smt { //===----------------------------------------------------------------------===// // mlir::smt::DeclareFunOp definitions //===----------------------------------------------------------------------===// namespace detail { DeclareFunOpGenericAdaptorBase::DeclareFunOpGenericAdaptorBase(DeclareFunOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {} ::std::optional< ::llvm::StringRef > DeclareFunOpGenericAdaptorBase::getNamePrefix() { auto attr = getNamePrefixAttr(); return attr ? ::std::optional< ::llvm::StringRef >(attr.getValue()) : (::std::nullopt); } } // namespace detail DeclareFunOpAdaptor::DeclareFunOpAdaptor(DeclareFunOp op) : DeclareFunOpGenericAdaptor(op->getOperands(), op) {} ::llvm::LogicalResult DeclareFunOpAdaptor::verify(::mlir::Location loc) { auto tblgen_namePrefix = getProperties().namePrefix; (void)tblgen_namePrefix; if (tblgen_namePrefix && !((::llvm::isa<::mlir::StringAttr>(tblgen_namePrefix)))) return emitError(loc, "'smt.declare_fun' op attribute 'namePrefix' failed to satisfy constraint: string attribute"); return ::mlir::success(); } ::llvm::LogicalResult DeclareFunOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) { ::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr); if (!dict) { emitError() << "expected DictionaryAttr to set properties"; return ::mlir::failure(); } { auto &propStorage = prop.namePrefix; auto attr = dict.get("namePrefix"); if (attr) { auto convertedAttr = ::llvm::dyn_cast>(attr); if (convertedAttr) { propStorage = convertedAttr; } else { emitError() << "Invalid attribute `namePrefix` in property conversion: " << attr; return ::mlir::failure(); } } } return ::mlir::success(); } ::mlir::Attribute DeclareFunOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) { ::mlir::SmallVector<::mlir::NamedAttribute> attrs; ::mlir::Builder odsBuilder{ctx}; { const auto &propStorage = prop.namePrefix; if (propStorage) attrs.push_back(odsBuilder.getNamedAttr("namePrefix", propStorage)); } if (!attrs.empty()) return odsBuilder.getDictionaryAttr(attrs); return {}; } llvm::hash_code DeclareFunOp::computePropertiesHash(const Properties &prop) { using llvm::hash_value; return llvm::hash_combine( llvm::hash_value(prop.namePrefix.getAsOpaquePointer())); } std::optional DeclareFunOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) { if (name == "namePrefix") return prop.namePrefix; return std::nullopt; } void DeclareFunOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) { if (name == "namePrefix") { prop.namePrefix = ::llvm::dyn_cast_or_null>(value); return; } } void DeclareFunOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) { if (prop.namePrefix) attrs.append("namePrefix", prop.namePrefix); } ::llvm::LogicalResult DeclareFunOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) { { ::mlir::Attribute attr = attrs.get(getNamePrefixAttrName(opName)); if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_SMT5(attr, "namePrefix", emitError))) return ::mlir::failure(); } return ::mlir::success(); } ::llvm::LogicalResult DeclareFunOp::readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state) { auto &prop = state.getOrAddProperties(); (void)prop; if (::mlir::failed(reader.readOptionalAttribute(prop.namePrefix))) return ::mlir::failure(); return ::mlir::success(); } void DeclareFunOp::writeProperties(::mlir::DialectBytecodeWriter &writer) { auto &prop = getProperties(); (void)prop; writer.writeOptionalAttribute(prop.namePrefix); } ::std::optional< ::llvm::StringRef > DeclareFunOp::getNamePrefix() { auto attr = getNamePrefixAttr(); return attr ? ::std::optional< ::llvm::StringRef >(attr.getValue()) : (::std::nullopt); } void DeclareFunOp::setNamePrefix(::std::optional<::llvm::StringRef> attrValue) { auto &odsProp = getProperties().namePrefix; if (attrValue) odsProp = ::mlir::Builder((*this)->getContext()).getStringAttr(*attrValue); else odsProp = nullptr; } void DeclareFunOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, mlir::Type type) { build(odsBuilder, odsState, type, nullptr); } DeclareFunOp DeclareFunOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, mlir::Type type) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(type)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } DeclareFunOp DeclareFunOp::create(::mlir::ImplicitLocOpBuilder &builder, mlir::Type type) { return create(builder, builder.getLoc(), std::forward(type)); } void DeclareFunOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, /*optional*/::mlir::StringAttr namePrefix) { if (namePrefix) { odsState.getOrAddProperties().namePrefix = namePrefix; } odsState.addTypes(result); } DeclareFunOp DeclareFunOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, /*optional*/::mlir::StringAttr namePrefix) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(result), std::forward(namePrefix)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } DeclareFunOp DeclareFunOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, /*optional*/::mlir::StringAttr namePrefix) { return create(builder, builder.getLoc(), std::forward(result), std::forward(namePrefix)); } void DeclareFunOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, /*optional*/::mlir::StringAttr namePrefix) { if (namePrefix) { odsState.getOrAddProperties().namePrefix = namePrefix; } assert(resultTypes.size() == 1u && "mismatched number of results"); odsState.addTypes(resultTypes); } DeclareFunOp DeclareFunOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, /*optional*/::mlir::StringAttr namePrefix) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(resultTypes), std::forward(namePrefix)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } DeclareFunOp DeclareFunOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, /*optional*/::mlir::StringAttr namePrefix) { return create(builder, builder.getLoc(), std::forward(resultTypes), std::forward(namePrefix)); } void DeclareFunOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { assert(operands.size() == 0u && "mismatched number of parameters"); odsState.addOperands(operands); odsState.addAttributes(attributes); assert(resultTypes.size() == 1u && "mismatched number of return types"); odsState.addTypes(resultTypes); if (!attributes.empty()) { (void)odsState.getOrAddProperties(); ::mlir::PropertyRef properties = odsState.getRawProperties(); std::optional<::mlir::RegisteredOperationName> info = odsState.name.getRegisteredInfo(); if (failed(info->setOpPropertiesFromAttribute(odsState.name, properties, odsState.attributes.getDictionary(odsState.getContext()), nullptr))) ::llvm::report_fatal_error("Property conversion failed."); } } DeclareFunOp DeclareFunOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(resultTypes), std::forward(operands), std::forward(attributes)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } DeclareFunOp DeclareFunOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { return create(builder, builder.getLoc(), std::forward(resultTypes), std::forward(operands), std::forward(attributes)); } void DeclareFunOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { assert(operands.size() == 0u && "mismatched number of parameters"); odsState.addOperands(operands); odsState.useProperties(const_cast(properties)); odsState.addAttributes(discardableAttributes); assert(resultTypes.size() == 1u && "mismatched number of return types"); odsState.addTypes(resultTypes); } DeclareFunOp DeclareFunOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(resultTypes), std::forward(operands), std::forward(properties), std::forward(discardableAttributes)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } DeclareFunOp DeclareFunOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { return create(builder, builder.getLoc(), std::forward(resultTypes), std::forward(operands), std::forward(properties), std::forward(discardableAttributes)); } ::llvm::LogicalResult DeclareFunOp::verifyInvariantsImpl() { auto tblgen_namePrefix = getProperties().namePrefix; (void)tblgen_namePrefix; if (::mlir::failed(__mlir_ods_local_attr_constraint_SMT5(*this, tblgen_namePrefix, "namePrefix"))) return ::mlir::failure(); { unsigned index = 0; (void)index; auto valueGroup0 = getODSResults(0); for (auto v : valueGroup0) { if (::mlir::failed(__mlir_ods_local_type_constraint_SMT6(*this, v.getType(), "result", index++))) return ::mlir::failure(); } } return ::mlir::success(); } ::llvm::LogicalResult DeclareFunOp::verifyInvariants() { return verifyInvariantsImpl(); } ::mlir::ParseResult DeclareFunOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) { ::mlir::StringAttr namePrefixAttr; ::mlir::Type resultRawType{}; ::llvm::ArrayRef<::mlir::Type> resultTypes(&resultRawType, 1); ::mlir::OptionalParseResult parseResultnamePrefixAttr = parser.parseOptionalAttribute(namePrefixAttr, parser.getBuilder().getType<::mlir::NoneType>()); if (parseResultnamePrefixAttr.has_value() && failed(*parseResultnamePrefixAttr)) return ::mlir::failure(); if (parseResultnamePrefixAttr.has_value() && succeeded(*parseResultnamePrefixAttr)) if (namePrefixAttr) result.getOrAddProperties().namePrefix = namePrefixAttr; if (namePrefixAttr) { } { auto loc = parser.getCurrentLocation();(void)loc; if (parser.parseOptionalAttrDict(result.attributes)) return ::mlir::failure(); if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() { return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op "; }))) return ::mlir::failure(); } if (parser.parseColon()) return ::mlir::failure(); if (parser.parseType(resultRawType)) return ::mlir::failure(); result.addTypes(resultTypes); return ::mlir::success(); } void DeclareFunOp::print(::mlir::OpAsmPrinter &_odsPrinter) { if (getNamePrefixAttr()) { _odsPrinter << ' '; _odsPrinter.printAttributeWithoutType(getNamePrefixAttr()); } ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs; elidedAttrs.push_back("namePrefix"); _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs); _odsPrinter << ' ' << ":"; _odsPrinter << ' '; _odsPrinter << getResult().getType(); } void DeclareFunOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) { { auto valueRange = getODSResultIndexAndLength(0); for (unsigned idx = valueRange.first; idx < valueRange.first + valueRange.second; idx++) { effects.emplace_back(::mlir::MemoryEffects::Allocate::get(), getOperation()->getOpResult(idx), 0, false, ::mlir::SideEffects::DefaultResource::get()); } } } } // namespace mlir::smt MLIR_DEFINE_EXPLICIT_TYPE_ID(mlir::smt::DeclareFunOp) MLIR_DEFINE_EXPLICIT_TYPE_ID(mlir::smt::detail::DeclareFunOpGenericAdaptorBase::Properties) namespace mlir::smt { //===----------------------------------------------------------------------===// // mlir::smt::DistinctOp definitions //===----------------------------------------------------------------------===// namespace detail { DistinctOpGenericAdaptorBase::DistinctOpGenericAdaptorBase(DistinctOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {} std::pair DistinctOpGenericAdaptorBase::getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize) { bool isVariadic[] = {true}; int prevVariadicCount = 0; for (unsigned i = 0; i < index; ++i) if (isVariadic[i]) ++prevVariadicCount; // Calculate how many dynamic values a static variadic operand corresponds to. // This assumes all static variadic operands have the same dynamic value count. int variadicSize = (odsOperandsSize - 0) / 1; // `index` passed in as the parameter is the static index which counts each // operand (variadic or not) as size 1. So here for each previous static variadic // operand, we need to offset by (variadicSize - 1) to get where the dynamic // value pack for this static operand starts. int start = index + (variadicSize - 1) * prevVariadicCount; int size = isVariadic[index] ? variadicSize : 1; return {start, size}; } } // namespace detail DistinctOpAdaptor::DistinctOpAdaptor(DistinctOp op) : DistinctOpGenericAdaptor(op->getOperands(), op) {} ::llvm::LogicalResult DistinctOpAdaptor::verify(::mlir::Location loc) { return ::mlir::success(); } std::pair DistinctOp::getODSOperandIndexAndLength(unsigned index) { bool isVariadic[] = {true}; int prevVariadicCount = 0; for (unsigned i = 0; i < index; ++i) if (isVariadic[i]) ++prevVariadicCount; // Calculate how many dynamic values a static variadic operand corresponds to. // This assumes all static variadic operands have the same dynamic value count. int variadicSize = (getOperation()->getNumOperands() - 0) / 1; // `index` passed in as the parameter is the static index which counts each // operand (variadic or not) as size 1. So here for each previous static variadic // operand, we need to offset by (variadicSize - 1) to get where the dynamic // value pack for this static operand starts. int start = index + (variadicSize - 1) * prevVariadicCount; int size = isVariadic[index] ? variadicSize : 1; return {start, size}; } ::mlir::MutableOperandRange DistinctOp::getInputsMutable() { auto range = getODSOperandIndexAndLength(0); auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second); return mutableRange; } ::llvm::LogicalResult DistinctOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) { ::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr); if (!dict) { emitError() << "expected DictionaryAttr to set properties"; return ::mlir::failure(); } return ::mlir::success(); } ::mlir::Attribute DistinctOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) { ::mlir::SmallVector<::mlir::NamedAttribute> attrs; ::mlir::Builder odsBuilder{ctx}; if (!attrs.empty()) return odsBuilder.getDictionaryAttr(attrs); return {}; } llvm::hash_code DistinctOp::computePropertiesHash(const Properties &prop) { using llvm::hash_value; return llvm::hash_combine(); } std::optional DistinctOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) { return std::nullopt; } void DistinctOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) { } void DistinctOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) { } ::llvm::LogicalResult DistinctOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) { return ::mlir::success(); } void DistinctOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, mlir::Value lhs, mlir::Value rhs) { build(odsBuilder, odsState, ValueRange{lhs, rhs}); } DistinctOp DistinctOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, mlir::Value lhs, mlir::Value rhs) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(lhs), std::forward(rhs)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } DistinctOp DistinctOp::create(::mlir::ImplicitLocOpBuilder &builder, mlir::Value lhs, mlir::Value rhs) { return create(builder, builder.getLoc(), std::forward(lhs), std::forward(rhs)); } void DistinctOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::ValueRange inputs) { odsState.addOperands(inputs); odsState.addTypes(result); } DistinctOp DistinctOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::ValueRange inputs) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(result), std::forward(inputs)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } DistinctOp DistinctOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::ValueRange inputs) { return create(builder, builder.getLoc(), std::forward(result), std::forward(inputs)); } void DistinctOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { odsState.addOperands(operands); odsState.addAttributes(attributes); assert(resultTypes.size() == 1u && "mismatched number of return types"); odsState.addTypes(resultTypes); } DistinctOp DistinctOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(resultTypes), std::forward(operands), std::forward(attributes)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } DistinctOp DistinctOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { return create(builder, builder.getLoc(), std::forward(resultTypes), std::forward(operands), std::forward(attributes)); } void DistinctOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { odsState.addOperands(operands); odsState.addAttributes(attributes); ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes; if (::mlir::succeeded(DistinctOp::inferReturnTypes(odsBuilder.getContext(), odsState.location, operands, odsState.attributes.getDictionary(odsState.getContext()), odsState.getRawProperties(), odsState.regions, inferredReturnTypes))) { assert(inferredReturnTypes.size() == 1u && "mismatched number of return types"); odsState.addTypes(inferredReturnTypes); } else { ::llvm::report_fatal_error("Failed to infer result type(s)."); } } DistinctOp DistinctOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(operands), std::forward(attributes)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } DistinctOp DistinctOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { return create(builder, builder.getLoc(), std::forward(operands), std::forward(attributes)); } void DistinctOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { odsState.addOperands(operands); odsState.useProperties(const_cast(properties)); odsState.addAttributes(discardableAttributes); assert(resultTypes.size() == 1u && "mismatched number of return types"); odsState.addTypes(resultTypes); } DistinctOp DistinctOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(resultTypes), std::forward(operands), std::forward(properties), std::forward(discardableAttributes)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } DistinctOp DistinctOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { return create(builder, builder.getLoc(), std::forward(resultTypes), std::forward(operands), std::forward(properties), std::forward(discardableAttributes)); } void DistinctOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { odsState.addOperands(operands); odsState.useProperties(const_cast(properties)); odsState.addAttributes(discardableAttributes); ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes; if (::mlir::succeeded(DistinctOp::inferReturnTypes(odsBuilder.getContext(), odsState.location, operands, odsState.attributes.getDictionary(odsState.getContext()), odsState.getRawProperties(), odsState.regions, inferredReturnTypes))) { assert(inferredReturnTypes.size() == 1u && "mismatched number of return types"); odsState.addTypes(inferredReturnTypes); } else { ::llvm::report_fatal_error("Failed to infer result type(s)."); } } DistinctOp DistinctOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(operands), std::forward(properties), std::forward(discardableAttributes)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } DistinctOp DistinctOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { return create(builder, builder.getLoc(), std::forward(operands), std::forward(properties), std::forward(discardableAttributes)); } ::llvm::LogicalResult DistinctOp::verifyInvariantsImpl() { { unsigned index = 0; (void)index; auto valueGroup0 = getODSOperands(0); for (auto v : valueGroup0) { if (::mlir::failed(__mlir_ods_local_type_constraint_SMT4(*this, v.getType(), "operand", index++))) return ::mlir::failure(); } } { unsigned index = 0; (void)index; auto valueGroup0 = getODSResults(0); for (auto v : valueGroup0) { if (::mlir::failed(__mlir_ods_local_type_constraint_SMT2(*this, v.getType(), "result", index++))) return ::mlir::failure(); } } return ::mlir::success(); } ::llvm::LogicalResult DistinctOp::verifyInvariants() { if(::mlir::succeeded(verifyInvariantsImpl()) && ::mlir::succeeded(verify())) return ::mlir::success(); return ::mlir::failure(); } ::llvm::LogicalResult DistinctOp::inferReturnTypes(::mlir::MLIRContext *context, ::std::optional<::mlir::Location> location, ::mlir::ValueRange operands, ::mlir::DictionaryAttr attributes, ::mlir::PropertyRef properties, ::mlir::RegionRange regions, ::llvm::SmallVectorImpl<::mlir::Type>&inferredReturnTypes) { inferredReturnTypes.resize(1); ::mlir::Builder odsBuilder(context); ::mlir::Type odsInferredType0 = odsBuilder.getType(); inferredReturnTypes[0] = odsInferredType0; return ::mlir::success(); } ::llvm::LogicalResult DistinctOp::setPropertiesFromParsedAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) { ::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr); if (!dict) { emitError() << "expected DictionaryAttr to set properties"; return ::mlir::failure(); } // keep track of used keys in the input dictionary to be able to error out // if there are some unknown ones. ::mlir::DenseSet<::mlir::StringAttr> usedKeys; ::mlir::MLIRContext *ctx = dict.getContext(); (void)ctx; for (::mlir::NamedAttribute attr : dict) { if (!usedKeys.contains(attr.getName())) return emitError() << "unknown key '" << attr.getName() << "' when parsing properties dictionary"; } return ::mlir::success(); } void DistinctOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) { } } // namespace mlir::smt MLIR_DEFINE_EXPLICIT_TYPE_ID(mlir::smt::DistinctOp) namespace mlir::smt { //===----------------------------------------------------------------------===// // mlir::smt::EqOp definitions //===----------------------------------------------------------------------===// namespace detail { EqOpGenericAdaptorBase::EqOpGenericAdaptorBase(EqOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {} std::pair EqOpGenericAdaptorBase::getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize) { bool isVariadic[] = {true}; int prevVariadicCount = 0; for (unsigned i = 0; i < index; ++i) if (isVariadic[i]) ++prevVariadicCount; // Calculate how many dynamic values a static variadic operand corresponds to. // This assumes all static variadic operands have the same dynamic value count. int variadicSize = (odsOperandsSize - 0) / 1; // `index` passed in as the parameter is the static index which counts each // operand (variadic or not) as size 1. So here for each previous static variadic // operand, we need to offset by (variadicSize - 1) to get where the dynamic // value pack for this static operand starts. int start = index + (variadicSize - 1) * prevVariadicCount; int size = isVariadic[index] ? variadicSize : 1; return {start, size}; } } // namespace detail EqOpAdaptor::EqOpAdaptor(EqOp op) : EqOpGenericAdaptor(op->getOperands(), op) {} ::llvm::LogicalResult EqOpAdaptor::verify(::mlir::Location loc) { return ::mlir::success(); } std::pair EqOp::getODSOperandIndexAndLength(unsigned index) { bool isVariadic[] = {true}; int prevVariadicCount = 0; for (unsigned i = 0; i < index; ++i) if (isVariadic[i]) ++prevVariadicCount; // Calculate how many dynamic values a static variadic operand corresponds to. // This assumes all static variadic operands have the same dynamic value count. int variadicSize = (getOperation()->getNumOperands() - 0) / 1; // `index` passed in as the parameter is the static index which counts each // operand (variadic or not) as size 1. So here for each previous static variadic // operand, we need to offset by (variadicSize - 1) to get where the dynamic // value pack for this static operand starts. int start = index + (variadicSize - 1) * prevVariadicCount; int size = isVariadic[index] ? variadicSize : 1; return {start, size}; } ::mlir::MutableOperandRange EqOp::getInputsMutable() { auto range = getODSOperandIndexAndLength(0); auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second); return mutableRange; } ::llvm::LogicalResult EqOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) { ::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr); if (!dict) { emitError() << "expected DictionaryAttr to set properties"; return ::mlir::failure(); } return ::mlir::success(); } ::mlir::Attribute EqOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) { ::mlir::SmallVector<::mlir::NamedAttribute> attrs; ::mlir::Builder odsBuilder{ctx}; if (!attrs.empty()) return odsBuilder.getDictionaryAttr(attrs); return {}; } llvm::hash_code EqOp::computePropertiesHash(const Properties &prop) { using llvm::hash_value; return llvm::hash_combine(); } std::optional EqOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) { return std::nullopt; } void EqOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) { } void EqOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) { } ::llvm::LogicalResult EqOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) { return ::mlir::success(); } void EqOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, mlir::Value lhs, mlir::Value rhs) { build(odsBuilder, odsState, ValueRange{lhs, rhs}); } EqOp EqOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, mlir::Value lhs, mlir::Value rhs) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(lhs), std::forward(rhs)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } EqOp EqOp::create(::mlir::ImplicitLocOpBuilder &builder, mlir::Value lhs, mlir::Value rhs) { return create(builder, builder.getLoc(), std::forward(lhs), std::forward(rhs)); } void EqOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::ValueRange inputs) { odsState.addOperands(inputs); odsState.addTypes(result); } EqOp EqOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::ValueRange inputs) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(result), std::forward(inputs)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } EqOp EqOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::ValueRange inputs) { return create(builder, builder.getLoc(), std::forward(result), std::forward(inputs)); } void EqOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { odsState.addOperands(operands); odsState.addAttributes(attributes); assert(resultTypes.size() == 1u && "mismatched number of return types"); odsState.addTypes(resultTypes); } EqOp EqOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(resultTypes), std::forward(operands), std::forward(attributes)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } EqOp EqOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { return create(builder, builder.getLoc(), std::forward(resultTypes), std::forward(operands), std::forward(attributes)); } void EqOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { odsState.addOperands(operands); odsState.addAttributes(attributes); ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes; if (::mlir::succeeded(EqOp::inferReturnTypes(odsBuilder.getContext(), odsState.location, operands, odsState.attributes.getDictionary(odsState.getContext()), odsState.getRawProperties(), odsState.regions, inferredReturnTypes))) { assert(inferredReturnTypes.size() == 1u && "mismatched number of return types"); odsState.addTypes(inferredReturnTypes); } else { ::llvm::report_fatal_error("Failed to infer result type(s)."); } } EqOp EqOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(operands), std::forward(attributes)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } EqOp EqOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { return create(builder, builder.getLoc(), std::forward(operands), std::forward(attributes)); } void EqOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { odsState.addOperands(operands); odsState.useProperties(const_cast(properties)); odsState.addAttributes(discardableAttributes); assert(resultTypes.size() == 1u && "mismatched number of return types"); odsState.addTypes(resultTypes); } EqOp EqOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(resultTypes), std::forward(operands), std::forward(properties), std::forward(discardableAttributes)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } EqOp EqOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { return create(builder, builder.getLoc(), std::forward(resultTypes), std::forward(operands), std::forward(properties), std::forward(discardableAttributes)); } void EqOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { odsState.addOperands(operands); odsState.useProperties(const_cast(properties)); odsState.addAttributes(discardableAttributes); ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes; if (::mlir::succeeded(EqOp::inferReturnTypes(odsBuilder.getContext(), odsState.location, operands, odsState.attributes.getDictionary(odsState.getContext()), odsState.getRawProperties(), odsState.regions, inferredReturnTypes))) { assert(inferredReturnTypes.size() == 1u && "mismatched number of return types"); odsState.addTypes(inferredReturnTypes); } else { ::llvm::report_fatal_error("Failed to infer result type(s)."); } } EqOp EqOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(operands), std::forward(properties), std::forward(discardableAttributes)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } EqOp EqOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { return create(builder, builder.getLoc(), std::forward(operands), std::forward(properties), std::forward(discardableAttributes)); } ::llvm::LogicalResult EqOp::verifyInvariantsImpl() { { unsigned index = 0; (void)index; auto valueGroup0 = getODSOperands(0); for (auto v : valueGroup0) { if (::mlir::failed(__mlir_ods_local_type_constraint_SMT4(*this, v.getType(), "operand", index++))) return ::mlir::failure(); } } { unsigned index = 0; (void)index; auto valueGroup0 = getODSResults(0); for (auto v : valueGroup0) { if (::mlir::failed(__mlir_ods_local_type_constraint_SMT2(*this, v.getType(), "result", index++))) return ::mlir::failure(); } } return ::mlir::success(); } ::llvm::LogicalResult EqOp::verifyInvariants() { if(::mlir::succeeded(verifyInvariantsImpl()) && ::mlir::succeeded(verify())) return ::mlir::success(); return ::mlir::failure(); } ::llvm::LogicalResult EqOp::inferReturnTypes(::mlir::MLIRContext *context, ::std::optional<::mlir::Location> location, ::mlir::ValueRange operands, ::mlir::DictionaryAttr attributes, ::mlir::PropertyRef properties, ::mlir::RegionRange regions, ::llvm::SmallVectorImpl<::mlir::Type>&inferredReturnTypes) { inferredReturnTypes.resize(1); ::mlir::Builder odsBuilder(context); ::mlir::Type odsInferredType0 = odsBuilder.getType(); inferredReturnTypes[0] = odsInferredType0; return ::mlir::success(); } ::llvm::LogicalResult EqOp::setPropertiesFromParsedAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) { ::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr); if (!dict) { emitError() << "expected DictionaryAttr to set properties"; return ::mlir::failure(); } // keep track of used keys in the input dictionary to be able to error out // if there are some unknown ones. ::mlir::DenseSet<::mlir::StringAttr> usedKeys; ::mlir::MLIRContext *ctx = dict.getContext(); (void)ctx; for (::mlir::NamedAttribute attr : dict) { if (!usedKeys.contains(attr.getName())) return emitError() << "unknown key '" << attr.getName() << "' when parsing properties dictionary"; } return ::mlir::success(); } void EqOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) { } } // namespace mlir::smt MLIR_DEFINE_EXPLICIT_TYPE_ID(mlir::smt::EqOp) namespace mlir::smt { //===----------------------------------------------------------------------===// // mlir::smt::ExistsOp definitions //===----------------------------------------------------------------------===// namespace detail { ExistsOpGenericAdaptorBase::ExistsOpGenericAdaptorBase(ExistsOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {} ::mlir::IntegerAttr ExistsOpGenericAdaptorBase::getWeightAttr() { auto attr = ::llvm::dyn_cast_or_null<::mlir::IntegerAttr>(getProperties().weight); return attr; } uint32_t ExistsOpGenericAdaptorBase::getWeight() { auto attr = getWeightAttr(); return attr.getValue().getZExtValue(); } ::mlir::UnitAttr ExistsOpGenericAdaptorBase::getNoPatternAttr() { auto attr = ::llvm::dyn_cast_or_null<::mlir::UnitAttr>(getProperties().noPattern); if (!attr) attr = ((false) ? ::mlir::Builder(odsAttrs.getContext()).getUnitAttr() : nullptr); return attr; } bool ExistsOpGenericAdaptorBase::getNoPattern() { auto attr = getNoPatternAttr(); if (!attr) return ((false) ? ::mlir::Builder(odsAttrs.getContext()).getUnitAttr() : nullptr) != nullptr; return attr != nullptr; } ::std::optional< ::mlir::ArrayAttr > ExistsOpGenericAdaptorBase::getBoundVarNames() { auto attr = getBoundVarNamesAttr(); return attr ? ::std::optional< ::mlir::ArrayAttr >(attr) : (::std::nullopt); } } // namespace detail ExistsOpAdaptor::ExistsOpAdaptor(ExistsOp op) : ExistsOpGenericAdaptor(op->getOperands(), op) {} ::llvm::LogicalResult ExistsOpAdaptor::verify(::mlir::Location loc) { auto tblgen_boundVarNames = getProperties().boundVarNames; (void)tblgen_boundVarNames; auto tblgen_noPattern = getProperties().noPattern; (void)tblgen_noPattern; auto tblgen_weight = getProperties().weight; (void)tblgen_weight; if (tblgen_weight && !(((::llvm::isa<::mlir::IntegerAttr>(tblgen_weight))) && ((::llvm::cast<::mlir::IntegerAttr>(tblgen_weight).getType().isSignlessInteger(32))))) return emitError(loc, "'smt.exists' op attribute 'weight' failed to satisfy constraint: 32-bit signless integer attribute"); if (tblgen_noPattern && !((::llvm::isa<::mlir::UnitAttr>(tblgen_noPattern)))) return emitError(loc, "'smt.exists' op attribute 'noPattern' failed to satisfy constraint: unit attribute"); if (tblgen_boundVarNames && !(((::llvm::isa<::mlir::ArrayAttr>(tblgen_boundVarNames))) && (::llvm::all_of(::llvm::cast<::mlir::ArrayAttr>(tblgen_boundVarNames), [&](::mlir::Attribute attr) { return attr && ((::llvm::isa<::mlir::StringAttr>(attr))); })))) return emitError(loc, "'smt.exists' op attribute 'boundVarNames' failed to satisfy constraint: string array attribute"); return ::mlir::success(); } ::llvm::LogicalResult ExistsOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) { ::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr); if (!dict) { emitError() << "expected DictionaryAttr to set properties"; return ::mlir::failure(); } { auto &propStorage = prop.boundVarNames; auto attr = dict.get("boundVarNames"); if (attr) { auto convertedAttr = ::llvm::dyn_cast>(attr); if (convertedAttr) { propStorage = convertedAttr; } else { emitError() << "Invalid attribute `boundVarNames` in property conversion: " << attr; return ::mlir::failure(); } } } { auto &propStorage = prop.noPattern; auto attr = dict.get("noPattern"); if (attr) { auto convertedAttr = ::llvm::dyn_cast>(attr); if (convertedAttr) { propStorage = convertedAttr; } else { emitError() << "Invalid attribute `noPattern` in property conversion: " << attr; return ::mlir::failure(); } } } { auto &propStorage = prop.weight; auto attr = dict.get("weight"); if (attr) { auto convertedAttr = ::llvm::dyn_cast>(attr); if (convertedAttr) { propStorage = convertedAttr; } else { emitError() << "Invalid attribute `weight` in property conversion: " << attr; return ::mlir::failure(); } } } return ::mlir::success(); } ::mlir::Attribute ExistsOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) { ::mlir::SmallVector<::mlir::NamedAttribute> attrs; ::mlir::Builder odsBuilder{ctx}; { const auto &propStorage = prop.boundVarNames; if (propStorage) attrs.push_back(odsBuilder.getNamedAttr("boundVarNames", propStorage)); } { const auto &propStorage = prop.noPattern; if (propStorage) attrs.push_back(odsBuilder.getNamedAttr("noPattern", propStorage)); } { const auto &propStorage = prop.weight; if (propStorage) attrs.push_back(odsBuilder.getNamedAttr("weight", propStorage)); } if (!attrs.empty()) return odsBuilder.getDictionaryAttr(attrs); return {}; } llvm::hash_code ExistsOp::computePropertiesHash(const Properties &prop) { using llvm::hash_value; return llvm::hash_combine( llvm::hash_value(prop.boundVarNames.getAsOpaquePointer()), llvm::hash_value(prop.noPattern.getAsOpaquePointer()), llvm::hash_value(prop.weight.getAsOpaquePointer())); } std::optional ExistsOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) { if (name == "boundVarNames") return prop.boundVarNames; if (name == "noPattern") return prop.noPattern; if (name == "weight") return prop.weight; return std::nullopt; } void ExistsOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) { if (name == "boundVarNames") { prop.boundVarNames = ::llvm::dyn_cast_or_null>(value); return; } if (name == "noPattern") { prop.noPattern = ::llvm::dyn_cast_or_null>(value); return; } if (name == "weight") { prop.weight = ::llvm::dyn_cast_or_null>(value); return; } } void ExistsOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) { if (prop.boundVarNames) attrs.append("boundVarNames", prop.boundVarNames); if (prop.noPattern) attrs.append("noPattern", prop.noPattern); if (prop.weight) attrs.append("weight", prop.weight); } ::llvm::LogicalResult ExistsOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) { { ::mlir::Attribute attr = attrs.get(getBoundVarNamesAttrName(opName)); if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_SMT7(attr, "boundVarNames", emitError))) return ::mlir::failure(); } { ::mlir::Attribute attr = attrs.get(getNoPatternAttrName(opName)); if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_SMT1(attr, "noPattern", emitError))) return ::mlir::failure(); } { ::mlir::Attribute attr = attrs.get(getWeightAttrName(opName)); if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_SMT6(attr, "weight", emitError))) return ::mlir::failure(); } return ::mlir::success(); } ::llvm::LogicalResult ExistsOp::readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state) { auto &prop = state.getOrAddProperties(); (void)prop; if (::mlir::failed(reader.readOptionalAttribute(prop.boundVarNames))) return ::mlir::failure(); if (::mlir::failed(reader.readOptionalAttribute(prop.noPattern))) return ::mlir::failure(); if (::mlir::failed(reader.readOptionalAttribute(prop.weight))) return ::mlir::failure(); return ::mlir::success(); } void ExistsOp::writeProperties(::mlir::DialectBytecodeWriter &writer) { auto &prop = getProperties(); (void)prop; writer.writeOptionalAttribute(prop.boundVarNames); writer.writeOptionalAttribute(prop.noPattern); writer.writeOptionalAttribute(prop.weight); } uint32_t ExistsOp::getWeight() { auto attr = getWeightAttr(); return attr.getValue().getZExtValue(); } bool ExistsOp::getNoPattern() { auto attr = getNoPatternAttr(); if (!attr) return ((false) ? ::mlir::Builder((*this)->getContext()).getUnitAttr() : nullptr) != nullptr; return attr != nullptr; } ::std::optional< ::mlir::ArrayAttr > ExistsOp::getBoundVarNames() { auto attr = getBoundVarNamesAttr(); return attr ? ::std::optional< ::mlir::ArrayAttr >(attr) : (::std::nullopt); } void ExistsOp::setWeight(uint32_t attrValue) { getProperties().weight = ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(32), attrValue); } void ExistsOp::setNoPattern(bool attrValue) { auto &odsProp = getProperties().noPattern; if (attrValue) odsProp = ((attrValue) ? ::mlir::Builder((*this)->getContext()).getUnitAttr() : nullptr); else odsProp = nullptr; } ExistsOp ExistsOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, TypeRange boundVarTypes, function_ref bodyBuilder, std::optional> boundVarNames, function_ref patternBuilder, uint32_t weight, bool noPattern) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(boundVarTypes), std::forward(bodyBuilder), std::forward(boundVarNames), std::forward(patternBuilder), std::forward(weight), std::forward(noPattern)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } ExistsOp ExistsOp::create(::mlir::ImplicitLocOpBuilder &builder, TypeRange boundVarTypes, function_ref bodyBuilder, std::optional> boundVarNames, function_ref patternBuilder, uint32_t weight, bool noPattern) { return create(builder, builder.getLoc(), std::forward(boundVarTypes), std::forward(bodyBuilder), std::forward(boundVarNames), std::forward(patternBuilder), std::forward(weight), std::forward(noPattern)); } void ExistsOp::populateDefaultProperties(::mlir::OperationName opName, Properties &properties) { ::mlir::Builder odsBuilder(opName.getContext()); if (!properties.weight) properties.weight = odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(32), 0); } ::llvm::LogicalResult ExistsOp::verifyInvariantsImpl() { auto tblgen_boundVarNames = getProperties().boundVarNames; (void)tblgen_boundVarNames; auto tblgen_noPattern = getProperties().noPattern; (void)tblgen_noPattern; auto tblgen_weight = getProperties().weight; (void)tblgen_weight; if (::mlir::failed(__mlir_ods_local_attr_constraint_SMT6(*this, tblgen_weight, "weight"))) return ::mlir::failure(); if (::mlir::failed(__mlir_ods_local_attr_constraint_SMT1(*this, tblgen_noPattern, "noPattern"))) return ::mlir::failure(); if (::mlir::failed(__mlir_ods_local_attr_constraint_SMT7(*this, tblgen_boundVarNames, "boundVarNames"))) return ::mlir::failure(); { unsigned index = 0; (void)index; auto valueGroup0 = getODSResults(0); for (auto v : valueGroup0) { if (::mlir::failed(__mlir_ods_local_type_constraint_SMT2(*this, v.getType(), "result", index++))) return ::mlir::failure(); } } { unsigned index = 0; (void)index; for (auto ®ion : ::llvm::MutableArrayRef((*this)->getRegion(0))) if (::mlir::failed(__mlir_ods_local_region_constraint_SMT1(*this, region, "body", index++))) return ::mlir::failure(); for (auto ®ion : getPatterns()) if (::mlir::failed(__mlir_ods_local_region_constraint_SMT1(*this, region, "patterns", index++))) return ::mlir::failure(); } return ::mlir::success(); } ::llvm::LogicalResult ExistsOp::verifyInvariants() { if(::mlir::succeeded(verifyInvariantsImpl()) && ::mlir::succeeded(verify())) return ::mlir::success(); return ::mlir::failure(); } ::llvm::LogicalResult ExistsOp::inferReturnTypes(::mlir::MLIRContext *context, ::std::optional<::mlir::Location> location, ::mlir::ValueRange operands, ::mlir::DictionaryAttr attributes, ::mlir::PropertyRef properties, ::mlir::RegionRange regions, ::llvm::SmallVectorImpl<::mlir::Type>&inferredReturnTypes) { inferredReturnTypes.resize(1); ::mlir::Builder odsBuilder(context); ::mlir::Type odsInferredType0 = odsBuilder.getType(); inferredReturnTypes[0] = odsInferredType0; return ::mlir::success(); } ::mlir::ParseResult ExistsOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) { ::mlir::ArrayAttr boundVarNamesAttr; ::mlir::IntegerAttr weightAttr; std::unique_ptr<::mlir::Region> bodyRegion = std::make_unique<::mlir::Region>(); ::llvm::SmallVector, 2> patternsRegions; ::mlir::OptionalParseResult parseResultboundVarNamesAttr = parser.parseOptionalAttribute(boundVarNamesAttr, parser.getBuilder().getType<::mlir::NoneType>()); if (parseResultboundVarNamesAttr.has_value() && failed(*parseResultboundVarNamesAttr)) return ::mlir::failure(); if (parseResultboundVarNamesAttr.has_value() && succeeded(*parseResultboundVarNamesAttr)) if (boundVarNamesAttr) result.getOrAddProperties().boundVarNames = boundVarNamesAttr; if (boundVarNamesAttr) { } if (::mlir::succeeded(parser.parseOptionalKeyword("no_pattern"))) { result.getOrAddProperties().noPattern = parser.getBuilder().getUnitAttr(); } if (::mlir::succeeded(parser.parseOptionalKeyword("weight"))) { if (parser.parseCustomAttributeWithFallback(weightAttr, parser.getBuilder().getIntegerType(32))) { return ::mlir::failure(); } if (weightAttr) result.getOrAddProperties().weight = weightAttr; } { auto loc = parser.getCurrentLocation();(void)loc; if (parser.parseOptionalAttrDictWithKeyword(result.attributes)) return ::mlir::failure(); if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() { return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op "; }))) return ::mlir::failure(); } if (parser.parseRegion(*bodyRegion)) return ::mlir::failure(); ensureTerminator(*bodyRegion, parser.getBuilder(), result.location); if (::mlir::succeeded(parser.parseOptionalKeyword("patterns"))) { { std::unique_ptr<::mlir::Region> region; auto firstRegionResult = parser.parseOptionalRegion(region); if (firstRegionResult.has_value()) { if (failed(*firstRegionResult)) return ::mlir::failure(); patternsRegions.emplace_back(std::move(region)); // Parse any trailing regions. while (succeeded(parser.parseOptionalComma())) { region = std::make_unique<::mlir::Region>(); if (parser.parseRegion(*region)) return ::mlir::failure(); patternsRegions.emplace_back(std::move(region)); } } } for (auto ®ion : patternsRegions) ensureTerminator(*region, parser.getBuilder(), result.location); } result.addRegion(std::move(bodyRegion)); result.addRegions(patternsRegions); ::mlir::Type odsBuildableType0 = parser.getBuilder().getType(); result.addTypes(odsBuildableType0); return ::mlir::success(); } void ExistsOp::print(::mlir::OpAsmPrinter &_odsPrinter) { if (getBoundVarNamesAttr()) { _odsPrinter << ' '; _odsPrinter.printAttributeWithoutType(getBoundVarNamesAttr()); } if ((getNoPatternAttr() && getNoPatternAttr() != ((false) ? ::mlir::OpBuilder((*this)->getContext()).getUnitAttr() : nullptr))) { _odsPrinter << ' ' << "no_pattern"; } if (getWeightAttr() != ::mlir::OpBuilder((*this)->getContext()).getIntegerAttr(::mlir::OpBuilder((*this)->getContext()).getIntegerType(32), 0)) { _odsPrinter << ' ' << "weight"; _odsPrinter << ' '; _odsPrinter.printAttributeWithoutType(getWeightAttr()); } ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs; elidedAttrs.push_back("boundVarNames"); elidedAttrs.push_back("noPattern"); elidedAttrs.push_back("weight"); { ::mlir::Builder odsBuilder(getContext()); ::mlir::Attribute attr = getWeightAttr(); if(attr && (attr == odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(32), 0))) elidedAttrs.push_back("weight"); } { ::mlir::Builder odsBuilder(getContext()); ::mlir::Attribute attr = getNoPatternAttr(); if(attr && (attr == ((false) ? odsBuilder.getUnitAttr() : nullptr))) elidedAttrs.push_back("noPattern"); } _odsPrinter.printOptionalAttrDictWithKeyword((*this)->getAttrs(), elidedAttrs); _odsPrinter << ' '; { bool printTerminator = true; if (auto *term = getBody().empty() ? nullptr : getBody().begin()->getTerminator()) { printTerminator = !term->getAttrDictionary().empty() || term->getNumOperands() != 0 || term->getNumResults() != 0; } _odsPrinter.printRegion(getBody(), /*printEntryBlockArgs=*/true, /*printBlockTerminators=*/printTerminator); } if (!getPatterns().empty()) { _odsPrinter << ' ' << "patterns"; _odsPrinter << ' '; llvm::interleaveComma(getPatterns(), _odsPrinter, [&](::mlir::Region ®ion) { { bool printTerminator = true; if (auto *term = region.empty() ? nullptr : region.begin()->getTerminator()) { printTerminator = !term->getAttrDictionary().empty() || term->getNumOperands() != 0 || term->getNumResults() != 0; } _odsPrinter.printRegion(region, /*printEntryBlockArgs=*/true, /*printBlockTerminators=*/printTerminator); } }); } } } // namespace mlir::smt MLIR_DEFINE_EXPLICIT_TYPE_ID(mlir::smt::ExistsOp) MLIR_DEFINE_EXPLICIT_TYPE_ID(mlir::smt::detail::ExistsOpGenericAdaptorBase::Properties) namespace mlir::smt { //===----------------------------------------------------------------------===// // mlir::smt::ExtractOp definitions //===----------------------------------------------------------------------===// namespace detail { ExtractOpGenericAdaptorBase::ExtractOpGenericAdaptorBase(ExtractOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {} uint32_t ExtractOpGenericAdaptorBase::getLowBit() { auto attr = getLowBitAttr(); return attr.getValue().getZExtValue(); } } // namespace detail ExtractOpAdaptor::ExtractOpAdaptor(ExtractOp op) : ExtractOpGenericAdaptor(op->getOperands(), op) {} ::llvm::LogicalResult ExtractOpAdaptor::verify(::mlir::Location loc) { auto tblgen_lowBit = getProperties().lowBit; (void)tblgen_lowBit; if (!tblgen_lowBit) return emitError(loc, "'smt.bv.extract' op requires attribute 'lowBit'"); if (tblgen_lowBit && !(((::llvm::isa<::mlir::IntegerAttr>(tblgen_lowBit))) && ((::llvm::cast<::mlir::IntegerAttr>(tblgen_lowBit).getType().isSignlessInteger(32))))) return emitError(loc, "'smt.bv.extract' op attribute 'lowBit' failed to satisfy constraint: 32-bit signless integer attribute"); return ::mlir::success(); } ::llvm::LogicalResult ExtractOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) { ::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr); if (!dict) { emitError() << "expected DictionaryAttr to set properties"; return ::mlir::failure(); } { auto &propStorage = prop.lowBit; auto attr = dict.get("lowBit"); if (attr) { auto convertedAttr = ::llvm::dyn_cast>(attr); if (convertedAttr) { propStorage = convertedAttr; } else { emitError() << "Invalid attribute `lowBit` in property conversion: " << attr; return ::mlir::failure(); } } } return ::mlir::success(); } ::mlir::Attribute ExtractOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) { ::mlir::SmallVector<::mlir::NamedAttribute> attrs; ::mlir::Builder odsBuilder{ctx}; { const auto &propStorage = prop.lowBit; if (propStorage) attrs.push_back(odsBuilder.getNamedAttr("lowBit", propStorage)); } if (!attrs.empty()) return odsBuilder.getDictionaryAttr(attrs); return {}; } llvm::hash_code ExtractOp::computePropertiesHash(const Properties &prop) { using llvm::hash_value; return llvm::hash_combine( llvm::hash_value(prop.lowBit.getAsOpaquePointer())); } std::optional ExtractOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) { if (name == "lowBit") return prop.lowBit; return std::nullopt; } void ExtractOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) { if (name == "lowBit") { prop.lowBit = ::llvm::dyn_cast_or_null>(value); return; } } void ExtractOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) { if (prop.lowBit) attrs.append("lowBit", prop.lowBit); } ::llvm::LogicalResult ExtractOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) { { ::mlir::Attribute attr = attrs.get(getLowBitAttrName(opName)); if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_SMT6(attr, "lowBit", emitError))) return ::mlir::failure(); } return ::mlir::success(); } ::llvm::LogicalResult ExtractOp::readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state) { auto &prop = state.getOrAddProperties(); (void)prop; if (::mlir::failed(reader.readAttribute(prop.lowBit))) return ::mlir::failure(); return ::mlir::success(); } void ExtractOp::writeProperties(::mlir::DialectBytecodeWriter &writer) { auto &prop = getProperties(); (void)prop; writer.writeAttribute(prop.lowBit); } uint32_t ExtractOp::getLowBit() { auto attr = getLowBitAttr(); return attr.getValue().getZExtValue(); } void ExtractOp::setLowBit(uint32_t attrValue) { getProperties().lowBit = ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(32), attrValue); } void ExtractOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::IntegerAttr lowBit, ::mlir::Value input) { odsState.addOperands(input); odsState.getOrAddProperties().lowBit = lowBit; odsState.addTypes(result); } ExtractOp ExtractOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::IntegerAttr lowBit, ::mlir::Value input) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(result), std::forward(lowBit), std::forward(input)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } ExtractOp ExtractOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::IntegerAttr lowBit, ::mlir::Value input) { return create(builder, builder.getLoc(), std::forward(result), std::forward(lowBit), std::forward(input)); } void ExtractOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::IntegerAttr lowBit, ::mlir::Value input) { odsState.addOperands(input); odsState.getOrAddProperties().lowBit = lowBit; assert(resultTypes.size() == 1u && "mismatched number of results"); odsState.addTypes(resultTypes); } ExtractOp ExtractOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::IntegerAttr lowBit, ::mlir::Value input) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(resultTypes), std::forward(lowBit), std::forward(input)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } ExtractOp ExtractOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::IntegerAttr lowBit, ::mlir::Value input) { return create(builder, builder.getLoc(), std::forward(resultTypes), std::forward(lowBit), std::forward(input)); } void ExtractOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, uint32_t lowBit, ::mlir::Value input) { odsState.addOperands(input); odsState.getOrAddProperties().lowBit = odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(32), lowBit); odsState.addTypes(result); } ExtractOp ExtractOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, uint32_t lowBit, ::mlir::Value input) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(result), std::forward(lowBit), std::forward(input)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } ExtractOp ExtractOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, uint32_t lowBit, ::mlir::Value input) { return create(builder, builder.getLoc(), std::forward(result), std::forward(lowBit), std::forward(input)); } void ExtractOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, uint32_t lowBit, ::mlir::Value input) { odsState.addOperands(input); odsState.getOrAddProperties().lowBit = odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(32), lowBit); assert(resultTypes.size() == 1u && "mismatched number of results"); odsState.addTypes(resultTypes); } ExtractOp ExtractOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, uint32_t lowBit, ::mlir::Value input) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(resultTypes), std::forward(lowBit), std::forward(input)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } ExtractOp ExtractOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, uint32_t lowBit, ::mlir::Value input) { return create(builder, builder.getLoc(), std::forward(resultTypes), std::forward(lowBit), std::forward(input)); } void ExtractOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { assert(operands.size() == 1u && "mismatched number of parameters"); odsState.addOperands(operands); odsState.addAttributes(attributes); assert(resultTypes.size() == 1u && "mismatched number of return types"); odsState.addTypes(resultTypes); if (!attributes.empty()) { (void)odsState.getOrAddProperties(); ::mlir::PropertyRef properties = odsState.getRawProperties(); std::optional<::mlir::RegisteredOperationName> info = odsState.name.getRegisteredInfo(); if (failed(info->setOpPropertiesFromAttribute(odsState.name, properties, odsState.attributes.getDictionary(odsState.getContext()), nullptr))) ::llvm::report_fatal_error("Property conversion failed."); } } ExtractOp ExtractOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(resultTypes), std::forward(operands), std::forward(attributes)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } ExtractOp ExtractOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { return create(builder, builder.getLoc(), std::forward(resultTypes), std::forward(operands), std::forward(attributes)); } void ExtractOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { assert(operands.size() == 1u && "mismatched number of parameters"); odsState.addOperands(operands); odsState.useProperties(const_cast(properties)); odsState.addAttributes(discardableAttributes); assert(resultTypes.size() == 1u && "mismatched number of return types"); odsState.addTypes(resultTypes); } ExtractOp ExtractOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(resultTypes), std::forward(operands), std::forward(properties), std::forward(discardableAttributes)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } ExtractOp ExtractOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { return create(builder, builder.getLoc(), std::forward(resultTypes), std::forward(operands), std::forward(properties), std::forward(discardableAttributes)); } ::llvm::LogicalResult ExtractOp::verifyInvariantsImpl() { auto tblgen_lowBit = getProperties().lowBit; (void)tblgen_lowBit; if (!tblgen_lowBit) return emitOpError("requires attribute 'lowBit'"); if (::mlir::failed(__mlir_ods_local_attr_constraint_SMT6(*this, tblgen_lowBit, "lowBit"))) return ::mlir::failure(); { unsigned index = 0; (void)index; auto valueGroup0 = getODSOperands(0); for (auto v : valueGroup0) { if (::mlir::failed(__mlir_ods_local_type_constraint_SMT8(*this, v.getType(), "operand", index++))) return ::mlir::failure(); } } { unsigned index = 0; (void)index; auto valueGroup0 = getODSResults(0); for (auto v : valueGroup0) { if (::mlir::failed(__mlir_ods_local_type_constraint_SMT8(*this, v.getType(), "result", index++))) return ::mlir::failure(); } } return ::mlir::success(); } ::llvm::LogicalResult ExtractOp::verifyInvariants() { if(::mlir::succeeded(verifyInvariantsImpl()) && ::mlir::succeeded(verify())) return ::mlir::success(); return ::mlir::failure(); } ::mlir::ParseResult ExtractOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) { ::mlir::OpAsmParser::UnresolvedOperand inputRawOperand{}; ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> inputOperands(&inputRawOperand, 1); ::llvm::SMLoc inputOperandsLoc; (void)inputOperandsLoc; ::mlir::IntegerAttr lowBitAttr; ::llvm::ArrayRef<::mlir::Type> inputTypes; ::llvm::ArrayRef<::mlir::Type> resultTypes; inputOperandsLoc = parser.getCurrentLocation(); if (parser.parseOperand(inputRawOperand)) return ::mlir::failure(); if (parser.parseKeyword("from")) return ::mlir::failure(); if (parser.parseCustomAttributeWithFallback(lowBitAttr, parser.getBuilder().getIntegerType(32))) { return ::mlir::failure(); } if (lowBitAttr) result.getOrAddProperties().lowBit = lowBitAttr; { auto loc = parser.getCurrentLocation();(void)loc; if (parser.parseOptionalAttrDict(result.attributes)) return ::mlir::failure(); if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() { return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op "; }))) return ::mlir::failure(); } if (parser.parseColon()) return ::mlir::failure(); ::mlir::FunctionType input__result_functionType; if (parser.parseType(input__result_functionType)) return ::mlir::failure(); inputTypes = input__result_functionType.getInputs(); resultTypes = input__result_functionType.getResults(); result.addTypes(resultTypes); if (parser.resolveOperands(inputOperands, inputTypes, inputOperandsLoc, result.operands)) return ::mlir::failure(); return ::mlir::success(); } void ExtractOp::print(::mlir::OpAsmPrinter &_odsPrinter) { _odsPrinter << ' '; _odsPrinter << getInput(); _odsPrinter << ' ' << "from"; _odsPrinter << ' '; _odsPrinter.printAttributeWithoutType(getLowBitAttr()); ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs; elidedAttrs.push_back("lowBit"); _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs); _odsPrinter << ' ' << ":"; _odsPrinter << ' '; _odsPrinter.printFunctionalType(::llvm::ArrayRef<::mlir::Type>(getInput().getType()), ::llvm::ArrayRef<::mlir::Type>(getResult().getType())); } void ExtractOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) { } } // namespace mlir::smt MLIR_DEFINE_EXPLICIT_TYPE_ID(mlir::smt::ExtractOp) MLIR_DEFINE_EXPLICIT_TYPE_ID(mlir::smt::detail::ExtractOpGenericAdaptorBase::Properties) namespace mlir::smt { //===----------------------------------------------------------------------===// // mlir::smt::ForallOp definitions //===----------------------------------------------------------------------===// namespace detail { ForallOpGenericAdaptorBase::ForallOpGenericAdaptorBase(ForallOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {} ::mlir::IntegerAttr ForallOpGenericAdaptorBase::getWeightAttr() { auto attr = ::llvm::dyn_cast_or_null<::mlir::IntegerAttr>(getProperties().weight); return attr; } uint32_t ForallOpGenericAdaptorBase::getWeight() { auto attr = getWeightAttr(); return attr.getValue().getZExtValue(); } ::mlir::UnitAttr ForallOpGenericAdaptorBase::getNoPatternAttr() { auto attr = ::llvm::dyn_cast_or_null<::mlir::UnitAttr>(getProperties().noPattern); if (!attr) attr = ((false) ? ::mlir::Builder(odsAttrs.getContext()).getUnitAttr() : nullptr); return attr; } bool ForallOpGenericAdaptorBase::getNoPattern() { auto attr = getNoPatternAttr(); if (!attr) return ((false) ? ::mlir::Builder(odsAttrs.getContext()).getUnitAttr() : nullptr) != nullptr; return attr != nullptr; } ::std::optional< ::mlir::ArrayAttr > ForallOpGenericAdaptorBase::getBoundVarNames() { auto attr = getBoundVarNamesAttr(); return attr ? ::std::optional< ::mlir::ArrayAttr >(attr) : (::std::nullopt); } } // namespace detail ForallOpAdaptor::ForallOpAdaptor(ForallOp op) : ForallOpGenericAdaptor(op->getOperands(), op) {} ::llvm::LogicalResult ForallOpAdaptor::verify(::mlir::Location loc) { auto tblgen_boundVarNames = getProperties().boundVarNames; (void)tblgen_boundVarNames; auto tblgen_noPattern = getProperties().noPattern; (void)tblgen_noPattern; auto tblgen_weight = getProperties().weight; (void)tblgen_weight; if (tblgen_weight && !(((::llvm::isa<::mlir::IntegerAttr>(tblgen_weight))) && ((::llvm::cast<::mlir::IntegerAttr>(tblgen_weight).getType().isSignlessInteger(32))))) return emitError(loc, "'smt.forall' op attribute 'weight' failed to satisfy constraint: 32-bit signless integer attribute"); if (tblgen_noPattern && !((::llvm::isa<::mlir::UnitAttr>(tblgen_noPattern)))) return emitError(loc, "'smt.forall' op attribute 'noPattern' failed to satisfy constraint: unit attribute"); if (tblgen_boundVarNames && !(((::llvm::isa<::mlir::ArrayAttr>(tblgen_boundVarNames))) && (::llvm::all_of(::llvm::cast<::mlir::ArrayAttr>(tblgen_boundVarNames), [&](::mlir::Attribute attr) { return attr && ((::llvm::isa<::mlir::StringAttr>(attr))); })))) return emitError(loc, "'smt.forall' op attribute 'boundVarNames' failed to satisfy constraint: string array attribute"); return ::mlir::success(); } ::llvm::LogicalResult ForallOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) { ::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr); if (!dict) { emitError() << "expected DictionaryAttr to set properties"; return ::mlir::failure(); } { auto &propStorage = prop.boundVarNames; auto attr = dict.get("boundVarNames"); if (attr) { auto convertedAttr = ::llvm::dyn_cast>(attr); if (convertedAttr) { propStorage = convertedAttr; } else { emitError() << "Invalid attribute `boundVarNames` in property conversion: " << attr; return ::mlir::failure(); } } } { auto &propStorage = prop.noPattern; auto attr = dict.get("noPattern"); if (attr) { auto convertedAttr = ::llvm::dyn_cast>(attr); if (convertedAttr) { propStorage = convertedAttr; } else { emitError() << "Invalid attribute `noPattern` in property conversion: " << attr; return ::mlir::failure(); } } } { auto &propStorage = prop.weight; auto attr = dict.get("weight"); if (attr) { auto convertedAttr = ::llvm::dyn_cast>(attr); if (convertedAttr) { propStorage = convertedAttr; } else { emitError() << "Invalid attribute `weight` in property conversion: " << attr; return ::mlir::failure(); } } } return ::mlir::success(); } ::mlir::Attribute ForallOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) { ::mlir::SmallVector<::mlir::NamedAttribute> attrs; ::mlir::Builder odsBuilder{ctx}; { const auto &propStorage = prop.boundVarNames; if (propStorage) attrs.push_back(odsBuilder.getNamedAttr("boundVarNames", propStorage)); } { const auto &propStorage = prop.noPattern; if (propStorage) attrs.push_back(odsBuilder.getNamedAttr("noPattern", propStorage)); } { const auto &propStorage = prop.weight; if (propStorage) attrs.push_back(odsBuilder.getNamedAttr("weight", propStorage)); } if (!attrs.empty()) return odsBuilder.getDictionaryAttr(attrs); return {}; } llvm::hash_code ForallOp::computePropertiesHash(const Properties &prop) { using llvm::hash_value; return llvm::hash_combine( llvm::hash_value(prop.boundVarNames.getAsOpaquePointer()), llvm::hash_value(prop.noPattern.getAsOpaquePointer()), llvm::hash_value(prop.weight.getAsOpaquePointer())); } std::optional ForallOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) { if (name == "boundVarNames") return prop.boundVarNames; if (name == "noPattern") return prop.noPattern; if (name == "weight") return prop.weight; return std::nullopt; } void ForallOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) { if (name == "boundVarNames") { prop.boundVarNames = ::llvm::dyn_cast_or_null>(value); return; } if (name == "noPattern") { prop.noPattern = ::llvm::dyn_cast_or_null>(value); return; } if (name == "weight") { prop.weight = ::llvm::dyn_cast_or_null>(value); return; } } void ForallOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) { if (prop.boundVarNames) attrs.append("boundVarNames", prop.boundVarNames); if (prop.noPattern) attrs.append("noPattern", prop.noPattern); if (prop.weight) attrs.append("weight", prop.weight); } ::llvm::LogicalResult ForallOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) { { ::mlir::Attribute attr = attrs.get(getBoundVarNamesAttrName(opName)); if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_SMT7(attr, "boundVarNames", emitError))) return ::mlir::failure(); } { ::mlir::Attribute attr = attrs.get(getNoPatternAttrName(opName)); if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_SMT1(attr, "noPattern", emitError))) return ::mlir::failure(); } { ::mlir::Attribute attr = attrs.get(getWeightAttrName(opName)); if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_SMT6(attr, "weight", emitError))) return ::mlir::failure(); } return ::mlir::success(); } ::llvm::LogicalResult ForallOp::readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state) { auto &prop = state.getOrAddProperties(); (void)prop; if (::mlir::failed(reader.readOptionalAttribute(prop.boundVarNames))) return ::mlir::failure(); if (::mlir::failed(reader.readOptionalAttribute(prop.noPattern))) return ::mlir::failure(); if (::mlir::failed(reader.readOptionalAttribute(prop.weight))) return ::mlir::failure(); return ::mlir::success(); } void ForallOp::writeProperties(::mlir::DialectBytecodeWriter &writer) { auto &prop = getProperties(); (void)prop; writer.writeOptionalAttribute(prop.boundVarNames); writer.writeOptionalAttribute(prop.noPattern); writer.writeOptionalAttribute(prop.weight); } uint32_t ForallOp::getWeight() { auto attr = getWeightAttr(); return attr.getValue().getZExtValue(); } bool ForallOp::getNoPattern() { auto attr = getNoPatternAttr(); if (!attr) return ((false) ? ::mlir::Builder((*this)->getContext()).getUnitAttr() : nullptr) != nullptr; return attr != nullptr; } ::std::optional< ::mlir::ArrayAttr > ForallOp::getBoundVarNames() { auto attr = getBoundVarNamesAttr(); return attr ? ::std::optional< ::mlir::ArrayAttr >(attr) : (::std::nullopt); } void ForallOp::setWeight(uint32_t attrValue) { getProperties().weight = ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(32), attrValue); } void ForallOp::setNoPattern(bool attrValue) { auto &odsProp = getProperties().noPattern; if (attrValue) odsProp = ((attrValue) ? ::mlir::Builder((*this)->getContext()).getUnitAttr() : nullptr); else odsProp = nullptr; } ForallOp ForallOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, TypeRange boundVarTypes, function_ref bodyBuilder, std::optional> boundVarNames, function_ref patternBuilder, uint32_t weight, bool noPattern) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(boundVarTypes), std::forward(bodyBuilder), std::forward(boundVarNames), std::forward(patternBuilder), std::forward(weight), std::forward(noPattern)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } ForallOp ForallOp::create(::mlir::ImplicitLocOpBuilder &builder, TypeRange boundVarTypes, function_ref bodyBuilder, std::optional> boundVarNames, function_ref patternBuilder, uint32_t weight, bool noPattern) { return create(builder, builder.getLoc(), std::forward(boundVarTypes), std::forward(bodyBuilder), std::forward(boundVarNames), std::forward(patternBuilder), std::forward(weight), std::forward(noPattern)); } void ForallOp::populateDefaultProperties(::mlir::OperationName opName, Properties &properties) { ::mlir::Builder odsBuilder(opName.getContext()); if (!properties.weight) properties.weight = odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(32), 0); } ::llvm::LogicalResult ForallOp::verifyInvariantsImpl() { auto tblgen_boundVarNames = getProperties().boundVarNames; (void)tblgen_boundVarNames; auto tblgen_noPattern = getProperties().noPattern; (void)tblgen_noPattern; auto tblgen_weight = getProperties().weight; (void)tblgen_weight; if (::mlir::failed(__mlir_ods_local_attr_constraint_SMT6(*this, tblgen_weight, "weight"))) return ::mlir::failure(); if (::mlir::failed(__mlir_ods_local_attr_constraint_SMT1(*this, tblgen_noPattern, "noPattern"))) return ::mlir::failure(); if (::mlir::failed(__mlir_ods_local_attr_constraint_SMT7(*this, tblgen_boundVarNames, "boundVarNames"))) return ::mlir::failure(); { unsigned index = 0; (void)index; auto valueGroup0 = getODSResults(0); for (auto v : valueGroup0) { if (::mlir::failed(__mlir_ods_local_type_constraint_SMT2(*this, v.getType(), "result", index++))) return ::mlir::failure(); } } { unsigned index = 0; (void)index; for (auto ®ion : ::llvm::MutableArrayRef((*this)->getRegion(0))) if (::mlir::failed(__mlir_ods_local_region_constraint_SMT1(*this, region, "body", index++))) return ::mlir::failure(); for (auto ®ion : getPatterns()) if (::mlir::failed(__mlir_ods_local_region_constraint_SMT1(*this, region, "patterns", index++))) return ::mlir::failure(); } return ::mlir::success(); } ::llvm::LogicalResult ForallOp::verifyInvariants() { if(::mlir::succeeded(verifyInvariantsImpl()) && ::mlir::succeeded(verify())) return ::mlir::success(); return ::mlir::failure(); } ::llvm::LogicalResult ForallOp::inferReturnTypes(::mlir::MLIRContext *context, ::std::optional<::mlir::Location> location, ::mlir::ValueRange operands, ::mlir::DictionaryAttr attributes, ::mlir::PropertyRef properties, ::mlir::RegionRange regions, ::llvm::SmallVectorImpl<::mlir::Type>&inferredReturnTypes) { inferredReturnTypes.resize(1); ::mlir::Builder odsBuilder(context); ::mlir::Type odsInferredType0 = odsBuilder.getType(); inferredReturnTypes[0] = odsInferredType0; return ::mlir::success(); } ::mlir::ParseResult ForallOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) { ::mlir::ArrayAttr boundVarNamesAttr; ::mlir::IntegerAttr weightAttr; std::unique_ptr<::mlir::Region> bodyRegion = std::make_unique<::mlir::Region>(); ::llvm::SmallVector, 2> patternsRegions; ::mlir::OptionalParseResult parseResultboundVarNamesAttr = parser.parseOptionalAttribute(boundVarNamesAttr, parser.getBuilder().getType<::mlir::NoneType>()); if (parseResultboundVarNamesAttr.has_value() && failed(*parseResultboundVarNamesAttr)) return ::mlir::failure(); if (parseResultboundVarNamesAttr.has_value() && succeeded(*parseResultboundVarNamesAttr)) if (boundVarNamesAttr) result.getOrAddProperties().boundVarNames = boundVarNamesAttr; if (boundVarNamesAttr) { } if (::mlir::succeeded(parser.parseOptionalKeyword("no_pattern"))) { result.getOrAddProperties().noPattern = parser.getBuilder().getUnitAttr(); } if (::mlir::succeeded(parser.parseOptionalKeyword("weight"))) { if (parser.parseCustomAttributeWithFallback(weightAttr, parser.getBuilder().getIntegerType(32))) { return ::mlir::failure(); } if (weightAttr) result.getOrAddProperties().weight = weightAttr; } { auto loc = parser.getCurrentLocation();(void)loc; if (parser.parseOptionalAttrDictWithKeyword(result.attributes)) return ::mlir::failure(); if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() { return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op "; }))) return ::mlir::failure(); } if (parser.parseRegion(*bodyRegion)) return ::mlir::failure(); ensureTerminator(*bodyRegion, parser.getBuilder(), result.location); if (::mlir::succeeded(parser.parseOptionalKeyword("patterns"))) { { std::unique_ptr<::mlir::Region> region; auto firstRegionResult = parser.parseOptionalRegion(region); if (firstRegionResult.has_value()) { if (failed(*firstRegionResult)) return ::mlir::failure(); patternsRegions.emplace_back(std::move(region)); // Parse any trailing regions. while (succeeded(parser.parseOptionalComma())) { region = std::make_unique<::mlir::Region>(); if (parser.parseRegion(*region)) return ::mlir::failure(); patternsRegions.emplace_back(std::move(region)); } } } for (auto ®ion : patternsRegions) ensureTerminator(*region, parser.getBuilder(), result.location); } result.addRegion(std::move(bodyRegion)); result.addRegions(patternsRegions); ::mlir::Type odsBuildableType0 = parser.getBuilder().getType(); result.addTypes(odsBuildableType0); return ::mlir::success(); } void ForallOp::print(::mlir::OpAsmPrinter &_odsPrinter) { if (getBoundVarNamesAttr()) { _odsPrinter << ' '; _odsPrinter.printAttributeWithoutType(getBoundVarNamesAttr()); } if ((getNoPatternAttr() && getNoPatternAttr() != ((false) ? ::mlir::OpBuilder((*this)->getContext()).getUnitAttr() : nullptr))) { _odsPrinter << ' ' << "no_pattern"; } if (getWeightAttr() != ::mlir::OpBuilder((*this)->getContext()).getIntegerAttr(::mlir::OpBuilder((*this)->getContext()).getIntegerType(32), 0)) { _odsPrinter << ' ' << "weight"; _odsPrinter << ' '; _odsPrinter.printAttributeWithoutType(getWeightAttr()); } ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs; elidedAttrs.push_back("boundVarNames"); elidedAttrs.push_back("noPattern"); elidedAttrs.push_back("weight"); { ::mlir::Builder odsBuilder(getContext()); ::mlir::Attribute attr = getWeightAttr(); if(attr && (attr == odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(32), 0))) elidedAttrs.push_back("weight"); } { ::mlir::Builder odsBuilder(getContext()); ::mlir::Attribute attr = getNoPatternAttr(); if(attr && (attr == ((false) ? odsBuilder.getUnitAttr() : nullptr))) elidedAttrs.push_back("noPattern"); } _odsPrinter.printOptionalAttrDictWithKeyword((*this)->getAttrs(), elidedAttrs); _odsPrinter << ' '; { bool printTerminator = true; if (auto *term = getBody().empty() ? nullptr : getBody().begin()->getTerminator()) { printTerminator = !term->getAttrDictionary().empty() || term->getNumOperands() != 0 || term->getNumResults() != 0; } _odsPrinter.printRegion(getBody(), /*printEntryBlockArgs=*/true, /*printBlockTerminators=*/printTerminator); } if (!getPatterns().empty()) { _odsPrinter << ' ' << "patterns"; _odsPrinter << ' '; llvm::interleaveComma(getPatterns(), _odsPrinter, [&](::mlir::Region ®ion) { { bool printTerminator = true; if (auto *term = region.empty() ? nullptr : region.begin()->getTerminator()) { printTerminator = !term->getAttrDictionary().empty() || term->getNumOperands() != 0 || term->getNumResults() != 0; } _odsPrinter.printRegion(region, /*printEntryBlockArgs=*/true, /*printBlockTerminators=*/printTerminator); } }); } } } // namespace mlir::smt MLIR_DEFINE_EXPLICIT_TYPE_ID(mlir::smt::ForallOp) MLIR_DEFINE_EXPLICIT_TYPE_ID(mlir::smt::detail::ForallOpGenericAdaptorBase::Properties) namespace mlir::smt { //===----------------------------------------------------------------------===// // mlir::smt::ImpliesOp definitions //===----------------------------------------------------------------------===// namespace detail { ImpliesOpGenericAdaptorBase::ImpliesOpGenericAdaptorBase(ImpliesOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {} } // namespace detail ImpliesOpAdaptor::ImpliesOpAdaptor(ImpliesOp op) : ImpliesOpGenericAdaptor(op->getOperands(), op) {} ::llvm::LogicalResult ImpliesOpAdaptor::verify(::mlir::Location loc) { return ::mlir::success(); } ::llvm::LogicalResult ImpliesOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) { ::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr); if (!dict) { emitError() << "expected DictionaryAttr to set properties"; return ::mlir::failure(); } return ::mlir::success(); } ::mlir::Attribute ImpliesOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) { ::mlir::SmallVector<::mlir::NamedAttribute> attrs; ::mlir::Builder odsBuilder{ctx}; if (!attrs.empty()) return odsBuilder.getDictionaryAttr(attrs); return {}; } llvm::hash_code ImpliesOp::computePropertiesHash(const Properties &prop) { using llvm::hash_value; return llvm::hash_combine(); } std::optional ImpliesOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) { return std::nullopt; } void ImpliesOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) { } void ImpliesOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) { } ::llvm::LogicalResult ImpliesOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) { return ::mlir::success(); } void ImpliesOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs) { odsState.addOperands(lhs); odsState.addOperands(rhs); odsState.addTypes(result); } ImpliesOp ImpliesOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(result), std::forward(lhs), std::forward(rhs)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } ImpliesOp ImpliesOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs) { return create(builder, builder.getLoc(), std::forward(result), std::forward(lhs), std::forward(rhs)); } void ImpliesOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value lhs, ::mlir::Value rhs) { odsState.addOperands(lhs); odsState.addOperands(rhs); ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes; if (::mlir::succeeded(ImpliesOp::inferReturnTypes(odsBuilder.getContext(), odsState.location, odsState.operands, odsState.attributes.getDictionary(odsState.getContext()), odsState.getRawProperties(), odsState.regions, inferredReturnTypes))) odsState.addTypes(inferredReturnTypes); else ::mlir::detail::reportFatalInferReturnTypesError(odsState); } ImpliesOp ImpliesOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value lhs, ::mlir::Value rhs) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(lhs), std::forward(rhs)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } ImpliesOp ImpliesOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value lhs, ::mlir::Value rhs) { return create(builder, builder.getLoc(), std::forward(lhs), std::forward(rhs)); } void ImpliesOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs) { odsState.addOperands(lhs); odsState.addOperands(rhs); assert(resultTypes.size() == 1u && "mismatched number of results"); odsState.addTypes(resultTypes); } ImpliesOp ImpliesOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(resultTypes), std::forward(lhs), std::forward(rhs)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } ImpliesOp ImpliesOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs) { return create(builder, builder.getLoc(), std::forward(resultTypes), std::forward(lhs), std::forward(rhs)); } void ImpliesOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { assert(operands.size() == 2u && "mismatched number of parameters"); odsState.addOperands(operands); odsState.addAttributes(attributes); assert(resultTypes.size() == 1u && "mismatched number of return types"); odsState.addTypes(resultTypes); } ImpliesOp ImpliesOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(resultTypes), std::forward(operands), std::forward(attributes)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } ImpliesOp ImpliesOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { return create(builder, builder.getLoc(), std::forward(resultTypes), std::forward(operands), std::forward(attributes)); } void ImpliesOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { assert(operands.size() == 2u && "mismatched number of parameters"); odsState.addOperands(operands); odsState.addAttributes(attributes); ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes; if (::mlir::succeeded(ImpliesOp::inferReturnTypes(odsBuilder.getContext(), odsState.location, operands, odsState.attributes.getDictionary(odsState.getContext()), odsState.getRawProperties(), odsState.regions, inferredReturnTypes))) { assert(inferredReturnTypes.size() == 1u && "mismatched number of return types"); odsState.addTypes(inferredReturnTypes); } else { ::llvm::report_fatal_error("Failed to infer result type(s)."); } } ImpliesOp ImpliesOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(operands), std::forward(attributes)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } ImpliesOp ImpliesOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { return create(builder, builder.getLoc(), std::forward(operands), std::forward(attributes)); } void ImpliesOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { assert(operands.size() == 2u && "mismatched number of parameters"); odsState.addOperands(operands); odsState.useProperties(const_cast(properties)); odsState.addAttributes(discardableAttributes); assert(resultTypes.size() == 1u && "mismatched number of return types"); odsState.addTypes(resultTypes); } ImpliesOp ImpliesOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(resultTypes), std::forward(operands), std::forward(properties), std::forward(discardableAttributes)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } ImpliesOp ImpliesOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { return create(builder, builder.getLoc(), std::forward(resultTypes), std::forward(operands), std::forward(properties), std::forward(discardableAttributes)); } void ImpliesOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { assert(operands.size() == 2u && "mismatched number of parameters"); odsState.addOperands(operands); odsState.useProperties(const_cast(properties)); odsState.addAttributes(discardableAttributes); ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes; if (::mlir::succeeded(ImpliesOp::inferReturnTypes(odsBuilder.getContext(), odsState.location, operands, odsState.attributes.getDictionary(odsState.getContext()), odsState.getRawProperties(), odsState.regions, inferredReturnTypes))) { assert(inferredReturnTypes.size() == 1u && "mismatched number of return types"); odsState.addTypes(inferredReturnTypes); } else { ::llvm::report_fatal_error("Failed to infer result type(s)."); } } ImpliesOp ImpliesOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(operands), std::forward(properties), std::forward(discardableAttributes)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } ImpliesOp ImpliesOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { return create(builder, builder.getLoc(), std::forward(operands), std::forward(properties), std::forward(discardableAttributes)); } ::llvm::LogicalResult ImpliesOp::verifyInvariantsImpl() { { unsigned index = 0; (void)index; auto valueGroup0 = getODSOperands(0); for (auto v : valueGroup0) { if (::mlir::failed(__mlir_ods_local_type_constraint_SMT2(*this, v.getType(), "operand", index++))) return ::mlir::failure(); } auto valueGroup1 = getODSOperands(1); for (auto v : valueGroup1) { if (::mlir::failed(__mlir_ods_local_type_constraint_SMT2(*this, v.getType(), "operand", index++))) return ::mlir::failure(); } } { unsigned index = 0; (void)index; auto valueGroup0 = getODSResults(0); for (auto v : valueGroup0) { if (::mlir::failed(__mlir_ods_local_type_constraint_SMT2(*this, v.getType(), "result", index++))) return ::mlir::failure(); } } return ::mlir::success(); } ::llvm::LogicalResult ImpliesOp::verifyInvariants() { return verifyInvariantsImpl(); } ::llvm::LogicalResult ImpliesOp::inferReturnTypes(::mlir::MLIRContext *context, ::std::optional<::mlir::Location> location, ::mlir::ValueRange operands, ::mlir::DictionaryAttr attributes, ::mlir::PropertyRef properties, ::mlir::RegionRange regions, ::llvm::SmallVectorImpl<::mlir::Type>&inferredReturnTypes) { inferredReturnTypes.resize(1); ::mlir::Builder odsBuilder(context); ::mlir::Type odsInferredType0 = odsBuilder.getType(); inferredReturnTypes[0] = odsInferredType0; return ::mlir::success(); } ::mlir::ParseResult ImpliesOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) { ::mlir::OpAsmParser::UnresolvedOperand lhsRawOperand{}; ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> lhsOperands(&lhsRawOperand, 1); ::llvm::SMLoc lhsOperandsLoc; (void)lhsOperandsLoc; ::mlir::OpAsmParser::UnresolvedOperand rhsRawOperand{}; ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> rhsOperands(&rhsRawOperand, 1); ::llvm::SMLoc rhsOperandsLoc; (void)rhsOperandsLoc; lhsOperandsLoc = parser.getCurrentLocation(); if (parser.parseOperand(lhsRawOperand)) return ::mlir::failure(); if (parser.parseComma()) return ::mlir::failure(); rhsOperandsLoc = parser.getCurrentLocation(); if (parser.parseOperand(rhsRawOperand)) return ::mlir::failure(); { auto loc = parser.getCurrentLocation();(void)loc; if (parser.parseOptionalAttrDict(result.attributes)) return ::mlir::failure(); if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() { return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op "; }))) return ::mlir::failure(); } ::mlir::Type odsBuildableType0 = parser.getBuilder().getType(); result.addTypes(odsBuildableType0); if (parser.resolveOperands(lhsOperands, odsBuildableType0, lhsOperandsLoc, result.operands)) return ::mlir::failure(); if (parser.resolveOperands(rhsOperands, odsBuildableType0, rhsOperandsLoc, result.operands)) return ::mlir::failure(); return ::mlir::success(); } void ImpliesOp::print(::mlir::OpAsmPrinter &_odsPrinter) { _odsPrinter << ' '; _odsPrinter << getLhs(); _odsPrinter << ","; _odsPrinter << ' '; _odsPrinter << getRhs(); ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs; _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs); } void ImpliesOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) { } } // namespace mlir::smt MLIR_DEFINE_EXPLICIT_TYPE_ID(mlir::smt::ImpliesOp) namespace mlir::smt { //===----------------------------------------------------------------------===// // mlir::smt::Int2BVOp definitions //===----------------------------------------------------------------------===// namespace detail { Int2BVOpGenericAdaptorBase::Int2BVOpGenericAdaptorBase(Int2BVOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {} } // namespace detail Int2BVOpAdaptor::Int2BVOpAdaptor(Int2BVOp op) : Int2BVOpGenericAdaptor(op->getOperands(), op) {} ::llvm::LogicalResult Int2BVOpAdaptor::verify(::mlir::Location loc) { return ::mlir::success(); } ::llvm::LogicalResult Int2BVOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) { ::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr); if (!dict) { emitError() << "expected DictionaryAttr to set properties"; return ::mlir::failure(); } return ::mlir::success(); } ::mlir::Attribute Int2BVOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) { ::mlir::SmallVector<::mlir::NamedAttribute> attrs; ::mlir::Builder odsBuilder{ctx}; if (!attrs.empty()) return odsBuilder.getDictionaryAttr(attrs); return {}; } llvm::hash_code Int2BVOp::computePropertiesHash(const Properties &prop) { using llvm::hash_value; return llvm::hash_combine(); } std::optional Int2BVOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) { return std::nullopt; } void Int2BVOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) { } void Int2BVOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) { } ::llvm::LogicalResult Int2BVOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) { return ::mlir::success(); } void Int2BVOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value input) { odsState.addOperands(input); odsState.addTypes(result); } Int2BVOp Int2BVOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value input) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(result), std::forward(input)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } Int2BVOp Int2BVOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::Value input) { return create(builder, builder.getLoc(), std::forward(result), std::forward(input)); } void Int2BVOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input) { odsState.addOperands(input); assert(resultTypes.size() == 1u && "mismatched number of results"); odsState.addTypes(resultTypes); } Int2BVOp Int2BVOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value input) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(resultTypes), std::forward(input)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } Int2BVOp Int2BVOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value input) { return create(builder, builder.getLoc(), std::forward(resultTypes), std::forward(input)); } void Int2BVOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { assert(operands.size() == 1u && "mismatched number of parameters"); odsState.addOperands(operands); odsState.addAttributes(attributes); assert(resultTypes.size() == 1u && "mismatched number of return types"); odsState.addTypes(resultTypes); } Int2BVOp Int2BVOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(resultTypes), std::forward(operands), std::forward(attributes)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } Int2BVOp Int2BVOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { return create(builder, builder.getLoc(), std::forward(resultTypes), std::forward(operands), std::forward(attributes)); } void Int2BVOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { assert(operands.size() == 1u && "mismatched number of parameters"); odsState.addOperands(operands); odsState.useProperties(const_cast(properties)); odsState.addAttributes(discardableAttributes); assert(resultTypes.size() == 1u && "mismatched number of return types"); odsState.addTypes(resultTypes); } Int2BVOp Int2BVOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(resultTypes), std::forward(operands), std::forward(properties), std::forward(discardableAttributes)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } Int2BVOp Int2BVOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { return create(builder, builder.getLoc(), std::forward(resultTypes), std::forward(operands), std::forward(properties), std::forward(discardableAttributes)); } ::llvm::LogicalResult Int2BVOp::verifyInvariantsImpl() { { unsigned index = 0; (void)index; auto valueGroup0 = getODSOperands(0); for (auto v : valueGroup0) { if (::mlir::failed(__mlir_ods_local_type_constraint_SMT9(*this, v.getType(), "operand", index++))) return ::mlir::failure(); } } { unsigned index = 0; (void)index; auto valueGroup0 = getODSResults(0); for (auto v : valueGroup0) { if (::mlir::failed(__mlir_ods_local_type_constraint_SMT8(*this, v.getType(), "result", index++))) return ::mlir::failure(); } } return ::mlir::success(); } ::llvm::LogicalResult Int2BVOp::verifyInvariants() { return verifyInvariantsImpl(); } ::mlir::ParseResult Int2BVOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) { ::mlir::OpAsmParser::UnresolvedOperand inputRawOperand{}; ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> inputOperands(&inputRawOperand, 1); ::llvm::SMLoc inputOperandsLoc; (void)inputOperandsLoc; ::mlir::Type resultRawType{}; ::llvm::ArrayRef<::mlir::Type> resultTypes(&resultRawType, 1); inputOperandsLoc = parser.getCurrentLocation(); if (parser.parseOperand(inputRawOperand)) return ::mlir::failure(); { auto loc = parser.getCurrentLocation();(void)loc; if (parser.parseOptionalAttrDict(result.attributes)) return ::mlir::failure(); if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() { return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op "; }))) return ::mlir::failure(); } if (parser.parseColon()) return ::mlir::failure(); if (parser.parseType(resultRawType)) return ::mlir::failure(); ::mlir::Type odsBuildableType0 = parser.getBuilder().getType(); result.addTypes(resultTypes); if (parser.resolveOperands(inputOperands, odsBuildableType0, inputOperandsLoc, result.operands)) return ::mlir::failure(); return ::mlir::success(); } void Int2BVOp::print(::mlir::OpAsmPrinter &_odsPrinter) { _odsPrinter << ' '; _odsPrinter << getInput(); ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs; _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs); _odsPrinter << ' ' << ":"; _odsPrinter << ' '; _odsPrinter << getResult().getType(); } void Int2BVOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) { } } // namespace mlir::smt MLIR_DEFINE_EXPLICIT_TYPE_ID(mlir::smt::Int2BVOp) namespace mlir::smt { //===----------------------------------------------------------------------===// // mlir::smt::IntAbsOp definitions //===----------------------------------------------------------------------===// namespace detail { IntAbsOpGenericAdaptorBase::IntAbsOpGenericAdaptorBase(IntAbsOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {} } // namespace detail IntAbsOpAdaptor::IntAbsOpAdaptor(IntAbsOp op) : IntAbsOpGenericAdaptor(op->getOperands(), op) {} ::llvm::LogicalResult IntAbsOpAdaptor::verify(::mlir::Location loc) { return ::mlir::success(); } ::llvm::LogicalResult IntAbsOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) { ::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr); if (!dict) { emitError() << "expected DictionaryAttr to set properties"; return ::mlir::failure(); } return ::mlir::success(); } ::mlir::Attribute IntAbsOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) { ::mlir::SmallVector<::mlir::NamedAttribute> attrs; ::mlir::Builder odsBuilder{ctx}; if (!attrs.empty()) return odsBuilder.getDictionaryAttr(attrs); return {}; } llvm::hash_code IntAbsOp::computePropertiesHash(const Properties &prop) { using llvm::hash_value; return llvm::hash_combine(); } std::optional IntAbsOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) { return std::nullopt; } void IntAbsOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) { } void IntAbsOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) { } ::llvm::LogicalResult IntAbsOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) { return ::mlir::success(); } void IntAbsOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value input) { odsState.addOperands(input); odsState.addTypes(result); } IntAbsOp IntAbsOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value input) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(result), std::forward(input)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } IntAbsOp IntAbsOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::Value input) { return create(builder, builder.getLoc(), std::forward(result), std::forward(input)); } void IntAbsOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value input) { odsState.addOperands(input); ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes; if (::mlir::succeeded(IntAbsOp::inferReturnTypes(odsBuilder.getContext(), odsState.location, odsState.operands, odsState.attributes.getDictionary(odsState.getContext()), odsState.getRawProperties(), odsState.regions, inferredReturnTypes))) odsState.addTypes(inferredReturnTypes); else ::mlir::detail::reportFatalInferReturnTypesError(odsState); } IntAbsOp IntAbsOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value input) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(input)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } IntAbsOp IntAbsOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value input) { return create(builder, builder.getLoc(), std::forward(input)); } void IntAbsOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input) { odsState.addOperands(input); assert(resultTypes.size() == 1u && "mismatched number of results"); odsState.addTypes(resultTypes); } IntAbsOp IntAbsOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value input) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(resultTypes), std::forward(input)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } IntAbsOp IntAbsOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value input) { return create(builder, builder.getLoc(), std::forward(resultTypes), std::forward(input)); } void IntAbsOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { assert(operands.size() == 1u && "mismatched number of parameters"); odsState.addOperands(operands); odsState.addAttributes(attributes); assert(resultTypes.size() == 1u && "mismatched number of return types"); odsState.addTypes(resultTypes); } IntAbsOp IntAbsOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(resultTypes), std::forward(operands), std::forward(attributes)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } IntAbsOp IntAbsOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { return create(builder, builder.getLoc(), std::forward(resultTypes), std::forward(operands), std::forward(attributes)); } void IntAbsOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { assert(operands.size() == 1u && "mismatched number of parameters"); odsState.addOperands(operands); odsState.addAttributes(attributes); ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes; if (::mlir::succeeded(IntAbsOp::inferReturnTypes(odsBuilder.getContext(), odsState.location, operands, odsState.attributes.getDictionary(odsState.getContext()), odsState.getRawProperties(), odsState.regions, inferredReturnTypes))) { assert(inferredReturnTypes.size() == 1u && "mismatched number of return types"); odsState.addTypes(inferredReturnTypes); } else { ::llvm::report_fatal_error("Failed to infer result type(s)."); } } IntAbsOp IntAbsOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(operands), std::forward(attributes)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } IntAbsOp IntAbsOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { return create(builder, builder.getLoc(), std::forward(operands), std::forward(attributes)); } void IntAbsOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { assert(operands.size() == 1u && "mismatched number of parameters"); odsState.addOperands(operands); odsState.useProperties(const_cast(properties)); odsState.addAttributes(discardableAttributes); assert(resultTypes.size() == 1u && "mismatched number of return types"); odsState.addTypes(resultTypes); } IntAbsOp IntAbsOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(resultTypes), std::forward(operands), std::forward(properties), std::forward(discardableAttributes)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } IntAbsOp IntAbsOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { return create(builder, builder.getLoc(), std::forward(resultTypes), std::forward(operands), std::forward(properties), std::forward(discardableAttributes)); } void IntAbsOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { assert(operands.size() == 1u && "mismatched number of parameters"); odsState.addOperands(operands); odsState.useProperties(const_cast(properties)); odsState.addAttributes(discardableAttributes); ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes; if (::mlir::succeeded(IntAbsOp::inferReturnTypes(odsBuilder.getContext(), odsState.location, operands, odsState.attributes.getDictionary(odsState.getContext()), odsState.getRawProperties(), odsState.regions, inferredReturnTypes))) { assert(inferredReturnTypes.size() == 1u && "mismatched number of return types"); odsState.addTypes(inferredReturnTypes); } else { ::llvm::report_fatal_error("Failed to infer result type(s)."); } } IntAbsOp IntAbsOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(operands), std::forward(properties), std::forward(discardableAttributes)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } IntAbsOp IntAbsOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { return create(builder, builder.getLoc(), std::forward(operands), std::forward(properties), std::forward(discardableAttributes)); } ::llvm::LogicalResult IntAbsOp::verifyInvariantsImpl() { { unsigned index = 0; (void)index; auto valueGroup0 = getODSOperands(0); for (auto v : valueGroup0) { if (::mlir::failed(__mlir_ods_local_type_constraint_SMT9(*this, v.getType(), "operand", index++))) return ::mlir::failure(); } } { unsigned index = 0; (void)index; auto valueGroup0 = getODSResults(0); for (auto v : valueGroup0) { if (::mlir::failed(__mlir_ods_local_type_constraint_SMT9(*this, v.getType(), "result", index++))) return ::mlir::failure(); } } return ::mlir::success(); } ::llvm::LogicalResult IntAbsOp::verifyInvariants() { return verifyInvariantsImpl(); } ::llvm::LogicalResult IntAbsOp::inferReturnTypes(::mlir::MLIRContext *context, ::std::optional<::mlir::Location> location, ::mlir::ValueRange operands, ::mlir::DictionaryAttr attributes, ::mlir::PropertyRef properties, ::mlir::RegionRange regions, ::llvm::SmallVectorImpl<::mlir::Type>&inferredReturnTypes) { inferredReturnTypes.resize(1); ::mlir::Builder odsBuilder(context); ::mlir::Type odsInferredType0 = odsBuilder.getType(); inferredReturnTypes[0] = odsInferredType0; return ::mlir::success(); } ::mlir::ParseResult IntAbsOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) { ::mlir::OpAsmParser::UnresolvedOperand inputRawOperand{}; ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> inputOperands(&inputRawOperand, 1); ::llvm::SMLoc inputOperandsLoc; (void)inputOperandsLoc; inputOperandsLoc = parser.getCurrentLocation(); if (parser.parseOperand(inputRawOperand)) return ::mlir::failure(); { auto loc = parser.getCurrentLocation();(void)loc; if (parser.parseOptionalAttrDict(result.attributes)) return ::mlir::failure(); if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() { return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op "; }))) return ::mlir::failure(); } ::mlir::Type odsBuildableType0 = parser.getBuilder().getType(); result.addTypes(odsBuildableType0); if (parser.resolveOperands(inputOperands, odsBuildableType0, inputOperandsLoc, result.operands)) return ::mlir::failure(); return ::mlir::success(); } void IntAbsOp::print(::mlir::OpAsmPrinter &_odsPrinter) { _odsPrinter << ' '; _odsPrinter << getInput(); ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs; _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs); } void IntAbsOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) { } } // namespace mlir::smt MLIR_DEFINE_EXPLICIT_TYPE_ID(mlir::smt::IntAbsOp) namespace mlir::smt { //===----------------------------------------------------------------------===// // mlir::smt::IntAddOp definitions //===----------------------------------------------------------------------===// namespace detail { IntAddOpGenericAdaptorBase::IntAddOpGenericAdaptorBase(IntAddOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {} std::pair IntAddOpGenericAdaptorBase::getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize) { bool isVariadic[] = {true}; int prevVariadicCount = 0; for (unsigned i = 0; i < index; ++i) if (isVariadic[i]) ++prevVariadicCount; // Calculate how many dynamic values a static variadic operand corresponds to. // This assumes all static variadic operands have the same dynamic value count. int variadicSize = (odsOperandsSize - 0) / 1; // `index` passed in as the parameter is the static index which counts each // operand (variadic or not) as size 1. So here for each previous static variadic // operand, we need to offset by (variadicSize - 1) to get where the dynamic // value pack for this static operand starts. int start = index + (variadicSize - 1) * prevVariadicCount; int size = isVariadic[index] ? variadicSize : 1; return {start, size}; } } // namespace detail IntAddOpAdaptor::IntAddOpAdaptor(IntAddOp op) : IntAddOpGenericAdaptor(op->getOperands(), op) {} ::llvm::LogicalResult IntAddOpAdaptor::verify(::mlir::Location loc) { return ::mlir::success(); } std::pair IntAddOp::getODSOperandIndexAndLength(unsigned index) { bool isVariadic[] = {true}; int prevVariadicCount = 0; for (unsigned i = 0; i < index; ++i) if (isVariadic[i]) ++prevVariadicCount; // Calculate how many dynamic values a static variadic operand corresponds to. // This assumes all static variadic operands have the same dynamic value count. int variadicSize = (getOperation()->getNumOperands() - 0) / 1; // `index` passed in as the parameter is the static index which counts each // operand (variadic or not) as size 1. So here for each previous static variadic // operand, we need to offset by (variadicSize - 1) to get where the dynamic // value pack for this static operand starts. int start = index + (variadicSize - 1) * prevVariadicCount; int size = isVariadic[index] ? variadicSize : 1; return {start, size}; } ::mlir::MutableOperandRange IntAddOp::getInputsMutable() { auto range = getODSOperandIndexAndLength(0); auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second); return mutableRange; } ::llvm::LogicalResult IntAddOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) { ::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr); if (!dict) { emitError() << "expected DictionaryAttr to set properties"; return ::mlir::failure(); } return ::mlir::success(); } ::mlir::Attribute IntAddOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) { ::mlir::SmallVector<::mlir::NamedAttribute> attrs; ::mlir::Builder odsBuilder{ctx}; if (!attrs.empty()) return odsBuilder.getDictionaryAttr(attrs); return {}; } llvm::hash_code IntAddOp::computePropertiesHash(const Properties &prop) { using llvm::hash_value; return llvm::hash_combine(); } std::optional IntAddOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) { return std::nullopt; } void IntAddOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) { } void IntAddOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) { } ::llvm::LogicalResult IntAddOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) { return ::mlir::success(); } void IntAddOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::ValueRange inputs) { odsState.addOperands(inputs); odsState.addTypes(result); } IntAddOp IntAddOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::ValueRange inputs) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(result), std::forward(inputs)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } IntAddOp IntAddOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::ValueRange inputs) { return create(builder, builder.getLoc(), std::forward(result), std::forward(inputs)); } void IntAddOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { odsState.addOperands(operands); odsState.addAttributes(attributes); assert(resultTypes.size() == 1u && "mismatched number of return types"); odsState.addTypes(resultTypes); } IntAddOp IntAddOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(resultTypes), std::forward(operands), std::forward(attributes)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } IntAddOp IntAddOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { return create(builder, builder.getLoc(), std::forward(resultTypes), std::forward(operands), std::forward(attributes)); } void IntAddOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { odsState.addOperands(operands); odsState.addAttributes(attributes); ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes; if (::mlir::succeeded(IntAddOp::inferReturnTypes(odsBuilder.getContext(), odsState.location, operands, odsState.attributes.getDictionary(odsState.getContext()), odsState.getRawProperties(), odsState.regions, inferredReturnTypes))) { assert(inferredReturnTypes.size() == 1u && "mismatched number of return types"); odsState.addTypes(inferredReturnTypes); } else { ::llvm::report_fatal_error("Failed to infer result type(s)."); } } IntAddOp IntAddOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(operands), std::forward(attributes)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } IntAddOp IntAddOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { return create(builder, builder.getLoc(), std::forward(operands), std::forward(attributes)); } void IntAddOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { odsState.addOperands(operands); odsState.useProperties(const_cast(properties)); odsState.addAttributes(discardableAttributes); assert(resultTypes.size() == 1u && "mismatched number of return types"); odsState.addTypes(resultTypes); } IntAddOp IntAddOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(resultTypes), std::forward(operands), std::forward(properties), std::forward(discardableAttributes)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } IntAddOp IntAddOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { return create(builder, builder.getLoc(), std::forward(resultTypes), std::forward(operands), std::forward(properties), std::forward(discardableAttributes)); } void IntAddOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { odsState.addOperands(operands); odsState.useProperties(const_cast(properties)); odsState.addAttributes(discardableAttributes); ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes; if (::mlir::succeeded(IntAddOp::inferReturnTypes(odsBuilder.getContext(), odsState.location, operands, odsState.attributes.getDictionary(odsState.getContext()), odsState.getRawProperties(), odsState.regions, inferredReturnTypes))) { assert(inferredReturnTypes.size() == 1u && "mismatched number of return types"); odsState.addTypes(inferredReturnTypes); } else { ::llvm::report_fatal_error("Failed to infer result type(s)."); } } IntAddOp IntAddOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(operands), std::forward(properties), std::forward(discardableAttributes)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } IntAddOp IntAddOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { return create(builder, builder.getLoc(), std::forward(operands), std::forward(properties), std::forward(discardableAttributes)); } ::llvm::LogicalResult IntAddOp::verifyInvariantsImpl() { { unsigned index = 0; (void)index; auto valueGroup0 = getODSOperands(0); for (auto v : valueGroup0) { if (::mlir::failed(__mlir_ods_local_type_constraint_SMT11(*this, v.getType(), "operand", index++))) return ::mlir::failure(); } } { unsigned index = 0; (void)index; auto valueGroup0 = getODSResults(0); for (auto v : valueGroup0) { if (::mlir::failed(__mlir_ods_local_type_constraint_SMT9(*this, v.getType(), "result", index++))) return ::mlir::failure(); } } return ::mlir::success(); } ::llvm::LogicalResult IntAddOp::verifyInvariants() { return verifyInvariantsImpl(); } ::llvm::LogicalResult IntAddOp::inferReturnTypes(::mlir::MLIRContext *context, ::std::optional<::mlir::Location> location, ::mlir::ValueRange operands, ::mlir::DictionaryAttr attributes, ::mlir::PropertyRef properties, ::mlir::RegionRange regions, ::llvm::SmallVectorImpl<::mlir::Type>&inferredReturnTypes) { inferredReturnTypes.resize(1); ::mlir::Builder odsBuilder(context); ::mlir::Type odsInferredType0 = odsBuilder.getType(); inferredReturnTypes[0] = odsInferredType0; return ::mlir::success(); } ::mlir::ParseResult IntAddOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) { ::llvm::SmallVector<::mlir::OpAsmParser::UnresolvedOperand, 4> inputsOperands; ::llvm::SMLoc inputsOperandsLoc; (void)inputsOperandsLoc; inputsOperandsLoc = parser.getCurrentLocation(); if (parser.parseOperandList(inputsOperands)) return ::mlir::failure(); { auto loc = parser.getCurrentLocation();(void)loc; if (parser.parseOptionalAttrDict(result.attributes)) return ::mlir::failure(); if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() { return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op "; }))) return ::mlir::failure(); } ::mlir::Type odsBuildableType0 = parser.getBuilder().getType(); result.addTypes(odsBuildableType0); if (parser.resolveOperands(inputsOperands, odsBuildableType0, inputsOperandsLoc, result.operands)) return ::mlir::failure(); return ::mlir::success(); } void IntAddOp::print(::mlir::OpAsmPrinter &_odsPrinter) { _odsPrinter << ' '; _odsPrinter << getInputs(); ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs; _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs); } void IntAddOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) { } } // namespace mlir::smt MLIR_DEFINE_EXPLICIT_TYPE_ID(mlir::smt::IntAddOp) namespace mlir::smt { //===----------------------------------------------------------------------===// // mlir::smt::IntCmpOp definitions //===----------------------------------------------------------------------===// namespace detail { IntCmpOpGenericAdaptorBase::IntCmpOpGenericAdaptorBase(IntCmpOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {} mlir::smt::IntPredicate IntCmpOpGenericAdaptorBase::getPred() { auto attr = getPredAttr(); return attr.getValue(); } } // namespace detail IntCmpOpAdaptor::IntCmpOpAdaptor(IntCmpOp op) : IntCmpOpGenericAdaptor(op->getOperands(), op) {} ::llvm::LogicalResult IntCmpOpAdaptor::verify(::mlir::Location loc) { auto tblgen_pred = getProperties().pred; (void)tblgen_pred; if (!tblgen_pred) return emitError(loc, "'smt.int.cmp' op requires attribute 'pred'"); if (tblgen_pred && !((::llvm::isa(tblgen_pred)))) return emitError(loc, "'smt.int.cmp' op attribute 'pred' failed to satisfy constraint: smt comparison predicate for integers"); return ::mlir::success(); } ::llvm::LogicalResult IntCmpOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) { ::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr); if (!dict) { emitError() << "expected DictionaryAttr to set properties"; return ::mlir::failure(); } { auto &propStorage = prop.pred; auto attr = dict.get("pred"); if (attr) { auto convertedAttr = ::llvm::dyn_cast>(attr); if (convertedAttr) { propStorage = convertedAttr; } else { emitError() << "Invalid attribute `pred` in property conversion: " << attr; return ::mlir::failure(); } } } return ::mlir::success(); } ::mlir::Attribute IntCmpOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) { ::mlir::SmallVector<::mlir::NamedAttribute> attrs; ::mlir::Builder odsBuilder{ctx}; { const auto &propStorage = prop.pred; if (propStorage) attrs.push_back(odsBuilder.getNamedAttr("pred", propStorage)); } if (!attrs.empty()) return odsBuilder.getDictionaryAttr(attrs); return {}; } llvm::hash_code IntCmpOp::computePropertiesHash(const Properties &prop) { using llvm::hash_value; return llvm::hash_combine( llvm::hash_value(prop.pred.getAsOpaquePointer())); } std::optional IntCmpOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) { if (name == "pred") return prop.pred; return std::nullopt; } void IntCmpOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) { if (name == "pred") { prop.pred = ::llvm::dyn_cast_or_null>(value); return; } } void IntCmpOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) { if (prop.pred) attrs.append("pred", prop.pred); } ::llvm::LogicalResult IntCmpOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) { { ::mlir::Attribute attr = attrs.get(getPredAttrName(opName)); if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_SMT8(attr, "pred", emitError))) return ::mlir::failure(); } return ::mlir::success(); } ::llvm::LogicalResult IntCmpOp::readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state) { auto &prop = state.getOrAddProperties(); (void)prop; if (::mlir::failed(reader.readAttribute(prop.pred))) return ::mlir::failure(); return ::mlir::success(); } void IntCmpOp::writeProperties(::mlir::DialectBytecodeWriter &writer) { auto &prop = getProperties(); (void)prop; writer.writeAttribute(prop.pred); } mlir::smt::IntPredicate IntCmpOp::getPred() { auto attr = getPredAttr(); return attr.getValue(); } void IntCmpOp::setPred(mlir::smt::IntPredicate attrValue) { getProperties().pred = mlir::smt::IntPredicateAttr::get(::mlir::Builder((*this)->getContext()).getContext(), attrValue); } void IntCmpOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, mlir::smt::IntPredicateAttr pred, ::mlir::Value lhs, ::mlir::Value rhs) { odsState.addOperands(lhs); odsState.addOperands(rhs); odsState.getOrAddProperties().pred = pred; odsState.addTypes(result); } IntCmpOp IntCmpOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, mlir::smt::IntPredicateAttr pred, ::mlir::Value lhs, ::mlir::Value rhs) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(result), std::forward(pred), std::forward(lhs), std::forward(rhs)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } IntCmpOp IntCmpOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, mlir::smt::IntPredicateAttr pred, ::mlir::Value lhs, ::mlir::Value rhs) { return create(builder, builder.getLoc(), std::forward(result), std::forward(pred), std::forward(lhs), std::forward(rhs)); } void IntCmpOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, mlir::smt::IntPredicateAttr pred, ::mlir::Value lhs, ::mlir::Value rhs) { odsState.addOperands(lhs); odsState.addOperands(rhs); odsState.getOrAddProperties().pred = pred; ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes; if (::mlir::succeeded(IntCmpOp::inferReturnTypes(odsBuilder.getContext(), odsState.location, odsState.operands, odsState.attributes.getDictionary(odsState.getContext()), odsState.getRawProperties(), odsState.regions, inferredReturnTypes))) odsState.addTypes(inferredReturnTypes); else ::mlir::detail::reportFatalInferReturnTypesError(odsState); } IntCmpOp IntCmpOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, mlir::smt::IntPredicateAttr pred, ::mlir::Value lhs, ::mlir::Value rhs) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(pred), std::forward(lhs), std::forward(rhs)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } IntCmpOp IntCmpOp::create(::mlir::ImplicitLocOpBuilder &builder, mlir::smt::IntPredicateAttr pred, ::mlir::Value lhs, ::mlir::Value rhs) { return create(builder, builder.getLoc(), std::forward(pred), std::forward(lhs), std::forward(rhs)); } void IntCmpOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, mlir::smt::IntPredicateAttr pred, ::mlir::Value lhs, ::mlir::Value rhs) { odsState.addOperands(lhs); odsState.addOperands(rhs); odsState.getOrAddProperties().pred = pred; assert(resultTypes.size() == 1u && "mismatched number of results"); odsState.addTypes(resultTypes); } IntCmpOp IntCmpOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, mlir::smt::IntPredicateAttr pred, ::mlir::Value lhs, ::mlir::Value rhs) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(resultTypes), std::forward(pred), std::forward(lhs), std::forward(rhs)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } IntCmpOp IntCmpOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, mlir::smt::IntPredicateAttr pred, ::mlir::Value lhs, ::mlir::Value rhs) { return create(builder, builder.getLoc(), std::forward(resultTypes), std::forward(pred), std::forward(lhs), std::forward(rhs)); } void IntCmpOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, mlir::smt::IntPredicate pred, ::mlir::Value lhs, ::mlir::Value rhs) { odsState.addOperands(lhs); odsState.addOperands(rhs); odsState.getOrAddProperties().pred = mlir::smt::IntPredicateAttr::get(odsBuilder.getContext(), pred); odsState.addTypes(result); } IntCmpOp IntCmpOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, mlir::smt::IntPredicate pred, ::mlir::Value lhs, ::mlir::Value rhs) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(result), std::forward(pred), std::forward(lhs), std::forward(rhs)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } IntCmpOp IntCmpOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, mlir::smt::IntPredicate pred, ::mlir::Value lhs, ::mlir::Value rhs) { return create(builder, builder.getLoc(), std::forward(result), std::forward(pred), std::forward(lhs), std::forward(rhs)); } void IntCmpOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, mlir::smt::IntPredicate pred, ::mlir::Value lhs, ::mlir::Value rhs) { odsState.addOperands(lhs); odsState.addOperands(rhs); odsState.getOrAddProperties().pred = mlir::smt::IntPredicateAttr::get(odsBuilder.getContext(), pred); ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes; if (::mlir::succeeded(IntCmpOp::inferReturnTypes(odsBuilder.getContext(), odsState.location, odsState.operands, odsState.attributes.getDictionary(odsState.getContext()), odsState.getRawProperties(), odsState.regions, inferredReturnTypes))) odsState.addTypes(inferredReturnTypes); else ::mlir::detail::reportFatalInferReturnTypesError(odsState); } IntCmpOp IntCmpOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, mlir::smt::IntPredicate pred, ::mlir::Value lhs, ::mlir::Value rhs) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(pred), std::forward(lhs), std::forward(rhs)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } IntCmpOp IntCmpOp::create(::mlir::ImplicitLocOpBuilder &builder, mlir::smt::IntPredicate pred, ::mlir::Value lhs, ::mlir::Value rhs) { return create(builder, builder.getLoc(), std::forward(pred), std::forward(lhs), std::forward(rhs)); } void IntCmpOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, mlir::smt::IntPredicate pred, ::mlir::Value lhs, ::mlir::Value rhs) { odsState.addOperands(lhs); odsState.addOperands(rhs); odsState.getOrAddProperties().pred = mlir::smt::IntPredicateAttr::get(odsBuilder.getContext(), pred); assert(resultTypes.size() == 1u && "mismatched number of results"); odsState.addTypes(resultTypes); } IntCmpOp IntCmpOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, mlir::smt::IntPredicate pred, ::mlir::Value lhs, ::mlir::Value rhs) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(resultTypes), std::forward(pred), std::forward(lhs), std::forward(rhs)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } IntCmpOp IntCmpOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, mlir::smt::IntPredicate pred, ::mlir::Value lhs, ::mlir::Value rhs) { return create(builder, builder.getLoc(), std::forward(resultTypes), std::forward(pred), std::forward(lhs), std::forward(rhs)); } void IntCmpOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { assert(operands.size() == 2u && "mismatched number of parameters"); odsState.addOperands(operands); odsState.addAttributes(attributes); assert(resultTypes.size() == 1u && "mismatched number of return types"); odsState.addTypes(resultTypes); if (!attributes.empty()) { (void)odsState.getOrAddProperties(); ::mlir::PropertyRef properties = odsState.getRawProperties(); std::optional<::mlir::RegisteredOperationName> info = odsState.name.getRegisteredInfo(); if (failed(info->setOpPropertiesFromAttribute(odsState.name, properties, odsState.attributes.getDictionary(odsState.getContext()), nullptr))) ::llvm::report_fatal_error("Property conversion failed."); } } IntCmpOp IntCmpOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(resultTypes), std::forward(operands), std::forward(attributes)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } IntCmpOp IntCmpOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { return create(builder, builder.getLoc(), std::forward(resultTypes), std::forward(operands), std::forward(attributes)); } void IntCmpOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { assert(operands.size() == 2u && "mismatched number of parameters"); odsState.addOperands(operands); odsState.addAttributes(attributes); if (!attributes.empty()) { (void)odsState.getOrAddProperties(); ::mlir::PropertyRef properties = odsState.getRawProperties(); std::optional<::mlir::RegisteredOperationName> info = odsState.name.getRegisteredInfo(); if (failed(info->setOpPropertiesFromAttribute(odsState.name, properties, odsState.attributes.getDictionary(odsState.getContext()), nullptr))) ::llvm::report_fatal_error("Property conversion failed."); } ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes; if (::mlir::succeeded(IntCmpOp::inferReturnTypes(odsBuilder.getContext(), odsState.location, operands, odsState.attributes.getDictionary(odsState.getContext()), odsState.getRawProperties(), odsState.regions, inferredReturnTypes))) { assert(inferredReturnTypes.size() == 1u && "mismatched number of return types"); odsState.addTypes(inferredReturnTypes); } else { ::llvm::report_fatal_error("Failed to infer result type(s)."); } } IntCmpOp IntCmpOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(operands), std::forward(attributes)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } IntCmpOp IntCmpOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { return create(builder, builder.getLoc(), std::forward(operands), std::forward(attributes)); } void IntCmpOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { assert(operands.size() == 2u && "mismatched number of parameters"); odsState.addOperands(operands); odsState.useProperties(const_cast(properties)); odsState.addAttributes(discardableAttributes); assert(resultTypes.size() == 1u && "mismatched number of return types"); odsState.addTypes(resultTypes); } IntCmpOp IntCmpOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(resultTypes), std::forward(operands), std::forward(properties), std::forward(discardableAttributes)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } IntCmpOp IntCmpOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { return create(builder, builder.getLoc(), std::forward(resultTypes), std::forward(operands), std::forward(properties), std::forward(discardableAttributes)); } void IntCmpOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { assert(operands.size() == 2u && "mismatched number of parameters"); odsState.addOperands(operands); odsState.useProperties(const_cast(properties)); odsState.addAttributes(discardableAttributes); ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes; if (::mlir::succeeded(IntCmpOp::inferReturnTypes(odsBuilder.getContext(), odsState.location, operands, odsState.attributes.getDictionary(odsState.getContext()), odsState.getRawProperties(), odsState.regions, inferredReturnTypes))) { assert(inferredReturnTypes.size() == 1u && "mismatched number of return types"); odsState.addTypes(inferredReturnTypes); } else { ::llvm::report_fatal_error("Failed to infer result type(s)."); } } IntCmpOp IntCmpOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(operands), std::forward(properties), std::forward(discardableAttributes)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } IntCmpOp IntCmpOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { return create(builder, builder.getLoc(), std::forward(operands), std::forward(properties), std::forward(discardableAttributes)); } ::llvm::LogicalResult IntCmpOp::verifyInvariantsImpl() { auto tblgen_pred = getProperties().pred; (void)tblgen_pred; if (!tblgen_pred) return emitOpError("requires attribute 'pred'"); if (::mlir::failed(__mlir_ods_local_attr_constraint_SMT8(*this, tblgen_pred, "pred"))) return ::mlir::failure(); { unsigned index = 0; (void)index; auto valueGroup0 = getODSOperands(0); for (auto v : valueGroup0) { if (::mlir::failed(__mlir_ods_local_type_constraint_SMT9(*this, v.getType(), "operand", index++))) return ::mlir::failure(); } auto valueGroup1 = getODSOperands(1); for (auto v : valueGroup1) { if (::mlir::failed(__mlir_ods_local_type_constraint_SMT9(*this, v.getType(), "operand", index++))) return ::mlir::failure(); } } { unsigned index = 0; (void)index; auto valueGroup0 = getODSResults(0); for (auto v : valueGroup0) { if (::mlir::failed(__mlir_ods_local_type_constraint_SMT2(*this, v.getType(), "result", index++))) return ::mlir::failure(); } } return ::mlir::success(); } ::llvm::LogicalResult IntCmpOp::verifyInvariants() { return verifyInvariantsImpl(); } ::llvm::LogicalResult IntCmpOp::inferReturnTypes(::mlir::MLIRContext *context, ::std::optional<::mlir::Location> location, ::mlir::ValueRange operands, ::mlir::DictionaryAttr attributes, ::mlir::PropertyRef properties, ::mlir::RegionRange regions, ::llvm::SmallVectorImpl<::mlir::Type>&inferredReturnTypes) { inferredReturnTypes.resize(1); ::mlir::Builder odsBuilder(context); ::mlir::Type odsInferredType0 = odsBuilder.getType(); inferredReturnTypes[0] = odsInferredType0; return ::mlir::success(); } ::mlir::ParseResult IntCmpOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) { mlir::smt::IntPredicateAttr predAttr; ::mlir::OpAsmParser::UnresolvedOperand lhsRawOperand{}; ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> lhsOperands(&lhsRawOperand, 1); ::llvm::SMLoc lhsOperandsLoc; (void)lhsOperandsLoc; ::mlir::OpAsmParser::UnresolvedOperand rhsRawOperand{}; ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> rhsOperands(&rhsRawOperand, 1); ::llvm::SMLoc rhsOperandsLoc; (void)rhsOperandsLoc; { ::llvm::StringRef attrStr; ::mlir::NamedAttrList attrStorage; auto loc = parser.getCurrentLocation(); if (parser.parseOptionalKeyword(&attrStr, {"lt","le","gt","ge"})) { ::mlir::StringAttr attrVal; ::mlir::OptionalParseResult parseResult = parser.parseOptionalAttribute(attrVal, parser.getBuilder().getNoneType(), "pred", attrStorage); if (parseResult.has_value()) { if (failed(*parseResult)) return ::mlir::failure(); attrStr = attrVal.getValue(); } else { return parser.emitError(loc, "expected string or keyword containing one of the following enum values for attribute 'pred' [lt, le, gt, ge]"); } } if (!attrStr.empty()) { auto attrOptional = mlir::smt::symbolizeIntPredicate(attrStr); if (!attrOptional) return parser.emitError(loc, "invalid ") << "pred attribute specification: \"" << attrStr << '"';; predAttr = mlir::smt::IntPredicateAttr::get(parser.getBuilder().getContext(), *attrOptional); result.getOrAddProperties().pred = predAttr; } } lhsOperandsLoc = parser.getCurrentLocation(); if (parser.parseOperand(lhsRawOperand)) return ::mlir::failure(); if (parser.parseComma()) return ::mlir::failure(); rhsOperandsLoc = parser.getCurrentLocation(); if (parser.parseOperand(rhsRawOperand)) return ::mlir::failure(); { auto loc = parser.getCurrentLocation();(void)loc; if (parser.parseOptionalAttrDict(result.attributes)) return ::mlir::failure(); if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() { return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op "; }))) return ::mlir::failure(); } ::mlir::Type odsBuildableType0 = parser.getBuilder().getType(); ::mlir::Type odsBuildableType1 = parser.getBuilder().getType(); result.addTypes(odsBuildableType0); if (parser.resolveOperands(lhsOperands, odsBuildableType1, lhsOperandsLoc, result.operands)) return ::mlir::failure(); if (parser.resolveOperands(rhsOperands, odsBuildableType1, rhsOperandsLoc, result.operands)) return ::mlir::failure(); return ::mlir::success(); } void IntCmpOp::print(::mlir::OpAsmPrinter &_odsPrinter) { _odsPrinter << ' '; { auto caseValue = getPred(); auto caseValueStr = stringifyIntPredicate(caseValue); _odsPrinter << caseValueStr; } _odsPrinter << ' '; _odsPrinter << getLhs(); _odsPrinter << ","; _odsPrinter << ' '; _odsPrinter << getRhs(); ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs; elidedAttrs.push_back("pred"); _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs); } void IntCmpOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) { } } // namespace mlir::smt MLIR_DEFINE_EXPLICIT_TYPE_ID(mlir::smt::IntCmpOp) MLIR_DEFINE_EXPLICIT_TYPE_ID(mlir::smt::detail::IntCmpOpGenericAdaptorBase::Properties) namespace mlir::smt { //===----------------------------------------------------------------------===// // mlir::smt::IntConstantOp definitions //===----------------------------------------------------------------------===// namespace detail { IntConstantOpGenericAdaptorBase::IntConstantOpGenericAdaptorBase(IntConstantOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {} ::mlir::APInt IntConstantOpGenericAdaptorBase::getValue() { auto attr = getValueAttr(); return attr.getValue(); } } // namespace detail IntConstantOpAdaptor::IntConstantOpAdaptor(IntConstantOp op) : IntConstantOpGenericAdaptor(op->getOperands(), op) {} ::llvm::LogicalResult IntConstantOpAdaptor::verify(::mlir::Location loc) { auto tblgen_value = getProperties().value; (void)tblgen_value; if (!tblgen_value) return emitError(loc, "'smt.int.constant' op requires attribute 'value'"); if (tblgen_value && !((::llvm::isa<::mlir::IntegerAttr>(tblgen_value)))) return emitError(loc, "'smt.int.constant' op attribute 'value' failed to satisfy constraint: arbitrary integer attribute"); return ::mlir::success(); } ::llvm::LogicalResult IntConstantOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) { ::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr); if (!dict) { emitError() << "expected DictionaryAttr to set properties"; return ::mlir::failure(); } { auto &propStorage = prop.value; auto attr = dict.get("value"); if (attr) { auto convertedAttr = ::llvm::dyn_cast>(attr); if (convertedAttr) { propStorage = convertedAttr; } else { emitError() << "Invalid attribute `value` in property conversion: " << attr; return ::mlir::failure(); } } } return ::mlir::success(); } ::mlir::Attribute IntConstantOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) { ::mlir::SmallVector<::mlir::NamedAttribute> attrs; ::mlir::Builder odsBuilder{ctx}; { const auto &propStorage = prop.value; if (propStorage) attrs.push_back(odsBuilder.getNamedAttr("value", propStorage)); } if (!attrs.empty()) return odsBuilder.getDictionaryAttr(attrs); return {}; } llvm::hash_code IntConstantOp::computePropertiesHash(const Properties &prop) { using llvm::hash_value; return llvm::hash_combine( llvm::hash_value(prop.value.getAsOpaquePointer())); } std::optional IntConstantOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) { if (name == "value") return prop.value; return std::nullopt; } void IntConstantOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) { if (name == "value") { prop.value = ::llvm::dyn_cast_or_null>(value); return; } } void IntConstantOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) { if (prop.value) attrs.append("value", prop.value); } ::llvm::LogicalResult IntConstantOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) { { ::mlir::Attribute attr = attrs.get(getValueAttrName(opName)); if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_SMT9(attr, "value", emitError))) return ::mlir::failure(); } return ::mlir::success(); } ::llvm::LogicalResult IntConstantOp::readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state) { auto &prop = state.getOrAddProperties(); (void)prop; if (::mlir::failed(reader.readAttribute(prop.value))) return ::mlir::failure(); return ::mlir::success(); } void IntConstantOp::writeProperties(::mlir::DialectBytecodeWriter &writer) { auto &prop = getProperties(); (void)prop; writer.writeAttribute(prop.value); } ::mlir::APInt IntConstantOp::getValue() { auto attr = getValueAttr(); return attr.getValue(); } void IntConstantOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::IntegerAttr value) { odsState.getOrAddProperties().value = value; odsState.addTypes(result); } IntConstantOp IntConstantOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::IntegerAttr value) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(result), std::forward(value)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } IntConstantOp IntConstantOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::IntegerAttr value) { return create(builder, builder.getLoc(), std::forward(result), std::forward(value)); } void IntConstantOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::IntegerAttr value) { odsState.getOrAddProperties().value = value; ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes; if (::mlir::succeeded(IntConstantOp::inferReturnTypes(odsBuilder.getContext(), odsState.location, odsState.operands, odsState.attributes.getDictionary(odsState.getContext()), odsState.getRawProperties(), odsState.regions, inferredReturnTypes))) odsState.addTypes(inferredReturnTypes); else ::mlir::detail::reportFatalInferReturnTypesError(odsState); } IntConstantOp IntConstantOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::IntegerAttr value) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(value)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } IntConstantOp IntConstantOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::IntegerAttr value) { return create(builder, builder.getLoc(), std::forward(value)); } void IntConstantOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::IntegerAttr value) { odsState.getOrAddProperties().value = value; assert(resultTypes.size() == 1u && "mismatched number of results"); odsState.addTypes(resultTypes); } IntConstantOp IntConstantOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::IntegerAttr value) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(resultTypes), std::forward(value)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } IntConstantOp IntConstantOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::IntegerAttr value) { return create(builder, builder.getLoc(), std::forward(resultTypes), std::forward(value)); } void IntConstantOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { assert(operands.size() == 0u && "mismatched number of parameters"); odsState.addOperands(operands); odsState.addAttributes(attributes); assert(resultTypes.size() == 1u && "mismatched number of return types"); odsState.addTypes(resultTypes); if (!attributes.empty()) { (void)odsState.getOrAddProperties(); ::mlir::PropertyRef properties = odsState.getRawProperties(); std::optional<::mlir::RegisteredOperationName> info = odsState.name.getRegisteredInfo(); if (failed(info->setOpPropertiesFromAttribute(odsState.name, properties, odsState.attributes.getDictionary(odsState.getContext()), nullptr))) ::llvm::report_fatal_error("Property conversion failed."); } } IntConstantOp IntConstantOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(resultTypes), std::forward(operands), std::forward(attributes)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } IntConstantOp IntConstantOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { return create(builder, builder.getLoc(), std::forward(resultTypes), std::forward(operands), std::forward(attributes)); } void IntConstantOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { assert(operands.size() == 0u && "mismatched number of parameters"); odsState.addOperands(operands); odsState.addAttributes(attributes); if (!attributes.empty()) { (void)odsState.getOrAddProperties(); ::mlir::PropertyRef properties = odsState.getRawProperties(); std::optional<::mlir::RegisteredOperationName> info = odsState.name.getRegisteredInfo(); if (failed(info->setOpPropertiesFromAttribute(odsState.name, properties, odsState.attributes.getDictionary(odsState.getContext()), nullptr))) ::llvm::report_fatal_error("Property conversion failed."); } ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes; if (::mlir::succeeded(IntConstantOp::inferReturnTypes(odsBuilder.getContext(), odsState.location, operands, odsState.attributes.getDictionary(odsState.getContext()), odsState.getRawProperties(), odsState.regions, inferredReturnTypes))) { assert(inferredReturnTypes.size() == 1u && "mismatched number of return types"); odsState.addTypes(inferredReturnTypes); } else { ::llvm::report_fatal_error("Failed to infer result type(s)."); } } IntConstantOp IntConstantOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(operands), std::forward(attributes)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } IntConstantOp IntConstantOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { return create(builder, builder.getLoc(), std::forward(operands), std::forward(attributes)); } void IntConstantOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { assert(operands.size() == 0u && "mismatched number of parameters"); odsState.addOperands(operands); odsState.useProperties(const_cast(properties)); odsState.addAttributes(discardableAttributes); assert(resultTypes.size() == 1u && "mismatched number of return types"); odsState.addTypes(resultTypes); } IntConstantOp IntConstantOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(resultTypes), std::forward(operands), std::forward(properties), std::forward(discardableAttributes)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } IntConstantOp IntConstantOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { return create(builder, builder.getLoc(), std::forward(resultTypes), std::forward(operands), std::forward(properties), std::forward(discardableAttributes)); } void IntConstantOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { assert(operands.size() == 0u && "mismatched number of parameters"); odsState.addOperands(operands); odsState.useProperties(const_cast(properties)); odsState.addAttributes(discardableAttributes); ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes; if (::mlir::succeeded(IntConstantOp::inferReturnTypes(odsBuilder.getContext(), odsState.location, operands, odsState.attributes.getDictionary(odsState.getContext()), odsState.getRawProperties(), odsState.regions, inferredReturnTypes))) { assert(inferredReturnTypes.size() == 1u && "mismatched number of return types"); odsState.addTypes(inferredReturnTypes); } else { ::llvm::report_fatal_error("Failed to infer result type(s)."); } } IntConstantOp IntConstantOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(operands), std::forward(properties), std::forward(discardableAttributes)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } IntConstantOp IntConstantOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { return create(builder, builder.getLoc(), std::forward(operands), std::forward(properties), std::forward(discardableAttributes)); } ::llvm::LogicalResult IntConstantOp::verifyInvariantsImpl() { auto tblgen_value = getProperties().value; (void)tblgen_value; if (!tblgen_value) return emitOpError("requires attribute 'value'"); if (::mlir::failed(__mlir_ods_local_attr_constraint_SMT9(*this, tblgen_value, "value"))) return ::mlir::failure(); { unsigned index = 0; (void)index; auto valueGroup0 = getODSResults(0); for (auto v : valueGroup0) { if (::mlir::failed(__mlir_ods_local_type_constraint_SMT9(*this, v.getType(), "result", index++))) return ::mlir::failure(); } } return ::mlir::success(); } ::llvm::LogicalResult IntConstantOp::verifyInvariants() { return verifyInvariantsImpl(); } ::llvm::LogicalResult IntConstantOp::inferReturnTypes(::mlir::MLIRContext *context, ::std::optional<::mlir::Location> location, ::mlir::ValueRange operands, ::mlir::DictionaryAttr attributes, ::mlir::PropertyRef properties, ::mlir::RegionRange regions, ::llvm::SmallVectorImpl<::mlir::Type>&inferredReturnTypes) { inferredReturnTypes.resize(1); ::mlir::Builder odsBuilder(context); ::mlir::Type odsInferredType0 = odsBuilder.getType(); inferredReturnTypes[0] = odsInferredType0; return ::mlir::success(); } ::llvm::LogicalResult IntConstantOp::setPropertiesFromParsedAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) { ::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr); if (!dict) { emitError() << "expected DictionaryAttr to set properties"; return ::mlir::failure(); } // keep track of used keys in the input dictionary to be able to error out // if there are some unknown ones. ::mlir::DenseSet<::mlir::StringAttr> usedKeys; ::mlir::MLIRContext *ctx = dict.getContext(); (void)ctx; { auto &propStorage = prop.value; auto valueAttrName = ::mlir::StringAttr::get(ctx, "value"); auto attr = dict.get(valueAttrName); usedKeys.insert(valueAttrName); if (attr || /*isRequired=*/true) { if (!attr) { emitError() << "expected key entry for value in DictionaryAttr to set " "Properties."; return ::mlir::failure(); } auto convertedAttr = ::llvm::dyn_cast>(attr); if (convertedAttr) { propStorage = convertedAttr; } else { emitError() << "Invalid attribute `value` in property conversion: " << attr; return ::mlir::failure(); } } } for (::mlir::NamedAttribute attr : dict) { if (!usedKeys.contains(attr.getName())) return emitError() << "unknown key '" << attr.getName() << "' when parsing properties dictionary"; } return ::mlir::success(); } void IntConstantOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) { } } // namespace mlir::smt MLIR_DEFINE_EXPLICIT_TYPE_ID(mlir::smt::IntConstantOp) MLIR_DEFINE_EXPLICIT_TYPE_ID(mlir::smt::detail::IntConstantOpGenericAdaptorBase::Properties) namespace mlir::smt { //===----------------------------------------------------------------------===// // mlir::smt::IntDivOp definitions //===----------------------------------------------------------------------===// namespace detail { IntDivOpGenericAdaptorBase::IntDivOpGenericAdaptorBase(IntDivOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {} } // namespace detail IntDivOpAdaptor::IntDivOpAdaptor(IntDivOp op) : IntDivOpGenericAdaptor(op->getOperands(), op) {} ::llvm::LogicalResult IntDivOpAdaptor::verify(::mlir::Location loc) { return ::mlir::success(); } ::llvm::LogicalResult IntDivOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) { ::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr); if (!dict) { emitError() << "expected DictionaryAttr to set properties"; return ::mlir::failure(); } return ::mlir::success(); } ::mlir::Attribute IntDivOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) { ::mlir::SmallVector<::mlir::NamedAttribute> attrs; ::mlir::Builder odsBuilder{ctx}; if (!attrs.empty()) return odsBuilder.getDictionaryAttr(attrs); return {}; } llvm::hash_code IntDivOp::computePropertiesHash(const Properties &prop) { using llvm::hash_value; return llvm::hash_combine(); } std::optional IntDivOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) { return std::nullopt; } void IntDivOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) { } void IntDivOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) { } ::llvm::LogicalResult IntDivOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) { return ::mlir::success(); } void IntDivOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs) { odsState.addOperands(lhs); odsState.addOperands(rhs); odsState.addTypes(result); } IntDivOp IntDivOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(result), std::forward(lhs), std::forward(rhs)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } IntDivOp IntDivOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs) { return create(builder, builder.getLoc(), std::forward(result), std::forward(lhs), std::forward(rhs)); } void IntDivOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value lhs, ::mlir::Value rhs) { odsState.addOperands(lhs); odsState.addOperands(rhs); ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes; if (::mlir::succeeded(IntDivOp::inferReturnTypes(odsBuilder.getContext(), odsState.location, odsState.operands, odsState.attributes.getDictionary(odsState.getContext()), odsState.getRawProperties(), odsState.regions, inferredReturnTypes))) odsState.addTypes(inferredReturnTypes); else ::mlir::detail::reportFatalInferReturnTypesError(odsState); } IntDivOp IntDivOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value lhs, ::mlir::Value rhs) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(lhs), std::forward(rhs)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } IntDivOp IntDivOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value lhs, ::mlir::Value rhs) { return create(builder, builder.getLoc(), std::forward(lhs), std::forward(rhs)); } void IntDivOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs) { odsState.addOperands(lhs); odsState.addOperands(rhs); assert(resultTypes.size() == 1u && "mismatched number of results"); odsState.addTypes(resultTypes); } IntDivOp IntDivOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(resultTypes), std::forward(lhs), std::forward(rhs)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } IntDivOp IntDivOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs) { return create(builder, builder.getLoc(), std::forward(resultTypes), std::forward(lhs), std::forward(rhs)); } void IntDivOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { assert(operands.size() == 2u && "mismatched number of parameters"); odsState.addOperands(operands); odsState.addAttributes(attributes); assert(resultTypes.size() == 1u && "mismatched number of return types"); odsState.addTypes(resultTypes); } IntDivOp IntDivOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(resultTypes), std::forward(operands), std::forward(attributes)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } IntDivOp IntDivOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { return create(builder, builder.getLoc(), std::forward(resultTypes), std::forward(operands), std::forward(attributes)); } void IntDivOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { assert(operands.size() == 2u && "mismatched number of parameters"); odsState.addOperands(operands); odsState.addAttributes(attributes); ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes; if (::mlir::succeeded(IntDivOp::inferReturnTypes(odsBuilder.getContext(), odsState.location, operands, odsState.attributes.getDictionary(odsState.getContext()), odsState.getRawProperties(), odsState.regions, inferredReturnTypes))) { assert(inferredReturnTypes.size() == 1u && "mismatched number of return types"); odsState.addTypes(inferredReturnTypes); } else { ::llvm::report_fatal_error("Failed to infer result type(s)."); } } IntDivOp IntDivOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(operands), std::forward(attributes)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } IntDivOp IntDivOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { return create(builder, builder.getLoc(), std::forward(operands), std::forward(attributes)); } void IntDivOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { assert(operands.size() == 2u && "mismatched number of parameters"); odsState.addOperands(operands); odsState.useProperties(const_cast(properties)); odsState.addAttributes(discardableAttributes); assert(resultTypes.size() == 1u && "mismatched number of return types"); odsState.addTypes(resultTypes); } IntDivOp IntDivOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(resultTypes), std::forward(operands), std::forward(properties), std::forward(discardableAttributes)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } IntDivOp IntDivOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { return create(builder, builder.getLoc(), std::forward(resultTypes), std::forward(operands), std::forward(properties), std::forward(discardableAttributes)); } void IntDivOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { assert(operands.size() == 2u && "mismatched number of parameters"); odsState.addOperands(operands); odsState.useProperties(const_cast(properties)); odsState.addAttributes(discardableAttributes); ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes; if (::mlir::succeeded(IntDivOp::inferReturnTypes(odsBuilder.getContext(), odsState.location, operands, odsState.attributes.getDictionary(odsState.getContext()), odsState.getRawProperties(), odsState.regions, inferredReturnTypes))) { assert(inferredReturnTypes.size() == 1u && "mismatched number of return types"); odsState.addTypes(inferredReturnTypes); } else { ::llvm::report_fatal_error("Failed to infer result type(s)."); } } IntDivOp IntDivOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(operands), std::forward(properties), std::forward(discardableAttributes)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } IntDivOp IntDivOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { return create(builder, builder.getLoc(), std::forward(operands), std::forward(properties), std::forward(discardableAttributes)); } ::llvm::LogicalResult IntDivOp::verifyInvariantsImpl() { { unsigned index = 0; (void)index; auto valueGroup0 = getODSOperands(0); for (auto v : valueGroup0) { if (::mlir::failed(__mlir_ods_local_type_constraint_SMT9(*this, v.getType(), "operand", index++))) return ::mlir::failure(); } auto valueGroup1 = getODSOperands(1); for (auto v : valueGroup1) { if (::mlir::failed(__mlir_ods_local_type_constraint_SMT9(*this, v.getType(), "operand", index++))) return ::mlir::failure(); } } { unsigned index = 0; (void)index; auto valueGroup0 = getODSResults(0); for (auto v : valueGroup0) { if (::mlir::failed(__mlir_ods_local_type_constraint_SMT9(*this, v.getType(), "result", index++))) return ::mlir::failure(); } } return ::mlir::success(); } ::llvm::LogicalResult IntDivOp::verifyInvariants() { return verifyInvariantsImpl(); } ::llvm::LogicalResult IntDivOp::inferReturnTypes(::mlir::MLIRContext *context, ::std::optional<::mlir::Location> location, ::mlir::ValueRange operands, ::mlir::DictionaryAttr attributes, ::mlir::PropertyRef properties, ::mlir::RegionRange regions, ::llvm::SmallVectorImpl<::mlir::Type>&inferredReturnTypes) { inferredReturnTypes.resize(1); ::mlir::Builder odsBuilder(context); ::mlir::Type odsInferredType0 = odsBuilder.getType(); inferredReturnTypes[0] = odsInferredType0; return ::mlir::success(); } ::mlir::ParseResult IntDivOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) { ::mlir::OpAsmParser::UnresolvedOperand lhsRawOperand{}; ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> lhsOperands(&lhsRawOperand, 1); ::llvm::SMLoc lhsOperandsLoc; (void)lhsOperandsLoc; ::mlir::OpAsmParser::UnresolvedOperand rhsRawOperand{}; ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> rhsOperands(&rhsRawOperand, 1); ::llvm::SMLoc rhsOperandsLoc; (void)rhsOperandsLoc; lhsOperandsLoc = parser.getCurrentLocation(); if (parser.parseOperand(lhsRawOperand)) return ::mlir::failure(); if (parser.parseComma()) return ::mlir::failure(); rhsOperandsLoc = parser.getCurrentLocation(); if (parser.parseOperand(rhsRawOperand)) return ::mlir::failure(); { auto loc = parser.getCurrentLocation();(void)loc; if (parser.parseOptionalAttrDict(result.attributes)) return ::mlir::failure(); if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() { return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op "; }))) return ::mlir::failure(); } ::mlir::Type odsBuildableType0 = parser.getBuilder().getType(); result.addTypes(odsBuildableType0); if (parser.resolveOperands(lhsOperands, odsBuildableType0, lhsOperandsLoc, result.operands)) return ::mlir::failure(); if (parser.resolveOperands(rhsOperands, odsBuildableType0, rhsOperandsLoc, result.operands)) return ::mlir::failure(); return ::mlir::success(); } void IntDivOp::print(::mlir::OpAsmPrinter &_odsPrinter) { _odsPrinter << ' '; _odsPrinter << getLhs(); _odsPrinter << ","; _odsPrinter << ' '; _odsPrinter << getRhs(); ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs; _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs); } void IntDivOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) { } } // namespace mlir::smt MLIR_DEFINE_EXPLICIT_TYPE_ID(mlir::smt::IntDivOp) namespace mlir::smt { //===----------------------------------------------------------------------===// // mlir::smt::IntModOp definitions //===----------------------------------------------------------------------===// namespace detail { IntModOpGenericAdaptorBase::IntModOpGenericAdaptorBase(IntModOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {} } // namespace detail IntModOpAdaptor::IntModOpAdaptor(IntModOp op) : IntModOpGenericAdaptor(op->getOperands(), op) {} ::llvm::LogicalResult IntModOpAdaptor::verify(::mlir::Location loc) { return ::mlir::success(); } ::llvm::LogicalResult IntModOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) { ::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr); if (!dict) { emitError() << "expected DictionaryAttr to set properties"; return ::mlir::failure(); } return ::mlir::success(); } ::mlir::Attribute IntModOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) { ::mlir::SmallVector<::mlir::NamedAttribute> attrs; ::mlir::Builder odsBuilder{ctx}; if (!attrs.empty()) return odsBuilder.getDictionaryAttr(attrs); return {}; } llvm::hash_code IntModOp::computePropertiesHash(const Properties &prop) { using llvm::hash_value; return llvm::hash_combine(); } std::optional IntModOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) { return std::nullopt; } void IntModOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) { } void IntModOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) { } ::llvm::LogicalResult IntModOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) { return ::mlir::success(); } void IntModOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs) { odsState.addOperands(lhs); odsState.addOperands(rhs); odsState.addTypes(result); } IntModOp IntModOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(result), std::forward(lhs), std::forward(rhs)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } IntModOp IntModOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs) { return create(builder, builder.getLoc(), std::forward(result), std::forward(lhs), std::forward(rhs)); } void IntModOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value lhs, ::mlir::Value rhs) { odsState.addOperands(lhs); odsState.addOperands(rhs); ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes; if (::mlir::succeeded(IntModOp::inferReturnTypes(odsBuilder.getContext(), odsState.location, odsState.operands, odsState.attributes.getDictionary(odsState.getContext()), odsState.getRawProperties(), odsState.regions, inferredReturnTypes))) odsState.addTypes(inferredReturnTypes); else ::mlir::detail::reportFatalInferReturnTypesError(odsState); } IntModOp IntModOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value lhs, ::mlir::Value rhs) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(lhs), std::forward(rhs)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } IntModOp IntModOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value lhs, ::mlir::Value rhs) { return create(builder, builder.getLoc(), std::forward(lhs), std::forward(rhs)); } void IntModOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs) { odsState.addOperands(lhs); odsState.addOperands(rhs); assert(resultTypes.size() == 1u && "mismatched number of results"); odsState.addTypes(resultTypes); } IntModOp IntModOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(resultTypes), std::forward(lhs), std::forward(rhs)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } IntModOp IntModOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs) { return create(builder, builder.getLoc(), std::forward(resultTypes), std::forward(lhs), std::forward(rhs)); } void IntModOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { assert(operands.size() == 2u && "mismatched number of parameters"); odsState.addOperands(operands); odsState.addAttributes(attributes); assert(resultTypes.size() == 1u && "mismatched number of return types"); odsState.addTypes(resultTypes); } IntModOp IntModOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(resultTypes), std::forward(operands), std::forward(attributes)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } IntModOp IntModOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { return create(builder, builder.getLoc(), std::forward(resultTypes), std::forward(operands), std::forward(attributes)); } void IntModOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { assert(operands.size() == 2u && "mismatched number of parameters"); odsState.addOperands(operands); odsState.addAttributes(attributes); ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes; if (::mlir::succeeded(IntModOp::inferReturnTypes(odsBuilder.getContext(), odsState.location, operands, odsState.attributes.getDictionary(odsState.getContext()), odsState.getRawProperties(), odsState.regions, inferredReturnTypes))) { assert(inferredReturnTypes.size() == 1u && "mismatched number of return types"); odsState.addTypes(inferredReturnTypes); } else { ::llvm::report_fatal_error("Failed to infer result type(s)."); } } IntModOp IntModOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(operands), std::forward(attributes)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } IntModOp IntModOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { return create(builder, builder.getLoc(), std::forward(operands), std::forward(attributes)); } void IntModOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { assert(operands.size() == 2u && "mismatched number of parameters"); odsState.addOperands(operands); odsState.useProperties(const_cast(properties)); odsState.addAttributes(discardableAttributes); assert(resultTypes.size() == 1u && "mismatched number of return types"); odsState.addTypes(resultTypes); } IntModOp IntModOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(resultTypes), std::forward(operands), std::forward(properties), std::forward(discardableAttributes)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } IntModOp IntModOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { return create(builder, builder.getLoc(), std::forward(resultTypes), std::forward(operands), std::forward(properties), std::forward(discardableAttributes)); } void IntModOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { assert(operands.size() == 2u && "mismatched number of parameters"); odsState.addOperands(operands); odsState.useProperties(const_cast(properties)); odsState.addAttributes(discardableAttributes); ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes; if (::mlir::succeeded(IntModOp::inferReturnTypes(odsBuilder.getContext(), odsState.location, operands, odsState.attributes.getDictionary(odsState.getContext()), odsState.getRawProperties(), odsState.regions, inferredReturnTypes))) { assert(inferredReturnTypes.size() == 1u && "mismatched number of return types"); odsState.addTypes(inferredReturnTypes); } else { ::llvm::report_fatal_error("Failed to infer result type(s)."); } } IntModOp IntModOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(operands), std::forward(properties), std::forward(discardableAttributes)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } IntModOp IntModOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { return create(builder, builder.getLoc(), std::forward(operands), std::forward(properties), std::forward(discardableAttributes)); } ::llvm::LogicalResult IntModOp::verifyInvariantsImpl() { { unsigned index = 0; (void)index; auto valueGroup0 = getODSOperands(0); for (auto v : valueGroup0) { if (::mlir::failed(__mlir_ods_local_type_constraint_SMT9(*this, v.getType(), "operand", index++))) return ::mlir::failure(); } auto valueGroup1 = getODSOperands(1); for (auto v : valueGroup1) { if (::mlir::failed(__mlir_ods_local_type_constraint_SMT9(*this, v.getType(), "operand", index++))) return ::mlir::failure(); } } { unsigned index = 0; (void)index; auto valueGroup0 = getODSResults(0); for (auto v : valueGroup0) { if (::mlir::failed(__mlir_ods_local_type_constraint_SMT9(*this, v.getType(), "result", index++))) return ::mlir::failure(); } } return ::mlir::success(); } ::llvm::LogicalResult IntModOp::verifyInvariants() { return verifyInvariantsImpl(); } ::llvm::LogicalResult IntModOp::inferReturnTypes(::mlir::MLIRContext *context, ::std::optional<::mlir::Location> location, ::mlir::ValueRange operands, ::mlir::DictionaryAttr attributes, ::mlir::PropertyRef properties, ::mlir::RegionRange regions, ::llvm::SmallVectorImpl<::mlir::Type>&inferredReturnTypes) { inferredReturnTypes.resize(1); ::mlir::Builder odsBuilder(context); ::mlir::Type odsInferredType0 = odsBuilder.getType(); inferredReturnTypes[0] = odsInferredType0; return ::mlir::success(); } ::mlir::ParseResult IntModOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) { ::mlir::OpAsmParser::UnresolvedOperand lhsRawOperand{}; ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> lhsOperands(&lhsRawOperand, 1); ::llvm::SMLoc lhsOperandsLoc; (void)lhsOperandsLoc; ::mlir::OpAsmParser::UnresolvedOperand rhsRawOperand{}; ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> rhsOperands(&rhsRawOperand, 1); ::llvm::SMLoc rhsOperandsLoc; (void)rhsOperandsLoc; lhsOperandsLoc = parser.getCurrentLocation(); if (parser.parseOperand(lhsRawOperand)) return ::mlir::failure(); if (parser.parseComma()) return ::mlir::failure(); rhsOperandsLoc = parser.getCurrentLocation(); if (parser.parseOperand(rhsRawOperand)) return ::mlir::failure(); { auto loc = parser.getCurrentLocation();(void)loc; if (parser.parseOptionalAttrDict(result.attributes)) return ::mlir::failure(); if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() { return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op "; }))) return ::mlir::failure(); } ::mlir::Type odsBuildableType0 = parser.getBuilder().getType(); result.addTypes(odsBuildableType0); if (parser.resolveOperands(lhsOperands, odsBuildableType0, lhsOperandsLoc, result.operands)) return ::mlir::failure(); if (parser.resolveOperands(rhsOperands, odsBuildableType0, rhsOperandsLoc, result.operands)) return ::mlir::failure(); return ::mlir::success(); } void IntModOp::print(::mlir::OpAsmPrinter &_odsPrinter) { _odsPrinter << ' '; _odsPrinter << getLhs(); _odsPrinter << ","; _odsPrinter << ' '; _odsPrinter << getRhs(); ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs; _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs); } void IntModOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) { } } // namespace mlir::smt MLIR_DEFINE_EXPLICIT_TYPE_ID(mlir::smt::IntModOp) namespace mlir::smt { //===----------------------------------------------------------------------===// // mlir::smt::IntMulOp definitions //===----------------------------------------------------------------------===// namespace detail { IntMulOpGenericAdaptorBase::IntMulOpGenericAdaptorBase(IntMulOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {} std::pair IntMulOpGenericAdaptorBase::getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize) { bool isVariadic[] = {true}; int prevVariadicCount = 0; for (unsigned i = 0; i < index; ++i) if (isVariadic[i]) ++prevVariadicCount; // Calculate how many dynamic values a static variadic operand corresponds to. // This assumes all static variadic operands have the same dynamic value count. int variadicSize = (odsOperandsSize - 0) / 1; // `index` passed in as the parameter is the static index which counts each // operand (variadic or not) as size 1. So here for each previous static variadic // operand, we need to offset by (variadicSize - 1) to get where the dynamic // value pack for this static operand starts. int start = index + (variadicSize - 1) * prevVariadicCount; int size = isVariadic[index] ? variadicSize : 1; return {start, size}; } } // namespace detail IntMulOpAdaptor::IntMulOpAdaptor(IntMulOp op) : IntMulOpGenericAdaptor(op->getOperands(), op) {} ::llvm::LogicalResult IntMulOpAdaptor::verify(::mlir::Location loc) { return ::mlir::success(); } std::pair IntMulOp::getODSOperandIndexAndLength(unsigned index) { bool isVariadic[] = {true}; int prevVariadicCount = 0; for (unsigned i = 0; i < index; ++i) if (isVariadic[i]) ++prevVariadicCount; // Calculate how many dynamic values a static variadic operand corresponds to. // This assumes all static variadic operands have the same dynamic value count. int variadicSize = (getOperation()->getNumOperands() - 0) / 1; // `index` passed in as the parameter is the static index which counts each // operand (variadic or not) as size 1. So here for each previous static variadic // operand, we need to offset by (variadicSize - 1) to get where the dynamic // value pack for this static operand starts. int start = index + (variadicSize - 1) * prevVariadicCount; int size = isVariadic[index] ? variadicSize : 1; return {start, size}; } ::mlir::MutableOperandRange IntMulOp::getInputsMutable() { auto range = getODSOperandIndexAndLength(0); auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second); return mutableRange; } ::llvm::LogicalResult IntMulOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) { ::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr); if (!dict) { emitError() << "expected DictionaryAttr to set properties"; return ::mlir::failure(); } return ::mlir::success(); } ::mlir::Attribute IntMulOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) { ::mlir::SmallVector<::mlir::NamedAttribute> attrs; ::mlir::Builder odsBuilder{ctx}; if (!attrs.empty()) return odsBuilder.getDictionaryAttr(attrs); return {}; } llvm::hash_code IntMulOp::computePropertiesHash(const Properties &prop) { using llvm::hash_value; return llvm::hash_combine(); } std::optional IntMulOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) { return std::nullopt; } void IntMulOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) { } void IntMulOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) { } ::llvm::LogicalResult IntMulOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) { return ::mlir::success(); } void IntMulOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::ValueRange inputs) { odsState.addOperands(inputs); odsState.addTypes(result); } IntMulOp IntMulOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::ValueRange inputs) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(result), std::forward(inputs)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } IntMulOp IntMulOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::ValueRange inputs) { return create(builder, builder.getLoc(), std::forward(result), std::forward(inputs)); } void IntMulOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { odsState.addOperands(operands); odsState.addAttributes(attributes); assert(resultTypes.size() == 1u && "mismatched number of return types"); odsState.addTypes(resultTypes); } IntMulOp IntMulOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(resultTypes), std::forward(operands), std::forward(attributes)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } IntMulOp IntMulOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { return create(builder, builder.getLoc(), std::forward(resultTypes), std::forward(operands), std::forward(attributes)); } void IntMulOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { odsState.addOperands(operands); odsState.addAttributes(attributes); ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes; if (::mlir::succeeded(IntMulOp::inferReturnTypes(odsBuilder.getContext(), odsState.location, operands, odsState.attributes.getDictionary(odsState.getContext()), odsState.getRawProperties(), odsState.regions, inferredReturnTypes))) { assert(inferredReturnTypes.size() == 1u && "mismatched number of return types"); odsState.addTypes(inferredReturnTypes); } else { ::llvm::report_fatal_error("Failed to infer result type(s)."); } } IntMulOp IntMulOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(operands), std::forward(attributes)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } IntMulOp IntMulOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { return create(builder, builder.getLoc(), std::forward(operands), std::forward(attributes)); } void IntMulOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { odsState.addOperands(operands); odsState.useProperties(const_cast(properties)); odsState.addAttributes(discardableAttributes); assert(resultTypes.size() == 1u && "mismatched number of return types"); odsState.addTypes(resultTypes); } IntMulOp IntMulOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(resultTypes), std::forward(operands), std::forward(properties), std::forward(discardableAttributes)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } IntMulOp IntMulOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { return create(builder, builder.getLoc(), std::forward(resultTypes), std::forward(operands), std::forward(properties), std::forward(discardableAttributes)); } void IntMulOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { odsState.addOperands(operands); odsState.useProperties(const_cast(properties)); odsState.addAttributes(discardableAttributes); ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes; if (::mlir::succeeded(IntMulOp::inferReturnTypes(odsBuilder.getContext(), odsState.location, operands, odsState.attributes.getDictionary(odsState.getContext()), odsState.getRawProperties(), odsState.regions, inferredReturnTypes))) { assert(inferredReturnTypes.size() == 1u && "mismatched number of return types"); odsState.addTypes(inferredReturnTypes); } else { ::llvm::report_fatal_error("Failed to infer result type(s)."); } } IntMulOp IntMulOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(operands), std::forward(properties), std::forward(discardableAttributes)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } IntMulOp IntMulOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { return create(builder, builder.getLoc(), std::forward(operands), std::forward(properties), std::forward(discardableAttributes)); } ::llvm::LogicalResult IntMulOp::verifyInvariantsImpl() { { unsigned index = 0; (void)index; auto valueGroup0 = getODSOperands(0); for (auto v : valueGroup0) { if (::mlir::failed(__mlir_ods_local_type_constraint_SMT11(*this, v.getType(), "operand", index++))) return ::mlir::failure(); } } { unsigned index = 0; (void)index; auto valueGroup0 = getODSResults(0); for (auto v : valueGroup0) { if (::mlir::failed(__mlir_ods_local_type_constraint_SMT9(*this, v.getType(), "result", index++))) return ::mlir::failure(); } } return ::mlir::success(); } ::llvm::LogicalResult IntMulOp::verifyInvariants() { return verifyInvariantsImpl(); } ::llvm::LogicalResult IntMulOp::inferReturnTypes(::mlir::MLIRContext *context, ::std::optional<::mlir::Location> location, ::mlir::ValueRange operands, ::mlir::DictionaryAttr attributes, ::mlir::PropertyRef properties, ::mlir::RegionRange regions, ::llvm::SmallVectorImpl<::mlir::Type>&inferredReturnTypes) { inferredReturnTypes.resize(1); ::mlir::Builder odsBuilder(context); ::mlir::Type odsInferredType0 = odsBuilder.getType(); inferredReturnTypes[0] = odsInferredType0; return ::mlir::success(); } ::mlir::ParseResult IntMulOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) { ::llvm::SmallVector<::mlir::OpAsmParser::UnresolvedOperand, 4> inputsOperands; ::llvm::SMLoc inputsOperandsLoc; (void)inputsOperandsLoc; inputsOperandsLoc = parser.getCurrentLocation(); if (parser.parseOperandList(inputsOperands)) return ::mlir::failure(); { auto loc = parser.getCurrentLocation();(void)loc; if (parser.parseOptionalAttrDict(result.attributes)) return ::mlir::failure(); if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() { return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op "; }))) return ::mlir::failure(); } ::mlir::Type odsBuildableType0 = parser.getBuilder().getType(); result.addTypes(odsBuildableType0); if (parser.resolveOperands(inputsOperands, odsBuildableType0, inputsOperandsLoc, result.operands)) return ::mlir::failure(); return ::mlir::success(); } void IntMulOp::print(::mlir::OpAsmPrinter &_odsPrinter) { _odsPrinter << ' '; _odsPrinter << getInputs(); ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs; _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs); } void IntMulOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) { } } // namespace mlir::smt MLIR_DEFINE_EXPLICIT_TYPE_ID(mlir::smt::IntMulOp) namespace mlir::smt { //===----------------------------------------------------------------------===// // mlir::smt::IntSubOp definitions //===----------------------------------------------------------------------===// namespace detail { IntSubOpGenericAdaptorBase::IntSubOpGenericAdaptorBase(IntSubOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {} } // namespace detail IntSubOpAdaptor::IntSubOpAdaptor(IntSubOp op) : IntSubOpGenericAdaptor(op->getOperands(), op) {} ::llvm::LogicalResult IntSubOpAdaptor::verify(::mlir::Location loc) { return ::mlir::success(); } ::llvm::LogicalResult IntSubOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) { ::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr); if (!dict) { emitError() << "expected DictionaryAttr to set properties"; return ::mlir::failure(); } return ::mlir::success(); } ::mlir::Attribute IntSubOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) { ::mlir::SmallVector<::mlir::NamedAttribute> attrs; ::mlir::Builder odsBuilder{ctx}; if (!attrs.empty()) return odsBuilder.getDictionaryAttr(attrs); return {}; } llvm::hash_code IntSubOp::computePropertiesHash(const Properties &prop) { using llvm::hash_value; return llvm::hash_combine(); } std::optional IntSubOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) { return std::nullopt; } void IntSubOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) { } void IntSubOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) { } ::llvm::LogicalResult IntSubOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) { return ::mlir::success(); } void IntSubOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs) { odsState.addOperands(lhs); odsState.addOperands(rhs); odsState.addTypes(result); } IntSubOp IntSubOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(result), std::forward(lhs), std::forward(rhs)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } IntSubOp IntSubOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs) { return create(builder, builder.getLoc(), std::forward(result), std::forward(lhs), std::forward(rhs)); } void IntSubOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value lhs, ::mlir::Value rhs) { odsState.addOperands(lhs); odsState.addOperands(rhs); ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes; if (::mlir::succeeded(IntSubOp::inferReturnTypes(odsBuilder.getContext(), odsState.location, odsState.operands, odsState.attributes.getDictionary(odsState.getContext()), odsState.getRawProperties(), odsState.regions, inferredReturnTypes))) odsState.addTypes(inferredReturnTypes); else ::mlir::detail::reportFatalInferReturnTypesError(odsState); } IntSubOp IntSubOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value lhs, ::mlir::Value rhs) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(lhs), std::forward(rhs)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } IntSubOp IntSubOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value lhs, ::mlir::Value rhs) { return create(builder, builder.getLoc(), std::forward(lhs), std::forward(rhs)); } void IntSubOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs) { odsState.addOperands(lhs); odsState.addOperands(rhs); assert(resultTypes.size() == 1u && "mismatched number of results"); odsState.addTypes(resultTypes); } IntSubOp IntSubOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(resultTypes), std::forward(lhs), std::forward(rhs)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } IntSubOp IntSubOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs) { return create(builder, builder.getLoc(), std::forward(resultTypes), std::forward(lhs), std::forward(rhs)); } void IntSubOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { assert(operands.size() == 2u && "mismatched number of parameters"); odsState.addOperands(operands); odsState.addAttributes(attributes); assert(resultTypes.size() == 1u && "mismatched number of return types"); odsState.addTypes(resultTypes); } IntSubOp IntSubOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(resultTypes), std::forward(operands), std::forward(attributes)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } IntSubOp IntSubOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { return create(builder, builder.getLoc(), std::forward(resultTypes), std::forward(operands), std::forward(attributes)); } void IntSubOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { assert(operands.size() == 2u && "mismatched number of parameters"); odsState.addOperands(operands); odsState.addAttributes(attributes); ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes; if (::mlir::succeeded(IntSubOp::inferReturnTypes(odsBuilder.getContext(), odsState.location, operands, odsState.attributes.getDictionary(odsState.getContext()), odsState.getRawProperties(), odsState.regions, inferredReturnTypes))) { assert(inferredReturnTypes.size() == 1u && "mismatched number of return types"); odsState.addTypes(inferredReturnTypes); } else { ::llvm::report_fatal_error("Failed to infer result type(s)."); } } IntSubOp IntSubOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(operands), std::forward(attributes)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } IntSubOp IntSubOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { return create(builder, builder.getLoc(), std::forward(operands), std::forward(attributes)); } void IntSubOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { assert(operands.size() == 2u && "mismatched number of parameters"); odsState.addOperands(operands); odsState.useProperties(const_cast(properties)); odsState.addAttributes(discardableAttributes); assert(resultTypes.size() == 1u && "mismatched number of return types"); odsState.addTypes(resultTypes); } IntSubOp IntSubOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(resultTypes), std::forward(operands), std::forward(properties), std::forward(discardableAttributes)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } IntSubOp IntSubOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { return create(builder, builder.getLoc(), std::forward(resultTypes), std::forward(operands), std::forward(properties), std::forward(discardableAttributes)); } void IntSubOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { assert(operands.size() == 2u && "mismatched number of parameters"); odsState.addOperands(operands); odsState.useProperties(const_cast(properties)); odsState.addAttributes(discardableAttributes); ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes; if (::mlir::succeeded(IntSubOp::inferReturnTypes(odsBuilder.getContext(), odsState.location, operands, odsState.attributes.getDictionary(odsState.getContext()), odsState.getRawProperties(), odsState.regions, inferredReturnTypes))) { assert(inferredReturnTypes.size() == 1u && "mismatched number of return types"); odsState.addTypes(inferredReturnTypes); } else { ::llvm::report_fatal_error("Failed to infer result type(s)."); } } IntSubOp IntSubOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(operands), std::forward(properties), std::forward(discardableAttributes)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } IntSubOp IntSubOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { return create(builder, builder.getLoc(), std::forward(operands), std::forward(properties), std::forward(discardableAttributes)); } ::llvm::LogicalResult IntSubOp::verifyInvariantsImpl() { { unsigned index = 0; (void)index; auto valueGroup0 = getODSOperands(0); for (auto v : valueGroup0) { if (::mlir::failed(__mlir_ods_local_type_constraint_SMT9(*this, v.getType(), "operand", index++))) return ::mlir::failure(); } auto valueGroup1 = getODSOperands(1); for (auto v : valueGroup1) { if (::mlir::failed(__mlir_ods_local_type_constraint_SMT9(*this, v.getType(), "operand", index++))) return ::mlir::failure(); } } { unsigned index = 0; (void)index; auto valueGroup0 = getODSResults(0); for (auto v : valueGroup0) { if (::mlir::failed(__mlir_ods_local_type_constraint_SMT9(*this, v.getType(), "result", index++))) return ::mlir::failure(); } } return ::mlir::success(); } ::llvm::LogicalResult IntSubOp::verifyInvariants() { return verifyInvariantsImpl(); } ::llvm::LogicalResult IntSubOp::inferReturnTypes(::mlir::MLIRContext *context, ::std::optional<::mlir::Location> location, ::mlir::ValueRange operands, ::mlir::DictionaryAttr attributes, ::mlir::PropertyRef properties, ::mlir::RegionRange regions, ::llvm::SmallVectorImpl<::mlir::Type>&inferredReturnTypes) { inferredReturnTypes.resize(1); ::mlir::Builder odsBuilder(context); ::mlir::Type odsInferredType0 = odsBuilder.getType(); inferredReturnTypes[0] = odsInferredType0; return ::mlir::success(); } ::mlir::ParseResult IntSubOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) { ::mlir::OpAsmParser::UnresolvedOperand lhsRawOperand{}; ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> lhsOperands(&lhsRawOperand, 1); ::llvm::SMLoc lhsOperandsLoc; (void)lhsOperandsLoc; ::mlir::OpAsmParser::UnresolvedOperand rhsRawOperand{}; ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> rhsOperands(&rhsRawOperand, 1); ::llvm::SMLoc rhsOperandsLoc; (void)rhsOperandsLoc; lhsOperandsLoc = parser.getCurrentLocation(); if (parser.parseOperand(lhsRawOperand)) return ::mlir::failure(); if (parser.parseComma()) return ::mlir::failure(); rhsOperandsLoc = parser.getCurrentLocation(); if (parser.parseOperand(rhsRawOperand)) return ::mlir::failure(); { auto loc = parser.getCurrentLocation();(void)loc; if (parser.parseOptionalAttrDict(result.attributes)) return ::mlir::failure(); if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() { return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op "; }))) return ::mlir::failure(); } ::mlir::Type odsBuildableType0 = parser.getBuilder().getType(); result.addTypes(odsBuildableType0); if (parser.resolveOperands(lhsOperands, odsBuildableType0, lhsOperandsLoc, result.operands)) return ::mlir::failure(); if (parser.resolveOperands(rhsOperands, odsBuildableType0, rhsOperandsLoc, result.operands)) return ::mlir::failure(); return ::mlir::success(); } void IntSubOp::print(::mlir::OpAsmPrinter &_odsPrinter) { _odsPrinter << ' '; _odsPrinter << getLhs(); _odsPrinter << ","; _odsPrinter << ' '; _odsPrinter << getRhs(); ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs; _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs); } void IntSubOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) { } } // namespace mlir::smt MLIR_DEFINE_EXPLICIT_TYPE_ID(mlir::smt::IntSubOp) namespace mlir::smt { //===----------------------------------------------------------------------===// // mlir::smt::IteOp definitions //===----------------------------------------------------------------------===// namespace detail { IteOpGenericAdaptorBase::IteOpGenericAdaptorBase(IteOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {} } // namespace detail IteOpAdaptor::IteOpAdaptor(IteOp op) : IteOpGenericAdaptor(op->getOperands(), op) {} ::llvm::LogicalResult IteOpAdaptor::verify(::mlir::Location loc) { return ::mlir::success(); } ::llvm::LogicalResult IteOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) { ::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr); if (!dict) { emitError() << "expected DictionaryAttr to set properties"; return ::mlir::failure(); } return ::mlir::success(); } ::mlir::Attribute IteOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) { ::mlir::SmallVector<::mlir::NamedAttribute> attrs; ::mlir::Builder odsBuilder{ctx}; if (!attrs.empty()) return odsBuilder.getDictionaryAttr(attrs); return {}; } llvm::hash_code IteOp::computePropertiesHash(const Properties &prop) { using llvm::hash_value; return llvm::hash_combine(); } std::optional IteOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) { return std::nullopt; } void IteOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) { } void IteOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) { } ::llvm::LogicalResult IteOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) { return ::mlir::success(); } void IteOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value cond, ::mlir::Value thenValue, ::mlir::Value elseValue) { odsState.addOperands(cond); odsState.addOperands(thenValue); odsState.addOperands(elseValue); odsState.addTypes(result); } IteOp IteOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value cond, ::mlir::Value thenValue, ::mlir::Value elseValue) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(result), std::forward(cond), std::forward(thenValue), std::forward(elseValue)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } IteOp IteOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::Value cond, ::mlir::Value thenValue, ::mlir::Value elseValue) { return create(builder, builder.getLoc(), std::forward(result), std::forward(cond), std::forward(thenValue), std::forward(elseValue)); } void IteOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value cond, ::mlir::Value thenValue, ::mlir::Value elseValue) { odsState.addOperands(cond); odsState.addOperands(thenValue); odsState.addOperands(elseValue); ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes; if (::mlir::succeeded(IteOp::inferReturnTypes(odsBuilder.getContext(), odsState.location, odsState.operands, odsState.attributes.getDictionary(odsState.getContext()), odsState.getRawProperties(), odsState.regions, inferredReturnTypes))) odsState.addTypes(inferredReturnTypes); else ::mlir::detail::reportFatalInferReturnTypesError(odsState); } IteOp IteOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value cond, ::mlir::Value thenValue, ::mlir::Value elseValue) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(cond), std::forward(thenValue), std::forward(elseValue)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } IteOp IteOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value cond, ::mlir::Value thenValue, ::mlir::Value elseValue) { return create(builder, builder.getLoc(), std::forward(cond), std::forward(thenValue), std::forward(elseValue)); } void IteOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value cond, ::mlir::Value thenValue, ::mlir::Value elseValue) { odsState.addOperands(cond); odsState.addOperands(thenValue); odsState.addOperands(elseValue); assert(resultTypes.size() == 1u && "mismatched number of results"); odsState.addTypes(resultTypes); } IteOp IteOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value cond, ::mlir::Value thenValue, ::mlir::Value elseValue) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(resultTypes), std::forward(cond), std::forward(thenValue), std::forward(elseValue)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } IteOp IteOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value cond, ::mlir::Value thenValue, ::mlir::Value elseValue) { return create(builder, builder.getLoc(), std::forward(resultTypes), std::forward(cond), std::forward(thenValue), std::forward(elseValue)); } void IteOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { assert(operands.size() == 3u && "mismatched number of parameters"); odsState.addOperands(operands); odsState.addAttributes(attributes); assert(resultTypes.size() == 1u && "mismatched number of return types"); odsState.addTypes(resultTypes); } IteOp IteOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(resultTypes), std::forward(operands), std::forward(attributes)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } IteOp IteOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { return create(builder, builder.getLoc(), std::forward(resultTypes), std::forward(operands), std::forward(attributes)); } void IteOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { assert(operands.size() == 3u && "mismatched number of parameters"); odsState.addOperands(operands); odsState.addAttributes(attributes); ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes; if (::mlir::succeeded(IteOp::inferReturnTypes(odsBuilder.getContext(), odsState.location, operands, odsState.attributes.getDictionary(odsState.getContext()), odsState.getRawProperties(), odsState.regions, inferredReturnTypes))) { assert(inferredReturnTypes.size() == 1u && "mismatched number of return types"); odsState.addTypes(inferredReturnTypes); } else { ::llvm::report_fatal_error("Failed to infer result type(s)."); } } IteOp IteOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(operands), std::forward(attributes)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } IteOp IteOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { return create(builder, builder.getLoc(), std::forward(operands), std::forward(attributes)); } void IteOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { assert(operands.size() == 3u && "mismatched number of parameters"); odsState.addOperands(operands); odsState.useProperties(const_cast(properties)); odsState.addAttributes(discardableAttributes); assert(resultTypes.size() == 1u && "mismatched number of return types"); odsState.addTypes(resultTypes); } IteOp IteOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(resultTypes), std::forward(operands), std::forward(properties), std::forward(discardableAttributes)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } IteOp IteOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { return create(builder, builder.getLoc(), std::forward(resultTypes), std::forward(operands), std::forward(properties), std::forward(discardableAttributes)); } void IteOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { assert(operands.size() == 3u && "mismatched number of parameters"); odsState.addOperands(operands); odsState.useProperties(const_cast(properties)); odsState.addAttributes(discardableAttributes); ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes; if (::mlir::succeeded(IteOp::inferReturnTypes(odsBuilder.getContext(), odsState.location, operands, odsState.attributes.getDictionary(odsState.getContext()), odsState.getRawProperties(), odsState.regions, inferredReturnTypes))) { assert(inferredReturnTypes.size() == 1u && "mismatched number of return types"); odsState.addTypes(inferredReturnTypes); } else { ::llvm::report_fatal_error("Failed to infer result type(s)."); } } IteOp IteOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(operands), std::forward(properties), std::forward(discardableAttributes)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } IteOp IteOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { return create(builder, builder.getLoc(), std::forward(operands), std::forward(properties), std::forward(discardableAttributes)); } ::llvm::LogicalResult IteOp::verifyInvariantsImpl() { { unsigned index = 0; (void)index; auto valueGroup0 = getODSOperands(0); for (auto v : valueGroup0) { if (::mlir::failed(__mlir_ods_local_type_constraint_SMT2(*this, v.getType(), "operand", index++))) return ::mlir::failure(); } auto valueGroup1 = getODSOperands(1); for (auto v : valueGroup1) { if (::mlir::failed(__mlir_ods_local_type_constraint_SMT6(*this, v.getType(), "operand", index++))) return ::mlir::failure(); } auto valueGroup2 = getODSOperands(2); for (auto v : valueGroup2) { if (::mlir::failed(__mlir_ods_local_type_constraint_SMT6(*this, v.getType(), "operand", index++))) return ::mlir::failure(); } } { unsigned index = 0; (void)index; auto valueGroup0 = getODSResults(0); for (auto v : valueGroup0) { if (::mlir::failed(__mlir_ods_local_type_constraint_SMT6(*this, v.getType(), "result", index++))) return ::mlir::failure(); } } if (!((((*this->getODSOperands(1).begin()).getType()) == ((*this->getODSOperands(2).begin()).getType()) && ((*this->getODSOperands(2).begin()).getType()) == ((*this->getODSResults(0).begin()).getType()) && ((*this->getODSResults(0).begin()).getType()) == ((*this->getODSOperands(1).begin()).getType())))) return emitOpError("failed to verify that all of {thenValue, elseValue, result} have same type"); return ::mlir::success(); } ::llvm::LogicalResult IteOp::verifyInvariants() { return verifyInvariantsImpl(); } ::llvm::LogicalResult IteOp::inferReturnTypes(::mlir::MLIRContext *context, ::std::optional<::mlir::Location> location, ::mlir::ValueRange operands, ::mlir::DictionaryAttr attributes, ::mlir::PropertyRef properties, ::mlir::RegionRange regions, ::llvm::SmallVectorImpl<::mlir::Type>&inferredReturnTypes) { inferredReturnTypes.resize(1); ::mlir::Builder odsBuilder(context); if (operands.size() <= 2) return ::mlir::failure(); ::mlir::Type odsInferredType0 = operands[2].getType(); inferredReturnTypes[0] = odsInferredType0; return ::mlir::success(); } ::mlir::ParseResult IteOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) { ::mlir::OpAsmParser::UnresolvedOperand condRawOperand{}; ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> condOperands(&condRawOperand, 1); ::llvm::SMLoc condOperandsLoc; (void)condOperandsLoc; ::mlir::OpAsmParser::UnresolvedOperand thenValueRawOperand{}; ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> thenValueOperands(&thenValueRawOperand, 1); ::llvm::SMLoc thenValueOperandsLoc; (void)thenValueOperandsLoc; ::mlir::OpAsmParser::UnresolvedOperand elseValueRawOperand{}; ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> elseValueOperands(&elseValueRawOperand, 1); ::llvm::SMLoc elseValueOperandsLoc; (void)elseValueOperandsLoc; ::mlir::Type resultRawType{}; ::llvm::ArrayRef<::mlir::Type> resultTypes(&resultRawType, 1); condOperandsLoc = parser.getCurrentLocation(); if (parser.parseOperand(condRawOperand)) return ::mlir::failure(); if (parser.parseComma()) return ::mlir::failure(); thenValueOperandsLoc = parser.getCurrentLocation(); if (parser.parseOperand(thenValueRawOperand)) return ::mlir::failure(); if (parser.parseComma()) return ::mlir::failure(); elseValueOperandsLoc = parser.getCurrentLocation(); if (parser.parseOperand(elseValueRawOperand)) return ::mlir::failure(); { auto loc = parser.getCurrentLocation();(void)loc; if (parser.parseOptionalAttrDict(result.attributes)) return ::mlir::failure(); if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() { return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op "; }))) return ::mlir::failure(); } if (parser.parseColon()) return ::mlir::failure(); if (parser.parseType(resultRawType)) return ::mlir::failure(); ::mlir::Type odsBuildableType0 = parser.getBuilder().getType(); result.addTypes(resultTypes); if (parser.resolveOperands(condOperands, odsBuildableType0, condOperandsLoc, result.operands)) return ::mlir::failure(); if (parser.resolveOperands(thenValueOperands, resultTypes[0], thenValueOperandsLoc, result.operands)) return ::mlir::failure(); if (parser.resolveOperands(elseValueOperands, resultTypes[0], elseValueOperandsLoc, result.operands)) return ::mlir::failure(); return ::mlir::success(); } void IteOp::print(::mlir::OpAsmPrinter &_odsPrinter) { _odsPrinter << ' '; _odsPrinter << getCond(); _odsPrinter << ","; _odsPrinter << ' '; _odsPrinter << getThenValue(); _odsPrinter << ","; _odsPrinter << ' '; _odsPrinter << getElseValue(); ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs; _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs); _odsPrinter << ' ' << ":"; _odsPrinter << ' '; _odsPrinter << getResult().getType(); } void IteOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) { } } // namespace mlir::smt MLIR_DEFINE_EXPLICIT_TYPE_ID(mlir::smt::IteOp) namespace mlir::smt { //===----------------------------------------------------------------------===// // mlir::smt::NotOp definitions //===----------------------------------------------------------------------===// namespace detail { NotOpGenericAdaptorBase::NotOpGenericAdaptorBase(NotOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {} } // namespace detail NotOpAdaptor::NotOpAdaptor(NotOp op) : NotOpGenericAdaptor(op->getOperands(), op) {} ::llvm::LogicalResult NotOpAdaptor::verify(::mlir::Location loc) { return ::mlir::success(); } ::llvm::LogicalResult NotOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) { ::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr); if (!dict) { emitError() << "expected DictionaryAttr to set properties"; return ::mlir::failure(); } return ::mlir::success(); } ::mlir::Attribute NotOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) { ::mlir::SmallVector<::mlir::NamedAttribute> attrs; ::mlir::Builder odsBuilder{ctx}; if (!attrs.empty()) return odsBuilder.getDictionaryAttr(attrs); return {}; } llvm::hash_code NotOp::computePropertiesHash(const Properties &prop) { using llvm::hash_value; return llvm::hash_combine(); } std::optional NotOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) { return std::nullopt; } void NotOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) { } void NotOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) { } ::llvm::LogicalResult NotOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) { return ::mlir::success(); } void NotOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value input) { odsState.addOperands(input); odsState.addTypes(result); } NotOp NotOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value input) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(result), std::forward(input)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } NotOp NotOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::Value input) { return create(builder, builder.getLoc(), std::forward(result), std::forward(input)); } void NotOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value input) { odsState.addOperands(input); ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes; if (::mlir::succeeded(NotOp::inferReturnTypes(odsBuilder.getContext(), odsState.location, odsState.operands, odsState.attributes.getDictionary(odsState.getContext()), odsState.getRawProperties(), odsState.regions, inferredReturnTypes))) odsState.addTypes(inferredReturnTypes); else ::mlir::detail::reportFatalInferReturnTypesError(odsState); } NotOp NotOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value input) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(input)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } NotOp NotOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value input) { return create(builder, builder.getLoc(), std::forward(input)); } void NotOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input) { odsState.addOperands(input); assert(resultTypes.size() == 1u && "mismatched number of results"); odsState.addTypes(resultTypes); } NotOp NotOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value input) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(resultTypes), std::forward(input)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } NotOp NotOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value input) { return create(builder, builder.getLoc(), std::forward(resultTypes), std::forward(input)); } void NotOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { assert(operands.size() == 1u && "mismatched number of parameters"); odsState.addOperands(operands); odsState.addAttributes(attributes); assert(resultTypes.size() == 1u && "mismatched number of return types"); odsState.addTypes(resultTypes); } NotOp NotOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(resultTypes), std::forward(operands), std::forward(attributes)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } NotOp NotOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { return create(builder, builder.getLoc(), std::forward(resultTypes), std::forward(operands), std::forward(attributes)); } void NotOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { assert(operands.size() == 1u && "mismatched number of parameters"); odsState.addOperands(operands); odsState.addAttributes(attributes); ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes; if (::mlir::succeeded(NotOp::inferReturnTypes(odsBuilder.getContext(), odsState.location, operands, odsState.attributes.getDictionary(odsState.getContext()), odsState.getRawProperties(), odsState.regions, inferredReturnTypes))) { assert(inferredReturnTypes.size() == 1u && "mismatched number of return types"); odsState.addTypes(inferredReturnTypes); } else { ::llvm::report_fatal_error("Failed to infer result type(s)."); } } NotOp NotOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(operands), std::forward(attributes)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } NotOp NotOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { return create(builder, builder.getLoc(), std::forward(operands), std::forward(attributes)); } void NotOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { assert(operands.size() == 1u && "mismatched number of parameters"); odsState.addOperands(operands); odsState.useProperties(const_cast(properties)); odsState.addAttributes(discardableAttributes); assert(resultTypes.size() == 1u && "mismatched number of return types"); odsState.addTypes(resultTypes); } NotOp NotOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(resultTypes), std::forward(operands), std::forward(properties), std::forward(discardableAttributes)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } NotOp NotOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { return create(builder, builder.getLoc(), std::forward(resultTypes), std::forward(operands), std::forward(properties), std::forward(discardableAttributes)); } void NotOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { assert(operands.size() == 1u && "mismatched number of parameters"); odsState.addOperands(operands); odsState.useProperties(const_cast(properties)); odsState.addAttributes(discardableAttributes); ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes; if (::mlir::succeeded(NotOp::inferReturnTypes(odsBuilder.getContext(), odsState.location, operands, odsState.attributes.getDictionary(odsState.getContext()), odsState.getRawProperties(), odsState.regions, inferredReturnTypes))) { assert(inferredReturnTypes.size() == 1u && "mismatched number of return types"); odsState.addTypes(inferredReturnTypes); } else { ::llvm::report_fatal_error("Failed to infer result type(s)."); } } NotOp NotOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(operands), std::forward(properties), std::forward(discardableAttributes)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } NotOp NotOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { return create(builder, builder.getLoc(), std::forward(operands), std::forward(properties), std::forward(discardableAttributes)); } ::llvm::LogicalResult NotOp::verifyInvariantsImpl() { { unsigned index = 0; (void)index; auto valueGroup0 = getODSOperands(0); for (auto v : valueGroup0) { if (::mlir::failed(__mlir_ods_local_type_constraint_SMT2(*this, v.getType(), "operand", index++))) return ::mlir::failure(); } } { unsigned index = 0; (void)index; auto valueGroup0 = getODSResults(0); for (auto v : valueGroup0) { if (::mlir::failed(__mlir_ods_local_type_constraint_SMT2(*this, v.getType(), "result", index++))) return ::mlir::failure(); } } return ::mlir::success(); } ::llvm::LogicalResult NotOp::verifyInvariants() { return verifyInvariantsImpl(); } ::llvm::LogicalResult NotOp::inferReturnTypes(::mlir::MLIRContext *context, ::std::optional<::mlir::Location> location, ::mlir::ValueRange operands, ::mlir::DictionaryAttr attributes, ::mlir::PropertyRef properties, ::mlir::RegionRange regions, ::llvm::SmallVectorImpl<::mlir::Type>&inferredReturnTypes) { inferredReturnTypes.resize(1); ::mlir::Builder odsBuilder(context); ::mlir::Type odsInferredType0 = odsBuilder.getType(); inferredReturnTypes[0] = odsInferredType0; return ::mlir::success(); } ::mlir::ParseResult NotOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) { ::mlir::OpAsmParser::UnresolvedOperand inputRawOperand{}; ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> inputOperands(&inputRawOperand, 1); ::llvm::SMLoc inputOperandsLoc; (void)inputOperandsLoc; inputOperandsLoc = parser.getCurrentLocation(); if (parser.parseOperand(inputRawOperand)) return ::mlir::failure(); { auto loc = parser.getCurrentLocation();(void)loc; if (parser.parseOptionalAttrDict(result.attributes)) return ::mlir::failure(); if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() { return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op "; }))) return ::mlir::failure(); } ::mlir::Type odsBuildableType0 = parser.getBuilder().getType(); result.addTypes(odsBuildableType0); if (parser.resolveOperands(inputOperands, odsBuildableType0, inputOperandsLoc, result.operands)) return ::mlir::failure(); return ::mlir::success(); } void NotOp::print(::mlir::OpAsmPrinter &_odsPrinter) { _odsPrinter << ' '; _odsPrinter << getInput(); ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs; _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs); } void NotOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) { } } // namespace mlir::smt MLIR_DEFINE_EXPLICIT_TYPE_ID(mlir::smt::NotOp) namespace mlir::smt { //===----------------------------------------------------------------------===// // mlir::smt::OrOp definitions //===----------------------------------------------------------------------===// namespace detail { OrOpGenericAdaptorBase::OrOpGenericAdaptorBase(OrOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {} std::pair OrOpGenericAdaptorBase::getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize) { bool isVariadic[] = {true}; int prevVariadicCount = 0; for (unsigned i = 0; i < index; ++i) if (isVariadic[i]) ++prevVariadicCount; // Calculate how many dynamic values a static variadic operand corresponds to. // This assumes all static variadic operands have the same dynamic value count. int variadicSize = (odsOperandsSize - 0) / 1; // `index` passed in as the parameter is the static index which counts each // operand (variadic or not) as size 1. So here for each previous static variadic // operand, we need to offset by (variadicSize - 1) to get where the dynamic // value pack for this static operand starts. int start = index + (variadicSize - 1) * prevVariadicCount; int size = isVariadic[index] ? variadicSize : 1; return {start, size}; } } // namespace detail OrOpAdaptor::OrOpAdaptor(OrOp op) : OrOpGenericAdaptor(op->getOperands(), op) {} ::llvm::LogicalResult OrOpAdaptor::verify(::mlir::Location loc) { return ::mlir::success(); } std::pair OrOp::getODSOperandIndexAndLength(unsigned index) { bool isVariadic[] = {true}; int prevVariadicCount = 0; for (unsigned i = 0; i < index; ++i) if (isVariadic[i]) ++prevVariadicCount; // Calculate how many dynamic values a static variadic operand corresponds to. // This assumes all static variadic operands have the same dynamic value count. int variadicSize = (getOperation()->getNumOperands() - 0) / 1; // `index` passed in as the parameter is the static index which counts each // operand (variadic or not) as size 1. So here for each previous static variadic // operand, we need to offset by (variadicSize - 1) to get where the dynamic // value pack for this static operand starts. int start = index + (variadicSize - 1) * prevVariadicCount; int size = isVariadic[index] ? variadicSize : 1; return {start, size}; } ::mlir::MutableOperandRange OrOp::getInputsMutable() { auto range = getODSOperandIndexAndLength(0); auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second); return mutableRange; } ::llvm::LogicalResult OrOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) { ::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr); if (!dict) { emitError() << "expected DictionaryAttr to set properties"; return ::mlir::failure(); } return ::mlir::success(); } ::mlir::Attribute OrOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) { ::mlir::SmallVector<::mlir::NamedAttribute> attrs; ::mlir::Builder odsBuilder{ctx}; if (!attrs.empty()) return odsBuilder.getDictionaryAttr(attrs); return {}; } llvm::hash_code OrOp::computePropertiesHash(const Properties &prop) { using llvm::hash_value; return llvm::hash_combine(); } std::optional OrOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) { return std::nullopt; } void OrOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) { } void OrOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) { } ::llvm::LogicalResult OrOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) { return ::mlir::success(); } void OrOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, mlir::Value lhs, mlir::Value rhs) { build(odsBuilder, odsState, ValueRange{lhs, rhs}); } OrOp OrOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, mlir::Value lhs, mlir::Value rhs) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(lhs), std::forward(rhs)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } OrOp OrOp::create(::mlir::ImplicitLocOpBuilder &builder, mlir::Value lhs, mlir::Value rhs) { return create(builder, builder.getLoc(), std::forward(lhs), std::forward(rhs)); } void OrOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::ValueRange inputs) { odsState.addOperands(inputs); odsState.addTypes(result); } OrOp OrOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::ValueRange inputs) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(result), std::forward(inputs)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } OrOp OrOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::ValueRange inputs) { return create(builder, builder.getLoc(), std::forward(result), std::forward(inputs)); } void OrOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { odsState.addOperands(operands); odsState.addAttributes(attributes); assert(resultTypes.size() == 1u && "mismatched number of return types"); odsState.addTypes(resultTypes); } OrOp OrOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(resultTypes), std::forward(operands), std::forward(attributes)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } OrOp OrOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { return create(builder, builder.getLoc(), std::forward(resultTypes), std::forward(operands), std::forward(attributes)); } void OrOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { odsState.addOperands(operands); odsState.addAttributes(attributes); ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes; if (::mlir::succeeded(OrOp::inferReturnTypes(odsBuilder.getContext(), odsState.location, operands, odsState.attributes.getDictionary(odsState.getContext()), odsState.getRawProperties(), odsState.regions, inferredReturnTypes))) { assert(inferredReturnTypes.size() == 1u && "mismatched number of return types"); odsState.addTypes(inferredReturnTypes); } else { ::llvm::report_fatal_error("Failed to infer result type(s)."); } } OrOp OrOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(operands), std::forward(attributes)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } OrOp OrOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { return create(builder, builder.getLoc(), std::forward(operands), std::forward(attributes)); } void OrOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { odsState.addOperands(operands); odsState.useProperties(const_cast(properties)); odsState.addAttributes(discardableAttributes); assert(resultTypes.size() == 1u && "mismatched number of return types"); odsState.addTypes(resultTypes); } OrOp OrOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(resultTypes), std::forward(operands), std::forward(properties), std::forward(discardableAttributes)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } OrOp OrOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { return create(builder, builder.getLoc(), std::forward(resultTypes), std::forward(operands), std::forward(properties), std::forward(discardableAttributes)); } void OrOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { odsState.addOperands(operands); odsState.useProperties(const_cast(properties)); odsState.addAttributes(discardableAttributes); ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes; if (::mlir::succeeded(OrOp::inferReturnTypes(odsBuilder.getContext(), odsState.location, operands, odsState.attributes.getDictionary(odsState.getContext()), odsState.getRawProperties(), odsState.regions, inferredReturnTypes))) { assert(inferredReturnTypes.size() == 1u && "mismatched number of return types"); odsState.addTypes(inferredReturnTypes); } else { ::llvm::report_fatal_error("Failed to infer result type(s)."); } } OrOp OrOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(operands), std::forward(properties), std::forward(discardableAttributes)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } OrOp OrOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { return create(builder, builder.getLoc(), std::forward(operands), std::forward(properties), std::forward(discardableAttributes)); } ::llvm::LogicalResult OrOp::verifyInvariantsImpl() { { unsigned index = 0; (void)index; auto valueGroup0 = getODSOperands(0); for (auto v : valueGroup0) { if (::mlir::failed(__mlir_ods_local_type_constraint_SMT1(*this, v.getType(), "operand", index++))) return ::mlir::failure(); } } { unsigned index = 0; (void)index; auto valueGroup0 = getODSResults(0); for (auto v : valueGroup0) { if (::mlir::failed(__mlir_ods_local_type_constraint_SMT2(*this, v.getType(), "result", index++))) return ::mlir::failure(); } } return ::mlir::success(); } ::llvm::LogicalResult OrOp::verifyInvariants() { return verifyInvariantsImpl(); } ::llvm::LogicalResult OrOp::inferReturnTypes(::mlir::MLIRContext *context, ::std::optional<::mlir::Location> location, ::mlir::ValueRange operands, ::mlir::DictionaryAttr attributes, ::mlir::PropertyRef properties, ::mlir::RegionRange regions, ::llvm::SmallVectorImpl<::mlir::Type>&inferredReturnTypes) { inferredReturnTypes.resize(1); ::mlir::Builder odsBuilder(context); ::mlir::Type odsInferredType0 = odsBuilder.getType(); inferredReturnTypes[0] = odsInferredType0; return ::mlir::success(); } ::mlir::ParseResult OrOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) { ::llvm::SmallVector<::mlir::OpAsmParser::UnresolvedOperand, 4> inputsOperands; ::llvm::SMLoc inputsOperandsLoc; (void)inputsOperandsLoc; inputsOperandsLoc = parser.getCurrentLocation(); if (parser.parseOperandList(inputsOperands)) return ::mlir::failure(); { auto loc = parser.getCurrentLocation();(void)loc; if (parser.parseOptionalAttrDict(result.attributes)) return ::mlir::failure(); if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() { return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op "; }))) return ::mlir::failure(); } ::mlir::Type odsBuildableType0 = parser.getBuilder().getType(); result.addTypes(odsBuildableType0); if (parser.resolveOperands(inputsOperands, odsBuildableType0, inputsOperandsLoc, result.operands)) return ::mlir::failure(); return ::mlir::success(); } void OrOp::print(::mlir::OpAsmPrinter &_odsPrinter) { _odsPrinter << ' '; _odsPrinter << getInputs(); ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs; _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs); } void OrOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) { } } // namespace mlir::smt MLIR_DEFINE_EXPLICIT_TYPE_ID(mlir::smt::OrOp) namespace mlir::smt { //===----------------------------------------------------------------------===// // mlir::smt::PopOp definitions //===----------------------------------------------------------------------===// namespace detail { PopOpGenericAdaptorBase::PopOpGenericAdaptorBase(PopOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {} uint32_t PopOpGenericAdaptorBase::getCount() { auto attr = getCountAttr(); return attr.getValue().getZExtValue(); } } // namespace detail PopOpAdaptor::PopOpAdaptor(PopOp op) : PopOpGenericAdaptor(op->getOperands(), op) {} ::llvm::LogicalResult PopOpAdaptor::verify(::mlir::Location loc) { auto tblgen_count = getProperties().count; (void)tblgen_count; if (!tblgen_count) return emitError(loc, "'smt.pop' op requires attribute 'count'"); if (tblgen_count && !((((::llvm::isa<::mlir::IntegerAttr>(tblgen_count))) && ((::llvm::cast<::mlir::IntegerAttr>(tblgen_count).getType().isSignlessInteger(32)))) && ((!::llvm::cast<::mlir::IntegerAttr>(tblgen_count).getValue().isNegative())))) return emitError(loc, "'smt.pop' op attribute 'count' failed to satisfy constraint: 32-bit signless integer attribute whose value is non-negative"); return ::mlir::success(); } ::llvm::LogicalResult PopOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) { ::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr); if (!dict) { emitError() << "expected DictionaryAttr to set properties"; return ::mlir::failure(); } { auto &propStorage = prop.count; auto attr = dict.get("count"); if (attr) { auto convertedAttr = ::llvm::dyn_cast>(attr); if (convertedAttr) { propStorage = convertedAttr; } else { emitError() << "Invalid attribute `count` in property conversion: " << attr; return ::mlir::failure(); } } } return ::mlir::success(); } ::mlir::Attribute PopOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) { ::mlir::SmallVector<::mlir::NamedAttribute> attrs; ::mlir::Builder odsBuilder{ctx}; { const auto &propStorage = prop.count; if (propStorage) attrs.push_back(odsBuilder.getNamedAttr("count", propStorage)); } if (!attrs.empty()) return odsBuilder.getDictionaryAttr(attrs); return {}; } llvm::hash_code PopOp::computePropertiesHash(const Properties &prop) { using llvm::hash_value; return llvm::hash_combine( llvm::hash_value(prop.count.getAsOpaquePointer())); } std::optional PopOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) { if (name == "count") return prop.count; return std::nullopt; } void PopOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) { if (name == "count") { prop.count = ::llvm::dyn_cast_or_null>(value); return; } } void PopOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) { if (prop.count) attrs.append("count", prop.count); } ::llvm::LogicalResult PopOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) { { ::mlir::Attribute attr = attrs.get(getCountAttrName(opName)); if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_SMT10(attr, "count", emitError))) return ::mlir::failure(); } return ::mlir::success(); } ::llvm::LogicalResult PopOp::readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state) { auto &prop = state.getOrAddProperties(); (void)prop; if (::mlir::failed(reader.readAttribute(prop.count))) return ::mlir::failure(); return ::mlir::success(); } void PopOp::writeProperties(::mlir::DialectBytecodeWriter &writer) { auto &prop = getProperties(); (void)prop; writer.writeAttribute(prop.count); } uint32_t PopOp::getCount() { auto attr = getCountAttr(); return attr.getValue().getZExtValue(); } void PopOp::setCount(uint32_t attrValue) { getProperties().count = ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(32), attrValue); } void PopOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::IntegerAttr count) { odsState.getOrAddProperties().count = count; } PopOp PopOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::IntegerAttr count) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(count)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } PopOp PopOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::IntegerAttr count) { return create(builder, builder.getLoc(), std::forward(count)); } void PopOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::IntegerAttr count) { odsState.getOrAddProperties().count = count; assert(resultTypes.size() == 0u && "mismatched number of results"); odsState.addTypes(resultTypes); } PopOp PopOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::IntegerAttr count) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(resultTypes), std::forward(count)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } PopOp PopOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::IntegerAttr count) { return create(builder, builder.getLoc(), std::forward(resultTypes), std::forward(count)); } void PopOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, uint32_t count) { odsState.getOrAddProperties().count = odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(32), count); } PopOp PopOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, uint32_t count) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(count)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } PopOp PopOp::create(::mlir::ImplicitLocOpBuilder &builder, uint32_t count) { return create(builder, builder.getLoc(), std::forward(count)); } void PopOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, uint32_t count) { odsState.getOrAddProperties().count = odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(32), count); assert(resultTypes.size() == 0u && "mismatched number of results"); odsState.addTypes(resultTypes); } PopOp PopOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, uint32_t count) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(resultTypes), std::forward(count)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } PopOp PopOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, uint32_t count) { return create(builder, builder.getLoc(), std::forward(resultTypes), std::forward(count)); } void PopOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { assert(operands.size() == 0u && "mismatched number of parameters"); odsState.addOperands(operands); odsState.addAttributes(attributes); assert(resultTypes.size() == 0u && "mismatched number of return types"); odsState.addTypes(resultTypes); if (!attributes.empty()) { (void)odsState.getOrAddProperties(); ::mlir::PropertyRef properties = odsState.getRawProperties(); std::optional<::mlir::RegisteredOperationName> info = odsState.name.getRegisteredInfo(); if (failed(info->setOpPropertiesFromAttribute(odsState.name, properties, odsState.attributes.getDictionary(odsState.getContext()), nullptr))) ::llvm::report_fatal_error("Property conversion failed."); } } PopOp PopOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(resultTypes), std::forward(operands), std::forward(attributes)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } PopOp PopOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { return create(builder, builder.getLoc(), std::forward(resultTypes), std::forward(operands), std::forward(attributes)); } void PopOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { assert(operands.size() == 0u && "mismatched number of parameters"); odsState.addOperands(operands); odsState.useProperties(const_cast(properties)); odsState.addAttributes(discardableAttributes); assert(resultTypes.size() == 0u && "mismatched number of return types"); odsState.addTypes(resultTypes); } PopOp PopOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(resultTypes), std::forward(operands), std::forward(properties), std::forward(discardableAttributes)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } PopOp PopOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { return create(builder, builder.getLoc(), std::forward(resultTypes), std::forward(operands), std::forward(properties), std::forward(discardableAttributes)); } ::llvm::LogicalResult PopOp::verifyInvariantsImpl() { auto tblgen_count = getProperties().count; (void)tblgen_count; if (!tblgen_count) return emitOpError("requires attribute 'count'"); if (::mlir::failed(__mlir_ods_local_attr_constraint_SMT10(*this, tblgen_count, "count"))) return ::mlir::failure(); return ::mlir::success(); } ::llvm::LogicalResult PopOp::verifyInvariants() { return verifyInvariantsImpl(); } ::mlir::ParseResult PopOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) { ::mlir::IntegerAttr countAttr; if (parser.parseCustomAttributeWithFallback(countAttr, parser.getBuilder().getIntegerType(32))) { return ::mlir::failure(); } if (countAttr) result.getOrAddProperties().count = countAttr; { auto loc = parser.getCurrentLocation();(void)loc; if (parser.parseOptionalAttrDict(result.attributes)) return ::mlir::failure(); if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() { return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op "; }))) return ::mlir::failure(); } return ::mlir::success(); } void PopOp::print(::mlir::OpAsmPrinter &_odsPrinter) { _odsPrinter << ' '; _odsPrinter.printAttributeWithoutType(getCountAttr()); ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs; elidedAttrs.push_back("count"); _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs); } } // namespace mlir::smt MLIR_DEFINE_EXPLICIT_TYPE_ID(mlir::smt::PopOp) MLIR_DEFINE_EXPLICIT_TYPE_ID(mlir::smt::detail::PopOpGenericAdaptorBase::Properties) namespace mlir::smt { //===----------------------------------------------------------------------===// // mlir::smt::PushOp definitions //===----------------------------------------------------------------------===// namespace detail { PushOpGenericAdaptorBase::PushOpGenericAdaptorBase(PushOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {} uint32_t PushOpGenericAdaptorBase::getCount() { auto attr = getCountAttr(); return attr.getValue().getZExtValue(); } } // namespace detail PushOpAdaptor::PushOpAdaptor(PushOp op) : PushOpGenericAdaptor(op->getOperands(), op) {} ::llvm::LogicalResult PushOpAdaptor::verify(::mlir::Location loc) { auto tblgen_count = getProperties().count; (void)tblgen_count; if (!tblgen_count) return emitError(loc, "'smt.push' op requires attribute 'count'"); if (tblgen_count && !((((::llvm::isa<::mlir::IntegerAttr>(tblgen_count))) && ((::llvm::cast<::mlir::IntegerAttr>(tblgen_count).getType().isSignlessInteger(32)))) && ((!::llvm::cast<::mlir::IntegerAttr>(tblgen_count).getValue().isNegative())))) return emitError(loc, "'smt.push' op attribute 'count' failed to satisfy constraint: 32-bit signless integer attribute whose value is non-negative"); return ::mlir::success(); } ::llvm::LogicalResult PushOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) { ::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr); if (!dict) { emitError() << "expected DictionaryAttr to set properties"; return ::mlir::failure(); } { auto &propStorage = prop.count; auto attr = dict.get("count"); if (attr) { auto convertedAttr = ::llvm::dyn_cast>(attr); if (convertedAttr) { propStorage = convertedAttr; } else { emitError() << "Invalid attribute `count` in property conversion: " << attr; return ::mlir::failure(); } } } return ::mlir::success(); } ::mlir::Attribute PushOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) { ::mlir::SmallVector<::mlir::NamedAttribute> attrs; ::mlir::Builder odsBuilder{ctx}; { const auto &propStorage = prop.count; if (propStorage) attrs.push_back(odsBuilder.getNamedAttr("count", propStorage)); } if (!attrs.empty()) return odsBuilder.getDictionaryAttr(attrs); return {}; } llvm::hash_code PushOp::computePropertiesHash(const Properties &prop) { using llvm::hash_value; return llvm::hash_combine( llvm::hash_value(prop.count.getAsOpaquePointer())); } std::optional PushOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) { if (name == "count") return prop.count; return std::nullopt; } void PushOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) { if (name == "count") { prop.count = ::llvm::dyn_cast_or_null>(value); return; } } void PushOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) { if (prop.count) attrs.append("count", prop.count); } ::llvm::LogicalResult PushOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) { { ::mlir::Attribute attr = attrs.get(getCountAttrName(opName)); if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_SMT10(attr, "count", emitError))) return ::mlir::failure(); } return ::mlir::success(); } ::llvm::LogicalResult PushOp::readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state) { auto &prop = state.getOrAddProperties(); (void)prop; if (::mlir::failed(reader.readAttribute(prop.count))) return ::mlir::failure(); return ::mlir::success(); } void PushOp::writeProperties(::mlir::DialectBytecodeWriter &writer) { auto &prop = getProperties(); (void)prop; writer.writeAttribute(prop.count); } uint32_t PushOp::getCount() { auto attr = getCountAttr(); return attr.getValue().getZExtValue(); } void PushOp::setCount(uint32_t attrValue) { getProperties().count = ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(32), attrValue); } void PushOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::IntegerAttr count) { odsState.getOrAddProperties().count = count; } PushOp PushOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::IntegerAttr count) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(count)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } PushOp PushOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::IntegerAttr count) { return create(builder, builder.getLoc(), std::forward(count)); } void PushOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::IntegerAttr count) { odsState.getOrAddProperties().count = count; assert(resultTypes.size() == 0u && "mismatched number of results"); odsState.addTypes(resultTypes); } PushOp PushOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::IntegerAttr count) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(resultTypes), std::forward(count)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } PushOp PushOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::IntegerAttr count) { return create(builder, builder.getLoc(), std::forward(resultTypes), std::forward(count)); } void PushOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, uint32_t count) { odsState.getOrAddProperties().count = odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(32), count); } PushOp PushOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, uint32_t count) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(count)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } PushOp PushOp::create(::mlir::ImplicitLocOpBuilder &builder, uint32_t count) { return create(builder, builder.getLoc(), std::forward(count)); } void PushOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, uint32_t count) { odsState.getOrAddProperties().count = odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(32), count); assert(resultTypes.size() == 0u && "mismatched number of results"); odsState.addTypes(resultTypes); } PushOp PushOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, uint32_t count) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(resultTypes), std::forward(count)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } PushOp PushOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, uint32_t count) { return create(builder, builder.getLoc(), std::forward(resultTypes), std::forward(count)); } void PushOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { assert(operands.size() == 0u && "mismatched number of parameters"); odsState.addOperands(operands); odsState.addAttributes(attributes); assert(resultTypes.size() == 0u && "mismatched number of return types"); odsState.addTypes(resultTypes); if (!attributes.empty()) { (void)odsState.getOrAddProperties(); ::mlir::PropertyRef properties = odsState.getRawProperties(); std::optional<::mlir::RegisteredOperationName> info = odsState.name.getRegisteredInfo(); if (failed(info->setOpPropertiesFromAttribute(odsState.name, properties, odsState.attributes.getDictionary(odsState.getContext()), nullptr))) ::llvm::report_fatal_error("Property conversion failed."); } } PushOp PushOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(resultTypes), std::forward(operands), std::forward(attributes)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } PushOp PushOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { return create(builder, builder.getLoc(), std::forward(resultTypes), std::forward(operands), std::forward(attributes)); } void PushOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { assert(operands.size() == 0u && "mismatched number of parameters"); odsState.addOperands(operands); odsState.useProperties(const_cast(properties)); odsState.addAttributes(discardableAttributes); assert(resultTypes.size() == 0u && "mismatched number of return types"); odsState.addTypes(resultTypes); } PushOp PushOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(resultTypes), std::forward(operands), std::forward(properties), std::forward(discardableAttributes)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } PushOp PushOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { return create(builder, builder.getLoc(), std::forward(resultTypes), std::forward(operands), std::forward(properties), std::forward(discardableAttributes)); } ::llvm::LogicalResult PushOp::verifyInvariantsImpl() { auto tblgen_count = getProperties().count; (void)tblgen_count; if (!tblgen_count) return emitOpError("requires attribute 'count'"); if (::mlir::failed(__mlir_ods_local_attr_constraint_SMT10(*this, tblgen_count, "count"))) return ::mlir::failure(); return ::mlir::success(); } ::llvm::LogicalResult PushOp::verifyInvariants() { return verifyInvariantsImpl(); } ::mlir::ParseResult PushOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) { ::mlir::IntegerAttr countAttr; if (parser.parseCustomAttributeWithFallback(countAttr, parser.getBuilder().getIntegerType(32))) { return ::mlir::failure(); } if (countAttr) result.getOrAddProperties().count = countAttr; { auto loc = parser.getCurrentLocation();(void)loc; if (parser.parseOptionalAttrDict(result.attributes)) return ::mlir::failure(); if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() { return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op "; }))) return ::mlir::failure(); } return ::mlir::success(); } void PushOp::print(::mlir::OpAsmPrinter &_odsPrinter) { _odsPrinter << ' '; _odsPrinter.printAttributeWithoutType(getCountAttr()); ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs; elidedAttrs.push_back("count"); _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs); } } // namespace mlir::smt MLIR_DEFINE_EXPLICIT_TYPE_ID(mlir::smt::PushOp) MLIR_DEFINE_EXPLICIT_TYPE_ID(mlir::smt::detail::PushOpGenericAdaptorBase::Properties) namespace mlir::smt { //===----------------------------------------------------------------------===// // mlir::smt::RepeatOp definitions //===----------------------------------------------------------------------===// namespace detail { RepeatOpGenericAdaptorBase::RepeatOpGenericAdaptorBase(RepeatOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {} } // namespace detail RepeatOpAdaptor::RepeatOpAdaptor(RepeatOp op) : RepeatOpGenericAdaptor(op->getOperands(), op) {} ::llvm::LogicalResult RepeatOpAdaptor::verify(::mlir::Location loc) { return ::mlir::success(); } ::llvm::LogicalResult RepeatOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) { ::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr); if (!dict) { emitError() << "expected DictionaryAttr to set properties"; return ::mlir::failure(); } return ::mlir::success(); } ::mlir::Attribute RepeatOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) { ::mlir::SmallVector<::mlir::NamedAttribute> attrs; ::mlir::Builder odsBuilder{ctx}; if (!attrs.empty()) return odsBuilder.getDictionaryAttr(attrs); return {}; } llvm::hash_code RepeatOp::computePropertiesHash(const Properties &prop) { using llvm::hash_value; return llvm::hash_combine(); } std::optional RepeatOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) { return std::nullopt; } void RepeatOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) { } void RepeatOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) { } ::llvm::LogicalResult RepeatOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) { return ::mlir::success(); } RepeatOp RepeatOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, unsigned count, mlir::Value input) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(count), std::forward(input)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } RepeatOp RepeatOp::create(::mlir::ImplicitLocOpBuilder &builder, unsigned count, mlir::Value input) { return create(builder, builder.getLoc(), std::forward(count), std::forward(input)); } void RepeatOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value input) { odsState.addOperands(input); odsState.addTypes(result); } RepeatOp RepeatOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value input) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(result), std::forward(input)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } RepeatOp RepeatOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::Value input) { return create(builder, builder.getLoc(), std::forward(result), std::forward(input)); } void RepeatOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input) { odsState.addOperands(input); assert(resultTypes.size() == 1u && "mismatched number of results"); odsState.addTypes(resultTypes); } RepeatOp RepeatOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value input) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(resultTypes), std::forward(input)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } RepeatOp RepeatOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value input) { return create(builder, builder.getLoc(), std::forward(resultTypes), std::forward(input)); } void RepeatOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { assert(operands.size() == 1u && "mismatched number of parameters"); odsState.addOperands(operands); odsState.addAttributes(attributes); assert(resultTypes.size() == 1u && "mismatched number of return types"); odsState.addTypes(resultTypes); } RepeatOp RepeatOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(resultTypes), std::forward(operands), std::forward(attributes)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } RepeatOp RepeatOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { return create(builder, builder.getLoc(), std::forward(resultTypes), std::forward(operands), std::forward(attributes)); } void RepeatOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { assert(operands.size() == 1u && "mismatched number of parameters"); odsState.addOperands(operands); odsState.useProperties(const_cast(properties)); odsState.addAttributes(discardableAttributes); assert(resultTypes.size() == 1u && "mismatched number of return types"); odsState.addTypes(resultTypes); } RepeatOp RepeatOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(resultTypes), std::forward(operands), std::forward(properties), std::forward(discardableAttributes)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } RepeatOp RepeatOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { return create(builder, builder.getLoc(), std::forward(resultTypes), std::forward(operands), std::forward(properties), std::forward(discardableAttributes)); } ::llvm::LogicalResult RepeatOp::verifyInvariantsImpl() { { unsigned index = 0; (void)index; auto valueGroup0 = getODSOperands(0); for (auto v : valueGroup0) { if (::mlir::failed(__mlir_ods_local_type_constraint_SMT8(*this, v.getType(), "operand", index++))) return ::mlir::failure(); } } { unsigned index = 0; (void)index; auto valueGroup0 = getODSResults(0); for (auto v : valueGroup0) { if (::mlir::failed(__mlir_ods_local_type_constraint_SMT8(*this, v.getType(), "result", index++))) return ::mlir::failure(); } } return ::mlir::success(); } ::llvm::LogicalResult RepeatOp::verifyInvariants() { if(::mlir::succeeded(verifyInvariantsImpl()) && ::mlir::succeeded(verify())) return ::mlir::success(); return ::mlir::failure(); } ::llvm::LogicalResult RepeatOp::setPropertiesFromParsedAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) { ::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr); if (!dict) { emitError() << "expected DictionaryAttr to set properties"; return ::mlir::failure(); } // keep track of used keys in the input dictionary to be able to error out // if there are some unknown ones. ::mlir::DenseSet<::mlir::StringAttr> usedKeys; ::mlir::MLIRContext *ctx = dict.getContext(); (void)ctx; for (::mlir::NamedAttribute attr : dict) { if (!usedKeys.contains(attr.getName())) return emitError() << "unknown key '" << attr.getName() << "' when parsing properties dictionary"; } return ::mlir::success(); } void RepeatOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) { } } // namespace mlir::smt MLIR_DEFINE_EXPLICIT_TYPE_ID(mlir::smt::RepeatOp) namespace mlir::smt { //===----------------------------------------------------------------------===// // mlir::smt::ResetOp definitions //===----------------------------------------------------------------------===// namespace detail { ResetOpGenericAdaptorBase::ResetOpGenericAdaptorBase(ResetOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {} } // namespace detail ResetOpAdaptor::ResetOpAdaptor(ResetOp op) : ResetOpGenericAdaptor(op->getOperands(), op) {} ::llvm::LogicalResult ResetOpAdaptor::verify(::mlir::Location loc) { return ::mlir::success(); } ::llvm::LogicalResult ResetOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) { ::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr); if (!dict) { emitError() << "expected DictionaryAttr to set properties"; return ::mlir::failure(); } return ::mlir::success(); } ::mlir::Attribute ResetOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) { ::mlir::SmallVector<::mlir::NamedAttribute> attrs; ::mlir::Builder odsBuilder{ctx}; if (!attrs.empty()) return odsBuilder.getDictionaryAttr(attrs); return {}; } llvm::hash_code ResetOp::computePropertiesHash(const Properties &prop) { using llvm::hash_value; return llvm::hash_combine(); } std::optional ResetOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) { return std::nullopt; } void ResetOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) { } void ResetOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) { } ::llvm::LogicalResult ResetOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) { return ::mlir::success(); } void ResetOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState) { } ResetOp ResetOp::create(::mlir::OpBuilder &builder, ::mlir::Location location) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } ResetOp ResetOp::create(::mlir::ImplicitLocOpBuilder &builder) { return create(builder, builder.getLoc()); } void ResetOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes) { assert(resultTypes.size() == 0u && "mismatched number of results"); odsState.addTypes(resultTypes); } ResetOp ResetOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(resultTypes)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } ResetOp ResetOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes) { return create(builder, builder.getLoc(), std::forward(resultTypes)); } void ResetOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { assert(operands.size() == 0u && "mismatched number of parameters"); odsState.addOperands(operands); odsState.addAttributes(attributes); assert(resultTypes.size() == 0u && "mismatched number of return types"); odsState.addTypes(resultTypes); } ResetOp ResetOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(resultTypes), std::forward(operands), std::forward(attributes)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } ResetOp ResetOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { return create(builder, builder.getLoc(), std::forward(resultTypes), std::forward(operands), std::forward(attributes)); } void ResetOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { assert(operands.size() == 0u && "mismatched number of parameters"); odsState.addOperands(operands); odsState.useProperties(const_cast(properties)); odsState.addAttributes(discardableAttributes); assert(resultTypes.size() == 0u && "mismatched number of return types"); odsState.addTypes(resultTypes); } ResetOp ResetOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(resultTypes), std::forward(operands), std::forward(properties), std::forward(discardableAttributes)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } ResetOp ResetOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { return create(builder, builder.getLoc(), std::forward(resultTypes), std::forward(operands), std::forward(properties), std::forward(discardableAttributes)); } ::llvm::LogicalResult ResetOp::verifyInvariantsImpl() { return ::mlir::success(); } ::llvm::LogicalResult ResetOp::verifyInvariants() { return verifyInvariantsImpl(); } ::mlir::ParseResult ResetOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) { { auto loc = parser.getCurrentLocation();(void)loc; if (parser.parseOptionalAttrDict(result.attributes)) return ::mlir::failure(); if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() { return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op "; }))) return ::mlir::failure(); } return ::mlir::success(); } void ResetOp::print(::mlir::OpAsmPrinter &_odsPrinter) { ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs; _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs); } } // namespace mlir::smt MLIR_DEFINE_EXPLICIT_TYPE_ID(mlir::smt::ResetOp) namespace mlir::smt { //===----------------------------------------------------------------------===// // mlir::smt::SetLogicOp definitions //===----------------------------------------------------------------------===// namespace detail { SetLogicOpGenericAdaptorBase::SetLogicOpGenericAdaptorBase(SetLogicOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {} ::llvm::StringRef SetLogicOpGenericAdaptorBase::getLogic() { auto attr = getLogicAttr(); return attr.getValue(); } } // namespace detail SetLogicOpAdaptor::SetLogicOpAdaptor(SetLogicOp op) : SetLogicOpGenericAdaptor(op->getOperands(), op) {} ::llvm::LogicalResult SetLogicOpAdaptor::verify(::mlir::Location loc) { auto tblgen_logic = getProperties().logic; (void)tblgen_logic; if (!tblgen_logic) return emitError(loc, "'smt.set_logic' op requires attribute 'logic'"); if (tblgen_logic && !((::llvm::isa<::mlir::StringAttr>(tblgen_logic)))) return emitError(loc, "'smt.set_logic' op attribute 'logic' failed to satisfy constraint: string attribute"); return ::mlir::success(); } ::llvm::LogicalResult SetLogicOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) { ::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr); if (!dict) { emitError() << "expected DictionaryAttr to set properties"; return ::mlir::failure(); } { auto &propStorage = prop.logic; auto attr = dict.get("logic"); if (attr) { auto convertedAttr = ::llvm::dyn_cast>(attr); if (convertedAttr) { propStorage = convertedAttr; } else { emitError() << "Invalid attribute `logic` in property conversion: " << attr; return ::mlir::failure(); } } } return ::mlir::success(); } ::mlir::Attribute SetLogicOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) { ::mlir::SmallVector<::mlir::NamedAttribute> attrs; ::mlir::Builder odsBuilder{ctx}; { const auto &propStorage = prop.logic; if (propStorage) attrs.push_back(odsBuilder.getNamedAttr("logic", propStorage)); } if (!attrs.empty()) return odsBuilder.getDictionaryAttr(attrs); return {}; } llvm::hash_code SetLogicOp::computePropertiesHash(const Properties &prop) { using llvm::hash_value; return llvm::hash_combine( llvm::hash_value(prop.logic.getAsOpaquePointer())); } std::optional SetLogicOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) { if (name == "logic") return prop.logic; return std::nullopt; } void SetLogicOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) { if (name == "logic") { prop.logic = ::llvm::dyn_cast_or_null>(value); return; } } void SetLogicOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) { if (prop.logic) attrs.append("logic", prop.logic); } ::llvm::LogicalResult SetLogicOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) { { ::mlir::Attribute attr = attrs.get(getLogicAttrName(opName)); if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_SMT5(attr, "logic", emitError))) return ::mlir::failure(); } return ::mlir::success(); } ::llvm::LogicalResult SetLogicOp::readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state) { auto &prop = state.getOrAddProperties(); (void)prop; if (::mlir::failed(reader.readAttribute(prop.logic))) return ::mlir::failure(); return ::mlir::success(); } void SetLogicOp::writeProperties(::mlir::DialectBytecodeWriter &writer) { auto &prop = getProperties(); (void)prop; writer.writeAttribute(prop.logic); } ::llvm::StringRef SetLogicOp::getLogic() { auto attr = getLogicAttr(); return attr.getValue(); } void SetLogicOp::setLogic(::llvm::StringRef attrValue) { getProperties().logic = ::mlir::Builder((*this)->getContext()).getStringAttr(attrValue); } void SetLogicOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::StringAttr logic) { odsState.getOrAddProperties().logic = logic; } SetLogicOp SetLogicOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::StringAttr logic) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(logic)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } SetLogicOp SetLogicOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::StringAttr logic) { return create(builder, builder.getLoc(), std::forward(logic)); } void SetLogicOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::StringAttr logic) { odsState.getOrAddProperties().logic = logic; assert(resultTypes.size() == 0u && "mismatched number of results"); odsState.addTypes(resultTypes); } SetLogicOp SetLogicOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::StringAttr logic) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(resultTypes), std::forward(logic)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } SetLogicOp SetLogicOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::StringAttr logic) { return create(builder, builder.getLoc(), std::forward(resultTypes), std::forward(logic)); } void SetLogicOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::llvm::StringRef logic) { odsState.getOrAddProperties().logic = odsBuilder.getStringAttr(logic); } SetLogicOp SetLogicOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::llvm::StringRef logic) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(logic)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } SetLogicOp SetLogicOp::create(::mlir::ImplicitLocOpBuilder &builder, ::llvm::StringRef logic) { return create(builder, builder.getLoc(), std::forward(logic)); } void SetLogicOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::llvm::StringRef logic) { odsState.getOrAddProperties().logic = odsBuilder.getStringAttr(logic); assert(resultTypes.size() == 0u && "mismatched number of results"); odsState.addTypes(resultTypes); } SetLogicOp SetLogicOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::llvm::StringRef logic) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(resultTypes), std::forward(logic)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } SetLogicOp SetLogicOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::llvm::StringRef logic) { return create(builder, builder.getLoc(), std::forward(resultTypes), std::forward(logic)); } void SetLogicOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { assert(operands.size() == 0u && "mismatched number of parameters"); odsState.addOperands(operands); odsState.addAttributes(attributes); assert(resultTypes.size() == 0u && "mismatched number of return types"); odsState.addTypes(resultTypes); if (!attributes.empty()) { (void)odsState.getOrAddProperties(); ::mlir::PropertyRef properties = odsState.getRawProperties(); std::optional<::mlir::RegisteredOperationName> info = odsState.name.getRegisteredInfo(); if (failed(info->setOpPropertiesFromAttribute(odsState.name, properties, odsState.attributes.getDictionary(odsState.getContext()), nullptr))) ::llvm::report_fatal_error("Property conversion failed."); } } SetLogicOp SetLogicOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(resultTypes), std::forward(operands), std::forward(attributes)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } SetLogicOp SetLogicOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { return create(builder, builder.getLoc(), std::forward(resultTypes), std::forward(operands), std::forward(attributes)); } void SetLogicOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { assert(operands.size() == 0u && "mismatched number of parameters"); odsState.addOperands(operands); odsState.useProperties(const_cast(properties)); odsState.addAttributes(discardableAttributes); assert(resultTypes.size() == 0u && "mismatched number of return types"); odsState.addTypes(resultTypes); } SetLogicOp SetLogicOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(resultTypes), std::forward(operands), std::forward(properties), std::forward(discardableAttributes)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } SetLogicOp SetLogicOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { return create(builder, builder.getLoc(), std::forward(resultTypes), std::forward(operands), std::forward(properties), std::forward(discardableAttributes)); } ::llvm::LogicalResult SetLogicOp::verifyInvariantsImpl() { auto tblgen_logic = getProperties().logic; (void)tblgen_logic; if (!tblgen_logic) return emitOpError("requires attribute 'logic'"); if (::mlir::failed(__mlir_ods_local_attr_constraint_SMT5(*this, tblgen_logic, "logic"))) return ::mlir::failure(); return ::mlir::success(); } ::llvm::LogicalResult SetLogicOp::verifyInvariants() { return verifyInvariantsImpl(); } ::mlir::ParseResult SetLogicOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) { ::mlir::StringAttr logicAttr; if (parser.parseCustomAttributeWithFallback(logicAttr, parser.getBuilder().getType<::mlir::NoneType>())) { return ::mlir::failure(); } if (logicAttr) result.getOrAddProperties().logic = logicAttr; { auto loc = parser.getCurrentLocation();(void)loc; if (parser.parseOptionalAttrDict(result.attributes)) return ::mlir::failure(); if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() { return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op "; }))) return ::mlir::failure(); } return ::mlir::success(); } void SetLogicOp::print(::mlir::OpAsmPrinter &_odsPrinter) { _odsPrinter << ' '; _odsPrinter.printAttributeWithoutType(getLogicAttr()); ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs; elidedAttrs.push_back("logic"); _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs); } } // namespace mlir::smt MLIR_DEFINE_EXPLICIT_TYPE_ID(mlir::smt::SetLogicOp) MLIR_DEFINE_EXPLICIT_TYPE_ID(mlir::smt::detail::SetLogicOpGenericAdaptorBase::Properties) namespace mlir::smt { //===----------------------------------------------------------------------===// // mlir::smt::SolverOp definitions //===----------------------------------------------------------------------===// namespace detail { SolverOpGenericAdaptorBase::SolverOpGenericAdaptorBase(SolverOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {} std::pair SolverOpGenericAdaptorBase::getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize) { bool isVariadic[] = {true}; int prevVariadicCount = 0; for (unsigned i = 0; i < index; ++i) if (isVariadic[i]) ++prevVariadicCount; // Calculate how many dynamic values a static variadic operand corresponds to. // This assumes all static variadic operands have the same dynamic value count. int variadicSize = (odsOperandsSize - 0) / 1; // `index` passed in as the parameter is the static index which counts each // operand (variadic or not) as size 1. So here for each previous static variadic // operand, we need to offset by (variadicSize - 1) to get where the dynamic // value pack for this static operand starts. int start = index + (variadicSize - 1) * prevVariadicCount; int size = isVariadic[index] ? variadicSize : 1; return {start, size}; } } // namespace detail SolverOpAdaptor::SolverOpAdaptor(SolverOp op) : SolverOpGenericAdaptor(op->getOperands(), op) {} ::llvm::LogicalResult SolverOpAdaptor::verify(::mlir::Location loc) { return ::mlir::success(); } std::pair SolverOp::getODSOperandIndexAndLength(unsigned index) { bool isVariadic[] = {true}; int prevVariadicCount = 0; for (unsigned i = 0; i < index; ++i) if (isVariadic[i]) ++prevVariadicCount; // Calculate how many dynamic values a static variadic operand corresponds to. // This assumes all static variadic operands have the same dynamic value count. int variadicSize = (getOperation()->getNumOperands() - 0) / 1; // `index` passed in as the parameter is the static index which counts each // operand (variadic or not) as size 1. So here for each previous static variadic // operand, we need to offset by (variadicSize - 1) to get where the dynamic // value pack for this static operand starts. int start = index + (variadicSize - 1) * prevVariadicCount; int size = isVariadic[index] ? variadicSize : 1; return {start, size}; } ::mlir::MutableOperandRange SolverOp::getInputsMutable() { auto range = getODSOperandIndexAndLength(0); auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second); return mutableRange; } std::pair SolverOp::getODSResultIndexAndLength(unsigned index) { bool isVariadic[] = {true}; int prevVariadicCount = 0; for (unsigned i = 0; i < index; ++i) if (isVariadic[i]) ++prevVariadicCount; // Calculate how many dynamic values a static variadic operand corresponds to. // This assumes all static variadic operands have the same dynamic value count. int variadicSize = (getOperation()->getNumResults() - 0) / 1; // `index` passed in as the parameter is the static index which counts each // operand (variadic or not) as size 1. So here for each previous static variadic // operand, we need to offset by (variadicSize - 1) to get where the dynamic // value pack for this static operand starts. int start = index + (variadicSize - 1) * prevVariadicCount; int size = isVariadic[index] ? variadicSize : 1; return {start, size}; } ::llvm::LogicalResult SolverOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) { ::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr); if (!dict) { emitError() << "expected DictionaryAttr to set properties"; return ::mlir::failure(); } return ::mlir::success(); } ::mlir::Attribute SolverOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) { ::mlir::SmallVector<::mlir::NamedAttribute> attrs; ::mlir::Builder odsBuilder{ctx}; if (!attrs.empty()) return odsBuilder.getDictionaryAttr(attrs); return {}; } llvm::hash_code SolverOp::computePropertiesHash(const Properties &prop) { using llvm::hash_value; return llvm::hash_combine(); } std::optional SolverOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) { return std::nullopt; } void SolverOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) { } void SolverOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) { } ::llvm::LogicalResult SolverOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) { return ::mlir::success(); } void SolverOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { odsState.addOperands(operands); odsState.addAttributes(attributes); for (unsigned i = 0; i != 1; ++i) (void)odsState.addRegion(); odsState.addTypes(resultTypes); } SolverOp SolverOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(resultTypes), std::forward(operands), std::forward(attributes)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } SolverOp SolverOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { return create(builder, builder.getLoc(), std::forward(resultTypes), std::forward(operands), std::forward(attributes)); } void SolverOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { odsState.addOperands(operands); odsState.useProperties(const_cast(properties)); odsState.addAttributes(discardableAttributes); for (unsigned i = 0; i != 1; ++i) (void)odsState.addRegion(); odsState.addTypes(resultTypes); } SolverOp SolverOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(resultTypes), std::forward(operands), std::forward(properties), std::forward(discardableAttributes)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } SolverOp SolverOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { return create(builder, builder.getLoc(), std::forward(resultTypes), std::forward(operands), std::forward(properties), std::forward(discardableAttributes)); } ::llvm::LogicalResult SolverOp::verifyInvariantsImpl() { { unsigned index = 0; (void)index; auto valueGroup0 = getODSOperands(0); for (auto v : valueGroup0) { if (::mlir::failed(__mlir_ods_local_type_constraint_SMT12(*this, v.getType(), "operand", index++))) return ::mlir::failure(); } } { unsigned index = 0; (void)index; auto valueGroup0 = getODSResults(0); for (auto v : valueGroup0) { if (::mlir::failed(__mlir_ods_local_type_constraint_SMT12(*this, v.getType(), "result", index++))) return ::mlir::failure(); } } { unsigned index = 0; (void)index; for (auto ®ion : ::llvm::MutableArrayRef((*this)->getRegion(0))) if (::mlir::failed(__mlir_ods_local_region_constraint_SMT1(*this, region, "bodyRegion", index++))) return ::mlir::failure(); } return ::mlir::success(); } ::llvm::LogicalResult SolverOp::verifyInvariants() { return verifyInvariantsImpl(); } ::mlir::ParseResult SolverOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) { ::llvm::SmallVector<::mlir::OpAsmParser::UnresolvedOperand, 4> inputsOperands; ::llvm::SMLoc inputsOperandsLoc; (void)inputsOperandsLoc; ::llvm::ArrayRef<::mlir::Type> inputsTypes; ::llvm::ArrayRef<::mlir::Type> resultsTypes; std::unique_ptr<::mlir::Region> bodyRegionRegion = std::make_unique<::mlir::Region>(); if (parser.parseLParen()) return ::mlir::failure(); inputsOperandsLoc = parser.getCurrentLocation(); if (parser.parseOperandList(inputsOperands)) return ::mlir::failure(); if (parser.parseRParen()) return ::mlir::failure(); { auto loc = parser.getCurrentLocation();(void)loc; if (parser.parseOptionalAttrDict(result.attributes)) return ::mlir::failure(); if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() { return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op "; }))) return ::mlir::failure(); } if (parser.parseColon()) return ::mlir::failure(); ::mlir::FunctionType inputs__results_functionType; if (parser.parseType(inputs__results_functionType)) return ::mlir::failure(); inputsTypes = inputs__results_functionType.getInputs(); resultsTypes = inputs__results_functionType.getResults(); if (parser.parseRegion(*bodyRegionRegion)) return ::mlir::failure(); ensureTerminator(*bodyRegionRegion, parser.getBuilder(), result.location); result.addRegion(std::move(bodyRegionRegion)); result.addTypes(resultsTypes); if (parser.resolveOperands(inputsOperands, inputsTypes, inputsOperandsLoc, result.operands)) return ::mlir::failure(); return ::mlir::success(); } void SolverOp::print(::mlir::OpAsmPrinter &_odsPrinter) { _odsPrinter << "("; _odsPrinter << getInputs(); _odsPrinter << ")"; ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs; _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs); _odsPrinter << ' ' << ":"; _odsPrinter << ' '; _odsPrinter.printFunctionalType(getInputs().getTypes(), getResults().getTypes()); _odsPrinter << ' '; { bool printTerminator = true; if (auto *term = getBodyRegion().empty() ? nullptr : getBodyRegion().begin()->getTerminator()) { printTerminator = !term->getAttrDictionary().empty() || term->getNumOperands() != 0 || term->getNumResults() != 0; } _odsPrinter.printRegion(getBodyRegion(), /*printEntryBlockArgs=*/true, /*printBlockTerminators=*/printTerminator); } } } // namespace mlir::smt MLIR_DEFINE_EXPLICIT_TYPE_ID(mlir::smt::SolverOp) namespace mlir::smt { //===----------------------------------------------------------------------===// // mlir::smt::XOrOp definitions //===----------------------------------------------------------------------===// namespace detail { XOrOpGenericAdaptorBase::XOrOpGenericAdaptorBase(XOrOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {} std::pair XOrOpGenericAdaptorBase::getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize) { bool isVariadic[] = {true}; int prevVariadicCount = 0; for (unsigned i = 0; i < index; ++i) if (isVariadic[i]) ++prevVariadicCount; // Calculate how many dynamic values a static variadic operand corresponds to. // This assumes all static variadic operands have the same dynamic value count. int variadicSize = (odsOperandsSize - 0) / 1; // `index` passed in as the parameter is the static index which counts each // operand (variadic or not) as size 1. So here for each previous static variadic // operand, we need to offset by (variadicSize - 1) to get where the dynamic // value pack for this static operand starts. int start = index + (variadicSize - 1) * prevVariadicCount; int size = isVariadic[index] ? variadicSize : 1; return {start, size}; } } // namespace detail XOrOpAdaptor::XOrOpAdaptor(XOrOp op) : XOrOpGenericAdaptor(op->getOperands(), op) {} ::llvm::LogicalResult XOrOpAdaptor::verify(::mlir::Location loc) { return ::mlir::success(); } std::pair XOrOp::getODSOperandIndexAndLength(unsigned index) { bool isVariadic[] = {true}; int prevVariadicCount = 0; for (unsigned i = 0; i < index; ++i) if (isVariadic[i]) ++prevVariadicCount; // Calculate how many dynamic values a static variadic operand corresponds to. // This assumes all static variadic operands have the same dynamic value count. int variadicSize = (getOperation()->getNumOperands() - 0) / 1; // `index` passed in as the parameter is the static index which counts each // operand (variadic or not) as size 1. So here for each previous static variadic // operand, we need to offset by (variadicSize - 1) to get where the dynamic // value pack for this static operand starts. int start = index + (variadicSize - 1) * prevVariadicCount; int size = isVariadic[index] ? variadicSize : 1; return {start, size}; } ::mlir::MutableOperandRange XOrOp::getInputsMutable() { auto range = getODSOperandIndexAndLength(0); auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second); return mutableRange; } ::llvm::LogicalResult XOrOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) { ::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr); if (!dict) { emitError() << "expected DictionaryAttr to set properties"; return ::mlir::failure(); } return ::mlir::success(); } ::mlir::Attribute XOrOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) { ::mlir::SmallVector<::mlir::NamedAttribute> attrs; ::mlir::Builder odsBuilder{ctx}; if (!attrs.empty()) return odsBuilder.getDictionaryAttr(attrs); return {}; } llvm::hash_code XOrOp::computePropertiesHash(const Properties &prop) { using llvm::hash_value; return llvm::hash_combine(); } std::optional XOrOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) { return std::nullopt; } void XOrOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) { } void XOrOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) { } ::llvm::LogicalResult XOrOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) { return ::mlir::success(); } void XOrOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, mlir::Value lhs, mlir::Value rhs) { build(odsBuilder, odsState, ValueRange{lhs, rhs}); } XOrOp XOrOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, mlir::Value lhs, mlir::Value rhs) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(lhs), std::forward(rhs)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } XOrOp XOrOp::create(::mlir::ImplicitLocOpBuilder &builder, mlir::Value lhs, mlir::Value rhs) { return create(builder, builder.getLoc(), std::forward(lhs), std::forward(rhs)); } void XOrOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::ValueRange inputs) { odsState.addOperands(inputs); odsState.addTypes(result); } XOrOp XOrOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::ValueRange inputs) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(result), std::forward(inputs)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } XOrOp XOrOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::ValueRange inputs) { return create(builder, builder.getLoc(), std::forward(result), std::forward(inputs)); } void XOrOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { odsState.addOperands(operands); odsState.addAttributes(attributes); assert(resultTypes.size() == 1u && "mismatched number of return types"); odsState.addTypes(resultTypes); } XOrOp XOrOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(resultTypes), std::forward(operands), std::forward(attributes)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } XOrOp XOrOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { return create(builder, builder.getLoc(), std::forward(resultTypes), std::forward(operands), std::forward(attributes)); } void XOrOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { odsState.addOperands(operands); odsState.addAttributes(attributes); ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes; if (::mlir::succeeded(XOrOp::inferReturnTypes(odsBuilder.getContext(), odsState.location, operands, odsState.attributes.getDictionary(odsState.getContext()), odsState.getRawProperties(), odsState.regions, inferredReturnTypes))) { assert(inferredReturnTypes.size() == 1u && "mismatched number of return types"); odsState.addTypes(inferredReturnTypes); } else { ::llvm::report_fatal_error("Failed to infer result type(s)."); } } XOrOp XOrOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(operands), std::forward(attributes)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } XOrOp XOrOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { return create(builder, builder.getLoc(), std::forward(operands), std::forward(attributes)); } void XOrOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { odsState.addOperands(operands); odsState.useProperties(const_cast(properties)); odsState.addAttributes(discardableAttributes); assert(resultTypes.size() == 1u && "mismatched number of return types"); odsState.addTypes(resultTypes); } XOrOp XOrOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(resultTypes), std::forward(operands), std::forward(properties), std::forward(discardableAttributes)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } XOrOp XOrOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { return create(builder, builder.getLoc(), std::forward(resultTypes), std::forward(operands), std::forward(properties), std::forward(discardableAttributes)); } void XOrOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { odsState.addOperands(operands); odsState.useProperties(const_cast(properties)); odsState.addAttributes(discardableAttributes); ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes; if (::mlir::succeeded(XOrOp::inferReturnTypes(odsBuilder.getContext(), odsState.location, operands, odsState.attributes.getDictionary(odsState.getContext()), odsState.getRawProperties(), odsState.regions, inferredReturnTypes))) { assert(inferredReturnTypes.size() == 1u && "mismatched number of return types"); odsState.addTypes(inferredReturnTypes); } else { ::llvm::report_fatal_error("Failed to infer result type(s)."); } } XOrOp XOrOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(operands), std::forward(properties), std::forward(discardableAttributes)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } XOrOp XOrOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { return create(builder, builder.getLoc(), std::forward(operands), std::forward(properties), std::forward(discardableAttributes)); } ::llvm::LogicalResult XOrOp::verifyInvariantsImpl() { { unsigned index = 0; (void)index; auto valueGroup0 = getODSOperands(0); for (auto v : valueGroup0) { if (::mlir::failed(__mlir_ods_local_type_constraint_SMT1(*this, v.getType(), "operand", index++))) return ::mlir::failure(); } } { unsigned index = 0; (void)index; auto valueGroup0 = getODSResults(0); for (auto v : valueGroup0) { if (::mlir::failed(__mlir_ods_local_type_constraint_SMT2(*this, v.getType(), "result", index++))) return ::mlir::failure(); } } return ::mlir::success(); } ::llvm::LogicalResult XOrOp::verifyInvariants() { return verifyInvariantsImpl(); } ::llvm::LogicalResult XOrOp::inferReturnTypes(::mlir::MLIRContext *context, ::std::optional<::mlir::Location> location, ::mlir::ValueRange operands, ::mlir::DictionaryAttr attributes, ::mlir::PropertyRef properties, ::mlir::RegionRange regions, ::llvm::SmallVectorImpl<::mlir::Type>&inferredReturnTypes) { inferredReturnTypes.resize(1); ::mlir::Builder odsBuilder(context); ::mlir::Type odsInferredType0 = odsBuilder.getType(); inferredReturnTypes[0] = odsInferredType0; return ::mlir::success(); } ::mlir::ParseResult XOrOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) { ::llvm::SmallVector<::mlir::OpAsmParser::UnresolvedOperand, 4> inputsOperands; ::llvm::SMLoc inputsOperandsLoc; (void)inputsOperandsLoc; inputsOperandsLoc = parser.getCurrentLocation(); if (parser.parseOperandList(inputsOperands)) return ::mlir::failure(); { auto loc = parser.getCurrentLocation();(void)loc; if (parser.parseOptionalAttrDict(result.attributes)) return ::mlir::failure(); if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() { return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op "; }))) return ::mlir::failure(); } ::mlir::Type odsBuildableType0 = parser.getBuilder().getType(); result.addTypes(odsBuildableType0); if (parser.resolveOperands(inputsOperands, odsBuildableType0, inputsOperandsLoc, result.operands)) return ::mlir::failure(); return ::mlir::success(); } void XOrOp::print(::mlir::OpAsmPrinter &_odsPrinter) { _odsPrinter << ' '; _odsPrinter << getInputs(); ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs; _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs); } void XOrOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) { } } // namespace mlir::smt MLIR_DEFINE_EXPLICIT_TYPE_ID(mlir::smt::XOrOp) namespace mlir::smt { //===----------------------------------------------------------------------===// // mlir::smt::YieldOp definitions //===----------------------------------------------------------------------===// namespace detail { YieldOpGenericAdaptorBase::YieldOpGenericAdaptorBase(YieldOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {} std::pair YieldOpGenericAdaptorBase::getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize) { bool isVariadic[] = {true}; int prevVariadicCount = 0; for (unsigned i = 0; i < index; ++i) if (isVariadic[i]) ++prevVariadicCount; // Calculate how many dynamic values a static variadic operand corresponds to. // This assumes all static variadic operands have the same dynamic value count. int variadicSize = (odsOperandsSize - 0) / 1; // `index` passed in as the parameter is the static index which counts each // operand (variadic or not) as size 1. So here for each previous static variadic // operand, we need to offset by (variadicSize - 1) to get where the dynamic // value pack for this static operand starts. int start = index + (variadicSize - 1) * prevVariadicCount; int size = isVariadic[index] ? variadicSize : 1; return {start, size}; } } // namespace detail YieldOpAdaptor::YieldOpAdaptor(YieldOp op) : YieldOpGenericAdaptor(op->getOperands(), op) {} ::llvm::LogicalResult YieldOpAdaptor::verify(::mlir::Location loc) { return ::mlir::success(); } std::pair YieldOp::getODSOperandIndexAndLength(unsigned index) { bool isVariadic[] = {true}; int prevVariadicCount = 0; for (unsigned i = 0; i < index; ++i) if (isVariadic[i]) ++prevVariadicCount; // Calculate how many dynamic values a static variadic operand corresponds to. // This assumes all static variadic operands have the same dynamic value count. int variadicSize = (getOperation()->getNumOperands() - 0) / 1; // `index` passed in as the parameter is the static index which counts each // operand (variadic or not) as size 1. So here for each previous static variadic // operand, we need to offset by (variadicSize - 1) to get where the dynamic // value pack for this static operand starts. int start = index + (variadicSize - 1) * prevVariadicCount; int size = isVariadic[index] ? variadicSize : 1; return {start, size}; } ::mlir::MutableOperandRange YieldOp::getValuesMutable() { auto range = getODSOperandIndexAndLength(0); auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second); return mutableRange; } ::llvm::LogicalResult YieldOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) { ::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr); if (!dict) { emitError() << "expected DictionaryAttr to set properties"; return ::mlir::failure(); } return ::mlir::success(); } ::mlir::Attribute YieldOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) { ::mlir::SmallVector<::mlir::NamedAttribute> attrs; ::mlir::Builder odsBuilder{ctx}; if (!attrs.empty()) return odsBuilder.getDictionaryAttr(attrs); return {}; } llvm::hash_code YieldOp::computePropertiesHash(const Properties &prop) { using llvm::hash_value; return llvm::hash_combine(); } std::optional YieldOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) { return std::nullopt; } void YieldOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) { } void YieldOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) { } ::llvm::LogicalResult YieldOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) { return ::mlir::success(); } void YieldOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState) { build(odsBuilder, odsState, {}); } YieldOp YieldOp::create(::mlir::OpBuilder &builder, ::mlir::Location location) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } YieldOp YieldOp::create(::mlir::ImplicitLocOpBuilder &builder) { return create(builder, builder.getLoc()); } void YieldOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange values) { odsState.addOperands(values); } YieldOp YieldOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange values) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(values)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } YieldOp YieldOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange values) { return create(builder, builder.getLoc(), std::forward(values)); } void YieldOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { odsState.addOperands(operands); odsState.addAttributes(attributes); assert(resultTypes.size() == 0u && "mismatched number of return types"); odsState.addTypes(resultTypes); } YieldOp YieldOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(resultTypes), std::forward(operands), std::forward(attributes)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } YieldOp YieldOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) { return create(builder, builder.getLoc(), std::forward(resultTypes), std::forward(operands), std::forward(attributes)); } void YieldOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { odsState.addOperands(operands); odsState.useProperties(const_cast(properties)); odsState.addAttributes(discardableAttributes); assert(resultTypes.size() == 0u && "mismatched number of return types"); odsState.addTypes(resultTypes); } YieldOp YieldOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { ::mlir::OperationState __state__(location, getOperationName()); build(builder, __state__, std::forward(resultTypes), std::forward(operands), std::forward(properties), std::forward(discardableAttributes)); auto __res__ = ::llvm::dyn_cast(builder.create(__state__)); assert(__res__ && "builder didn't return the right type"); return __res__; } YieldOp YieldOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) { return create(builder, builder.getLoc(), std::forward(resultTypes), std::forward(operands), std::forward(properties), std::forward(discardableAttributes)); } ::llvm::LogicalResult YieldOp::verifyInvariantsImpl() { { unsigned index = 0; (void)index; auto valueGroup0 = getODSOperands(0); for (auto v : valueGroup0) { if (::mlir::failed(__mlir_ods_local_type_constraint_SMT10(*this, v.getType(), "operand", index++))) return ::mlir::failure(); } } return ::mlir::success(); } ::llvm::LogicalResult YieldOp::verifyInvariants() { return verifyInvariantsImpl(); } ::mlir::ParseResult YieldOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) { ::llvm::SmallVector<::mlir::OpAsmParser::UnresolvedOperand, 4> valuesOperands; ::llvm::SMLoc valuesOperandsLoc; (void)valuesOperandsLoc; ::llvm::SmallVector<::mlir::Type, 1> valuesTypes; valuesOperandsLoc = parser.getCurrentLocation(); if (parser.parseOperandList(valuesOperands)) return ::mlir::failure(); if (!valuesOperands.empty()) { if (parser.parseColon()) return ::mlir::failure(); if (parser.parseTypeList(valuesTypes)) return ::mlir::failure(); } { auto loc = parser.getCurrentLocation();(void)loc; if (parser.parseOptionalAttrDict(result.attributes)) return ::mlir::failure(); if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() { return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op "; }))) return ::mlir::failure(); } if (parser.resolveOperands(valuesOperands, valuesTypes, valuesOperandsLoc, result.operands)) return ::mlir::failure(); return ::mlir::success(); } void YieldOp::print(::mlir::OpAsmPrinter &_odsPrinter) { if (!getValues().empty()) { _odsPrinter << ' '; _odsPrinter << getValues(); _odsPrinter << ' ' << ":"; _odsPrinter << ' '; _odsPrinter << getValues().getTypes(); } ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs; _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs); } void YieldOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) { } } // namespace mlir::smt MLIR_DEFINE_EXPLICIT_TYPE_ID(mlir::smt::YieldOp) #endif // GET_OP_CLASSES