Files
gps/tools/local/circt/include/circt/Dialect/LTL/LTL.cpp.inc
T
2026-07-12 11:01:51 +03:00

7422 lines
361 KiB
C++

/*===- TableGen'erated file -------------------------------------*- C++ -*-===*\
|* *|
|* Op Definitions *|
|* *|
|* Automatically generated file, do not edit! *|
|* From: LTL.td *|
|* *|
\*===----------------------------------------------------------------------===*/
#ifdef GET_OP_LIST
#undef GET_OP_LIST
circt::ltl::AndOp,
circt::ltl::BooleanConstantOp,
circt::ltl::ClockOp,
circt::ltl::ClockedDelayOp,
circt::ltl::ConcatOp,
circt::ltl::DelayOp,
circt::ltl::EventuallyOp,
circt::ltl::GoToRepeatOp,
circt::ltl::ImplicationOp,
circt::ltl::IntersectOp,
circt::ltl::NonConsecutiveRepeatOp,
circt::ltl::NotOp,
circt::ltl::OrOp,
circt::ltl::PastOp,
circt::ltl::RepeatOp,
circt::ltl::SampledOp,
circt::ltl::UntilOp
#endif // GET_OP_LIST
#ifdef GET_OP_CLASSES
#undef GET_OP_CLASSES
//===----------------------------------------------------------------------===//
// Local Utility Method Definitions
//===----------------------------------------------------------------------===//
static ::llvm::LogicalResult __mlir_ods_local_type_constraint_LTL1(
::mlir::Operation *op, ::mlir::Type type, ::llvm::StringRef valueKind,
unsigned valueIndex) {
if (!(((type.isSignlessInteger(1))) || ((::llvm::isa<circt::ltl::SequenceType>(type))) || ((::llvm::isa<circt::ltl::PropertyType>(type))))) {
return op->emitOpError(valueKind) << " #" << valueIndex
<< " must be variadic of 1-bit signless integer or LTL sequence type or LTL property type, but got " << type;
}
return ::mlir::success();
}
static ::llvm::LogicalResult __mlir_ods_local_type_constraint_LTL2(
::mlir::Operation *op, ::mlir::Type type, ::llvm::StringRef valueKind,
unsigned valueIndex) {
if (!(((type.isSignlessInteger(1))) || ((::llvm::isa<circt::ltl::SequenceType>(type))) || ((::llvm::isa<circt::ltl::PropertyType>(type))))) {
return op->emitOpError(valueKind) << " #" << valueIndex
<< " must be 1-bit signless integer or LTL sequence type or LTL property type, but got " << type;
}
return ::mlir::success();
}
static ::llvm::LogicalResult __mlir_ods_local_type_constraint_LTL3(
::mlir::Operation *op, ::mlir::Type type, ::llvm::StringRef valueKind,
unsigned valueIndex) {
if (!((::llvm::isa<circt::ltl::PropertyType>(type)))) {
return op->emitOpError(valueKind) << " #" << valueIndex
<< " must be LTL property type, but got " << type;
}
return ::mlir::success();
}
static ::llvm::LogicalResult __mlir_ods_local_type_constraint_LTL4(
::mlir::Operation *op, ::mlir::Type type, ::llvm::StringRef valueKind,
unsigned valueIndex) {
if (!((type.isSignlessInteger(1)))) {
return op->emitOpError(valueKind) << " #" << valueIndex
<< " must be 1-bit signless integer, but got " << type;
}
return ::mlir::success();
}
static ::llvm::LogicalResult __mlir_ods_local_type_constraint_LTL5(
::mlir::Operation *op, ::mlir::Type type, ::llvm::StringRef valueKind,
unsigned valueIndex) {
if (!(((::llvm::isa<circt::ltl::SequenceType>(type))) || ((::llvm::isa<circt::ltl::PropertyType>(type))))) {
return op->emitOpError(valueKind) << " #" << valueIndex
<< " must be LTL sequence type or LTL property type, but got " << type;
}
return ::mlir::success();
}
static ::llvm::LogicalResult __mlir_ods_local_type_constraint_LTL6(
::mlir::Operation *op, ::mlir::Type type, ::llvm::StringRef valueKind,
unsigned valueIndex) {
if (!(((type.isSignlessInteger(1))) || ((::llvm::isa<circt::ltl::SequenceType>(type))))) {
return op->emitOpError(valueKind) << " #" << valueIndex
<< " must be 1-bit signless integer or LTL sequence type, but got " << type;
}
return ::mlir::success();
}
static ::llvm::LogicalResult __mlir_ods_local_type_constraint_LTL7(
::mlir::Operation *op, ::mlir::Type type, ::llvm::StringRef valueKind,
unsigned valueIndex) {
if (!((::llvm::isa<circt::ltl::SequenceType>(type)))) {
return op->emitOpError(valueKind) << " #" << valueIndex
<< " must be LTL sequence type, but got " << type;
}
return ::mlir::success();
}
static ::llvm::LogicalResult __mlir_ods_local_type_constraint_LTL8(
::mlir::Operation *op, ::mlir::Type type, ::llvm::StringRef valueKind,
unsigned valueIndex) {
if (!(((type.isSignlessInteger(1))) || ((::llvm::isa<circt::ltl::SequenceType>(type))))) {
return op->emitOpError(valueKind) << " #" << valueIndex
<< " must be variadic of 1-bit signless integer or LTL sequence type, but got " << type;
}
return ::mlir::success();
}
static ::llvm::LogicalResult __mlir_ods_local_type_constraint_LTL9(
::mlir::Operation *op, ::mlir::Type type, ::llvm::StringRef valueKind,
unsigned valueIndex) {
if (!((::circt::hw::isHWIntegerType(type)))) {
return op->emitOpError(valueKind) << " #" << valueIndex
<< " must be a signless integer bitvector, but got " << type;
}
return ::mlir::success();
}
static ::llvm::LogicalResult __mlir_ods_local_type_constraint_LTL10(
::mlir::Operation *op, ::mlir::Type type, ::llvm::StringRef valueKind,
unsigned valueIndex) {
if (!(!((::llvm::isa<::mlir::TokenType>(type))))) {
return op->emitOpError(valueKind) << " #" << valueIndex
<< " must be any non-token type, but got " << type;
}
return ::mlir::success();
}
static ::llvm::LogicalResult __mlir_ods_local_attr_constraint_LTL1(
::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_LTL1(
::mlir::Operation *op, ::mlir::Attribute attr, ::llvm::StringRef attrName) {
return __mlir_ods_local_attr_constraint_LTL1(attr, attrName, [op]() {
return op->emitOpError();
});
}
static ::llvm::LogicalResult __mlir_ods_local_attr_constraint_LTL2(
::mlir::Attribute attr, ::llvm::StringRef attrName, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
if (attr && !((::llvm::isa<circt::ltl::ClockEdgeAttr>(attr))))
return emitError() << "attribute '" << attrName
<< "' failed to satisfy constraint: clock edge";
return ::mlir::success();
}
static ::llvm::LogicalResult __mlir_ods_local_attr_constraint_LTL2(
::mlir::Operation *op, ::mlir::Attribute attr, ::llvm::StringRef attrName) {
return __mlir_ods_local_attr_constraint_LTL2(attr, attrName, [op]() {
return op->emitOpError();
});
}
static ::llvm::LogicalResult __mlir_ods_local_attr_constraint_LTL3(
::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(64)))))
return emitError() << "attribute '" << attrName
<< "' failed to satisfy constraint: 64-bit signless integer attribute";
return ::mlir::success();
}
static ::llvm::LogicalResult __mlir_ods_local_attr_constraint_LTL3(
::mlir::Operation *op, ::mlir::Attribute attr, ::llvm::StringRef attrName) {
return __mlir_ods_local_attr_constraint_LTL3(attr, attrName, [op]() {
return op->emitOpError();
});
}
namespace circt::ltl {
//===----------------------------------------------------------------------===//
// circt::ltl::AndOp definitions
//===----------------------------------------------------------------------===//
namespace detail {
AndOpGenericAdaptorBase::AndOpGenericAdaptorBase(AndOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
std::pair<unsigned, unsigned> 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<unsigned, unsigned> 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<mlir::Attribute> 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::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<decltype(result)>(result), std::forward<decltype(inputs)>(inputs));
auto __res__ = ::llvm::dyn_cast<AndOp>(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<decltype(result)>(result), std::forward<decltype(inputs)>(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<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<AndOp>(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<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(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<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<AndOp>(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<decltype(operands)>(operands), std::forward<decltype(attributes)>(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&>(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<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<AndOp>(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<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(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 &>(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<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<AndOp>(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<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(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_LTL1(*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_LTL2(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult AndOp::verifyInvariants() {
return verifyInvariantsImpl();
}
void AndOp::getCanonicalizationPatterns(::mlir::RewritePatternSet &results, ::mlir::MLIRContext *context) {
results.add(canonicalize);
}
::mlir::ParseResult AndOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
::llvm::SmallVector<::mlir::OpAsmParser::UnresolvedOperand, 4> inputsOperands;
::llvm::SMLoc inputsOperandsLoc;
(void)inputsOperandsLoc;
::llvm::SmallVector<::mlir::Type, 1> inputsTypes;
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();
}
if (parser.parseColon())
return ::mlir::failure();
if (parser.parseTypeList(inputsTypes))
return ::mlir::failure();
if (parser.resolveOperands(inputsOperands, inputsTypes, inputsOperandsLoc, result.operands))
return ::mlir::failure();
::llvm::SmallVector<::mlir::Type> inferredReturnTypes;
if (::mlir::failed(AndOp::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 AndOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
_odsPrinter << ' ';
_odsPrinter << getInputs();
::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
_odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
_odsPrinter << ' ' << ":";
_odsPrinter << ' ';
_odsPrinter << getInputs().getTypes();
}
void AndOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}
} // namespace circt::ltl
MLIR_DEFINE_EXPLICIT_TYPE_ID(circt::ltl::AndOp)
namespace circt::ltl {
//===----------------------------------------------------------------------===//
// circt::ltl::BooleanConstantOp definitions
//===----------------------------------------------------------------------===//
namespace detail {
BooleanConstantOpGenericAdaptorBase::BooleanConstantOpGenericAdaptorBase(BooleanConstantOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
bool BooleanConstantOpGenericAdaptorBase::getValue() {
auto attr = getValueAttr();
return attr.getValue();
}
} // namespace detail
BooleanConstantOpAdaptor::BooleanConstantOpAdaptor(BooleanConstantOp op) : BooleanConstantOpGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult BooleanConstantOpAdaptor::verify(::mlir::Location loc) {
auto tblgen_value = getProperties().value; (void)tblgen_value;
if (!tblgen_value) return emitError(loc, "'ltl.boolean_constant' op requires attribute 'value'");
if (tblgen_value && !((::llvm::isa<::mlir::BoolAttr>(tblgen_value))))
return emitError(loc, "'ltl.boolean_constant' op attribute 'value' failed to satisfy constraint: bool attribute");
return ::mlir::success();
}
::llvm::LogicalResult BooleanConstantOp::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<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `value` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
return ::mlir::success();
}
::mlir::Attribute BooleanConstantOp::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 BooleanConstantOp::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine(
llvm::hash_value(prop.value.getAsOpaquePointer()));
}
std::optional<mlir::Attribute> BooleanConstantOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
if (name == "value")
return prop.value;
return std::nullopt;
}
void BooleanConstantOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
if (name == "value") {
prop.value = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.value)>>(value);
return;
}
}
void BooleanConstantOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
if (prop.value) attrs.append("value", prop.value);
}
::llvm::LogicalResult BooleanConstantOp::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_LTL1(attr, "value", emitError)))
return ::mlir::failure();
}
return ::mlir::success();
}
::llvm::LogicalResult BooleanConstantOp::readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state) {
auto &prop = state.getOrAddProperties<Properties>(); (void)prop;
if (::mlir::failed(reader.readAttribute(prop.value)))
return ::mlir::failure();
return ::mlir::success();
}
void BooleanConstantOp::writeProperties(::mlir::DialectBytecodeWriter &writer) {
auto &prop = getProperties(); (void)prop;
writer.writeAttribute(prop.value);
}
bool BooleanConstantOp::getValue() {
auto attr = getValueAttr();
return attr.getValue();
}
void BooleanConstantOp::setValue(bool attrValue) {
getProperties().value = ::mlir::Builder((*this)->getContext()).getBoolAttr(attrValue);
}
void BooleanConstantOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::BoolAttr value) {
odsState.getOrAddProperties<Properties>().value = value;
odsState.addTypes(result);
}
BooleanConstantOp BooleanConstantOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::BoolAttr value) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(result)>(result), std::forward<decltype(value)>(value));
auto __res__ = ::llvm::dyn_cast<BooleanConstantOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
BooleanConstantOp BooleanConstantOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::BoolAttr value) {
return create(builder, builder.getLoc(), std::forward<decltype(result)>(result), std::forward<decltype(value)>(value));
}
void BooleanConstantOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::BoolAttr value) {
odsState.getOrAddProperties<Properties>().value = value;
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(BooleanConstantOp::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);
}
BooleanConstantOp BooleanConstantOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::BoolAttr value) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(value)>(value));
auto __res__ = ::llvm::dyn_cast<BooleanConstantOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
BooleanConstantOp BooleanConstantOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::BoolAttr value) {
return create(builder, builder.getLoc(), std::forward<decltype(value)>(value));
}
void BooleanConstantOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::BoolAttr value) {
odsState.getOrAddProperties<Properties>().value = value;
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
BooleanConstantOp BooleanConstantOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::BoolAttr value) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(value)>(value));
auto __res__ = ::llvm::dyn_cast<BooleanConstantOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
BooleanConstantOp BooleanConstantOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::BoolAttr value) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(value)>(value));
}
void BooleanConstantOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, bool value) {
odsState.getOrAddProperties<Properties>().value = odsBuilder.getBoolAttr(value);
odsState.addTypes(result);
}
BooleanConstantOp BooleanConstantOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, bool value) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(result)>(result), std::forward<decltype(value)>(value));
auto __res__ = ::llvm::dyn_cast<BooleanConstantOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
BooleanConstantOp BooleanConstantOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, bool value) {
return create(builder, builder.getLoc(), std::forward<decltype(result)>(result), std::forward<decltype(value)>(value));
}
void BooleanConstantOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, bool value) {
odsState.getOrAddProperties<Properties>().value = odsBuilder.getBoolAttr(value);
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(BooleanConstantOp::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);
}
BooleanConstantOp BooleanConstantOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, bool value) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(value)>(value));
auto __res__ = ::llvm::dyn_cast<BooleanConstantOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
BooleanConstantOp BooleanConstantOp::create(::mlir::ImplicitLocOpBuilder &builder, bool value) {
return create(builder, builder.getLoc(), std::forward<decltype(value)>(value));
}
void BooleanConstantOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, bool value) {
odsState.getOrAddProperties<Properties>().value = odsBuilder.getBoolAttr(value);
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
BooleanConstantOp BooleanConstantOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, bool value) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(value)>(value));
auto __res__ = ::llvm::dyn_cast<BooleanConstantOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
BooleanConstantOp BooleanConstantOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, bool value) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(value)>(value));
}
void BooleanConstantOp::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<BooleanConstantOp::Properties>();
::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.");
}
}
BooleanConstantOp BooleanConstantOp::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<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<BooleanConstantOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
BooleanConstantOp BooleanConstantOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void BooleanConstantOp::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<BooleanConstantOp::Properties>();
::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(BooleanConstantOp::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).");
}
}
BooleanConstantOp BooleanConstantOp::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<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<BooleanConstantOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
BooleanConstantOp BooleanConstantOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void BooleanConstantOp::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&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
BooleanConstantOp BooleanConstantOp::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<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<BooleanConstantOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
BooleanConstantOp BooleanConstantOp::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<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
void BooleanConstantOp::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 &>(properties));
odsState.addAttributes(discardableAttributes);
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(BooleanConstantOp::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).");
}
}
BooleanConstantOp BooleanConstantOp::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<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<BooleanConstantOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
BooleanConstantOp BooleanConstantOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
::llvm::LogicalResult BooleanConstantOp::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_LTL1(*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_LTL3(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult BooleanConstantOp::verifyInvariants() {
return verifyInvariantsImpl();
}
::llvm::LogicalResult BooleanConstantOp::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<circt::ltl::PropertyType>();
inferredReturnTypes[0] = odsInferredType0;
return ::mlir::success();
}
::mlir::ParseResult BooleanConstantOp::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<BooleanConstantOp::Properties>().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<circt::ltl::PropertyType>();
result.addTypes(odsBuildableType0);
return ::mlir::success();
}
void BooleanConstantOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
_odsPrinter << ' ';
_odsPrinter.printAttributeWithoutType(getValueAttr());
::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
elidedAttrs.push_back("value");
_odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
}
void BooleanConstantOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}
} // namespace circt::ltl
MLIR_DEFINE_EXPLICIT_TYPE_ID(circt::ltl::BooleanConstantOp)
MLIR_DEFINE_EXPLICIT_TYPE_ID(circt::ltl::detail::BooleanConstantOpGenericAdaptorBase::Properties)
namespace circt::ltl {
//===----------------------------------------------------------------------===//
// circt::ltl::ClockOp definitions
//===----------------------------------------------------------------------===//
namespace detail {
ClockOpGenericAdaptorBase::ClockOpGenericAdaptorBase(ClockOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
circt::ltl::ClockEdge ClockOpGenericAdaptorBase::getEdge() {
auto attr = getEdgeAttr();
return attr.getValue();
}
} // namespace detail
ClockOpAdaptor::ClockOpAdaptor(ClockOp op) : ClockOpGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult ClockOpAdaptor::verify(::mlir::Location loc) {
auto tblgen_edge = getProperties().edge; (void)tblgen_edge;
if (!tblgen_edge) return emitError(loc, "'ltl.clock' op requires attribute 'edge'");
if (tblgen_edge && !((::llvm::isa<circt::ltl::ClockEdgeAttr>(tblgen_edge))))
return emitError(loc, "'ltl.clock' op attribute 'edge' failed to satisfy constraint: clock edge");
return ::mlir::success();
}
::llvm::LogicalResult ClockOp::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.edge;
auto attr = dict.get("edge");
if (attr) {
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `edge` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
return ::mlir::success();
}
::mlir::Attribute ClockOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
{
const auto &propStorage = prop.edge;
if (propStorage)
attrs.push_back(odsBuilder.getNamedAttr("edge",
propStorage));
}
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code ClockOp::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine(
llvm::hash_value(prop.edge.getAsOpaquePointer()));
}
std::optional<mlir::Attribute> ClockOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
if (name == "edge")
return prop.edge;
return std::nullopt;
}
void ClockOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
if (name == "edge") {
prop.edge = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.edge)>>(value);
return;
}
}
void ClockOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
if (prop.edge) attrs.append("edge", prop.edge);
}
::llvm::LogicalResult ClockOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
{
::mlir::Attribute attr = attrs.get(getEdgeAttrName(opName));
if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_LTL2(attr, "edge", emitError)))
return ::mlir::failure();
}
return ::mlir::success();
}
::llvm::LogicalResult ClockOp::readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state) {
auto &prop = state.getOrAddProperties<Properties>(); (void)prop;
if (::mlir::failed(reader.readAttribute(prop.edge)))
return ::mlir::failure();
return ::mlir::success();
}
void ClockOp::writeProperties(::mlir::DialectBytecodeWriter &writer) {
auto &prop = getProperties(); (void)prop;
writer.writeAttribute(prop.edge);
}
circt::ltl::ClockEdge ClockOp::getEdge() {
auto attr = getEdgeAttr();
return attr.getValue();
}
void ClockOp::setEdge(circt::ltl::ClockEdge attrValue) {
getProperties().edge = circt::ltl::ClockEdgeAttr::get(::mlir::Builder((*this)->getContext()).getContext(), attrValue);
}
void ClockOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value input, circt::ltl::ClockEdgeAttr edge, ::mlir::Value clock) {
odsState.addOperands(input);
odsState.addOperands(clock);
odsState.getOrAddProperties<Properties>().edge = edge;
odsState.addTypes(result);
}
ClockOp ClockOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value input, circt::ltl::ClockEdgeAttr edge, ::mlir::Value clock) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(result)>(result), std::forward<decltype(input)>(input), std::forward<decltype(edge)>(edge), std::forward<decltype(clock)>(clock));
auto __res__ = ::llvm::dyn_cast<ClockOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ClockOp ClockOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::Value input, circt::ltl::ClockEdgeAttr edge, ::mlir::Value clock) {
return create(builder, builder.getLoc(), std::forward<decltype(result)>(result), std::forward<decltype(input)>(input), std::forward<decltype(edge)>(edge), std::forward<decltype(clock)>(clock));
}
void ClockOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value input, circt::ltl::ClockEdgeAttr edge, ::mlir::Value clock) {
odsState.addOperands(input);
odsState.addOperands(clock);
odsState.getOrAddProperties<Properties>().edge = edge;
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(ClockOp::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);
}
ClockOp ClockOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value input, circt::ltl::ClockEdgeAttr edge, ::mlir::Value clock) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(input)>(input), std::forward<decltype(edge)>(edge), std::forward<decltype(clock)>(clock));
auto __res__ = ::llvm::dyn_cast<ClockOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ClockOp ClockOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value input, circt::ltl::ClockEdgeAttr edge, ::mlir::Value clock) {
return create(builder, builder.getLoc(), std::forward<decltype(input)>(input), std::forward<decltype(edge)>(edge), std::forward<decltype(clock)>(clock));
}
void ClockOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input, circt::ltl::ClockEdgeAttr edge, ::mlir::Value clock) {
odsState.addOperands(input);
odsState.addOperands(clock);
odsState.getOrAddProperties<Properties>().edge = edge;
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
ClockOp ClockOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value input, circt::ltl::ClockEdgeAttr edge, ::mlir::Value clock) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(input)>(input), std::forward<decltype(edge)>(edge), std::forward<decltype(clock)>(clock));
auto __res__ = ::llvm::dyn_cast<ClockOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ClockOp ClockOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value input, circt::ltl::ClockEdgeAttr edge, ::mlir::Value clock) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(input)>(input), std::forward<decltype(edge)>(edge), std::forward<decltype(clock)>(clock));
}
void ClockOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value input, circt::ltl::ClockEdge edge, ::mlir::Value clock) {
odsState.addOperands(input);
odsState.addOperands(clock);
odsState.getOrAddProperties<Properties>().edge = circt::ltl::ClockEdgeAttr::get(odsBuilder.getContext(), edge);
odsState.addTypes(result);
}
ClockOp ClockOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value input, circt::ltl::ClockEdge edge, ::mlir::Value clock) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(result)>(result), std::forward<decltype(input)>(input), std::forward<decltype(edge)>(edge), std::forward<decltype(clock)>(clock));
auto __res__ = ::llvm::dyn_cast<ClockOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ClockOp ClockOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::Value input, circt::ltl::ClockEdge edge, ::mlir::Value clock) {
return create(builder, builder.getLoc(), std::forward<decltype(result)>(result), std::forward<decltype(input)>(input), std::forward<decltype(edge)>(edge), std::forward<decltype(clock)>(clock));
}
void ClockOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value input, circt::ltl::ClockEdge edge, ::mlir::Value clock) {
odsState.addOperands(input);
odsState.addOperands(clock);
odsState.getOrAddProperties<Properties>().edge = circt::ltl::ClockEdgeAttr::get(odsBuilder.getContext(), edge);
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(ClockOp::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);
}
ClockOp ClockOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value input, circt::ltl::ClockEdge edge, ::mlir::Value clock) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(input)>(input), std::forward<decltype(edge)>(edge), std::forward<decltype(clock)>(clock));
auto __res__ = ::llvm::dyn_cast<ClockOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ClockOp ClockOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value input, circt::ltl::ClockEdge edge, ::mlir::Value clock) {
return create(builder, builder.getLoc(), std::forward<decltype(input)>(input), std::forward<decltype(edge)>(edge), std::forward<decltype(clock)>(clock));
}
void ClockOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input, circt::ltl::ClockEdge edge, ::mlir::Value clock) {
odsState.addOperands(input);
odsState.addOperands(clock);
odsState.getOrAddProperties<Properties>().edge = circt::ltl::ClockEdgeAttr::get(odsBuilder.getContext(), edge);
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
ClockOp ClockOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value input, circt::ltl::ClockEdge edge, ::mlir::Value clock) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(input)>(input), std::forward<decltype(edge)>(edge), std::forward<decltype(clock)>(clock));
auto __res__ = ::llvm::dyn_cast<ClockOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ClockOp ClockOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value input, circt::ltl::ClockEdge edge, ::mlir::Value clock) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(input)>(input), std::forward<decltype(edge)>(edge), std::forward<decltype(clock)>(clock));
}
void ClockOp::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<ClockOp::Properties>();
::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.");
}
}
ClockOp ClockOp::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<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<ClockOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ClockOp ClockOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void ClockOp::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<ClockOp::Properties>();
::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(ClockOp::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).");
}
}
ClockOp ClockOp::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<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<ClockOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ClockOp ClockOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void ClockOp::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&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
ClockOp ClockOp::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<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<ClockOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ClockOp ClockOp::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<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
void ClockOp::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 &>(properties));
odsState.addAttributes(discardableAttributes);
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(ClockOp::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).");
}
}
ClockOp ClockOp::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<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<ClockOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ClockOp ClockOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
::llvm::LogicalResult ClockOp::verifyInvariantsImpl() {
auto tblgen_edge = getProperties().edge; (void)tblgen_edge;
if (!tblgen_edge) return emitOpError("requires attribute 'edge'");
if (::mlir::failed(__mlir_ods_local_attr_constraint_LTL2(*this, tblgen_edge, "edge")))
return ::mlir::failure();
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LTL2(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup1 = getODSOperands(1);
for (auto v : valueGroup1) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LTL4(*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_LTL5(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult ClockOp::verifyInvariants() {
return verifyInvariantsImpl();
}
::mlir::ParseResult ClockOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
::mlir::OpAsmParser::UnresolvedOperand inputRawOperand{};
::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> inputOperands(&inputRawOperand, 1); ::llvm::SMLoc inputOperandsLoc;
(void)inputOperandsLoc;
circt::ltl::ClockEdgeAttr edgeAttr;
::mlir::OpAsmParser::UnresolvedOperand clockRawOperand{};
::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> clockOperands(&clockRawOperand, 1); ::llvm::SMLoc clockOperandsLoc;
(void)clockOperandsLoc;
::mlir::Type inputRawType{};
::llvm::ArrayRef<::mlir::Type> inputTypes(&inputRawType, 1);
inputOperandsLoc = parser.getCurrentLocation();
if (parser.parseOperand(inputRawOperand))
return ::mlir::failure();
if (parser.parseComma())
return ::mlir::failure();
{
::llvm::StringRef attrStr;
::mlir::NamedAttrList attrStorage;
auto loc = parser.getCurrentLocation();
if (parser.parseOptionalKeyword(&attrStr, {"posedge","negedge","edge"})) {
::mlir::StringAttr attrVal;
::mlir::OptionalParseResult parseResult =
parser.parseOptionalAttribute(attrVal,
parser.getBuilder().getNoneType(),
"edge", 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 'edge' [posedge, negedge, edge]");
}
}
if (!attrStr.empty()) {
auto attrOptional = circt::ltl::symbolizeClockEdge(attrStr);
if (!attrOptional)
return parser.emitError(loc, "invalid ")
<< "edge attribute specification: \"" << attrStr << '"';;
edgeAttr = circt::ltl::ClockEdgeAttr::get(parser.getBuilder().getContext(), *attrOptional);
result.getOrAddProperties<ClockOp::Properties>().edge = edgeAttr;
}
}
clockOperandsLoc = parser.getCurrentLocation();
if (parser.parseOperand(clockRawOperand))
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::Type type;
if (parser.parseCustomTypeWithFallback(type))
return ::mlir::failure();
inputRawType = type;
}
::mlir::Type odsBuildableType0 = parser.getBuilder().getIntegerType(1);
if (parser.resolveOperands(inputOperands, inputTypes, inputOperandsLoc, result.operands))
return ::mlir::failure();
if (parser.resolveOperands(clockOperands, odsBuildableType0, clockOperandsLoc, result.operands))
return ::mlir::failure();
::llvm::SmallVector<::mlir::Type> inferredReturnTypes;
if (::mlir::failed(ClockOp::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 ClockOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
_odsPrinter << ' ';
_odsPrinter << getInput();
_odsPrinter << ",";
_odsPrinter << ' ';
{
auto caseValue = getEdge();
auto caseValueStr = stringifyClockEdge(caseValue);
_odsPrinter << caseValueStr;
}
_odsPrinter << ' ';
_odsPrinter << getClock();
::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
elidedAttrs.push_back("edge");
_odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
_odsPrinter << ' ' << ":";
_odsPrinter << ' ';
{
auto type = getInput().getType();
if (auto validType = ::llvm::dyn_cast<::mlir::Type>(type))
_odsPrinter.printStrippedAttrOrType(validType);
else
_odsPrinter << type;
}
}
void ClockOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}
} // namespace circt::ltl
MLIR_DEFINE_EXPLICIT_TYPE_ID(circt::ltl::ClockOp)
MLIR_DEFINE_EXPLICIT_TYPE_ID(circt::ltl::detail::ClockOpGenericAdaptorBase::Properties)
namespace circt::ltl {
//===----------------------------------------------------------------------===//
// circt::ltl::ClockedDelayOp definitions
//===----------------------------------------------------------------------===//
namespace detail {
ClockedDelayOpGenericAdaptorBase::ClockedDelayOpGenericAdaptorBase(ClockedDelayOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
circt::ltl::ClockEdge ClockedDelayOpGenericAdaptorBase::getEdge() {
auto attr = getEdgeAttr();
return attr.getValue();
}
uint64_t ClockedDelayOpGenericAdaptorBase::getDelay() {
auto attr = getDelayAttr();
return attr.getValue().getZExtValue();
}
::std::optional<uint64_t> ClockedDelayOpGenericAdaptorBase::getLength() {
auto attr = getLengthAttr();
return attr ? ::std::optional<uint64_t>(attr.getValue().getZExtValue()) : (::std::nullopt);
}
} // namespace detail
ClockedDelayOpAdaptor::ClockedDelayOpAdaptor(ClockedDelayOp op) : ClockedDelayOpGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult ClockedDelayOpAdaptor::verify(::mlir::Location loc) {
auto tblgen_delay = getProperties().delay; (void)tblgen_delay;
if (!tblgen_delay) return emitError(loc, "'ltl.clocked_delay' op requires attribute 'delay'");
auto tblgen_edge = getProperties().edge; (void)tblgen_edge;
if (!tblgen_edge) return emitError(loc, "'ltl.clocked_delay' op requires attribute 'edge'");
auto tblgen_length = getProperties().length; (void)tblgen_length;
if (tblgen_edge && !((::llvm::isa<circt::ltl::ClockEdgeAttr>(tblgen_edge))))
return emitError(loc, "'ltl.clocked_delay' op attribute 'edge' failed to satisfy constraint: clock edge");
if (tblgen_delay && !(((::llvm::isa<::mlir::IntegerAttr>(tblgen_delay))) && ((::llvm::cast<::mlir::IntegerAttr>(tblgen_delay).getType().isSignlessInteger(64)))))
return emitError(loc, "'ltl.clocked_delay' op attribute 'delay' failed to satisfy constraint: 64-bit signless integer attribute");
if (tblgen_length && !(((::llvm::isa<::mlir::IntegerAttr>(tblgen_length))) && ((::llvm::cast<::mlir::IntegerAttr>(tblgen_length).getType().isSignlessInteger(64)))))
return emitError(loc, "'ltl.clocked_delay' op attribute 'length' failed to satisfy constraint: 64-bit signless integer attribute");
return ::mlir::success();
}
::llvm::LogicalResult ClockedDelayOp::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.delay;
auto attr = dict.get("delay");
if (attr) {
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `delay` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
{
auto &propStorage = prop.edge;
auto attr = dict.get("edge");
if (attr) {
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `edge` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
{
auto &propStorage = prop.length;
auto attr = dict.get("length");
if (attr) {
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `length` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
return ::mlir::success();
}
::mlir::Attribute ClockedDelayOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
{
const auto &propStorage = prop.delay;
if (propStorage)
attrs.push_back(odsBuilder.getNamedAttr("delay",
propStorage));
}
{
const auto &propStorage = prop.edge;
if (propStorage)
attrs.push_back(odsBuilder.getNamedAttr("edge",
propStorage));
}
{
const auto &propStorage = prop.length;
if (propStorage)
attrs.push_back(odsBuilder.getNamedAttr("length",
propStorage));
}
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code ClockedDelayOp::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine(
llvm::hash_value(prop.delay.getAsOpaquePointer()),
llvm::hash_value(prop.edge.getAsOpaquePointer()),
llvm::hash_value(prop.length.getAsOpaquePointer()));
}
std::optional<mlir::Attribute> ClockedDelayOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
if (name == "delay")
return prop.delay;
if (name == "edge")
return prop.edge;
if (name == "length")
return prop.length;
return std::nullopt;
}
void ClockedDelayOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
if (name == "delay") {
prop.delay = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.delay)>>(value);
return;
}
if (name == "edge") {
prop.edge = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.edge)>>(value);
return;
}
if (name == "length") {
prop.length = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.length)>>(value);
return;
}
}
void ClockedDelayOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
if (prop.delay) attrs.append("delay", prop.delay);
if (prop.edge) attrs.append("edge", prop.edge);
if (prop.length) attrs.append("length", prop.length);
}
::llvm::LogicalResult ClockedDelayOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
{
::mlir::Attribute attr = attrs.get(getDelayAttrName(opName));
if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_LTL3(attr, "delay", emitError)))
return ::mlir::failure();
}
{
::mlir::Attribute attr = attrs.get(getEdgeAttrName(opName));
if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_LTL2(attr, "edge", emitError)))
return ::mlir::failure();
}
{
::mlir::Attribute attr = attrs.get(getLengthAttrName(opName));
if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_LTL3(attr, "length", emitError)))
return ::mlir::failure();
}
return ::mlir::success();
}
::llvm::LogicalResult ClockedDelayOp::readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state) {
auto &prop = state.getOrAddProperties<Properties>(); (void)prop;
if (::mlir::failed(reader.readAttribute(prop.delay)))
return ::mlir::failure();
if (::mlir::failed(reader.readAttribute(prop.edge)))
return ::mlir::failure();
if (::mlir::failed(reader.readOptionalAttribute(prop.length)))
return ::mlir::failure();
return ::mlir::success();
}
void ClockedDelayOp::writeProperties(::mlir::DialectBytecodeWriter &writer) {
auto &prop = getProperties(); (void)prop;
writer.writeAttribute(prop.delay);
writer.writeAttribute(prop.edge);
writer.writeOptionalAttribute(prop.length);
}
circt::ltl::ClockEdge ClockedDelayOp::getEdge() {
auto attr = getEdgeAttr();
return attr.getValue();
}
uint64_t ClockedDelayOp::getDelay() {
auto attr = getDelayAttr();
return attr.getValue().getZExtValue();
}
::std::optional<uint64_t> ClockedDelayOp::getLength() {
auto attr = getLengthAttr();
return attr ? ::std::optional<uint64_t>(attr.getValue().getZExtValue()) : (::std::nullopt);
}
void ClockedDelayOp::setEdge(circt::ltl::ClockEdge attrValue) {
getProperties().edge = circt::ltl::ClockEdgeAttr::get(::mlir::Builder((*this)->getContext()).getContext(), attrValue);
}
void ClockedDelayOp::setDelay(uint64_t attrValue) {
getProperties().delay = ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(64), attrValue);
}
void ClockedDelayOp::setLength(::std::optional<uint64_t> attrValue) {
auto &odsProp = getProperties().length;
if (attrValue)
odsProp = ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(64), *attrValue);
else
odsProp = nullptr;
}
void ClockedDelayOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value input, circt::ltl::ClockEdgeAttr edge, ::mlir::Value clock, ::mlir::IntegerAttr delay, /*optional*/::mlir::IntegerAttr length) {
odsState.addOperands(input);
odsState.addOperands(clock);
odsState.getOrAddProperties<Properties>().edge = edge;
odsState.getOrAddProperties<Properties>().delay = delay;
if (length) {
odsState.getOrAddProperties<Properties>().length = length;
}
odsState.addTypes(result);
}
ClockedDelayOp ClockedDelayOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value input, circt::ltl::ClockEdgeAttr edge, ::mlir::Value clock, ::mlir::IntegerAttr delay, /*optional*/::mlir::IntegerAttr length) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(result)>(result), std::forward<decltype(input)>(input), std::forward<decltype(edge)>(edge), std::forward<decltype(clock)>(clock), std::forward<decltype(delay)>(delay), std::forward<decltype(length)>(length));
auto __res__ = ::llvm::dyn_cast<ClockedDelayOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ClockedDelayOp ClockedDelayOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::Value input, circt::ltl::ClockEdgeAttr edge, ::mlir::Value clock, ::mlir::IntegerAttr delay, /*optional*/::mlir::IntegerAttr length) {
return create(builder, builder.getLoc(), std::forward<decltype(result)>(result), std::forward<decltype(input)>(input), std::forward<decltype(edge)>(edge), std::forward<decltype(clock)>(clock), std::forward<decltype(delay)>(delay), std::forward<decltype(length)>(length));
}
void ClockedDelayOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value input, circt::ltl::ClockEdgeAttr edge, ::mlir::Value clock, ::mlir::IntegerAttr delay, /*optional*/::mlir::IntegerAttr length) {
odsState.addOperands(input);
odsState.addOperands(clock);
odsState.getOrAddProperties<Properties>().edge = edge;
odsState.getOrAddProperties<Properties>().delay = delay;
if (length) {
odsState.getOrAddProperties<Properties>().length = length;
}
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(ClockedDelayOp::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);
}
ClockedDelayOp ClockedDelayOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value input, circt::ltl::ClockEdgeAttr edge, ::mlir::Value clock, ::mlir::IntegerAttr delay, /*optional*/::mlir::IntegerAttr length) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(input)>(input), std::forward<decltype(edge)>(edge), std::forward<decltype(clock)>(clock), std::forward<decltype(delay)>(delay), std::forward<decltype(length)>(length));
auto __res__ = ::llvm::dyn_cast<ClockedDelayOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ClockedDelayOp ClockedDelayOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value input, circt::ltl::ClockEdgeAttr edge, ::mlir::Value clock, ::mlir::IntegerAttr delay, /*optional*/::mlir::IntegerAttr length) {
return create(builder, builder.getLoc(), std::forward<decltype(input)>(input), std::forward<decltype(edge)>(edge), std::forward<decltype(clock)>(clock), std::forward<decltype(delay)>(delay), std::forward<decltype(length)>(length));
}
void ClockedDelayOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input, circt::ltl::ClockEdgeAttr edge, ::mlir::Value clock, ::mlir::IntegerAttr delay, /*optional*/::mlir::IntegerAttr length) {
odsState.addOperands(input);
odsState.addOperands(clock);
odsState.getOrAddProperties<Properties>().edge = edge;
odsState.getOrAddProperties<Properties>().delay = delay;
if (length) {
odsState.getOrAddProperties<Properties>().length = length;
}
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
ClockedDelayOp ClockedDelayOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value input, circt::ltl::ClockEdgeAttr edge, ::mlir::Value clock, ::mlir::IntegerAttr delay, /*optional*/::mlir::IntegerAttr length) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(input)>(input), std::forward<decltype(edge)>(edge), std::forward<decltype(clock)>(clock), std::forward<decltype(delay)>(delay), std::forward<decltype(length)>(length));
auto __res__ = ::llvm::dyn_cast<ClockedDelayOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ClockedDelayOp ClockedDelayOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value input, circt::ltl::ClockEdgeAttr edge, ::mlir::Value clock, ::mlir::IntegerAttr delay, /*optional*/::mlir::IntegerAttr length) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(input)>(input), std::forward<decltype(edge)>(edge), std::forward<decltype(clock)>(clock), std::forward<decltype(delay)>(delay), std::forward<decltype(length)>(length));
}
void ClockedDelayOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value input, circt::ltl::ClockEdge edge, ::mlir::Value clock, uint64_t delay, /*optional*/::mlir::IntegerAttr length) {
odsState.addOperands(input);
odsState.addOperands(clock);
odsState.getOrAddProperties<Properties>().edge = circt::ltl::ClockEdgeAttr::get(odsBuilder.getContext(), edge);
odsState.getOrAddProperties<Properties>().delay = odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), delay);
if (length) {
odsState.getOrAddProperties<Properties>().length = length;
}
odsState.addTypes(result);
}
ClockedDelayOp ClockedDelayOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value input, circt::ltl::ClockEdge edge, ::mlir::Value clock, uint64_t delay, /*optional*/::mlir::IntegerAttr length) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(result)>(result), std::forward<decltype(input)>(input), std::forward<decltype(edge)>(edge), std::forward<decltype(clock)>(clock), std::forward<decltype(delay)>(delay), std::forward<decltype(length)>(length));
auto __res__ = ::llvm::dyn_cast<ClockedDelayOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ClockedDelayOp ClockedDelayOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::Value input, circt::ltl::ClockEdge edge, ::mlir::Value clock, uint64_t delay, /*optional*/::mlir::IntegerAttr length) {
return create(builder, builder.getLoc(), std::forward<decltype(result)>(result), std::forward<decltype(input)>(input), std::forward<decltype(edge)>(edge), std::forward<decltype(clock)>(clock), std::forward<decltype(delay)>(delay), std::forward<decltype(length)>(length));
}
void ClockedDelayOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value input, circt::ltl::ClockEdge edge, ::mlir::Value clock, uint64_t delay, /*optional*/::mlir::IntegerAttr length) {
odsState.addOperands(input);
odsState.addOperands(clock);
odsState.getOrAddProperties<Properties>().edge = circt::ltl::ClockEdgeAttr::get(odsBuilder.getContext(), edge);
odsState.getOrAddProperties<Properties>().delay = odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), delay);
if (length) {
odsState.getOrAddProperties<Properties>().length = length;
}
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(ClockedDelayOp::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);
}
ClockedDelayOp ClockedDelayOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value input, circt::ltl::ClockEdge edge, ::mlir::Value clock, uint64_t delay, /*optional*/::mlir::IntegerAttr length) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(input)>(input), std::forward<decltype(edge)>(edge), std::forward<decltype(clock)>(clock), std::forward<decltype(delay)>(delay), std::forward<decltype(length)>(length));
auto __res__ = ::llvm::dyn_cast<ClockedDelayOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ClockedDelayOp ClockedDelayOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value input, circt::ltl::ClockEdge edge, ::mlir::Value clock, uint64_t delay, /*optional*/::mlir::IntegerAttr length) {
return create(builder, builder.getLoc(), std::forward<decltype(input)>(input), std::forward<decltype(edge)>(edge), std::forward<decltype(clock)>(clock), std::forward<decltype(delay)>(delay), std::forward<decltype(length)>(length));
}
void ClockedDelayOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input, circt::ltl::ClockEdge edge, ::mlir::Value clock, uint64_t delay, /*optional*/::mlir::IntegerAttr length) {
odsState.addOperands(input);
odsState.addOperands(clock);
odsState.getOrAddProperties<Properties>().edge = circt::ltl::ClockEdgeAttr::get(odsBuilder.getContext(), edge);
odsState.getOrAddProperties<Properties>().delay = odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), delay);
if (length) {
odsState.getOrAddProperties<Properties>().length = length;
}
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
ClockedDelayOp ClockedDelayOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value input, circt::ltl::ClockEdge edge, ::mlir::Value clock, uint64_t delay, /*optional*/::mlir::IntegerAttr length) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(input)>(input), std::forward<decltype(edge)>(edge), std::forward<decltype(clock)>(clock), std::forward<decltype(delay)>(delay), std::forward<decltype(length)>(length));
auto __res__ = ::llvm::dyn_cast<ClockedDelayOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ClockedDelayOp ClockedDelayOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value input, circt::ltl::ClockEdge edge, ::mlir::Value clock, uint64_t delay, /*optional*/::mlir::IntegerAttr length) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(input)>(input), std::forward<decltype(edge)>(edge), std::forward<decltype(clock)>(clock), std::forward<decltype(delay)>(delay), std::forward<decltype(length)>(length));
}
void ClockedDelayOp::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<ClockedDelayOp::Properties>();
::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.");
}
}
ClockedDelayOp ClockedDelayOp::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<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<ClockedDelayOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ClockedDelayOp ClockedDelayOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void ClockedDelayOp::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<ClockedDelayOp::Properties>();
::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(ClockedDelayOp::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).");
}
}
ClockedDelayOp ClockedDelayOp::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<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<ClockedDelayOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ClockedDelayOp ClockedDelayOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void ClockedDelayOp::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&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
ClockedDelayOp ClockedDelayOp::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<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<ClockedDelayOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ClockedDelayOp ClockedDelayOp::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<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
void ClockedDelayOp::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 &>(properties));
odsState.addAttributes(discardableAttributes);
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(ClockedDelayOp::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).");
}
}
ClockedDelayOp ClockedDelayOp::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<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<ClockedDelayOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ClockedDelayOp ClockedDelayOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
::llvm::LogicalResult ClockedDelayOp::verifyInvariantsImpl() {
auto tblgen_delay = getProperties().delay; (void)tblgen_delay;
if (!tblgen_delay) return emitOpError("requires attribute 'delay'");
auto tblgen_edge = getProperties().edge; (void)tblgen_edge;
if (!tblgen_edge) return emitOpError("requires attribute 'edge'");
auto tblgen_length = getProperties().length; (void)tblgen_length;
if (::mlir::failed(__mlir_ods_local_attr_constraint_LTL2(*this, tblgen_edge, "edge")))
return ::mlir::failure();
if (::mlir::failed(__mlir_ods_local_attr_constraint_LTL3(*this, tblgen_delay, "delay")))
return ::mlir::failure();
if (::mlir::failed(__mlir_ods_local_attr_constraint_LTL3(*this, tblgen_length, "length")))
return ::mlir::failure();
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LTL6(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup1 = getODSOperands(1);
for (auto v : valueGroup1) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LTL4(*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_LTL7(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult ClockedDelayOp::verifyInvariants() {
return verifyInvariantsImpl();
}
::llvm::LogicalResult ClockedDelayOp::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<circt::ltl::SequenceType>();
inferredReturnTypes[0] = odsInferredType0;
return ::mlir::success();
}
::mlir::ParseResult ClockedDelayOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
::mlir::OpAsmParser::UnresolvedOperand inputRawOperand{};
::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> inputOperands(&inputRawOperand, 1); ::llvm::SMLoc inputOperandsLoc;
(void)inputOperandsLoc;
circt::ltl::ClockEdgeAttr edgeAttr;
::mlir::OpAsmParser::UnresolvedOperand clockRawOperand{};
::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> clockOperands(&clockRawOperand, 1); ::llvm::SMLoc clockOperandsLoc;
(void)clockOperandsLoc;
::mlir::IntegerAttr delayAttr;
::mlir::IntegerAttr lengthAttr;
::mlir::Type inputRawType{};
::llvm::ArrayRef<::mlir::Type> inputTypes(&inputRawType, 1);
inputOperandsLoc = parser.getCurrentLocation();
if (parser.parseOperand(inputRawOperand))
return ::mlir::failure();
if (parser.parseComma())
return ::mlir::failure();
{
::llvm::StringRef attrStr;
::mlir::NamedAttrList attrStorage;
auto loc = parser.getCurrentLocation();
if (parser.parseOptionalKeyword(&attrStr, {"posedge","negedge","edge"})) {
::mlir::StringAttr attrVal;
::mlir::OptionalParseResult parseResult =
parser.parseOptionalAttribute(attrVal,
parser.getBuilder().getNoneType(),
"edge", 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 'edge' [posedge, negedge, edge]");
}
}
if (!attrStr.empty()) {
auto attrOptional = circt::ltl::symbolizeClockEdge(attrStr);
if (!attrOptional)
return parser.emitError(loc, "invalid ")
<< "edge attribute specification: \"" << attrStr << '"';;
edgeAttr = circt::ltl::ClockEdgeAttr::get(parser.getBuilder().getContext(), *attrOptional);
result.getOrAddProperties<ClockedDelayOp::Properties>().edge = edgeAttr;
}
}
clockOperandsLoc = parser.getCurrentLocation();
if (parser.parseOperand(clockRawOperand))
return ::mlir::failure();
if (parser.parseComma())
return ::mlir::failure();
if (parser.parseCustomAttributeWithFallback(delayAttr, parser.getBuilder().getIntegerType(64))) {
return ::mlir::failure();
}
if (delayAttr) result.getOrAddProperties<ClockedDelayOp::Properties>().delay = delayAttr;
if (::mlir::succeeded(parser.parseOptionalComma())) {
if (parser.parseCustomAttributeWithFallback(lengthAttr, parser.getBuilder().getIntegerType(64))) {
return ::mlir::failure();
}
if (lengthAttr) result.getOrAddProperties<ClockedDelayOp::Properties>().length = lengthAttr;
}
{
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::Type type;
if (parser.parseCustomTypeWithFallback(type))
return ::mlir::failure();
inputRawType = type;
}
::mlir::Type odsBuildableType0 = parser.getBuilder().getType<circt::ltl::SequenceType>();
::mlir::Type odsBuildableType1 = parser.getBuilder().getIntegerType(1);
result.addTypes(odsBuildableType0);
if (parser.resolveOperands(inputOperands, inputTypes, inputOperandsLoc, result.operands))
return ::mlir::failure();
if (parser.resolveOperands(clockOperands, odsBuildableType1, clockOperandsLoc, result.operands))
return ::mlir::failure();
return ::mlir::success();
}
void ClockedDelayOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
_odsPrinter << ' ';
_odsPrinter << getInput();
_odsPrinter << ",";
_odsPrinter << ' ';
{
auto caseValue = getEdge();
auto caseValueStr = stringifyClockEdge(caseValue);
_odsPrinter << caseValueStr;
}
_odsPrinter << ' ';
_odsPrinter << getClock();
_odsPrinter << ",";
_odsPrinter << ' ';
_odsPrinter.printAttributeWithoutType(getDelayAttr());
if (getLengthAttr()) {
_odsPrinter << ",";
_odsPrinter << ' ';
_odsPrinter.printAttributeWithoutType(getLengthAttr());
}
::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
elidedAttrs.push_back("edge");
elidedAttrs.push_back("delay");
elidedAttrs.push_back("length");
_odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
_odsPrinter << ' ' << ":";
_odsPrinter << ' ';
{
auto type = getInput().getType();
if (auto validType = ::llvm::dyn_cast<::mlir::Type>(type))
_odsPrinter.printStrippedAttrOrType(validType);
else
_odsPrinter << type;
}
}
void ClockedDelayOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}
} // namespace circt::ltl
MLIR_DEFINE_EXPLICIT_TYPE_ID(circt::ltl::ClockedDelayOp)
MLIR_DEFINE_EXPLICIT_TYPE_ID(circt::ltl::detail::ClockedDelayOpGenericAdaptorBase::Properties)
namespace circt::ltl {
//===----------------------------------------------------------------------===//
// circt::ltl::ConcatOp definitions
//===----------------------------------------------------------------------===//
namespace detail {
ConcatOpGenericAdaptorBase::ConcatOpGenericAdaptorBase(ConcatOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
std::pair<unsigned, unsigned> ConcatOpGenericAdaptorBase::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
ConcatOpAdaptor::ConcatOpAdaptor(ConcatOp op) : ConcatOpGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult ConcatOpAdaptor::verify(::mlir::Location loc) {
return ::mlir::success();
}
std::pair<unsigned, unsigned> ConcatOp::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 ConcatOp::getInputsMutable() {
auto range = getODSOperandIndexAndLength(0);
auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
return mutableRange;
}
::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<mlir::Attribute> 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::ValueRange inputs) {
odsState.addOperands(inputs);
odsState.addTypes(result);
}
ConcatOp ConcatOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::ValueRange inputs) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(result)>(result), std::forward<decltype(inputs)>(inputs));
auto __res__ = ::llvm::dyn_cast<ConcatOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ConcatOp ConcatOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::ValueRange inputs) {
return create(builder, builder.getLoc(), std::forward<decltype(result)>(result), std::forward<decltype(inputs)>(inputs));
}
void ConcatOp::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);
}
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<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<ConcatOp>(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<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void ConcatOp::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(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<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<ConcatOp>(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<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void ConcatOp::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&>(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<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<ConcatOp>(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<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
void ConcatOp::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 &>(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<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<ConcatOp>(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<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(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_LTL8(*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_LTL7(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult ConcatOp::verifyInvariants() {
return verifyInvariantsImpl();
}
::llvm::LogicalResult ConcatOp::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<circt::ltl::SequenceType>();
inferredReturnTypes[0] = odsInferredType0;
return ::mlir::success();
}
::mlir::ParseResult ConcatOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
::llvm::SmallVector<::mlir::OpAsmParser::UnresolvedOperand, 4> inputsOperands;
::llvm::SMLoc inputsOperandsLoc;
(void)inputsOperandsLoc;
::llvm::SmallVector<::mlir::Type, 1> inputsTypes;
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();
}
if (parser.parseColon())
return ::mlir::failure();
if (parser.parseTypeList(inputsTypes))
return ::mlir::failure();
::mlir::Type odsBuildableType0 = parser.getBuilder().getType<circt::ltl::SequenceType>();
result.addTypes(odsBuildableType0);
if (parser.resolveOperands(inputsOperands, inputsTypes, inputsOperandsLoc, result.operands))
return ::mlir::failure();
return ::mlir::success();
}
void ConcatOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
_odsPrinter << ' ';
_odsPrinter << getInputs();
::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
_odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
_odsPrinter << ' ' << ":";
_odsPrinter << ' ';
_odsPrinter << getInputs().getTypes();
}
void ConcatOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}
} // namespace circt::ltl
MLIR_DEFINE_EXPLICIT_TYPE_ID(circt::ltl::ConcatOp)
namespace circt::ltl {
//===----------------------------------------------------------------------===//
// circt::ltl::DelayOp definitions
//===----------------------------------------------------------------------===//
namespace detail {
DelayOpGenericAdaptorBase::DelayOpGenericAdaptorBase(DelayOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
uint64_t DelayOpGenericAdaptorBase::getDelay() {
auto attr = getDelayAttr();
return attr.getValue().getZExtValue();
}
::std::optional<uint64_t> DelayOpGenericAdaptorBase::getLength() {
auto attr = getLengthAttr();
return attr ? ::std::optional<uint64_t>(attr.getValue().getZExtValue()) : (::std::nullopt);
}
} // namespace detail
DelayOpAdaptor::DelayOpAdaptor(DelayOp op) : DelayOpGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult DelayOpAdaptor::verify(::mlir::Location loc) {
auto tblgen_delay = getProperties().delay; (void)tblgen_delay;
if (!tblgen_delay) return emitError(loc, "'ltl.delay' op requires attribute 'delay'");
auto tblgen_length = getProperties().length; (void)tblgen_length;
if (tblgen_delay && !(((::llvm::isa<::mlir::IntegerAttr>(tblgen_delay))) && ((::llvm::cast<::mlir::IntegerAttr>(tblgen_delay).getType().isSignlessInteger(64)))))
return emitError(loc, "'ltl.delay' op attribute 'delay' failed to satisfy constraint: 64-bit signless integer attribute");
if (tblgen_length && !(((::llvm::isa<::mlir::IntegerAttr>(tblgen_length))) && ((::llvm::cast<::mlir::IntegerAttr>(tblgen_length).getType().isSignlessInteger(64)))))
return emitError(loc, "'ltl.delay' op attribute 'length' failed to satisfy constraint: 64-bit signless integer attribute");
return ::mlir::success();
}
::llvm::LogicalResult DelayOp::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.delay;
auto attr = dict.get("delay");
if (attr) {
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `delay` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
{
auto &propStorage = prop.length;
auto attr = dict.get("length");
if (attr) {
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `length` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
return ::mlir::success();
}
::mlir::Attribute DelayOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
{
const auto &propStorage = prop.delay;
if (propStorage)
attrs.push_back(odsBuilder.getNamedAttr("delay",
propStorage));
}
{
const auto &propStorage = prop.length;
if (propStorage)
attrs.push_back(odsBuilder.getNamedAttr("length",
propStorage));
}
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code DelayOp::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine(
llvm::hash_value(prop.delay.getAsOpaquePointer()),
llvm::hash_value(prop.length.getAsOpaquePointer()));
}
std::optional<mlir::Attribute> DelayOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
if (name == "delay")
return prop.delay;
if (name == "length")
return prop.length;
return std::nullopt;
}
void DelayOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
if (name == "delay") {
prop.delay = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.delay)>>(value);
return;
}
if (name == "length") {
prop.length = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.length)>>(value);
return;
}
}
void DelayOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
if (prop.delay) attrs.append("delay", prop.delay);
if (prop.length) attrs.append("length", prop.length);
}
::llvm::LogicalResult DelayOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
{
::mlir::Attribute attr = attrs.get(getDelayAttrName(opName));
if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_LTL3(attr, "delay", emitError)))
return ::mlir::failure();
}
{
::mlir::Attribute attr = attrs.get(getLengthAttrName(opName));
if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_LTL3(attr, "length", emitError)))
return ::mlir::failure();
}
return ::mlir::success();
}
::llvm::LogicalResult DelayOp::readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state) {
auto &prop = state.getOrAddProperties<Properties>(); (void)prop;
if (::mlir::failed(reader.readAttribute(prop.delay)))
return ::mlir::failure();
if (::mlir::failed(reader.readOptionalAttribute(prop.length)))
return ::mlir::failure();
return ::mlir::success();
}
void DelayOp::writeProperties(::mlir::DialectBytecodeWriter &writer) {
auto &prop = getProperties(); (void)prop;
writer.writeAttribute(prop.delay);
writer.writeOptionalAttribute(prop.length);
}
uint64_t DelayOp::getDelay() {
auto attr = getDelayAttr();
return attr.getValue().getZExtValue();
}
::std::optional<uint64_t> DelayOp::getLength() {
auto attr = getLengthAttr();
return attr ? ::std::optional<uint64_t>(attr.getValue().getZExtValue()) : (::std::nullopt);
}
void DelayOp::setDelay(uint64_t attrValue) {
getProperties().delay = ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(64), attrValue);
}
void DelayOp::setLength(::std::optional<uint64_t> attrValue) {
auto &odsProp = getProperties().length;
if (attrValue)
odsProp = ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(64), *attrValue);
else
odsProp = nullptr;
}
void DelayOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value input, ::mlir::IntegerAttr delay, /*optional*/::mlir::IntegerAttr length) {
odsState.addOperands(input);
odsState.getOrAddProperties<Properties>().delay = delay;
if (length) {
odsState.getOrAddProperties<Properties>().length = length;
}
odsState.addTypes(result);
}
DelayOp DelayOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value input, ::mlir::IntegerAttr delay, /*optional*/::mlir::IntegerAttr length) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(result)>(result), std::forward<decltype(input)>(input), std::forward<decltype(delay)>(delay), std::forward<decltype(length)>(length));
auto __res__ = ::llvm::dyn_cast<DelayOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
DelayOp DelayOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::Value input, ::mlir::IntegerAttr delay, /*optional*/::mlir::IntegerAttr length) {
return create(builder, builder.getLoc(), std::forward<decltype(result)>(result), std::forward<decltype(input)>(input), std::forward<decltype(delay)>(delay), std::forward<decltype(length)>(length));
}
void DelayOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value input, ::mlir::IntegerAttr delay, /*optional*/::mlir::IntegerAttr length) {
odsState.addOperands(input);
odsState.getOrAddProperties<Properties>().delay = delay;
if (length) {
odsState.getOrAddProperties<Properties>().length = length;
}
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(DelayOp::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);
}
DelayOp DelayOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value input, ::mlir::IntegerAttr delay, /*optional*/::mlir::IntegerAttr length) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(input)>(input), std::forward<decltype(delay)>(delay), std::forward<decltype(length)>(length));
auto __res__ = ::llvm::dyn_cast<DelayOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
DelayOp DelayOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value input, ::mlir::IntegerAttr delay, /*optional*/::mlir::IntegerAttr length) {
return create(builder, builder.getLoc(), std::forward<decltype(input)>(input), std::forward<decltype(delay)>(delay), std::forward<decltype(length)>(length));
}
void DelayOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input, ::mlir::IntegerAttr delay, /*optional*/::mlir::IntegerAttr length) {
odsState.addOperands(input);
odsState.getOrAddProperties<Properties>().delay = delay;
if (length) {
odsState.getOrAddProperties<Properties>().length = length;
}
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
DelayOp DelayOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value input, ::mlir::IntegerAttr delay, /*optional*/::mlir::IntegerAttr length) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(input)>(input), std::forward<decltype(delay)>(delay), std::forward<decltype(length)>(length));
auto __res__ = ::llvm::dyn_cast<DelayOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
DelayOp DelayOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value input, ::mlir::IntegerAttr delay, /*optional*/::mlir::IntegerAttr length) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(input)>(input), std::forward<decltype(delay)>(delay), std::forward<decltype(length)>(length));
}
void DelayOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value input, uint64_t delay, /*optional*/::mlir::IntegerAttr length) {
odsState.addOperands(input);
odsState.getOrAddProperties<Properties>().delay = odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), delay);
if (length) {
odsState.getOrAddProperties<Properties>().length = length;
}
odsState.addTypes(result);
}
DelayOp DelayOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value input, uint64_t delay, /*optional*/::mlir::IntegerAttr length) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(result)>(result), std::forward<decltype(input)>(input), std::forward<decltype(delay)>(delay), std::forward<decltype(length)>(length));
auto __res__ = ::llvm::dyn_cast<DelayOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
DelayOp DelayOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::Value input, uint64_t delay, /*optional*/::mlir::IntegerAttr length) {
return create(builder, builder.getLoc(), std::forward<decltype(result)>(result), std::forward<decltype(input)>(input), std::forward<decltype(delay)>(delay), std::forward<decltype(length)>(length));
}
void DelayOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value input, uint64_t delay, /*optional*/::mlir::IntegerAttr length) {
odsState.addOperands(input);
odsState.getOrAddProperties<Properties>().delay = odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), delay);
if (length) {
odsState.getOrAddProperties<Properties>().length = length;
}
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(DelayOp::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);
}
DelayOp DelayOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value input, uint64_t delay, /*optional*/::mlir::IntegerAttr length) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(input)>(input), std::forward<decltype(delay)>(delay), std::forward<decltype(length)>(length));
auto __res__ = ::llvm::dyn_cast<DelayOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
DelayOp DelayOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value input, uint64_t delay, /*optional*/::mlir::IntegerAttr length) {
return create(builder, builder.getLoc(), std::forward<decltype(input)>(input), std::forward<decltype(delay)>(delay), std::forward<decltype(length)>(length));
}
void DelayOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input, uint64_t delay, /*optional*/::mlir::IntegerAttr length) {
odsState.addOperands(input);
odsState.getOrAddProperties<Properties>().delay = odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), delay);
if (length) {
odsState.getOrAddProperties<Properties>().length = length;
}
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
DelayOp DelayOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value input, uint64_t delay, /*optional*/::mlir::IntegerAttr length) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(input)>(input), std::forward<decltype(delay)>(delay), std::forward<decltype(length)>(length));
auto __res__ = ::llvm::dyn_cast<DelayOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
DelayOp DelayOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value input, uint64_t delay, /*optional*/::mlir::IntegerAttr length) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(input)>(input), std::forward<decltype(delay)>(delay), std::forward<decltype(length)>(length));
}
void DelayOp::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<DelayOp::Properties>();
::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.");
}
}
DelayOp DelayOp::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<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<DelayOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
DelayOp DelayOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void DelayOp::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<DelayOp::Properties>();
::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(DelayOp::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).");
}
}
DelayOp DelayOp::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<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<DelayOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
DelayOp DelayOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void DelayOp::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&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
DelayOp DelayOp::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<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<DelayOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
DelayOp DelayOp::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<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
void DelayOp::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 &>(properties));
odsState.addAttributes(discardableAttributes);
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(DelayOp::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).");
}
}
DelayOp DelayOp::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<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<DelayOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
DelayOp DelayOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
::llvm::LogicalResult DelayOp::verifyInvariantsImpl() {
auto tblgen_delay = getProperties().delay; (void)tblgen_delay;
if (!tblgen_delay) return emitOpError("requires attribute 'delay'");
auto tblgen_length = getProperties().length; (void)tblgen_length;
if (::mlir::failed(__mlir_ods_local_attr_constraint_LTL3(*this, tblgen_delay, "delay")))
return ::mlir::failure();
if (::mlir::failed(__mlir_ods_local_attr_constraint_LTL3(*this, tblgen_length, "length")))
return ::mlir::failure();
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LTL6(*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_LTL7(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult DelayOp::verifyInvariants() {
return verifyInvariantsImpl();
}
::llvm::LogicalResult DelayOp::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<circt::ltl::SequenceType>();
inferredReturnTypes[0] = odsInferredType0;
return ::mlir::success();
}
::mlir::ParseResult DelayOp::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 delayAttr;
::mlir::IntegerAttr lengthAttr;
::mlir::Type inputRawType{};
::llvm::ArrayRef<::mlir::Type> inputTypes(&inputRawType, 1);
inputOperandsLoc = parser.getCurrentLocation();
if (parser.parseOperand(inputRawOperand))
return ::mlir::failure();
if (parser.parseComma())
return ::mlir::failure();
if (parser.parseCustomAttributeWithFallback(delayAttr, parser.getBuilder().getIntegerType(64))) {
return ::mlir::failure();
}
if (delayAttr) result.getOrAddProperties<DelayOp::Properties>().delay = delayAttr;
if (::mlir::succeeded(parser.parseOptionalComma())) {
if (parser.parseCustomAttributeWithFallback(lengthAttr, parser.getBuilder().getIntegerType(64))) {
return ::mlir::failure();
}
if (lengthAttr) result.getOrAddProperties<DelayOp::Properties>().length = lengthAttr;
}
{
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::Type type;
if (parser.parseCustomTypeWithFallback(type))
return ::mlir::failure();
inputRawType = type;
}
::mlir::Type odsBuildableType0 = parser.getBuilder().getType<circt::ltl::SequenceType>();
result.addTypes(odsBuildableType0);
if (parser.resolveOperands(inputOperands, inputTypes, inputOperandsLoc, result.operands))
return ::mlir::failure();
return ::mlir::success();
}
void DelayOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
_odsPrinter << ' ';
_odsPrinter << getInput();
_odsPrinter << ",";
_odsPrinter << ' ';
_odsPrinter.printAttributeWithoutType(getDelayAttr());
if (getLengthAttr()) {
_odsPrinter << ",";
_odsPrinter << ' ';
_odsPrinter.printAttributeWithoutType(getLengthAttr());
}
::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
elidedAttrs.push_back("delay");
elidedAttrs.push_back("length");
_odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
_odsPrinter << ' ' << ":";
_odsPrinter << ' ';
{
auto type = getInput().getType();
if (auto validType = ::llvm::dyn_cast<::mlir::Type>(type))
_odsPrinter.printStrippedAttrOrType(validType);
else
_odsPrinter << type;
}
}
void DelayOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}
} // namespace circt::ltl
MLIR_DEFINE_EXPLICIT_TYPE_ID(circt::ltl::DelayOp)
MLIR_DEFINE_EXPLICIT_TYPE_ID(circt::ltl::detail::DelayOpGenericAdaptorBase::Properties)
namespace circt::ltl {
//===----------------------------------------------------------------------===//
// circt::ltl::EventuallyOp definitions
//===----------------------------------------------------------------------===//
namespace detail {
EventuallyOpGenericAdaptorBase::EventuallyOpGenericAdaptorBase(EventuallyOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
} // namespace detail
EventuallyOpAdaptor::EventuallyOpAdaptor(EventuallyOp op) : EventuallyOpGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult EventuallyOpAdaptor::verify(::mlir::Location loc) {
return ::mlir::success();
}
::llvm::LogicalResult EventuallyOp::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 EventuallyOp::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 EventuallyOp::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine();
}
std::optional<mlir::Attribute> EventuallyOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
return std::nullopt;
}
void EventuallyOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
}
void EventuallyOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
}
::llvm::LogicalResult EventuallyOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
return ::mlir::success();
}
void EventuallyOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value input) {
odsState.addOperands(input);
odsState.addTypes(result);
}
EventuallyOp EventuallyOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value input) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(result)>(result), std::forward<decltype(input)>(input));
auto __res__ = ::llvm::dyn_cast<EventuallyOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
EventuallyOp EventuallyOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::Value input) {
return create(builder, builder.getLoc(), std::forward<decltype(result)>(result), std::forward<decltype(input)>(input));
}
void EventuallyOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value input) {
odsState.addOperands(input);
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(EventuallyOp::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);
}
EventuallyOp EventuallyOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value input) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(input)>(input));
auto __res__ = ::llvm::dyn_cast<EventuallyOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
EventuallyOp EventuallyOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value input) {
return create(builder, builder.getLoc(), std::forward<decltype(input)>(input));
}
void EventuallyOp::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);
}
EventuallyOp EventuallyOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value input) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(input)>(input));
auto __res__ = ::llvm::dyn_cast<EventuallyOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
EventuallyOp EventuallyOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value input) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(input)>(input));
}
void EventuallyOp::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);
}
EventuallyOp EventuallyOp::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<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<EventuallyOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
EventuallyOp EventuallyOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void EventuallyOp::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(EventuallyOp::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).");
}
}
EventuallyOp EventuallyOp::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<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<EventuallyOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
EventuallyOp EventuallyOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void EventuallyOp::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&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
EventuallyOp EventuallyOp::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<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<EventuallyOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
EventuallyOp EventuallyOp::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<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
void EventuallyOp::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 &>(properties));
odsState.addAttributes(discardableAttributes);
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(EventuallyOp::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).");
}
}
EventuallyOp EventuallyOp::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<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<EventuallyOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
EventuallyOp EventuallyOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
::llvm::LogicalResult EventuallyOp::verifyInvariantsImpl() {
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LTL2(*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_LTL3(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult EventuallyOp::verifyInvariants() {
return verifyInvariantsImpl();
}
::llvm::LogicalResult EventuallyOp::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<circt::ltl::PropertyType>();
inferredReturnTypes[0] = odsInferredType0;
return ::mlir::success();
}
::mlir::ParseResult EventuallyOp::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();
{
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::Type type;
if (parser.parseCustomTypeWithFallback(type))
return ::mlir::failure();
inputRawType = type;
}
::mlir::Type odsBuildableType0 = parser.getBuilder().getType<circt::ltl::PropertyType>();
result.addTypes(odsBuildableType0);
if (parser.resolveOperands(inputOperands, inputTypes, inputOperandsLoc, result.operands))
return ::mlir::failure();
return ::mlir::success();
}
void EventuallyOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
_odsPrinter << ' ';
_odsPrinter << getInput();
::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
_odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
_odsPrinter << ' ' << ":";
_odsPrinter << ' ';
{
auto type = getInput().getType();
if (auto validType = ::llvm::dyn_cast<::mlir::Type>(type))
_odsPrinter.printStrippedAttrOrType(validType);
else
_odsPrinter << type;
}
}
void EventuallyOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}
} // namespace circt::ltl
MLIR_DEFINE_EXPLICIT_TYPE_ID(circt::ltl::EventuallyOp)
namespace circt::ltl {
//===----------------------------------------------------------------------===//
// circt::ltl::GoToRepeatOp definitions
//===----------------------------------------------------------------------===//
namespace detail {
GoToRepeatOpGenericAdaptorBase::GoToRepeatOpGenericAdaptorBase(GoToRepeatOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
uint64_t GoToRepeatOpGenericAdaptorBase::getBase() {
auto attr = getBaseAttr();
return attr.getValue().getZExtValue();
}
uint64_t GoToRepeatOpGenericAdaptorBase::getMore() {
auto attr = getMoreAttr();
return attr.getValue().getZExtValue();
}
} // namespace detail
GoToRepeatOpAdaptor::GoToRepeatOpAdaptor(GoToRepeatOp op) : GoToRepeatOpGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult GoToRepeatOpAdaptor::verify(::mlir::Location loc) {
auto tblgen_base = getProperties().base; (void)tblgen_base;
if (!tblgen_base) return emitError(loc, "'ltl.goto_repeat' op requires attribute 'base'");
auto tblgen_more = getProperties().more; (void)tblgen_more;
if (!tblgen_more) return emitError(loc, "'ltl.goto_repeat' op requires attribute 'more'");
if (tblgen_base && !(((::llvm::isa<::mlir::IntegerAttr>(tblgen_base))) && ((::llvm::cast<::mlir::IntegerAttr>(tblgen_base).getType().isSignlessInteger(64)))))
return emitError(loc, "'ltl.goto_repeat' op attribute 'base' failed to satisfy constraint: 64-bit signless integer attribute");
if (tblgen_more && !(((::llvm::isa<::mlir::IntegerAttr>(tblgen_more))) && ((::llvm::cast<::mlir::IntegerAttr>(tblgen_more).getType().isSignlessInteger(64)))))
return emitError(loc, "'ltl.goto_repeat' op attribute 'more' failed to satisfy constraint: 64-bit signless integer attribute");
return ::mlir::success();
}
::llvm::LogicalResult GoToRepeatOp::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.base;
auto attr = dict.get("base");
if (attr) {
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `base` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
{
auto &propStorage = prop.more;
auto attr = dict.get("more");
if (attr) {
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `more` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
return ::mlir::success();
}
::mlir::Attribute GoToRepeatOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
{
const auto &propStorage = prop.base;
if (propStorage)
attrs.push_back(odsBuilder.getNamedAttr("base",
propStorage));
}
{
const auto &propStorage = prop.more;
if (propStorage)
attrs.push_back(odsBuilder.getNamedAttr("more",
propStorage));
}
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code GoToRepeatOp::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine(
llvm::hash_value(prop.base.getAsOpaquePointer()),
llvm::hash_value(prop.more.getAsOpaquePointer()));
}
std::optional<mlir::Attribute> GoToRepeatOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
if (name == "base")
return prop.base;
if (name == "more")
return prop.more;
return std::nullopt;
}
void GoToRepeatOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
if (name == "base") {
prop.base = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.base)>>(value);
return;
}
if (name == "more") {
prop.more = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.more)>>(value);
return;
}
}
void GoToRepeatOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
if (prop.base) attrs.append("base", prop.base);
if (prop.more) attrs.append("more", prop.more);
}
::llvm::LogicalResult GoToRepeatOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
{
::mlir::Attribute attr = attrs.get(getBaseAttrName(opName));
if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_LTL3(attr, "base", emitError)))
return ::mlir::failure();
}
{
::mlir::Attribute attr = attrs.get(getMoreAttrName(opName));
if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_LTL3(attr, "more", emitError)))
return ::mlir::failure();
}
return ::mlir::success();
}
::llvm::LogicalResult GoToRepeatOp::readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state) {
auto &prop = state.getOrAddProperties<Properties>(); (void)prop;
if (::mlir::failed(reader.readAttribute(prop.base)))
return ::mlir::failure();
if (::mlir::failed(reader.readAttribute(prop.more)))
return ::mlir::failure();
return ::mlir::success();
}
void GoToRepeatOp::writeProperties(::mlir::DialectBytecodeWriter &writer) {
auto &prop = getProperties(); (void)prop;
writer.writeAttribute(prop.base);
writer.writeAttribute(prop.more);
}
uint64_t GoToRepeatOp::getBase() {
auto attr = getBaseAttr();
return attr.getValue().getZExtValue();
}
uint64_t GoToRepeatOp::getMore() {
auto attr = getMoreAttr();
return attr.getValue().getZExtValue();
}
void GoToRepeatOp::setBase(uint64_t attrValue) {
getProperties().base = ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(64), attrValue);
}
void GoToRepeatOp::setMore(uint64_t attrValue) {
getProperties().more = ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(64), attrValue);
}
void GoToRepeatOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value input, ::mlir::IntegerAttr base, ::mlir::IntegerAttr more) {
odsState.addOperands(input);
odsState.getOrAddProperties<Properties>().base = base;
odsState.getOrAddProperties<Properties>().more = more;
odsState.addTypes(result);
}
GoToRepeatOp GoToRepeatOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value input, ::mlir::IntegerAttr base, ::mlir::IntegerAttr more) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(result)>(result), std::forward<decltype(input)>(input), std::forward<decltype(base)>(base), std::forward<decltype(more)>(more));
auto __res__ = ::llvm::dyn_cast<GoToRepeatOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
GoToRepeatOp GoToRepeatOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::Value input, ::mlir::IntegerAttr base, ::mlir::IntegerAttr more) {
return create(builder, builder.getLoc(), std::forward<decltype(result)>(result), std::forward<decltype(input)>(input), std::forward<decltype(base)>(base), std::forward<decltype(more)>(more));
}
void GoToRepeatOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value input, ::mlir::IntegerAttr base, ::mlir::IntegerAttr more) {
odsState.addOperands(input);
odsState.getOrAddProperties<Properties>().base = base;
odsState.getOrAddProperties<Properties>().more = more;
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(GoToRepeatOp::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);
}
GoToRepeatOp GoToRepeatOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value input, ::mlir::IntegerAttr base, ::mlir::IntegerAttr more) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(input)>(input), std::forward<decltype(base)>(base), std::forward<decltype(more)>(more));
auto __res__ = ::llvm::dyn_cast<GoToRepeatOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
GoToRepeatOp GoToRepeatOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value input, ::mlir::IntegerAttr base, ::mlir::IntegerAttr more) {
return create(builder, builder.getLoc(), std::forward<decltype(input)>(input), std::forward<decltype(base)>(base), std::forward<decltype(more)>(more));
}
void GoToRepeatOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input, ::mlir::IntegerAttr base, ::mlir::IntegerAttr more) {
odsState.addOperands(input);
odsState.getOrAddProperties<Properties>().base = base;
odsState.getOrAddProperties<Properties>().more = more;
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
GoToRepeatOp GoToRepeatOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value input, ::mlir::IntegerAttr base, ::mlir::IntegerAttr more) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(input)>(input), std::forward<decltype(base)>(base), std::forward<decltype(more)>(more));
auto __res__ = ::llvm::dyn_cast<GoToRepeatOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
GoToRepeatOp GoToRepeatOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value input, ::mlir::IntegerAttr base, ::mlir::IntegerAttr more) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(input)>(input), std::forward<decltype(base)>(base), std::forward<decltype(more)>(more));
}
void GoToRepeatOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value input, uint64_t base, uint64_t more) {
odsState.addOperands(input);
odsState.getOrAddProperties<Properties>().base = odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), base);
odsState.getOrAddProperties<Properties>().more = odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), more);
odsState.addTypes(result);
}
GoToRepeatOp GoToRepeatOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value input, uint64_t base, uint64_t more) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(result)>(result), std::forward<decltype(input)>(input), std::forward<decltype(base)>(base), std::forward<decltype(more)>(more));
auto __res__ = ::llvm::dyn_cast<GoToRepeatOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
GoToRepeatOp GoToRepeatOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::Value input, uint64_t base, uint64_t more) {
return create(builder, builder.getLoc(), std::forward<decltype(result)>(result), std::forward<decltype(input)>(input), std::forward<decltype(base)>(base), std::forward<decltype(more)>(more));
}
void GoToRepeatOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value input, uint64_t base, uint64_t more) {
odsState.addOperands(input);
odsState.getOrAddProperties<Properties>().base = odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), base);
odsState.getOrAddProperties<Properties>().more = odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), more);
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(GoToRepeatOp::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);
}
GoToRepeatOp GoToRepeatOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value input, uint64_t base, uint64_t more) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(input)>(input), std::forward<decltype(base)>(base), std::forward<decltype(more)>(more));
auto __res__ = ::llvm::dyn_cast<GoToRepeatOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
GoToRepeatOp GoToRepeatOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value input, uint64_t base, uint64_t more) {
return create(builder, builder.getLoc(), std::forward<decltype(input)>(input), std::forward<decltype(base)>(base), std::forward<decltype(more)>(more));
}
void GoToRepeatOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input, uint64_t base, uint64_t more) {
odsState.addOperands(input);
odsState.getOrAddProperties<Properties>().base = odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), base);
odsState.getOrAddProperties<Properties>().more = odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), more);
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
GoToRepeatOp GoToRepeatOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value input, uint64_t base, uint64_t more) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(input)>(input), std::forward<decltype(base)>(base), std::forward<decltype(more)>(more));
auto __res__ = ::llvm::dyn_cast<GoToRepeatOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
GoToRepeatOp GoToRepeatOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value input, uint64_t base, uint64_t more) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(input)>(input), std::forward<decltype(base)>(base), std::forward<decltype(more)>(more));
}
void GoToRepeatOp::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<GoToRepeatOp::Properties>();
::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.");
}
}
GoToRepeatOp GoToRepeatOp::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<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<GoToRepeatOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
GoToRepeatOp GoToRepeatOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void GoToRepeatOp::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<GoToRepeatOp::Properties>();
::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(GoToRepeatOp::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).");
}
}
GoToRepeatOp GoToRepeatOp::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<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<GoToRepeatOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
GoToRepeatOp GoToRepeatOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void GoToRepeatOp::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&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
GoToRepeatOp GoToRepeatOp::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<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<GoToRepeatOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
GoToRepeatOp GoToRepeatOp::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<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
void GoToRepeatOp::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 &>(properties));
odsState.addAttributes(discardableAttributes);
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(GoToRepeatOp::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).");
}
}
GoToRepeatOp GoToRepeatOp::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<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<GoToRepeatOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
GoToRepeatOp GoToRepeatOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
::llvm::LogicalResult GoToRepeatOp::verifyInvariantsImpl() {
auto tblgen_base = getProperties().base; (void)tblgen_base;
if (!tblgen_base) return emitOpError("requires attribute 'base'");
auto tblgen_more = getProperties().more; (void)tblgen_more;
if (!tblgen_more) return emitOpError("requires attribute 'more'");
if (::mlir::failed(__mlir_ods_local_attr_constraint_LTL3(*this, tblgen_base, "base")))
return ::mlir::failure();
if (::mlir::failed(__mlir_ods_local_attr_constraint_LTL3(*this, tblgen_more, "more")))
return ::mlir::failure();
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LTL6(*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_LTL7(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult GoToRepeatOp::verifyInvariants() {
return verifyInvariantsImpl();
}
::llvm::LogicalResult GoToRepeatOp::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<circt::ltl::SequenceType>();
inferredReturnTypes[0] = odsInferredType0;
return ::mlir::success();
}
::mlir::ParseResult GoToRepeatOp::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 baseAttr;
::mlir::IntegerAttr moreAttr;
::mlir::Type inputRawType{};
::llvm::ArrayRef<::mlir::Type> inputTypes(&inputRawType, 1);
inputOperandsLoc = parser.getCurrentLocation();
if (parser.parseOperand(inputRawOperand))
return ::mlir::failure();
if (parser.parseComma())
return ::mlir::failure();
if (parser.parseCustomAttributeWithFallback(baseAttr, parser.getBuilder().getIntegerType(64))) {
return ::mlir::failure();
}
if (baseAttr) result.getOrAddProperties<GoToRepeatOp::Properties>().base = baseAttr;
if (parser.parseComma())
return ::mlir::failure();
if (parser.parseCustomAttributeWithFallback(moreAttr, parser.getBuilder().getIntegerType(64))) {
return ::mlir::failure();
}
if (moreAttr) result.getOrAddProperties<GoToRepeatOp::Properties>().more = moreAttr;
{
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::Type type;
if (parser.parseCustomTypeWithFallback(type))
return ::mlir::failure();
inputRawType = type;
}
::mlir::Type odsBuildableType0 = parser.getBuilder().getType<circt::ltl::SequenceType>();
result.addTypes(odsBuildableType0);
if (parser.resolveOperands(inputOperands, inputTypes, inputOperandsLoc, result.operands))
return ::mlir::failure();
return ::mlir::success();
}
void GoToRepeatOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
_odsPrinter << ' ';
_odsPrinter << getInput();
_odsPrinter << ",";
_odsPrinter << ' ';
_odsPrinter.printAttributeWithoutType(getBaseAttr());
_odsPrinter << ",";
_odsPrinter << ' ';
_odsPrinter.printAttributeWithoutType(getMoreAttr());
::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
elidedAttrs.push_back("base");
elidedAttrs.push_back("more");
_odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
_odsPrinter << ' ' << ":";
_odsPrinter << ' ';
{
auto type = getInput().getType();
if (auto validType = ::llvm::dyn_cast<::mlir::Type>(type))
_odsPrinter.printStrippedAttrOrType(validType);
else
_odsPrinter << type;
}
}
void GoToRepeatOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}
} // namespace circt::ltl
MLIR_DEFINE_EXPLICIT_TYPE_ID(circt::ltl::GoToRepeatOp)
MLIR_DEFINE_EXPLICIT_TYPE_ID(circt::ltl::detail::GoToRepeatOpGenericAdaptorBase::Properties)
namespace circt::ltl {
//===----------------------------------------------------------------------===//
// circt::ltl::ImplicationOp definitions
//===----------------------------------------------------------------------===//
namespace detail {
ImplicationOpGenericAdaptorBase::ImplicationOpGenericAdaptorBase(ImplicationOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
} // namespace detail
ImplicationOpAdaptor::ImplicationOpAdaptor(ImplicationOp op) : ImplicationOpGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult ImplicationOpAdaptor::verify(::mlir::Location loc) {
return ::mlir::success();
}
::llvm::LogicalResult ImplicationOp::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 ImplicationOp::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 ImplicationOp::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine();
}
std::optional<mlir::Attribute> ImplicationOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
return std::nullopt;
}
void ImplicationOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
}
void ImplicationOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
}
::llvm::LogicalResult ImplicationOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
return ::mlir::success();
}
void ImplicationOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value antecedent, ::mlir::Value consequent) {
odsState.addOperands(antecedent);
odsState.addOperands(consequent);
odsState.addTypes(result);
}
ImplicationOp ImplicationOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value antecedent, ::mlir::Value consequent) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(result)>(result), std::forward<decltype(antecedent)>(antecedent), std::forward<decltype(consequent)>(consequent));
auto __res__ = ::llvm::dyn_cast<ImplicationOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ImplicationOp ImplicationOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::Value antecedent, ::mlir::Value consequent) {
return create(builder, builder.getLoc(), std::forward<decltype(result)>(result), std::forward<decltype(antecedent)>(antecedent), std::forward<decltype(consequent)>(consequent));
}
void ImplicationOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value antecedent, ::mlir::Value consequent) {
odsState.addOperands(antecedent);
odsState.addOperands(consequent);
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(ImplicationOp::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);
}
ImplicationOp ImplicationOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value antecedent, ::mlir::Value consequent) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(antecedent)>(antecedent), std::forward<decltype(consequent)>(consequent));
auto __res__ = ::llvm::dyn_cast<ImplicationOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ImplicationOp ImplicationOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value antecedent, ::mlir::Value consequent) {
return create(builder, builder.getLoc(), std::forward<decltype(antecedent)>(antecedent), std::forward<decltype(consequent)>(consequent));
}
void ImplicationOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value antecedent, ::mlir::Value consequent) {
odsState.addOperands(antecedent);
odsState.addOperands(consequent);
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
ImplicationOp ImplicationOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value antecedent, ::mlir::Value consequent) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(antecedent)>(antecedent), std::forward<decltype(consequent)>(consequent));
auto __res__ = ::llvm::dyn_cast<ImplicationOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ImplicationOp ImplicationOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value antecedent, ::mlir::Value consequent) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(antecedent)>(antecedent), std::forward<decltype(consequent)>(consequent));
}
void ImplicationOp::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);
}
ImplicationOp ImplicationOp::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<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<ImplicationOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ImplicationOp ImplicationOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void ImplicationOp::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(ImplicationOp::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).");
}
}
ImplicationOp ImplicationOp::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<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<ImplicationOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ImplicationOp ImplicationOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void ImplicationOp::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&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
ImplicationOp ImplicationOp::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<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<ImplicationOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ImplicationOp ImplicationOp::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<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
void ImplicationOp::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 &>(properties));
odsState.addAttributes(discardableAttributes);
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(ImplicationOp::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).");
}
}
ImplicationOp ImplicationOp::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<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<ImplicationOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ImplicationOp ImplicationOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
::llvm::LogicalResult ImplicationOp::verifyInvariantsImpl() {
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LTL6(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup1 = getODSOperands(1);
for (auto v : valueGroup1) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LTL2(*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_LTL3(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult ImplicationOp::verifyInvariants() {
return verifyInvariantsImpl();
}
::llvm::LogicalResult ImplicationOp::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<circt::ltl::PropertyType>();
inferredReturnTypes[0] = odsInferredType0;
return ::mlir::success();
}
::mlir::ParseResult ImplicationOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
::llvm::SmallVector<::mlir::OpAsmParser::UnresolvedOperand, 4> allOperands;
::llvm::SmallVector<::mlir::Type, 1> allOperandTypes;
[[maybe_unused]] ::llvm::SMLoc allOperandLoc = parser.getCurrentLocation();
if (parser.parseOperandList(allOperands))
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();
::mlir::Type odsBuildableType0 = parser.getBuilder().getType<circt::ltl::PropertyType>();
result.addTypes(odsBuildableType0);
if (parser.resolveOperands(allOperands, allOperandTypes, allOperandLoc, result.operands))
return ::mlir::failure();
return ::mlir::success();
}
void ImplicationOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
_odsPrinter << ' ';
_odsPrinter << getOperation()->getOperands();
::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
_odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
_odsPrinter << ' ' << ":";
_odsPrinter << ' ';
_odsPrinter << getOperation()->getOperandTypes();
}
void ImplicationOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}
} // namespace circt::ltl
MLIR_DEFINE_EXPLICIT_TYPE_ID(circt::ltl::ImplicationOp)
namespace circt::ltl {
//===----------------------------------------------------------------------===//
// circt::ltl::IntersectOp definitions
//===----------------------------------------------------------------------===//
namespace detail {
IntersectOpGenericAdaptorBase::IntersectOpGenericAdaptorBase(IntersectOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
std::pair<unsigned, unsigned> IntersectOpGenericAdaptorBase::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
IntersectOpAdaptor::IntersectOpAdaptor(IntersectOp op) : IntersectOpGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult IntersectOpAdaptor::verify(::mlir::Location loc) {
return ::mlir::success();
}
std::pair<unsigned, unsigned> IntersectOp::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 IntersectOp::getInputsMutable() {
auto range = getODSOperandIndexAndLength(0);
auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
return mutableRange;
}
::llvm::LogicalResult IntersectOp::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 IntersectOp::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 IntersectOp::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine();
}
std::optional<mlir::Attribute> IntersectOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
return std::nullopt;
}
void IntersectOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
}
void IntersectOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
}
::llvm::LogicalResult IntersectOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
return ::mlir::success();
}
void IntersectOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::ValueRange inputs) {
odsState.addOperands(inputs);
odsState.addTypes(result);
}
IntersectOp IntersectOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::ValueRange inputs) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(result)>(result), std::forward<decltype(inputs)>(inputs));
auto __res__ = ::llvm::dyn_cast<IntersectOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
IntersectOp IntersectOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::ValueRange inputs) {
return create(builder, builder.getLoc(), std::forward<decltype(result)>(result), std::forward<decltype(inputs)>(inputs));
}
void IntersectOp::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);
}
IntersectOp IntersectOp::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<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<IntersectOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
IntersectOp IntersectOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void IntersectOp::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(IntersectOp::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).");
}
}
IntersectOp IntersectOp::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<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<IntersectOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
IntersectOp IntersectOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void IntersectOp::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&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
IntersectOp IntersectOp::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<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<IntersectOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
IntersectOp IntersectOp::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<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
void IntersectOp::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 &>(properties));
odsState.addAttributes(discardableAttributes);
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(IntersectOp::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).");
}
}
IntersectOp IntersectOp::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<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<IntersectOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
IntersectOp IntersectOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
::llvm::LogicalResult IntersectOp::verifyInvariantsImpl() {
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LTL1(*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_LTL2(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult IntersectOp::verifyInvariants() {
return verifyInvariantsImpl();
}
void IntersectOp::getCanonicalizationPatterns(::mlir::RewritePatternSet &results, ::mlir::MLIRContext *context) {
results.add(canonicalize);
}
::mlir::ParseResult IntersectOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
::llvm::SmallVector<::mlir::OpAsmParser::UnresolvedOperand, 4> inputsOperands;
::llvm::SMLoc inputsOperandsLoc;
(void)inputsOperandsLoc;
::llvm::SmallVector<::mlir::Type, 1> inputsTypes;
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();
}
if (parser.parseColon())
return ::mlir::failure();
if (parser.parseTypeList(inputsTypes))
return ::mlir::failure();
if (parser.resolveOperands(inputsOperands, inputsTypes, inputsOperandsLoc, result.operands))
return ::mlir::failure();
::llvm::SmallVector<::mlir::Type> inferredReturnTypes;
if (::mlir::failed(IntersectOp::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 IntersectOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
_odsPrinter << ' ';
_odsPrinter << getInputs();
::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
_odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
_odsPrinter << ' ' << ":";
_odsPrinter << ' ';
_odsPrinter << getInputs().getTypes();
}
void IntersectOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}
} // namespace circt::ltl
MLIR_DEFINE_EXPLICIT_TYPE_ID(circt::ltl::IntersectOp)
namespace circt::ltl {
//===----------------------------------------------------------------------===//
// circt::ltl::NonConsecutiveRepeatOp definitions
//===----------------------------------------------------------------------===//
namespace detail {
NonConsecutiveRepeatOpGenericAdaptorBase::NonConsecutiveRepeatOpGenericAdaptorBase(NonConsecutiveRepeatOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
uint64_t NonConsecutiveRepeatOpGenericAdaptorBase::getBase() {
auto attr = getBaseAttr();
return attr.getValue().getZExtValue();
}
uint64_t NonConsecutiveRepeatOpGenericAdaptorBase::getMore() {
auto attr = getMoreAttr();
return attr.getValue().getZExtValue();
}
} // namespace detail
NonConsecutiveRepeatOpAdaptor::NonConsecutiveRepeatOpAdaptor(NonConsecutiveRepeatOp op) : NonConsecutiveRepeatOpGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult NonConsecutiveRepeatOpAdaptor::verify(::mlir::Location loc) {
auto tblgen_base = getProperties().base; (void)tblgen_base;
if (!tblgen_base) return emitError(loc, "'ltl.non_consecutive_repeat' op requires attribute 'base'");
auto tblgen_more = getProperties().more; (void)tblgen_more;
if (!tblgen_more) return emitError(loc, "'ltl.non_consecutive_repeat' op requires attribute 'more'");
if (tblgen_base && !(((::llvm::isa<::mlir::IntegerAttr>(tblgen_base))) && ((::llvm::cast<::mlir::IntegerAttr>(tblgen_base).getType().isSignlessInteger(64)))))
return emitError(loc, "'ltl.non_consecutive_repeat' op attribute 'base' failed to satisfy constraint: 64-bit signless integer attribute");
if (tblgen_more && !(((::llvm::isa<::mlir::IntegerAttr>(tblgen_more))) && ((::llvm::cast<::mlir::IntegerAttr>(tblgen_more).getType().isSignlessInteger(64)))))
return emitError(loc, "'ltl.non_consecutive_repeat' op attribute 'more' failed to satisfy constraint: 64-bit signless integer attribute");
return ::mlir::success();
}
::llvm::LogicalResult NonConsecutiveRepeatOp::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.base;
auto attr = dict.get("base");
if (attr) {
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `base` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
{
auto &propStorage = prop.more;
auto attr = dict.get("more");
if (attr) {
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `more` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
return ::mlir::success();
}
::mlir::Attribute NonConsecutiveRepeatOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
{
const auto &propStorage = prop.base;
if (propStorage)
attrs.push_back(odsBuilder.getNamedAttr("base",
propStorage));
}
{
const auto &propStorage = prop.more;
if (propStorage)
attrs.push_back(odsBuilder.getNamedAttr("more",
propStorage));
}
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code NonConsecutiveRepeatOp::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine(
llvm::hash_value(prop.base.getAsOpaquePointer()),
llvm::hash_value(prop.more.getAsOpaquePointer()));
}
std::optional<mlir::Attribute> NonConsecutiveRepeatOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
if (name == "base")
return prop.base;
if (name == "more")
return prop.more;
return std::nullopt;
}
void NonConsecutiveRepeatOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
if (name == "base") {
prop.base = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.base)>>(value);
return;
}
if (name == "more") {
prop.more = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.more)>>(value);
return;
}
}
void NonConsecutiveRepeatOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
if (prop.base) attrs.append("base", prop.base);
if (prop.more) attrs.append("more", prop.more);
}
::llvm::LogicalResult NonConsecutiveRepeatOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
{
::mlir::Attribute attr = attrs.get(getBaseAttrName(opName));
if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_LTL3(attr, "base", emitError)))
return ::mlir::failure();
}
{
::mlir::Attribute attr = attrs.get(getMoreAttrName(opName));
if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_LTL3(attr, "more", emitError)))
return ::mlir::failure();
}
return ::mlir::success();
}
::llvm::LogicalResult NonConsecutiveRepeatOp::readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state) {
auto &prop = state.getOrAddProperties<Properties>(); (void)prop;
if (::mlir::failed(reader.readAttribute(prop.base)))
return ::mlir::failure();
if (::mlir::failed(reader.readAttribute(prop.more)))
return ::mlir::failure();
return ::mlir::success();
}
void NonConsecutiveRepeatOp::writeProperties(::mlir::DialectBytecodeWriter &writer) {
auto &prop = getProperties(); (void)prop;
writer.writeAttribute(prop.base);
writer.writeAttribute(prop.more);
}
uint64_t NonConsecutiveRepeatOp::getBase() {
auto attr = getBaseAttr();
return attr.getValue().getZExtValue();
}
uint64_t NonConsecutiveRepeatOp::getMore() {
auto attr = getMoreAttr();
return attr.getValue().getZExtValue();
}
void NonConsecutiveRepeatOp::setBase(uint64_t attrValue) {
getProperties().base = ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(64), attrValue);
}
void NonConsecutiveRepeatOp::setMore(uint64_t attrValue) {
getProperties().more = ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(64), attrValue);
}
void NonConsecutiveRepeatOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value input, ::mlir::IntegerAttr base, ::mlir::IntegerAttr more) {
odsState.addOperands(input);
odsState.getOrAddProperties<Properties>().base = base;
odsState.getOrAddProperties<Properties>().more = more;
odsState.addTypes(result);
}
NonConsecutiveRepeatOp NonConsecutiveRepeatOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value input, ::mlir::IntegerAttr base, ::mlir::IntegerAttr more) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(result)>(result), std::forward<decltype(input)>(input), std::forward<decltype(base)>(base), std::forward<decltype(more)>(more));
auto __res__ = ::llvm::dyn_cast<NonConsecutiveRepeatOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
NonConsecutiveRepeatOp NonConsecutiveRepeatOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::Value input, ::mlir::IntegerAttr base, ::mlir::IntegerAttr more) {
return create(builder, builder.getLoc(), std::forward<decltype(result)>(result), std::forward<decltype(input)>(input), std::forward<decltype(base)>(base), std::forward<decltype(more)>(more));
}
void NonConsecutiveRepeatOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value input, ::mlir::IntegerAttr base, ::mlir::IntegerAttr more) {
odsState.addOperands(input);
odsState.getOrAddProperties<Properties>().base = base;
odsState.getOrAddProperties<Properties>().more = more;
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(NonConsecutiveRepeatOp::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);
}
NonConsecutiveRepeatOp NonConsecutiveRepeatOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value input, ::mlir::IntegerAttr base, ::mlir::IntegerAttr more) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(input)>(input), std::forward<decltype(base)>(base), std::forward<decltype(more)>(more));
auto __res__ = ::llvm::dyn_cast<NonConsecutiveRepeatOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
NonConsecutiveRepeatOp NonConsecutiveRepeatOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value input, ::mlir::IntegerAttr base, ::mlir::IntegerAttr more) {
return create(builder, builder.getLoc(), std::forward<decltype(input)>(input), std::forward<decltype(base)>(base), std::forward<decltype(more)>(more));
}
void NonConsecutiveRepeatOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input, ::mlir::IntegerAttr base, ::mlir::IntegerAttr more) {
odsState.addOperands(input);
odsState.getOrAddProperties<Properties>().base = base;
odsState.getOrAddProperties<Properties>().more = more;
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
NonConsecutiveRepeatOp NonConsecutiveRepeatOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value input, ::mlir::IntegerAttr base, ::mlir::IntegerAttr more) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(input)>(input), std::forward<decltype(base)>(base), std::forward<decltype(more)>(more));
auto __res__ = ::llvm::dyn_cast<NonConsecutiveRepeatOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
NonConsecutiveRepeatOp NonConsecutiveRepeatOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value input, ::mlir::IntegerAttr base, ::mlir::IntegerAttr more) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(input)>(input), std::forward<decltype(base)>(base), std::forward<decltype(more)>(more));
}
void NonConsecutiveRepeatOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value input, uint64_t base, uint64_t more) {
odsState.addOperands(input);
odsState.getOrAddProperties<Properties>().base = odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), base);
odsState.getOrAddProperties<Properties>().more = odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), more);
odsState.addTypes(result);
}
NonConsecutiveRepeatOp NonConsecutiveRepeatOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value input, uint64_t base, uint64_t more) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(result)>(result), std::forward<decltype(input)>(input), std::forward<decltype(base)>(base), std::forward<decltype(more)>(more));
auto __res__ = ::llvm::dyn_cast<NonConsecutiveRepeatOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
NonConsecutiveRepeatOp NonConsecutiveRepeatOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::Value input, uint64_t base, uint64_t more) {
return create(builder, builder.getLoc(), std::forward<decltype(result)>(result), std::forward<decltype(input)>(input), std::forward<decltype(base)>(base), std::forward<decltype(more)>(more));
}
void NonConsecutiveRepeatOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value input, uint64_t base, uint64_t more) {
odsState.addOperands(input);
odsState.getOrAddProperties<Properties>().base = odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), base);
odsState.getOrAddProperties<Properties>().more = odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), more);
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(NonConsecutiveRepeatOp::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);
}
NonConsecutiveRepeatOp NonConsecutiveRepeatOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value input, uint64_t base, uint64_t more) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(input)>(input), std::forward<decltype(base)>(base), std::forward<decltype(more)>(more));
auto __res__ = ::llvm::dyn_cast<NonConsecutiveRepeatOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
NonConsecutiveRepeatOp NonConsecutiveRepeatOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value input, uint64_t base, uint64_t more) {
return create(builder, builder.getLoc(), std::forward<decltype(input)>(input), std::forward<decltype(base)>(base), std::forward<decltype(more)>(more));
}
void NonConsecutiveRepeatOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input, uint64_t base, uint64_t more) {
odsState.addOperands(input);
odsState.getOrAddProperties<Properties>().base = odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), base);
odsState.getOrAddProperties<Properties>().more = odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), more);
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
NonConsecutiveRepeatOp NonConsecutiveRepeatOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value input, uint64_t base, uint64_t more) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(input)>(input), std::forward<decltype(base)>(base), std::forward<decltype(more)>(more));
auto __res__ = ::llvm::dyn_cast<NonConsecutiveRepeatOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
NonConsecutiveRepeatOp NonConsecutiveRepeatOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value input, uint64_t base, uint64_t more) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(input)>(input), std::forward<decltype(base)>(base), std::forward<decltype(more)>(more));
}
void NonConsecutiveRepeatOp::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<NonConsecutiveRepeatOp::Properties>();
::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.");
}
}
NonConsecutiveRepeatOp NonConsecutiveRepeatOp::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<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<NonConsecutiveRepeatOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
NonConsecutiveRepeatOp NonConsecutiveRepeatOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void NonConsecutiveRepeatOp::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<NonConsecutiveRepeatOp::Properties>();
::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(NonConsecutiveRepeatOp::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).");
}
}
NonConsecutiveRepeatOp NonConsecutiveRepeatOp::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<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<NonConsecutiveRepeatOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
NonConsecutiveRepeatOp NonConsecutiveRepeatOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void NonConsecutiveRepeatOp::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&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
NonConsecutiveRepeatOp NonConsecutiveRepeatOp::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<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<NonConsecutiveRepeatOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
NonConsecutiveRepeatOp NonConsecutiveRepeatOp::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<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
void NonConsecutiveRepeatOp::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 &>(properties));
odsState.addAttributes(discardableAttributes);
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(NonConsecutiveRepeatOp::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).");
}
}
NonConsecutiveRepeatOp NonConsecutiveRepeatOp::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<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<NonConsecutiveRepeatOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
NonConsecutiveRepeatOp NonConsecutiveRepeatOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
::llvm::LogicalResult NonConsecutiveRepeatOp::verifyInvariantsImpl() {
auto tblgen_base = getProperties().base; (void)tblgen_base;
if (!tblgen_base) return emitOpError("requires attribute 'base'");
auto tblgen_more = getProperties().more; (void)tblgen_more;
if (!tblgen_more) return emitOpError("requires attribute 'more'");
if (::mlir::failed(__mlir_ods_local_attr_constraint_LTL3(*this, tblgen_base, "base")))
return ::mlir::failure();
if (::mlir::failed(__mlir_ods_local_attr_constraint_LTL3(*this, tblgen_more, "more")))
return ::mlir::failure();
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LTL6(*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_LTL7(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult NonConsecutiveRepeatOp::verifyInvariants() {
return verifyInvariantsImpl();
}
::llvm::LogicalResult NonConsecutiveRepeatOp::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<circt::ltl::SequenceType>();
inferredReturnTypes[0] = odsInferredType0;
return ::mlir::success();
}
::mlir::ParseResult NonConsecutiveRepeatOp::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 baseAttr;
::mlir::IntegerAttr moreAttr;
::mlir::Type inputRawType{};
::llvm::ArrayRef<::mlir::Type> inputTypes(&inputRawType, 1);
inputOperandsLoc = parser.getCurrentLocation();
if (parser.parseOperand(inputRawOperand))
return ::mlir::failure();
if (parser.parseComma())
return ::mlir::failure();
if (parser.parseCustomAttributeWithFallback(baseAttr, parser.getBuilder().getIntegerType(64))) {
return ::mlir::failure();
}
if (baseAttr) result.getOrAddProperties<NonConsecutiveRepeatOp::Properties>().base = baseAttr;
if (parser.parseComma())
return ::mlir::failure();
if (parser.parseCustomAttributeWithFallback(moreAttr, parser.getBuilder().getIntegerType(64))) {
return ::mlir::failure();
}
if (moreAttr) result.getOrAddProperties<NonConsecutiveRepeatOp::Properties>().more = moreAttr;
{
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::Type type;
if (parser.parseCustomTypeWithFallback(type))
return ::mlir::failure();
inputRawType = type;
}
::mlir::Type odsBuildableType0 = parser.getBuilder().getType<circt::ltl::SequenceType>();
result.addTypes(odsBuildableType0);
if (parser.resolveOperands(inputOperands, inputTypes, inputOperandsLoc, result.operands))
return ::mlir::failure();
return ::mlir::success();
}
void NonConsecutiveRepeatOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
_odsPrinter << ' ';
_odsPrinter << getInput();
_odsPrinter << ",";
_odsPrinter << ' ';
_odsPrinter.printAttributeWithoutType(getBaseAttr());
_odsPrinter << ",";
_odsPrinter << ' ';
_odsPrinter.printAttributeWithoutType(getMoreAttr());
::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
elidedAttrs.push_back("base");
elidedAttrs.push_back("more");
_odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
_odsPrinter << ' ' << ":";
_odsPrinter << ' ';
{
auto type = getInput().getType();
if (auto validType = ::llvm::dyn_cast<::mlir::Type>(type))
_odsPrinter.printStrippedAttrOrType(validType);
else
_odsPrinter << type;
}
}
void NonConsecutiveRepeatOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}
} // namespace circt::ltl
MLIR_DEFINE_EXPLICIT_TYPE_ID(circt::ltl::NonConsecutiveRepeatOp)
MLIR_DEFINE_EXPLICIT_TYPE_ID(circt::ltl::detail::NonConsecutiveRepeatOpGenericAdaptorBase::Properties)
namespace circt::ltl {
//===----------------------------------------------------------------------===//
// circt::ltl::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<mlir::Attribute> 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<decltype(result)>(result), std::forward<decltype(input)>(input));
auto __res__ = ::llvm::dyn_cast<NotOp>(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<decltype(result)>(result), std::forward<decltype(input)>(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<decltype(input)>(input));
auto __res__ = ::llvm::dyn_cast<NotOp>(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<decltype(input)>(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<decltype(resultTypes)>(resultTypes), std::forward<decltype(input)>(input));
auto __res__ = ::llvm::dyn_cast<NotOp>(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<decltype(resultTypes)>(resultTypes), std::forward<decltype(input)>(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<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<NotOp>(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<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(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<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<NotOp>(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<decltype(operands)>(operands), std::forward<decltype(attributes)>(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&>(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<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<NotOp>(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<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(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 &>(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<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<NotOp>(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<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(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_LTL2(*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_LTL3(*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<circt::ltl::PropertyType>();
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;
::mlir::Type inputRawType{};
::llvm::ArrayRef<::mlir::Type> inputTypes(&inputRawType, 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();
{
::mlir::Type type;
if (parser.parseCustomTypeWithFallback(type))
return ::mlir::failure();
inputRawType = type;
}
::mlir::Type odsBuildableType0 = parser.getBuilder().getType<circt::ltl::PropertyType>();
result.addTypes(odsBuildableType0);
if (parser.resolveOperands(inputOperands, inputTypes, 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);
_odsPrinter << ' ' << ":";
_odsPrinter << ' ';
{
auto type = getInput().getType();
if (auto validType = ::llvm::dyn_cast<::mlir::Type>(type))
_odsPrinter.printStrippedAttrOrType(validType);
else
_odsPrinter << type;
}
}
void NotOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}
} // namespace circt::ltl
MLIR_DEFINE_EXPLICIT_TYPE_ID(circt::ltl::NotOp)
namespace circt::ltl {
//===----------------------------------------------------------------------===//
// circt::ltl::OrOp definitions
//===----------------------------------------------------------------------===//
namespace detail {
OrOpGenericAdaptorBase::OrOpGenericAdaptorBase(OrOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
std::pair<unsigned, unsigned> 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<unsigned, unsigned> 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<mlir::Attribute> 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::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<decltype(result)>(result), std::forward<decltype(inputs)>(inputs));
auto __res__ = ::llvm::dyn_cast<OrOp>(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<decltype(result)>(result), std::forward<decltype(inputs)>(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<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<OrOp>(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<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(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<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<OrOp>(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<decltype(operands)>(operands), std::forward<decltype(attributes)>(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&>(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<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<OrOp>(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<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(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 &>(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<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<OrOp>(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<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(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_LTL1(*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_LTL2(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult OrOp::verifyInvariants() {
return verifyInvariantsImpl();
}
void OrOp::getCanonicalizationPatterns(::mlir::RewritePatternSet &results, ::mlir::MLIRContext *context) {
results.add(canonicalize);
}
::mlir::ParseResult OrOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
::llvm::SmallVector<::mlir::OpAsmParser::UnresolvedOperand, 4> inputsOperands;
::llvm::SMLoc inputsOperandsLoc;
(void)inputsOperandsLoc;
::llvm::SmallVector<::mlir::Type, 1> inputsTypes;
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();
}
if (parser.parseColon())
return ::mlir::failure();
if (parser.parseTypeList(inputsTypes))
return ::mlir::failure();
if (parser.resolveOperands(inputsOperands, inputsTypes, inputsOperandsLoc, result.operands))
return ::mlir::failure();
::llvm::SmallVector<::mlir::Type> inferredReturnTypes;
if (::mlir::failed(OrOp::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 OrOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
_odsPrinter << ' ';
_odsPrinter << getInputs();
::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
_odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
_odsPrinter << ' ' << ":";
_odsPrinter << ' ';
_odsPrinter << getInputs().getTypes();
}
void OrOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}
} // namespace circt::ltl
MLIR_DEFINE_EXPLICIT_TYPE_ID(circt::ltl::OrOp)
namespace circt::ltl {
//===----------------------------------------------------------------------===//
// circt::ltl::PastOp definitions
//===----------------------------------------------------------------------===//
namespace detail {
PastOpGenericAdaptorBase::PastOpGenericAdaptorBase(PastOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
uint64_t PastOpGenericAdaptorBase::getDelay() {
auto attr = getDelayAttr();
return attr.getValue().getZExtValue();
}
} // namespace detail
PastOpAdaptor::PastOpAdaptor(PastOp op) : PastOpGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult PastOpAdaptor::verify(::mlir::Location loc) {
auto tblgen_delay = getProperties().delay; (void)tblgen_delay;
if (!tblgen_delay) return emitError(loc, "'ltl.past' op requires attribute 'delay'");
if (tblgen_delay && !(((::llvm::isa<::mlir::IntegerAttr>(tblgen_delay))) && ((::llvm::cast<::mlir::IntegerAttr>(tblgen_delay).getType().isSignlessInteger(64)))))
return emitError(loc, "'ltl.past' op attribute 'delay' failed to satisfy constraint: 64-bit signless integer attribute");
return ::mlir::success();
}
::llvm::LogicalResult PastOp::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.delay;
auto attr = dict.get("delay");
if (attr) {
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `delay` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
return ::mlir::success();
}
::mlir::Attribute PastOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
{
const auto &propStorage = prop.delay;
if (propStorage)
attrs.push_back(odsBuilder.getNamedAttr("delay",
propStorage));
}
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code PastOp::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine(
llvm::hash_value(prop.delay.getAsOpaquePointer()));
}
std::optional<mlir::Attribute> PastOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
if (name == "delay")
return prop.delay;
return std::nullopt;
}
void PastOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
if (name == "delay") {
prop.delay = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.delay)>>(value);
return;
}
}
void PastOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
if (prop.delay) attrs.append("delay", prop.delay);
}
::llvm::LogicalResult PastOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
{
::mlir::Attribute attr = attrs.get(getDelayAttrName(opName));
if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_LTL3(attr, "delay", emitError)))
return ::mlir::failure();
}
return ::mlir::success();
}
::llvm::LogicalResult PastOp::readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state) {
auto &prop = state.getOrAddProperties<Properties>(); (void)prop;
if (::mlir::failed(reader.readAttribute(prop.delay)))
return ::mlir::failure();
return ::mlir::success();
}
void PastOp::writeProperties(::mlir::DialectBytecodeWriter &writer) {
auto &prop = getProperties(); (void)prop;
writer.writeAttribute(prop.delay);
}
uint64_t PastOp::getDelay() {
auto attr = getDelayAttr();
return attr.getValue().getZExtValue();
}
void PastOp::setDelay(uint64_t attrValue) {
getProperties().delay = ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(64), attrValue);
}
void PastOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value input, ::mlir::IntegerAttr delay, ::mlir::Value clk) {
odsState.addOperands(input);
odsState.addOperands(clk);
odsState.getOrAddProperties<Properties>().delay = delay;
odsState.addTypes(result);
}
PastOp PastOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value input, ::mlir::IntegerAttr delay, ::mlir::Value clk) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(result)>(result), std::forward<decltype(input)>(input), std::forward<decltype(delay)>(delay), std::forward<decltype(clk)>(clk));
auto __res__ = ::llvm::dyn_cast<PastOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
PastOp PastOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::Value input, ::mlir::IntegerAttr delay, ::mlir::Value clk) {
return create(builder, builder.getLoc(), std::forward<decltype(result)>(result), std::forward<decltype(input)>(input), std::forward<decltype(delay)>(delay), std::forward<decltype(clk)>(clk));
}
void PastOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value input, ::mlir::IntegerAttr delay, ::mlir::Value clk) {
odsState.addOperands(input);
odsState.addOperands(clk);
odsState.getOrAddProperties<Properties>().delay = delay;
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(PastOp::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);
}
PastOp PastOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value input, ::mlir::IntegerAttr delay, ::mlir::Value clk) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(input)>(input), std::forward<decltype(delay)>(delay), std::forward<decltype(clk)>(clk));
auto __res__ = ::llvm::dyn_cast<PastOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
PastOp PastOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value input, ::mlir::IntegerAttr delay, ::mlir::Value clk) {
return create(builder, builder.getLoc(), std::forward<decltype(input)>(input), std::forward<decltype(delay)>(delay), std::forward<decltype(clk)>(clk));
}
void PastOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input, ::mlir::IntegerAttr delay, ::mlir::Value clk) {
odsState.addOperands(input);
odsState.addOperands(clk);
odsState.getOrAddProperties<Properties>().delay = delay;
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
PastOp PastOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value input, ::mlir::IntegerAttr delay, ::mlir::Value clk) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(input)>(input), std::forward<decltype(delay)>(delay), std::forward<decltype(clk)>(clk));
auto __res__ = ::llvm::dyn_cast<PastOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
PastOp PastOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value input, ::mlir::IntegerAttr delay, ::mlir::Value clk) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(input)>(input), std::forward<decltype(delay)>(delay), std::forward<decltype(clk)>(clk));
}
void PastOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value input, uint64_t delay, ::mlir::Value clk) {
odsState.addOperands(input);
odsState.addOperands(clk);
odsState.getOrAddProperties<Properties>().delay = odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), delay);
odsState.addTypes(result);
}
PastOp PastOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value input, uint64_t delay, ::mlir::Value clk) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(result)>(result), std::forward<decltype(input)>(input), std::forward<decltype(delay)>(delay), std::forward<decltype(clk)>(clk));
auto __res__ = ::llvm::dyn_cast<PastOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
PastOp PastOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::Value input, uint64_t delay, ::mlir::Value clk) {
return create(builder, builder.getLoc(), std::forward<decltype(result)>(result), std::forward<decltype(input)>(input), std::forward<decltype(delay)>(delay), std::forward<decltype(clk)>(clk));
}
void PastOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value input, uint64_t delay, ::mlir::Value clk) {
odsState.addOperands(input);
odsState.addOperands(clk);
odsState.getOrAddProperties<Properties>().delay = odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), delay);
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(PastOp::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);
}
PastOp PastOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value input, uint64_t delay, ::mlir::Value clk) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(input)>(input), std::forward<decltype(delay)>(delay), std::forward<decltype(clk)>(clk));
auto __res__ = ::llvm::dyn_cast<PastOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
PastOp PastOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value input, uint64_t delay, ::mlir::Value clk) {
return create(builder, builder.getLoc(), std::forward<decltype(input)>(input), std::forward<decltype(delay)>(delay), std::forward<decltype(clk)>(clk));
}
void PastOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input, uint64_t delay, ::mlir::Value clk) {
odsState.addOperands(input);
odsState.addOperands(clk);
odsState.getOrAddProperties<Properties>().delay = odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), delay);
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
PastOp PastOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value input, uint64_t delay, ::mlir::Value clk) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(input)>(input), std::forward<decltype(delay)>(delay), std::forward<decltype(clk)>(clk));
auto __res__ = ::llvm::dyn_cast<PastOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
PastOp PastOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value input, uint64_t delay, ::mlir::Value clk) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(input)>(input), std::forward<decltype(delay)>(delay), std::forward<decltype(clk)>(clk));
}
void PastOp::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<PastOp::Properties>();
::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.");
}
}
PastOp PastOp::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<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<PastOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
PastOp PastOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void PastOp::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<PastOp::Properties>();
::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(PastOp::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).");
}
}
PastOp PastOp::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<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<PastOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
PastOp PastOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void PastOp::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&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
PastOp PastOp::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<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<PastOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
PastOp PastOp::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<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
void PastOp::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 &>(properties));
odsState.addAttributes(discardableAttributes);
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(PastOp::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).");
}
}
PastOp PastOp::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<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<PastOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
PastOp PastOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
::llvm::LogicalResult PastOp::verifyInvariantsImpl() {
auto tblgen_delay = getProperties().delay; (void)tblgen_delay;
if (!tblgen_delay) return emitOpError("requires attribute 'delay'");
if (::mlir::failed(__mlir_ods_local_attr_constraint_LTL3(*this, tblgen_delay, "delay")))
return ::mlir::failure();
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LTL9(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup1 = getODSOperands(1);
for (auto v : valueGroup1) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LTL4(*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_LTL9(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
if (!((std::equal_to<>()((*this->getODSOperands(0).begin()).getType(), (*this->getODSResults(0).begin()).getType()))))
return emitOpError("failed to verify that input and result types must match");
return ::mlir::success();
}
::llvm::LogicalResult PastOp::verifyInvariants() {
return verifyInvariantsImpl();
}
::llvm::LogicalResult PastOp::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 PastOp::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 delayAttr;
::mlir::OpAsmParser::UnresolvedOperand clkRawOperand{};
::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> clkOperands(&clkRawOperand, 1); ::llvm::SMLoc clkOperandsLoc;
(void)clkOperandsLoc;
::mlir::Type inputRawType{};
::llvm::ArrayRef<::mlir::Type> inputTypes(&inputRawType, 1);
inputOperandsLoc = parser.getCurrentLocation();
if (parser.parseOperand(inputRawOperand))
return ::mlir::failure();
if (parser.parseComma())
return ::mlir::failure();
if (parser.parseCustomAttributeWithFallback(delayAttr, parser.getBuilder().getIntegerType(64))) {
return ::mlir::failure();
}
if (delayAttr) result.getOrAddProperties<PastOp::Properties>().delay = delayAttr;
if (parser.parseKeyword("clk"))
return ::mlir::failure();
clkOperandsLoc = parser.getCurrentLocation();
if (parser.parseOperand(clkRawOperand))
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();
{
::circt::hw::TypeVariant<::mlir::IntegerType, ::circt::hw::IntType> type;
if (parser.parseCustomTypeWithFallback(type))
return ::mlir::failure();
inputRawType = type;
}
for (::mlir::Type type : inputTypes) {
(void)type;
if (!((::circt::hw::isHWIntegerType(type)))) {
return parser.emitError(parser.getNameLoc()) << "'input' must be a signless integer bitvector, but got " << type;
}
}
::mlir::Type odsBuildableType0 = parser.getBuilder().getIntegerType(1);
result.addTypes(inputTypes[0]);
if (parser.resolveOperands(inputOperands, inputTypes, inputOperandsLoc, result.operands))
return ::mlir::failure();
if (parser.resolveOperands(clkOperands, odsBuildableType0, clkOperandsLoc, result.operands))
return ::mlir::failure();
return ::mlir::success();
}
void PastOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
_odsPrinter << ' ';
_odsPrinter << getInput();
_odsPrinter << ",";
_odsPrinter << ' ';
_odsPrinter.printAttributeWithoutType(getDelayAttr());
_odsPrinter << ' ' << "clk";
_odsPrinter << ' ';
_odsPrinter << getClk();
::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
elidedAttrs.push_back("delay");
_odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
_odsPrinter << ' ' << ":";
_odsPrinter << ' ';
{
auto type = getInput().getType();
if (auto validType = ::llvm::dyn_cast<::circt::hw::TypeVariant<::mlir::IntegerType, ::circt::hw::IntType>>(type))
_odsPrinter.printStrippedAttrOrType(validType);
else
_odsPrinter << type;
}
}
void PastOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}
} // namespace circt::ltl
MLIR_DEFINE_EXPLICIT_TYPE_ID(circt::ltl::PastOp)
MLIR_DEFINE_EXPLICIT_TYPE_ID(circt::ltl::detail::PastOpGenericAdaptorBase::Properties)
namespace circt::ltl {
//===----------------------------------------------------------------------===//
// circt::ltl::RepeatOp definitions
//===----------------------------------------------------------------------===//
namespace detail {
RepeatOpGenericAdaptorBase::RepeatOpGenericAdaptorBase(RepeatOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
uint64_t RepeatOpGenericAdaptorBase::getBase() {
auto attr = getBaseAttr();
return attr.getValue().getZExtValue();
}
::std::optional<uint64_t> RepeatOpGenericAdaptorBase::getMore() {
auto attr = getMoreAttr();
return attr ? ::std::optional<uint64_t>(attr.getValue().getZExtValue()) : (::std::nullopt);
}
} // namespace detail
RepeatOpAdaptor::RepeatOpAdaptor(RepeatOp op) : RepeatOpGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult RepeatOpAdaptor::verify(::mlir::Location loc) {
auto tblgen_base = getProperties().base; (void)tblgen_base;
if (!tblgen_base) return emitError(loc, "'ltl.repeat' op requires attribute 'base'");
auto tblgen_more = getProperties().more; (void)tblgen_more;
if (tblgen_base && !(((::llvm::isa<::mlir::IntegerAttr>(tblgen_base))) && ((::llvm::cast<::mlir::IntegerAttr>(tblgen_base).getType().isSignlessInteger(64)))))
return emitError(loc, "'ltl.repeat' op attribute 'base' failed to satisfy constraint: 64-bit signless integer attribute");
if (tblgen_more && !(((::llvm::isa<::mlir::IntegerAttr>(tblgen_more))) && ((::llvm::cast<::mlir::IntegerAttr>(tblgen_more).getType().isSignlessInteger(64)))))
return emitError(loc, "'ltl.repeat' op attribute 'more' failed to satisfy constraint: 64-bit signless integer attribute");
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();
}
{
auto &propStorage = prop.base;
auto attr = dict.get("base");
if (attr) {
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `base` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
{
auto &propStorage = prop.more;
auto attr = dict.get("more");
if (attr) {
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `more` in property conversion: " << attr;
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};
{
const auto &propStorage = prop.base;
if (propStorage)
attrs.push_back(odsBuilder.getNamedAttr("base",
propStorage));
}
{
const auto &propStorage = prop.more;
if (propStorage)
attrs.push_back(odsBuilder.getNamedAttr("more",
propStorage));
}
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code RepeatOp::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine(
llvm::hash_value(prop.base.getAsOpaquePointer()),
llvm::hash_value(prop.more.getAsOpaquePointer()));
}
std::optional<mlir::Attribute> RepeatOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
if (name == "base")
return prop.base;
if (name == "more")
return prop.more;
return std::nullopt;
}
void RepeatOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
if (name == "base") {
prop.base = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.base)>>(value);
return;
}
if (name == "more") {
prop.more = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.more)>>(value);
return;
}
}
void RepeatOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
if (prop.base) attrs.append("base", prop.base);
if (prop.more) attrs.append("more", prop.more);
}
::llvm::LogicalResult RepeatOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
{
::mlir::Attribute attr = attrs.get(getBaseAttrName(opName));
if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_LTL3(attr, "base", emitError)))
return ::mlir::failure();
}
{
::mlir::Attribute attr = attrs.get(getMoreAttrName(opName));
if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_LTL3(attr, "more", emitError)))
return ::mlir::failure();
}
return ::mlir::success();
}
::llvm::LogicalResult RepeatOp::readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state) {
auto &prop = state.getOrAddProperties<Properties>(); (void)prop;
if (::mlir::failed(reader.readAttribute(prop.base)))
return ::mlir::failure();
if (::mlir::failed(reader.readOptionalAttribute(prop.more)))
return ::mlir::failure();
return ::mlir::success();
}
void RepeatOp::writeProperties(::mlir::DialectBytecodeWriter &writer) {
auto &prop = getProperties(); (void)prop;
writer.writeAttribute(prop.base);
writer.writeOptionalAttribute(prop.more);
}
uint64_t RepeatOp::getBase() {
auto attr = getBaseAttr();
return attr.getValue().getZExtValue();
}
::std::optional<uint64_t> RepeatOp::getMore() {
auto attr = getMoreAttr();
return attr ? ::std::optional<uint64_t>(attr.getValue().getZExtValue()) : (::std::nullopt);
}
void RepeatOp::setBase(uint64_t attrValue) {
getProperties().base = ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(64), attrValue);
}
void RepeatOp::setMore(::std::optional<uint64_t> attrValue) {
auto &odsProp = getProperties().more;
if (attrValue)
odsProp = ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(64), *attrValue);
else
odsProp = nullptr;
}
void RepeatOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value input, ::mlir::IntegerAttr base, /*optional*/::mlir::IntegerAttr more) {
odsState.addOperands(input);
odsState.getOrAddProperties<Properties>().base = base;
if (more) {
odsState.getOrAddProperties<Properties>().more = more;
}
odsState.addTypes(result);
}
RepeatOp RepeatOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value input, ::mlir::IntegerAttr base, /*optional*/::mlir::IntegerAttr more) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(result)>(result), std::forward<decltype(input)>(input), std::forward<decltype(base)>(base), std::forward<decltype(more)>(more));
auto __res__ = ::llvm::dyn_cast<RepeatOp>(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, ::mlir::IntegerAttr base, /*optional*/::mlir::IntegerAttr more) {
return create(builder, builder.getLoc(), std::forward<decltype(result)>(result), std::forward<decltype(input)>(input), std::forward<decltype(base)>(base), std::forward<decltype(more)>(more));
}
void RepeatOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value input, ::mlir::IntegerAttr base, /*optional*/::mlir::IntegerAttr more) {
odsState.addOperands(input);
odsState.getOrAddProperties<Properties>().base = base;
if (more) {
odsState.getOrAddProperties<Properties>().more = more;
}
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(RepeatOp::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);
}
RepeatOp RepeatOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value input, ::mlir::IntegerAttr base, /*optional*/::mlir::IntegerAttr more) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(input)>(input), std::forward<decltype(base)>(base), std::forward<decltype(more)>(more));
auto __res__ = ::llvm::dyn_cast<RepeatOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
RepeatOp RepeatOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value input, ::mlir::IntegerAttr base, /*optional*/::mlir::IntegerAttr more) {
return create(builder, builder.getLoc(), std::forward<decltype(input)>(input), std::forward<decltype(base)>(base), std::forward<decltype(more)>(more));
}
void RepeatOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input, ::mlir::IntegerAttr base, /*optional*/::mlir::IntegerAttr more) {
odsState.addOperands(input);
odsState.getOrAddProperties<Properties>().base = base;
if (more) {
odsState.getOrAddProperties<Properties>().more = more;
}
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::IntegerAttr base, /*optional*/::mlir::IntegerAttr more) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(input)>(input), std::forward<decltype(base)>(base), std::forward<decltype(more)>(more));
auto __res__ = ::llvm::dyn_cast<RepeatOp>(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, ::mlir::IntegerAttr base, /*optional*/::mlir::IntegerAttr more) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(input)>(input), std::forward<decltype(base)>(base), std::forward<decltype(more)>(more));
}
void RepeatOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value input, uint64_t base, /*optional*/::mlir::IntegerAttr more) {
odsState.addOperands(input);
odsState.getOrAddProperties<Properties>().base = odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), base);
if (more) {
odsState.getOrAddProperties<Properties>().more = more;
}
odsState.addTypes(result);
}
RepeatOp RepeatOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value input, uint64_t base, /*optional*/::mlir::IntegerAttr more) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(result)>(result), std::forward<decltype(input)>(input), std::forward<decltype(base)>(base), std::forward<decltype(more)>(more));
auto __res__ = ::llvm::dyn_cast<RepeatOp>(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, uint64_t base, /*optional*/::mlir::IntegerAttr more) {
return create(builder, builder.getLoc(), std::forward<decltype(result)>(result), std::forward<decltype(input)>(input), std::forward<decltype(base)>(base), std::forward<decltype(more)>(more));
}
void RepeatOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value input, uint64_t base, /*optional*/::mlir::IntegerAttr more) {
odsState.addOperands(input);
odsState.getOrAddProperties<Properties>().base = odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), base);
if (more) {
odsState.getOrAddProperties<Properties>().more = more;
}
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(RepeatOp::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);
}
RepeatOp RepeatOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value input, uint64_t base, /*optional*/::mlir::IntegerAttr more) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(input)>(input), std::forward<decltype(base)>(base), std::forward<decltype(more)>(more));
auto __res__ = ::llvm::dyn_cast<RepeatOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
RepeatOp RepeatOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value input, uint64_t base, /*optional*/::mlir::IntegerAttr more) {
return create(builder, builder.getLoc(), std::forward<decltype(input)>(input), std::forward<decltype(base)>(base), std::forward<decltype(more)>(more));
}
void RepeatOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input, uint64_t base, /*optional*/::mlir::IntegerAttr more) {
odsState.addOperands(input);
odsState.getOrAddProperties<Properties>().base = odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), base);
if (more) {
odsState.getOrAddProperties<Properties>().more = more;
}
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, uint64_t base, /*optional*/::mlir::IntegerAttr more) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(input)>(input), std::forward<decltype(base)>(base), std::forward<decltype(more)>(more));
auto __res__ = ::llvm::dyn_cast<RepeatOp>(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, uint64_t base, /*optional*/::mlir::IntegerAttr more) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(input)>(input), std::forward<decltype(base)>(base), std::forward<decltype(more)>(more));
}
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);
if (!attributes.empty()) {
(void)odsState.getOrAddProperties<RepeatOp::Properties>();
::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.");
}
}
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<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<RepeatOp>(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<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void RepeatOp::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<RepeatOp::Properties>();
::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(RepeatOp::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).");
}
}
RepeatOp RepeatOp::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<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<RepeatOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
RepeatOp RepeatOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(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&>(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<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<RepeatOp>(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<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
void RepeatOp::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 &>(properties));
odsState.addAttributes(discardableAttributes);
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(RepeatOp::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).");
}
}
RepeatOp RepeatOp::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<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<RepeatOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
RepeatOp RepeatOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
::llvm::LogicalResult RepeatOp::verifyInvariantsImpl() {
auto tblgen_base = getProperties().base; (void)tblgen_base;
if (!tblgen_base) return emitOpError("requires attribute 'base'");
auto tblgen_more = getProperties().more; (void)tblgen_more;
if (::mlir::failed(__mlir_ods_local_attr_constraint_LTL3(*this, tblgen_base, "base")))
return ::mlir::failure();
if (::mlir::failed(__mlir_ods_local_attr_constraint_LTL3(*this, tblgen_more, "more")))
return ::mlir::failure();
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LTL6(*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_LTL7(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult RepeatOp::verifyInvariants() {
return verifyInvariantsImpl();
}
::llvm::LogicalResult RepeatOp::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<circt::ltl::SequenceType>();
inferredReturnTypes[0] = odsInferredType0;
return ::mlir::success();
}
::mlir::ParseResult RepeatOp::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 baseAttr;
::mlir::IntegerAttr moreAttr;
::mlir::Type inputRawType{};
::llvm::ArrayRef<::mlir::Type> inputTypes(&inputRawType, 1);
inputOperandsLoc = parser.getCurrentLocation();
if (parser.parseOperand(inputRawOperand))
return ::mlir::failure();
if (parser.parseComma())
return ::mlir::failure();
if (parser.parseCustomAttributeWithFallback(baseAttr, parser.getBuilder().getIntegerType(64))) {
return ::mlir::failure();
}
if (baseAttr) result.getOrAddProperties<RepeatOp::Properties>().base = baseAttr;
if (::mlir::succeeded(parser.parseOptionalComma())) {
if (parser.parseCustomAttributeWithFallback(moreAttr, parser.getBuilder().getIntegerType(64))) {
return ::mlir::failure();
}
if (moreAttr) result.getOrAddProperties<RepeatOp::Properties>().more = moreAttr;
}
{
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::Type type;
if (parser.parseCustomTypeWithFallback(type))
return ::mlir::failure();
inputRawType = type;
}
::mlir::Type odsBuildableType0 = parser.getBuilder().getType<circt::ltl::SequenceType>();
result.addTypes(odsBuildableType0);
if (parser.resolveOperands(inputOperands, inputTypes, inputOperandsLoc, result.operands))
return ::mlir::failure();
return ::mlir::success();
}
void RepeatOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
_odsPrinter << ' ';
_odsPrinter << getInput();
_odsPrinter << ",";
_odsPrinter << ' ';
_odsPrinter.printAttributeWithoutType(getBaseAttr());
if (getMoreAttr()) {
_odsPrinter << ",";
_odsPrinter << ' ';
_odsPrinter.printAttributeWithoutType(getMoreAttr());
}
::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
elidedAttrs.push_back("base");
elidedAttrs.push_back("more");
_odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
_odsPrinter << ' ' << ":";
_odsPrinter << ' ';
{
auto type = getInput().getType();
if (auto validType = ::llvm::dyn_cast<::mlir::Type>(type))
_odsPrinter.printStrippedAttrOrType(validType);
else
_odsPrinter << type;
}
}
void RepeatOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}
} // namespace circt::ltl
MLIR_DEFINE_EXPLICIT_TYPE_ID(circt::ltl::RepeatOp)
MLIR_DEFINE_EXPLICIT_TYPE_ID(circt::ltl::detail::RepeatOpGenericAdaptorBase::Properties)
namespace circt::ltl {
//===----------------------------------------------------------------------===//
// circt::ltl::SampledOp definitions
//===----------------------------------------------------------------------===//
namespace detail {
SampledOpGenericAdaptorBase::SampledOpGenericAdaptorBase(SampledOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
} // namespace detail
SampledOpAdaptor::SampledOpAdaptor(SampledOp op) : SampledOpGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult SampledOpAdaptor::verify(::mlir::Location loc) {
return ::mlir::success();
}
::llvm::LogicalResult SampledOp::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 SampledOp::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 SampledOp::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine();
}
std::optional<mlir::Attribute> SampledOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
return std::nullopt;
}
void SampledOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
}
void SampledOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
}
::llvm::LogicalResult SampledOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
return ::mlir::success();
}
void SampledOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type sampledValue, ::mlir::Value expression) {
odsState.addOperands(expression);
odsState.addTypes(sampledValue);
}
SampledOp SampledOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type sampledValue, ::mlir::Value expression) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(sampledValue)>(sampledValue), std::forward<decltype(expression)>(expression));
auto __res__ = ::llvm::dyn_cast<SampledOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
SampledOp SampledOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type sampledValue, ::mlir::Value expression) {
return create(builder, builder.getLoc(), std::forward<decltype(sampledValue)>(sampledValue), std::forward<decltype(expression)>(expression));
}
void SampledOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value expression) {
odsState.addOperands(expression);
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(SampledOp::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);
}
SampledOp SampledOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value expression) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(expression)>(expression));
auto __res__ = ::llvm::dyn_cast<SampledOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
SampledOp SampledOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value expression) {
return create(builder, builder.getLoc(), std::forward<decltype(expression)>(expression));
}
void SampledOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value expression) {
odsState.addOperands(expression);
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
SampledOp SampledOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value expression) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(expression)>(expression));
auto __res__ = ::llvm::dyn_cast<SampledOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
SampledOp SampledOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value expression) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(expression)>(expression));
}
void SampledOp::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);
}
SampledOp SampledOp::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<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<SampledOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
SampledOp SampledOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void SampledOp::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(SampledOp::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).");
}
}
SampledOp SampledOp::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<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<SampledOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
SampledOp SampledOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void SampledOp::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&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
SampledOp SampledOp::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<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<SampledOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
SampledOp SampledOp::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<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
void SampledOp::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 &>(properties));
odsState.addAttributes(discardableAttributes);
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(SampledOp::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).");
}
}
SampledOp SampledOp::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<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<SampledOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
SampledOp SampledOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
::llvm::LogicalResult SampledOp::verifyInvariantsImpl() {
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LTL10(*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_LTL10(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
if (!((std::equal_to<>()((*this->getODSOperands(0).begin()).getType(), (*this->getODSResults(0).begin()).getType()))))
return emitOpError("failed to verify that expression and sampledValue types must match");
return ::mlir::success();
}
::llvm::LogicalResult SampledOp::verifyInvariants() {
return verifyInvariantsImpl();
}
::llvm::LogicalResult SampledOp::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 SampledOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
::mlir::OpAsmParser::UnresolvedOperand expressionRawOperand{};
::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> expressionOperands(&expressionRawOperand, 1); ::llvm::SMLoc expressionOperandsLoc;
(void)expressionOperandsLoc;
::mlir::Type expressionRawType{};
::llvm::ArrayRef<::mlir::Type> expressionTypes(&expressionRawType, 1);
expressionOperandsLoc = parser.getCurrentLocation();
if (parser.parseOperand(expressionRawOperand))
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(expressionRawType))
return ::mlir::failure();
for (::mlir::Type type : expressionTypes) {
(void)type;
if (!(!((::llvm::isa<::mlir::TokenType>(type))))) {
return parser.emitError(parser.getNameLoc()) << "'expression' must be any non-token type, but got " << type;
}
}
result.addTypes(expressionTypes[0]);
if (parser.resolveOperands(expressionOperands, expressionTypes, expressionOperandsLoc, result.operands))
return ::mlir::failure();
return ::mlir::success();
}
void SampledOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
_odsPrinter << ' ';
_odsPrinter << getExpression();
::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
_odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
_odsPrinter << ' ' << ":";
_odsPrinter << ' ';
_odsPrinter << getExpression().getType();
}
void SampledOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}
} // namespace circt::ltl
MLIR_DEFINE_EXPLICIT_TYPE_ID(circt::ltl::SampledOp)
namespace circt::ltl {
//===----------------------------------------------------------------------===//
// circt::ltl::UntilOp definitions
//===----------------------------------------------------------------------===//
namespace detail {
UntilOpGenericAdaptorBase::UntilOpGenericAdaptorBase(UntilOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
} // namespace detail
UntilOpAdaptor::UntilOpAdaptor(UntilOp op) : UntilOpGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult UntilOpAdaptor::verify(::mlir::Location loc) {
return ::mlir::success();
}
::llvm::LogicalResult UntilOp::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 UntilOp::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 UntilOp::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine();
}
std::optional<mlir::Attribute> UntilOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
return std::nullopt;
}
void UntilOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
}
void UntilOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
}
::llvm::LogicalResult UntilOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
return ::mlir::success();
}
void UntilOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value input, ::mlir::Value condition) {
odsState.addOperands(input);
odsState.addOperands(condition);
odsState.addTypes(result);
}
UntilOp UntilOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value input, ::mlir::Value condition) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(result)>(result), std::forward<decltype(input)>(input), std::forward<decltype(condition)>(condition));
auto __res__ = ::llvm::dyn_cast<UntilOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
UntilOp UntilOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::Value input, ::mlir::Value condition) {
return create(builder, builder.getLoc(), std::forward<decltype(result)>(result), std::forward<decltype(input)>(input), std::forward<decltype(condition)>(condition));
}
void UntilOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value input, ::mlir::Value condition) {
odsState.addOperands(input);
odsState.addOperands(condition);
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(UntilOp::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);
}
UntilOp UntilOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value input, ::mlir::Value condition) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(input)>(input), std::forward<decltype(condition)>(condition));
auto __res__ = ::llvm::dyn_cast<UntilOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
UntilOp UntilOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value input, ::mlir::Value condition) {
return create(builder, builder.getLoc(), std::forward<decltype(input)>(input), std::forward<decltype(condition)>(condition));
}
void UntilOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input, ::mlir::Value condition) {
odsState.addOperands(input);
odsState.addOperands(condition);
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
UntilOp UntilOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value input, ::mlir::Value condition) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(input)>(input), std::forward<decltype(condition)>(condition));
auto __res__ = ::llvm::dyn_cast<UntilOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
UntilOp UntilOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value input, ::mlir::Value condition) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(input)>(input), std::forward<decltype(condition)>(condition));
}
void UntilOp::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);
}
UntilOp UntilOp::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<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<UntilOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
UntilOp UntilOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void UntilOp::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(UntilOp::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).");
}
}
UntilOp UntilOp::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<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<UntilOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
UntilOp UntilOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void UntilOp::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&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
UntilOp UntilOp::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<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<UntilOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
UntilOp UntilOp::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<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
void UntilOp::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 &>(properties));
odsState.addAttributes(discardableAttributes);
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(UntilOp::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).");
}
}
UntilOp UntilOp::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<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<UntilOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
UntilOp UntilOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
::llvm::LogicalResult UntilOp::verifyInvariantsImpl() {
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LTL2(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup1 = getODSOperands(1);
for (auto v : valueGroup1) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LTL2(*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_LTL3(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult UntilOp::verifyInvariants() {
return verifyInvariantsImpl();
}
::llvm::LogicalResult UntilOp::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<circt::ltl::PropertyType>();
inferredReturnTypes[0] = odsInferredType0;
return ::mlir::success();
}
::mlir::ParseResult UntilOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
::llvm::SmallVector<::mlir::OpAsmParser::UnresolvedOperand, 4> allOperands;
::llvm::SmallVector<::mlir::Type, 1> allOperandTypes;
[[maybe_unused]] ::llvm::SMLoc allOperandLoc = parser.getCurrentLocation();
if (parser.parseOperandList(allOperands))
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();
::mlir::Type odsBuildableType0 = parser.getBuilder().getType<circt::ltl::PropertyType>();
result.addTypes(odsBuildableType0);
if (parser.resolveOperands(allOperands, allOperandTypes, allOperandLoc, result.operands))
return ::mlir::failure();
return ::mlir::success();
}
void UntilOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
_odsPrinter << ' ';
_odsPrinter << getOperation()->getOperands();
::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
_odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
_odsPrinter << ' ' << ":";
_odsPrinter << ' ';
_odsPrinter << getOperation()->getOperandTypes();
}
void UntilOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}
} // namespace circt::ltl
MLIR_DEFINE_EXPLICIT_TYPE_ID(circt::ltl::UntilOp)
#endif // GET_OP_CLASSES