14#include <mlir/CAPI/IR.h>
15#include <mlir/CAPI/Support.h>
16#include <mlir/CAPI/Wrap.h>
28 SymbolTableCollection sc;
51 intptr_t numLhsParams, MlirAttribute
const *lhsParams, intptr_t numRhsParams,
52 MlirAttribute
const *rhsParams
54 SmallVector<Attribute> lhsSto, rhsSto;
56 unwrapList(numLhsParams, lhsParams, lhsSto), unwrapList(numRhsParams, rhsParams, rhsSto)
62 mlir::cast<ArrayAttr>(unwrap(lhsParams)), mlir::cast<ArrayAttr>(unwrap(rhsParams))
67 MlirType lhs, MlirType rhs, intptr_t nRhsReversePrefix, MlirStringRef
const *rhsReversePrefix
69 SmallVector<StringRef> rhsReversePrefixSto;
71 unwrap(lhs), unwrap(rhs), unwrapList(nRhsReversePrefix, rhsReversePrefix, rhsReversePrefixSto)
76 MlirType oldTy, MlirType newTy,
bool (*knownOldToNew)(MlirType, MlirType,
void *),
80 unwrap(oldTy), unwrap(newTy),
81 [knownOldToNew, userData](
auto lhs,
auto rhs) {
82 return knownOldToNew(wrap(lhs), wrap(rhs), userData);
bool llzkIsSignalType(MlirType type)
Return true iff the given type is a StructType referencing the COMPONENT_NAME_SIGNAL struct.
bool llzkIsConcreteType(MlirType type, bool allowStructParams)
Return false iff the type contains any TypeVarType
bool llzkIsValidArrayType(MlirType type)
Checks if the type is a LLZK Array and it also contains a valid LLZK type.
bool llzkIsValidGlobalType(MlirType type)
valid types: isValidType() - {TypeVarType} - {types with variable parameters}
bool llzkIsValidType(MlirType type)
valid types: {I1, Index, String, FeltType, StructType, ArrayType, TypeVarType}
bool llzkIsValidConstReadType(MlirType type)
valid types: {I1, Index, FeltType, TypeVarType}
bool llzkHasAffineMapAttr(MlirType type)
Return true iff the given type contains an AffineMapAttr.
bool llzkArrayAttrTypeParamsUnify(MlirAttribute lhsParams, MlirAttribute rhsParams)
Return true iff the two ArrayAttr instances containing StructType or ArrayType parameters are equival...
bool llzkIsMoreConcreteUnification(MlirType oldTy, MlirType newTy, bool(*knownOldToNew)(MlirType, MlirType, void *), void *userData)
Return true iff the types unify and newTy is "more concrete" than oldTy.
bool llzkTypesUnify(MlirType lhs, MlirType rhs, intptr_t nRhsReversePrefix, MlirStringRef const *rhsReversePrefix)
Return true iff the two Type instances are equivalent or could be equivalent after full instantiation...
bool llzkTypeParamsUnify(intptr_t numLhsParams, MlirAttribute const *lhsParams, intptr_t numRhsParams, MlirAttribute const *rhsParams)
Return true iff the two ArrayRef instances containing StructType or ArrayType parameters are equivale...
void llzkAssertValidAttrForParamOfType(MlirAttribute attr)
This function asserts that the given Attribute kind is legal within the LLZK types that can contain A...
bool llzkIsValidArrayElemType(MlirType type)
valid types: isValidType() - {ArrayType}
MlirAttribute llzkForceIntAttrType(MlirAttribute attr)
Convert any IntegerAttr with a type other than IndexType to use IndexType.
bool llzkIsValidEmitEqType(MlirType type)
valid types: isValidType() - {String, StructType} (excluded via any type parameter nesting)
bool llzkIsValidColumnType(MlirType type, MlirOperation op)
valid types: {FeltType, StructType (with columns), ArrayType (that contains a valid column type)}
void assertValidAttrForParamOfType(Attribute attr)
bool isValidArrayType(Type type)
bool isConcreteType(Type type, bool allowStructParams)
bool isValidArrayElemType(Type type)
bool isValidGlobalType(Type type)
bool isValidColumnType(Type type, SymbolTableCollection &symbolTable, Operation *op)
bool isValidEmitEqType(Type type)
bool isValidType(Type type)
bool isSignalType(Type type)
bool typesUnify(Type lhs, Type rhs, ArrayRef< StringRef > rhsReversePrefix, UnificationMap *unifications)
bool typeParamsUnify(const ArrayRef< Attribute > &lhsParams, const ArrayRef< Attribute > &rhsParams, UnificationMap *unifications)
bool isMoreConcreteUnification(Type oldTy, Type newTy, llvm::function_ref< bool(Type oldTy, Type newTy)> knownOldToNew)
Attribute forceIntAttrType(Attribute attr)
bool hasAffineMapAttr(Type type)
bool isValidConstReadType(Type type)