13#include "mlir/CAPI/Registration.h"
29 return isAnyNonFuncSMTValueType(
unwrap(type));
33 return isAnySMTValueType(
unwrap(type));
45 return isa<BitVectorType>(
unwrap(type));
49 return wrap(BitVectorType::get(
unwrap(ctx), width));
67 const MlirType *domainTypes, MlirType rangeType) {
68 SmallVector<Type> domainTypesVec;
69 domainTypesVec.reserve(numberOfDomainTypes);
71 for (
size_t i = 0; i < numberOfDomainTypes; i++)
72 domainTypesVec.push_back(
unwrap(domainTypes[i]));
74 return wrap(SMTFuncType::get(
unwrap(ctx), domainTypesVec,
unwrap(rangeType)));
80 size_t numberOfSortParams,
const MlirType *sortParams) {
81 SmallVector<Type> sortParamsVec;
82 sortParamsVec.reserve(numberOfSortParams);
84 for (
size_t i = 0; i < numberOfSortParams; i++)
85 sortParamsVec.push_back(
unwrap(sortParams[i]));
95 return symbolizeBVCmpPredicate(
unwrap(str)).has_value();
99 return symbolizeIntPredicate(
unwrap(str)).has_value();
103 return isa<BitVectorAttr, BVCmpPredicateAttr, IntPredicateAttr>(
unwrap(attr));
108 return wrap(BitVectorAttr::get(
unwrap(ctx), value, width));
112 auto predicate = symbolizeBVCmpPredicate(
unwrap(str));
113 assert(predicate.has_value() &&
"invalid predicate");
115 return wrap(BVCmpPredicateAttr::get(
unwrap(ctx), predicate.value()));
119 auto predicate = symbolizeIntPredicate(
unwrap(str));
120 assert(predicate.has_value() &&
"invalid predicate");
122 return wrap(IntPredicateAttr::get(
unwrap(ctx), predicate.value()));
assert(baseType &&"element must be base type")
return wrap(CMemoryType::get(unwrap(ctx), baseType, numElements))
MLIR_DEFINE_CAPI_DIALECT_REGISTRATION(CHIRRTL, chirrtl, circt::chirrtl::CHIRRTLDialect) MlirType chirrtlTypeGetCMemory(MlirContext ctx
static EvaluatorValuePtr unwrap(OMEvaluatorValue c)
bool smtTypeIsABitVector(MlirType type)
Checks if the given type is a smt::BitVectorType.
bool smtTypeIsASMTFunc(MlirType type)
Checks if the given type is a smt::FuncType.
MlirType smtTypeGetSort(MlirContext ctx, MlirIdentifier identifier, size_t numberOfSortParams, const MlirType *sortParams)
Creates a smt::SortType with the given identifier and sort parameters.
bool smtTypeIsABool(MlirType type)
Checks if the given type is a smt::BoolType.
MlirAttribute smtAttrGetBitVector(MlirContext ctx, uint64_t value, unsigned width)
Creates a smt::BitVectorAttr with the given value and width.
bool smtTypeIsAnyNonFuncSMTValueType(MlirType type)
Checks if the given type is any non-func SMT value type.
bool smtTypeIsAInt(MlirType type)
Checks if the given type is a smt::IntType.
MlirType smtTypeGetBool(MlirContext ctx)
Creates a smt::BoolType.
MlirType smtTypeGetBitVector(MlirContext ctx, int32_t width)
Creates a smt::BitVectorType with the given width.
MlirType smtTypeGetSMTFunc(MlirContext ctx, size_t numberOfDomainTypes, const MlirType *domainTypes, MlirType rangeType)
Creates a smt::FuncType with the given domain and range types.
bool smtAttrIsASMTAttribute(MlirAttribute attr)
Checks if the given attribute is a smt::SMTAttribute.
MlirAttribute smtAttrGetIntPredicate(MlirContext ctx, MlirStringRef str)
Creates a smt::IntPredicateAttr with the given string.
bool smtTypeIsAArray(MlirType type)
Checks if the given type is a smt::ArrayType.
MlirType smtTypeGetInt(MlirContext ctx)
Creates a smt::IntType.
MlirAttribute smtAttrGetBVCmpPredicate(MlirContext ctx, MlirStringRef str)
Creates a smt::BVCmpPredicateAttr with the given string.
bool smtAttrCheckBVCmpPredicate(MlirContext ctx, MlirStringRef str)
Checks if the given string is a valid smt::BVCmpPredicate.
MlirType smtTypeGetArray(MlirContext ctx, MlirType domainType, MlirType rangeType)
Creates an array type with the given domain and range types.
bool smtTypeIsAnySMTValueType(MlirType type)
Checks if the given type is any SMT value type.
bool smtTypeIsASort(MlirType type)
Checks if the given type is a smt::SortType.
bool smtAttrCheckIntPredicate(MlirContext ctx, MlirStringRef str)
Checks if the given string is a valid smt::IntPredicate.
The InstanceGraph op interface, see InstanceGraphInterface.td for more details.