LLZK 0.1.0
Veridise's ZK Language IR
Loading...
Searching...
No Matches
llzk Namespace Reference

Namespaces

namespace  affineMapHelpers
 Group together all implementation related to AffineMap type parameters.
 
namespace  array
 
namespace  boolean
 
namespace  cast
 
namespace  component
 
namespace  constrain
 
namespace  dataflow
 
namespace  debug
 
namespace  felt
 
namespace  function
 
namespace  global
 
namespace  impl
 
namespace  include
 
namespace  polymorphic
 
namespace  string
 
namespace  undef
 

Classes

class  BuildShortTypeString
 Note: If any symbol refs in an input Type/Attribute use any of the special characters that this class generates, they are not escaped. More...
 
class  CallGraph
 This is a port of mlir::CallGraph that has been adapted to use the custom symbol lookup helpers (see SymbolHelper.h). More...
 
class  CallGraphAnalysis
 An analysis wrapper to compute the CallGraph for a Module. More...
 
class  CallGraphNode
 This is a simple port of the mlir::CallGraphNode with llzk::CallGraph as a friend class, for mlir::CallGraphNode has a private constructor and can only be constructed by mlir::CallGraph. More...
 
class  CallGraphPrinterPass
 
class  CallGraphReachabilityAnalysis
 Lazily-constructed reachability analysis. More...
 
class  CallGraphSCCsPrinterPass
 
class  ConstrainRef
 Defines a reference to a llzk object within a constrain function call. More...
 
class  ConstrainRefAnalysis
 The dataflow analysis that computes the set of references that LLZK operations use and produce. More...
 
class  ConstrainRefIndex
 Defines an index into an LLZK object. More...
 
class  ConstrainRefLattice
 A lattice for use in dense analysis. More...
 
class  ConstrainRefLatticeValue
 A value at a given point of the ConstrainRefLattice. More...
 
class  ConstrainRefSet
 
class  ConstraintDependencyGraph
 A dependency graph of constraints enforced by an LLZK struct. More...
 
class  ConstraintDependencyGraphModuleAnalysis
 A module-level analysis for constructing ConstraintDependencyGraph objects for all structs in the given LLZK module. More...
 
class  ConstraintDependencyGraphPrinterPass
 
class  ConstraintDependencyGraphStructAnalysis
 An analysis wrapper around the ConstraintDependencyGraph for a given struct. More...
 
class  ExpressionValue
 Tracks a solver expression and an interval range for that expression. More...
 
class  Field
 Information about the prime finite field used for the interval analysis. More...
 
class  filtered_raw_ostream
 Wrapper for llvm::raw_ostream that filters out certain characters selected by a function. More...
 
struct  FullPolyLoweringOptions
 
class  GlobalSourceMgr
 
class  Interval
 Intervals over a finite field. More...
 
struct  IntervalAnalysisContext
 Parameters and shared objects to pass to child analyses. More...
 
class  IntervalAnalysisLattice
 Maps mlir::Values to LatticeValues. More...
 
class  IntervalAnalysisLatticeValue
 
class  IntervalAnalysisPrinterPass
 
struct  IntervalAnalysisPrinterPassOptions
 
class  IntervalDataFlowAnalysis
 
class  LLZKDialect
 
struct  LLZKDialectBytecodeInterface
 This implements the bytecode interface for the LLZK dialect. More...
 
struct  LLZKDialectVersion
 
class  ModuleAnalysis
 An analysis wrapper that runs the given StructAnalysisTy struct analysis over all of the struct contained within the module. More...
 
class  ModuleBuilder
 Builds out a LLZK-compliant module and provides utilities for populating that module. More...
 
class  ModuleIntervalAnalysis
 
struct  NamedOpLocationLess
 
struct  NoContext
 An empty struct that is used for convenience for analyses that do not require any context. More...
 
struct  OpHash
 
struct  OpLocationLess
 
struct  PolyLoweringPassOptions
 
class  StructAnalysis
 This is the base class for a dataflow analysis designed to run on a single struct (i.e., a single component). More...
 
class  StructIntervalAnalysis
 
class  StructIntervals
 
class  SymbolLookupResult
 
class  SymbolLookupResultUntyped
 
class  UnreducedInterval
 An inclusive interval [a, b] where a and b are arbitrary integers not necessarily bound to a given field. More...
 
struct  UnusedDeclarationEliminationPassOptions
 
struct  VerifySizesForMultiAffineOps
 Produces errors if there is an inconsistency in the various attributes/values that are used to support affine map instantiation in the Op marked with this Trait. More...
 
class  Within
 

Concepts

concept  StructAnalysisType
 Any type that is a subclass of StructAnalysis.
 
concept  OpComparable
 
concept  NamedOpComparable
 
concept  OpHashable
 

Typedefs

using TranslationMap
 
using ConstrainRefRemappings = std::vector<std::pair<ConstrainRef, ConstrainRefLatticeValue>>
 
using EmitErrorFn = llvm::function_ref<mlir::InFlightDiagnostic()>
 
using OwningEmitErrorFn = std::function<mlir::InFlightDiagnostic()>
 
using ManagedResources
 
using UnificationMap = mlir::DenseMap<std::pair<mlir::SymbolRefAttr, Side>, mlir::Attribute>
 Optional result from type unifications.
 

Enumerations

enum class  Side { EMPTY = 0 , LHS , RHS , TOMB }
 

Functions

std::unique_ptr< mlir::Pass > createCallGraphPrinterPass (llvm::raw_ostream &os=llvm::errs())
 
std::unique_ptr< mlir::Pass > createCallGraphSCCsPrinterPass (llvm::raw_ostream &os=llvm::errs())
 
SymbolLookupResult< StructDefOpgetStructDef (mlir::SymbolTableCollection &tables, mlir::ModuleOp mod, StructType ty)
 Lookup a StructDefOp from a given StructType.
 
mlir::raw_ostream & operator<< (mlir::raw_ostream &os, const ConstrainRef &rhs)
 
mlir::raw_ostream & operator<< (mlir::raw_ostream &os, const ConstrainRefSet &rhs)
 
mlir::raw_ostream & operator<< (mlir::raw_ostream &os, const ConstrainRefLatticeValue &v)
 
llvm::raw_ostream & operator<< (llvm::raw_ostream &os, const ConstrainRefLattice &lattice)
 
std::unique_ptr< mlir::Pass > createConstraintDependencyGraphPrinterPass (llvm::raw_ostream &os=llvm::errs())
 
UnreducedInterval operator+ (const UnreducedInterval &lhs, const UnreducedInterval &rhs)
 
UnreducedInterval operator- (const UnreducedInterval &lhs, const UnreducedInterval &rhs)
 
UnreducedInterval operator* (const UnreducedInterval &lhs, const UnreducedInterval &rhs)
 
std::strong_ordering operator<=> (const UnreducedInterval &lhs, const UnreducedInterval &rhs)
 
Interval operator+ (const Interval &lhs, const Interval &rhs)
 
Interval operator- (const Interval &lhs, const Interval &rhs)
 
Interval operator* (const Interval &lhs, const Interval &rhs)
 
FailureOr< Intervaloperator/ (const Interval &lhs, const Interval &rhs)
 
Interval operator% (const Interval &lhs, const Interval &rhs)
 
ExpressionValue intersection (llvm::SMTSolverRef solver, const ExpressionValue &lhs, const ExpressionValue &rhs)
 
ExpressionValue add (llvm::SMTSolverRef solver, const ExpressionValue &lhs, const ExpressionValue &rhs)
 
ExpressionValue sub (llvm::SMTSolverRef solver, const ExpressionValue &lhs, const ExpressionValue &rhs)
 
ExpressionValue mul (llvm::SMTSolverRef solver, const ExpressionValue &lhs, const ExpressionValue &rhs)
 
ExpressionValue div (llvm::SMTSolverRef solver, felt::DivFeltOp op, const ExpressionValue &lhs, const ExpressionValue &rhs)
 
ExpressionValue mod (llvm::SMTSolverRef solver, const ExpressionValue &lhs, const ExpressionValue &rhs)
 
ExpressionValue cmp (llvm::SMTSolverRef solver, boolean::CmpOp op, const ExpressionValue &lhs, const ExpressionValue &rhs)
 
ExpressionValue fallbackBinaryOp (llvm::SMTSolverRef solver, Operation *op, const ExpressionValue &lhs, const ExpressionValue &rhs)
 
ExpressionValue neg (llvm::SMTSolverRef solver, const ExpressionValue &val)
 
ExpressionValue notOp (llvm::SMTSolverRef solver, const ExpressionValue &val)
 
ExpressionValue fallbackUnaryOp (llvm::SMTSolverRef solver, Operation *op, const ExpressionValue &val)
 
std::unique_ptr< mlir::Pass > createIntervalAnalysisPrinterPass (llvm::raw_ostream &os=llvm::errs())
 
void registerAllDialects (mlir::DialectRegistry &registry)
 
void printAttrs (AsmPrinter &printer, ArrayRef< Attribute > attrs, const StringRef &separator)
 
OwningOpRef< ModuleOp > createLLZKModule (MLIRContext *context, Location loc)
 
void addLangAttrForLLZKDialect (mlir::ModuleOp mod)
 
void addRemoveUnnecessaryOpsAndDefsPipeline (OpPassManager &pm)
 
void registerTransformationPassPipelines ()
 
llvm::APSInt expandingAdd (const llvm::APSInt &lhs, const llvm::APSInt &rhs)
 Safely add lhs and rhs, expanding the width of the result as necessary.
 
llvm::APSInt expandingSub (const llvm::APSInt &lhs, const llvm::APSInt &rhs)
 Safely subtract lhs and rhs, expanding the width of the result as necessary.
 
llvm::APSInt expandingMul (const llvm::APSInt &lhs, const llvm::APSInt &rhs)
 Safely multiple lhs and rhs, expanding the width of the result as necessary.
 
std::strong_ordering safeCmp (const llvm::APSInt &lhs, const llvm::APSInt &rhs)
 Compares lhs and rhs, regardless of the bitwidth of lhs and rhs.
 
llvm::SmallVector< StringRef > getNames (SymbolRefAttr ref)
 
llvm::SmallVector< FlatSymbolRefAttr > getPieces (SymbolRefAttr ref)
 
SymbolRefAttr replaceLeaf (SymbolRefAttr orig, FlatSymbolRefAttr newLeaf)
 
SymbolRefAttr appendLeaf (SymbolRefAttr orig, FlatSymbolRefAttr newLeaf)
 
SymbolRefAttr appendLeafName (SymbolRefAttr orig, const Twine &newLeafSuffix)
 
FailureOr< ModuleOp > getRootModule (Operation *from)
 
FailureOr< SymbolRefAttr > getPathFromRoot (StructDefOp &to)
 
FailureOr< SymbolRefAttr > getPathFromRoot (FuncDefOp &to)
 
FailureOr< ModuleOp > getTopRootModule (Operation *from)
 
FailureOr< SymbolRefAttr > getPathFromTopRoot (StructDefOp &to)
 
FailureOr< SymbolRefAttr > getPathFromTopRoot (FuncDefOp &to)
 
bool hasUsesWithin (Operation *symbol, Operation *from)
 
LogicalResult verifyParamOfType (SymbolTableCollection &tables, SymbolRefAttr param, Type parameterizedType, Operation *origin)
 
LogicalResult verifyParamsOfType (SymbolTableCollection &tables, ArrayRef< Attribute > tyParams, Type parameterizedType, Operation *origin)
 
FailureOr< StructDefOpverifyStructTypeResolution (SymbolTableCollection &tables, StructType ty, Operation *origin)
 
LogicalResult verifyTypeResolution (SymbolTableCollection &tables, Operation *origin, Type ty)
 
bool isValidType (Type type)
 
bool isValidColumnType (Type type, SymbolTableCollection &symbolTable, Operation *op)
 
bool isValidGlobalType (Type type)
 
bool isValidEmitEqType (Type type)
 
bool isValidConstReadType (Type type)
 
bool isValidArrayElemType (Type type)
 
bool isValidArrayType (Type type)
 
bool isConcreteType (Type type, bool allowStructParams)
 
bool isSignalType (Type type)
 
bool isSignalType (component::StructType sType)
 Return true iff the given StructType is referencing the COMPONENT_NAME_SIGNAL struct.
 
bool hasAffineMapAttr (Type type)
 
bool isDynamic (IntegerAttr intAttr)
 
bool typeParamsUnify (const ArrayRef< Attribute > &lhsParams, const ArrayRef< Attribute > &rhsParams, UnificationMap *unifications)
 
bool typeParamsUnify (const ArrayAttr &lhsParams, const ArrayAttr &rhsParams, UnificationMap *unifications)
 Return true iff the two ArrayAttr instances containing StructType or ArrayType parameters are equivalent or could be equivalent after full instantiation of struct parameters.
 
bool arrayTypesUnify (ArrayType lhs, ArrayType rhs, ArrayRef< StringRef > rhsReversePrefix, UnificationMap *unifications)
 
bool structTypesUnify (StructType lhs, StructType rhs, ArrayRef< StringRef > rhsReversePrefix, UnificationMap *unifications)
 
bool typesUnify (Type lhs, Type rhs, ArrayRef< StringRef > rhsReversePrefix, UnificationMap *unifications)
 
bool isMoreConcreteUnification (Type oldTy, Type newTy, llvm::function_ref< bool(Type oldTy, Type newTy)> knownOldToNew)
 
IntegerAttr forceIntType (IntegerAttr attr)
 
Attribute forceIntAttrType (Attribute attr)
 
SmallVector< Attribute > forceIntAttrTypes (ArrayRef< Attribute > attrList)
 
LogicalResult verifyIntAttrType (EmitErrorFn emitError, Attribute in)
 
LogicalResult verifyAffineMapAttrType (EmitErrorFn emitError, Attribute in)
 
LogicalResult verifyStructTypeParams (EmitErrorFn emitError, ArrayAttr params)
 
LogicalResult verifyArrayDimSizes (EmitErrorFn emitError, ArrayRef< Attribute > dimensionSizes)
 
LogicalResult verifyArrayType (EmitErrorFn emitError, Type elementType, ArrayRef< Attribute > dimensionSizes)
 
void assertValidAttrForParamOfType (Attribute attr)
 
void registerCallGraphPrinterPass ()
 
void registerCallGraphPrinterPassPass ()
 
void registerCallGraphSCCsPrinterPass ()
 
void registerCallGraphSCCsPrinterPassPass ()
 
void registerConstraintDependencyGraphPrinterPass ()
 
void registerConstraintDependencyGraphPrinterPassPass ()
 
void registerIntervalAnalysisPrinterPass ()
 
void registerIntervalAnalysisPrinterPassPass ()
 
void registerAnalysisPasses ()
 
llvm::APInt toAPInt (int64_t i)
 
int64_t fromAPInt (llvm::APInt i)
 
bool isNullOrEmpty (mlir::ArrayAttr a)
 
bool isNullOrEmpty (mlir::DenseArrayAttr a)
 
bool isNullOrEmpty (mlir::DictionaryAttr a)
 
void appendWithoutType (mlir::raw_ostream &os, mlir::Attribute a)
 
std::string stringWithoutType (mlir::Attribute a)
 
void printAttrs (mlir::AsmPrinter &printer, mlir::ArrayRef< mlir::Attribute > attrs, const mlir::StringRef &separator)
 
mlir::Location getUnknownLoc (mlir::MLIRContext *context)
 
mlir::OwningOpRef< mlir::ModuleOp > createLLZKModule (mlir::MLIRContext *context, mlir::Location loc)
 
mlir::OwningOpRef< mlir::ModuleOp > createLLZKModule (mlir::MLIRContext *context)
 
template<typename OpClass>
llvm::StringLiteral getOperationName ()
 Get the operation name, like "constrain.eq" for the given OpClass.
 
template<typename OpClass>
mlir::FailureOr< OpClass > getParentOfType (mlir::Operation *op)
 Return the closest surrounding parent operation that is of type 'OpClass'.
 
template<unsigned N>
mlir::ParseResult parseDimAndSymbolList (mlir::OpAsmParser &parser, mlir::SmallVector< mlir::OpAsmParser::UnresolvedOperand, N > &mapOperands, mlir::IntegerAttr &numDims)
 
void printDimAndSymbolList (mlir::OpAsmPrinter &printer, mlir::Operation *op, mlir::OperandRange mapOperands, mlir::IntegerAttr numDims)
 
mlir::ParseResult parseMultiDimAndSymbolList (mlir::OpAsmParser &parser, mlir::SmallVector< mlir::SmallVector< mlir::OpAsmParser::UnresolvedOperand > > &multiMapOperands, mlir::DenseI32ArrayAttr &numDimsPerMap)
 
void printMultiDimAndSymbolList (mlir::OpAsmPrinter &printer, mlir::Operation *op, mlir::OperandRangeRange multiMapOperands, mlir::DenseI32ArrayAttr numDimsPerMap)
 
mlir::ParseResult parseAttrDictWithWarnings (mlir::OpAsmParser &parser, mlir::NamedAttrList &extraAttrs, mlir::OperationState &state)
 
template<typename ConcreteOp>
void printAttrDictWithWarnings (mlir::OpAsmPrinter &printer, ConcreteOp op, mlir::DictionaryAttr extraAttrs, typename mlir::PropertiesSelector< ConcreteOp >::type state)
 
std::unique_ptr< mlir::Pass > createFlatteningPass ()
 
std::unique_ptr< mlir::Pass > createRedundantReadAndWriteEliminationPass ()
 
std::unique_ptr< mlir::Pass > createRedundantOperationEliminationPass ()
 
std::unique_ptr< mlir::Pass > createUnusedDeclarationEliminationPass ()
 
std::unique_ptr< mlir::Pass > createArrayToScalarPass ()
 
std::unique_ptr< mlir::Pass > createPolyLoweringPass ()
 
std::unique_ptr< mlir::Pass > createPolyLoweringPass (unsigned maxDegree)
 
void registerPolyLoweringPass ()
 
void registerPolyLoweringPassPass ()
 
void registerRedundantOperationEliminationPass ()
 
void registerRedundantOperationEliminationPassPass ()
 
void registerRedundantReadAndWriteEliminationPass ()
 
void registerRedundantReadAndWriteEliminationPassPass ()
 
void registerUnusedDeclarationEliminationPass ()
 
void registerUnusedDeclarationEliminationPassPass ()
 
void registerTransformationPasses ()
 
bool safeLt (const llvm::APSInt &lhs, const llvm::APSInt &rhs)
 
bool safeLe (const llvm::APSInt &lhs, const llvm::APSInt &rhs)
 
bool safeEq (const llvm::APSInt &lhs, const llvm::APSInt &rhs)
 
bool safeNe (const llvm::APSInt &lhs, const llvm::APSInt &rhs)
 
bool safeGt (const llvm::APSInt &lhs, const llvm::APSInt &rhs)
 
bool safeGe (const llvm::APSInt &lhs, const llvm::APSInt &rhs)
 
llvm::APSInt safeMin (const llvm::APSInt &lhs, const llvm::APSInt &rhs)
 
llvm::APSInt safeMin (std::initializer_list< llvm::APSInt > ilist)
 
llvm::APSInt safeMax (const llvm::APSInt &lhs, const llvm::APSInt &rhs)
 
llvm::APSInt safeMax (std::initializer_list< llvm::APSInt > ilist)
 
template<typename OpClass, typename... Args>
OpClass delegate_to_build (mlir::Location location, Args &&...args)
 
template<OpComparable Op>
mlir::FailureOr< bool > isLocationLess (const Op &l, const Op &r)
 
OwningEmitErrorFn getEmitOpErrFn (mlir::Operation *op)
 
template<typename TypeClass>
OwningEmitErrorFn getEmitOpErrFn (TypeClass *opImpl)
 
void ensure (bool condition, llvm::Twine errMsg)
 
template<typename Func, typename... Args>
std::string buildStringViaCallback (Func &&appendFn, Args &&...args)
 Generate a string by calling the given appendFn with an llvm::raw_ostream & as the first argument followed by the additional Args provided (if any).
 
template<typename T>
std::string buildStringViaPrint (const T &base)
 Generate a string by calling base.print(llvm::raw_ostream &) on a stream backed by the returned string.
 
template<typename... Args>
std::string buildStringViaInsertionOp (Args &&...args)
 Generate a string by using the insertion operator (<<) to append all args to a stream backed by the returned string.
 
llvm::SmallVector< mlir::StringRef > getNames (mlir::SymbolRefAttr ref)
 
llvm::SmallVector< mlir::FlatSymbolRefAttr > getPieces (mlir::SymbolRefAttr ref)
 
mlir::FlatSymbolRefAttr getFlatSymbolRefAttr (mlir::MLIRContext *context, const mlir::Twine &twine)
 Construct a FlatSymbolRefAttr with the given content.
 
mlir::SymbolRefAttr asSymbolRefAttr (mlir::StringAttr root, mlir::SymbolRefAttr tail)
 Build a SymbolRefAttr that prepends tail with root, i.e. root::tail.
 
mlir::SymbolRefAttr asSymbolRefAttr (llvm::ArrayRef< mlir::FlatSymbolRefAttr > path)
 Build a SymbolRefAttr from the list of pieces.
 
mlir::SymbolRefAttr asSymbolRefAttr (std::vector< mlir::FlatSymbolRefAttr > path)
 Build a SymbolRefAttr from the list of pieces.
 
mlir::SymbolRefAttr getTailAsSymbolRefAttr (mlir::SymbolRefAttr symbol)
 Return SymbolRefAttr like the one given but with the root/head element removed.
 
mlir::SymbolRefAttr getPrefixAsSymbolRefAttr (mlir::SymbolRefAttr symbol)
 Return SymbolRefAttr like the one given but with the leaf/final element removed.
 
mlir::SymbolRefAttr replaceLeaf (mlir::SymbolRefAttr orig, mlir::FlatSymbolRefAttr newLeaf)
 Return SymbolRefAttr like the one given but with the leaf (final) element replaced.
 
mlir::SymbolRefAttr replaceLeaf (mlir::SymbolRefAttr orig, mlir::StringAttr newLeaf)
 
mlir::SymbolRefAttr replaceLeaf (mlir::SymbolRefAttr orig, const mlir::Twine &newLeaf)
 
mlir::SymbolRefAttr appendLeaf (mlir::SymbolRefAttr orig, mlir::FlatSymbolRefAttr newLeaf)
 Return SymbolRefAttr like the one given but with a new leaf (final) element added.
 
mlir::SymbolRefAttr appendLeaf (mlir::SymbolRefAttr orig, mlir::StringAttr newLeaf)
 
mlir::SymbolRefAttr appendLeaf (mlir::SymbolRefAttr orig, const mlir::Twine &newLeaf)
 
mlir::SymbolRefAttr appendLeafName (mlir::SymbolRefAttr orig, const mlir::Twine &newLeafSuffix)
 Return SymbolRefAttr like the one given but with the leaf (final) element appended with the given suffix.
 
mlir::FailureOr< mlir::ModuleOp > getRootModule (mlir::Operation *from)
 
mlir::FailureOr< mlir::ModuleOp > getTopRootModule (mlir::Operation *from)
 With include statements, there may be root modules nested within other root modules.
 
template<typename T>
mlir::FailureOr< SymbolLookupResult< T > > resolveCallable (mlir::SymbolTableCollection &symbolTable, mlir::CallOpInterface call)
 Based on mlir::CallOpInterface::resolveCallable, but using LLZK lookup helpers.
 
template<typename T>
mlir::FailureOr< SymbolLookupResult< T > > resolveCallable (mlir::CallOpInterface call)
 
bool hasUsesWithin (mlir::Operation *symbol, mlir::Operation *from)
 Equivalent to SymbolTable::getSymbolUses(...).has_value() but without fully computing uses.
 
mlir::LogicalResult verifyParamOfType (mlir::SymbolTableCollection &tables, mlir::SymbolRefAttr param, mlir::Type structOrArrayType, mlir::Operation *origin)
 Ensure that the given symbol (that is used as a parameter of the given type) can be resolved.
 
mlir::LogicalResult verifyParamsOfType (mlir::SymbolTableCollection &tables, mlir::ArrayRef< mlir::Attribute > tyParams, mlir::Type structOrArrayType, mlir::Operation *origin)
 Ensure that any symbols that appear within the given attributes (that are parameters of the given type) can be resolved.
 
mlir::FailureOr< component::StructDefOpverifyStructTypeResolution (mlir::SymbolTableCollection &tables, component::StructType ty, mlir::Operation *origin)
 Ensure that all symbols used within the type can be resolved.
 
mlir::LogicalResult verifyTypeResolution (mlir::SymbolTableCollection &tables, mlir::Operation *origin, mlir::Type type)
 Ensure that all symbols used within the given Type instance can be resolved.
 
template<std::ranges::input_range Range>
mlir::LogicalResult verifyTypeResolution (mlir::SymbolTableCollection &tables, mlir::Operation *origin, const Range &types)
 Ensure that all symbols used within all Type instances can be resolved.
 
mlir::FailureOr< SymbolLookupResultUntypedlookupSymbolIn (mlir::SymbolTableCollection &tables, mlir::SymbolRefAttr symbol, Within &&lookupWithin, mlir::Operation *origin, bool reportMissing=true)
 
mlir::FailureOr< SymbolLookupResultUntypedlookupTopLevelSymbol (mlir::SymbolTableCollection &tables, mlir::SymbolRefAttr symbol, mlir::Operation *origin, bool reportMissing=true)
 
template<typename T>
mlir::FailureOr< SymbolLookupResult< T > > lookupSymbolIn (mlir::SymbolTableCollection &tables, mlir::SymbolRefAttr symbol, Within &&lookupWithin, mlir::Operation *origin)
 
template<typename T>
mlir::FailureOr< SymbolLookupResult< T > > lookupTopLevelSymbol (mlir::SymbolTableCollection &tables, mlir::SymbolRefAttr symbol, mlir::Operation *origin)
 
void assertValidAttrForParamOfType (mlir::Attribute attr)
 
bool isValidType (mlir::Type type)
 valid types: {I1, Index, String, FeltType, StructType, ArrayType, TypeVarType}
 
bool isValidColumnType (mlir::Type type, mlir::SymbolTableCollection &symbolTable, mlir::Operation *op)
 valid types: {FeltType, StructType (with columns), ArrayType (that contains a valid column type)}
 
bool isValidGlobalType (mlir::Type type)
 valid types: isValidType() - {TypeVarType} - {types with variable parameters}
 
bool isValidEmitEqType (mlir::Type type)
 valid types: isValidType() - {String, StructType} (excluded via any type parameter nesting)
 
bool isValidConstReadType (mlir::Type type)
 valid types: {I1, Index, FeltType, TypeVarType}
 
bool isValidArrayElemType (mlir::Type type)
 valid types: isValidType() - {ArrayType}
 
bool isValidArrayType (mlir::Type type)
 Checks if the type is a LLZK Array and it also contains a valid LLZK type.
 
bool isConcreteType (mlir::Type type, bool allowStructParams=true)
 Return false iff the type contains any TypeVarType
 
mlir::LogicalResult checkValidType (EmitErrorFn emitError, mlir::Type type)
 
bool isSignalType (mlir::Type type)
 Return true iff the given type is a StructType referencing the COMPONENT_NAME_SIGNAL struct.
 
bool hasAffineMapAttr (mlir::Type type)
 Return true iff the given type contains an AffineMapAttr.
 
Side reverse (Side in)
 
bool isDynamic (mlir::IntegerAttr intAttr)
 
bool typeParamsUnify (const mlir::ArrayRef< mlir::Attribute > &lhsParams, const mlir::ArrayRef< mlir::Attribute > &rhsParams, UnificationMap *unifications=nullptr)
 Return true iff the two ArrayRef instances containing StructType or ArrayType parameters are equivalent or could be equivalent after full instantiation of struct parameters.
 
bool typeParamsUnify (const mlir::ArrayAttr &lhsParams, const mlir::ArrayAttr &rhsParams, UnificationMap *unifications=nullptr)
 Return true iff the two ArrayAttr instances containing StructType or ArrayType parameters are equivalent or could be equivalent after full instantiation of struct parameters.
 
bool arrayTypesUnify (array::ArrayType lhs, array::ArrayType rhs, mlir::ArrayRef< llvm::StringRef > rhsReversePrefix={}, UnificationMap *unifications=nullptr)
 Return true iff the two ArrayType instances are equivalent or could be equivalent after full instantiation of struct parameters.
 
bool structTypesUnify (component::StructType lhs, component::StructType rhs, mlir::ArrayRef< llvm::StringRef > rhsReversePrefix={}, UnificationMap *unifications=nullptr)
 Return true iff the two StructType instances are equivalent or could be equivalent after full instantiation of struct parameters.
 
bool typesUnify (mlir::Type lhs, mlir::Type rhs, mlir::ArrayRef< llvm::StringRef > rhsReversePrefix={}, UnificationMap *unifications=nullptr)
 Return true iff the two Type instances are equivalent or could be equivalent after full instantiation of struct parameters (if applicable within the given types).
 
template<typename Iter1, typename Iter2>
bool typeListsUnify (Iter1 lhs, Iter2 rhs, mlir::ArrayRef< llvm::StringRef > rhsReversePrefix={}, UnificationMap *unifications=nullptr)
 Return true iff the two lists of Type instances are equivalent or could be equivalent after full instantiation of struct parameters (if applicable within the given types).
 
template<typename Iter1, typename Iter2>
bool singletonTypeListsUnify (Iter1 lhs, Iter2 rhs, mlir::ArrayRef< llvm::StringRef > rhsReversePrefix={}, UnificationMap *unifications=nullptr)
 
bool isMoreConcreteUnification (mlir::Type oldTy, mlir::Type newTy, llvm::function_ref< bool(mlir::Type oldTy, mlir::Type newTy)> knownOldToNew=nullptr)
 Return true iff the types unify and newTy is "more concrete" than oldTy.
 
template<typename TypeClass>
TypeClass getIfSingleton (mlir::TypeRange types)
 
template<typename TypeClass>
TypeClass getAtIndex (mlir::TypeRange types, size_t index)
 
mlir::IntegerAttr forceIntType (mlir::IntegerAttr attr)
 Convert an IntegerAttr with a type other than IndexType to use IndexType.
 
mlir::Attribute forceIntAttrType (mlir::Attribute attr)
 Convert any IntegerAttr with a type other than IndexType to use IndexType.
 
llvm::SmallVector< mlir::Attribute > forceIntAttrTypes (llvm::ArrayRef< mlir::Attribute > attrList)
 Convert any IntegerAttr with a type other than IndexType to use IndexType.
 
mlir::LogicalResult verifyIntAttrType (EmitErrorFn emitError, mlir::Attribute in)
 Verify that all IntegerAttr have type IndexType.
 
mlir::LogicalResult verifyAffineMapAttrType (EmitErrorFn emitError, mlir::Attribute in)
 Verify that all AffineMapAttr only have a single result.
 
mlir::LogicalResult verifyStructTypeParams (EmitErrorFn emitError, mlir::ArrayAttr params)
 Verify that the StructType parameters are valid.
 
mlir::LogicalResult verifyArrayDimSizes (EmitErrorFn emitError, mlir::ArrayRef< mlir::Attribute > dimensionSizes)
 Verify that the array dimensions are valid.
 
mlir::LogicalResult verifyArrayType (EmitErrorFn emitError, mlir::Type elementType, mlir::ArrayRef< mlir::Attribute > dimensionSizes)
 Verify that the ArrayType is valid.
 
std::unique_ptr< mlir::Pass > createFieldWriteValidatorPass ()
 
void registerFieldWriteValidatorPass ()
 
void registerFieldWriteValidatorPassPass ()
 
void registerValidationPasses ()
 

Variables

constexpr char COMPONENT_NAME_SIGNAL [] = "Signal"
 Symbol name for the struct/component representing a signal.
 
constexpr char COMPONENT_NAME_MAIN [] = "Main"
 Symbol name for the main entry point struct/component (if any).
 
constexpr char FUNC_NAME_COMPUTE [] = "compute"
 Symbol name for the witness generation (and resp.
 
constexpr char FUNC_NAME_CONSTRAIN [] = "constrain"
 
constexpr char LANG_ATTR_NAME [] = "veridise.lang"
 Name of the attribute on the top-level ModuleOp that specifies the IR language name.
 

Typedef Documentation

◆ ConstrainRefRemappings

Definition at line 28 of file ConstraintDependencyGraph.h.

◆ EmitErrorFn

using llzk::EmitErrorFn = llvm::function_ref<mlir::InFlightDiagnostic()>

Definition at line 18 of file ErrorHelper.h.

◆ ManagedResources

Initial value:
std::shared_ptr<std::pair<mlir::OwningOpRef<mlir::ModuleOp>, mlir::SymbolTableCollection>>

Definition at line 29 of file SymbolLookup.h.

◆ OwningEmitErrorFn

using llzk::OwningEmitErrorFn = std::function<mlir::InFlightDiagnostic()>

Definition at line 22 of file ErrorHelper.h.

◆ TranslationMap

Initial value:
std::unordered_map<ConstrainRef, ConstrainRefLatticeValue, ConstrainRef::Hash>

Definition at line 20 of file ConstrainRefLattice.h.

◆ UnificationMap

using llzk::UnificationMap = mlir::DenseMap<std::pair<mlir::SymbolRefAttr, Side>, mlir::Attribute>

Optional result from type unifications.

Maps SymbolRefAttr appearing in one type to the associated Attribute from the other type at the same nested position. The Side enum in the key indicates which input expression the SymbolRefAttr is from. Additionally, if a conflict is found (i.e. multiple Occurrences of a specific SymbolRefAttr on the same side map to different Attributes from the other side). The mapped value will be nullptr.

This map is used by the llzk-flatten pass to replace struct parameter SymbolRefAttr with static concrete values to produce the flattened versions of structs.

Definition at line 181 of file TypeHelper.h.

Enumeration Type Documentation

◆ Side

enum class llzk::Side
strong
Enumerator
EMPTY 
LHS 
RHS 
TOMB 

Definition at line 124 of file TypeHelper.h.

Function Documentation

◆ add()

ExpressionValue llzk::add ( llvm::SMTSolverRef solver,
const ExpressionValue & lhs,
const ExpressionValue & rhs )

Definition at line 486 of file IntervalAnalysis.cpp.

◆ addLangAttrForLLZKDialect()

void llzk::addLangAttrForLLZKDialect ( mlir::ModuleOp mod)

Definition at line 28 of file Builders.cpp.

◆ addRemoveUnnecessaryOpsAndDefsPipeline()

void llzk::addRemoveUnnecessaryOpsAndDefsPipeline ( OpPassManager & pm)

Definition at line 32 of file TransformationPassPipelines.cpp.

◆ appendLeaf() [1/4]

mlir::SymbolRefAttr llzk::appendLeaf ( mlir::SymbolRefAttr orig,
const mlir::Twine & newLeaf )
inline

Definition at line 79 of file SymbolHelper.h.

◆ appendLeaf() [2/4]

mlir::SymbolRefAttr llzk::appendLeaf ( mlir::SymbolRefAttr orig,
mlir::FlatSymbolRefAttr newLeaf )

Return SymbolRefAttr like the one given but with a new leaf (final) element added.

◆ appendLeaf() [3/4]

mlir::SymbolRefAttr llzk::appendLeaf ( mlir::SymbolRefAttr orig,
mlir::StringAttr newLeaf )
inline

Definition at line 76 of file SymbolHelper.h.

◆ appendLeaf() [4/4]

SymbolRefAttr llzk::appendLeaf ( SymbolRefAttr orig,
FlatSymbolRefAttr newLeaf )

Definition at line 180 of file SymbolHelper.cpp.

◆ appendLeafName() [1/2]

mlir::SymbolRefAttr llzk::appendLeafName ( mlir::SymbolRefAttr orig,
const mlir::Twine & newLeafSuffix )

Return SymbolRefAttr like the one given but with the leaf (final) element appended with the given suffix.

◆ appendLeafName() [2/2]

SymbolRefAttr llzk::appendLeafName ( SymbolRefAttr orig,
const Twine & newLeafSuffix )

Definition at line 184 of file SymbolHelper.cpp.

◆ appendWithoutType()

void llzk::appendWithoutType ( mlir::raw_ostream & os,
mlir::Attribute a )
inline

Definition at line 40 of file AttributeHelper.h.

◆ arrayTypesUnify() [1/2]

bool llzk::arrayTypesUnify ( array::ArrayType lhs,
array::ArrayType rhs,
mlir::ArrayRef< llvm::StringRef > rhsReversePrefix = {},
UnificationMap * unifications = nullptr )

Return true iff the two ArrayType instances are equivalent or could be equivalent after full instantiation of struct parameters.

◆ arrayTypesUnify() [2/2]

bool llzk::arrayTypesUnify ( ArrayType lhs,
ArrayType rhs,
ArrayRef< StringRef > rhsReversePrefix,
UnificationMap * unifications )

Definition at line 752 of file TypeHelper.cpp.

◆ assertValidAttrForParamOfType() [1/2]

void llzk::assertValidAttrForParamOfType ( Attribute attr)

Definition at line 857 of file TypeHelper.cpp.

◆ assertValidAttrForParamOfType() [2/2]

void llzk::assertValidAttrForParamOfType ( mlir::Attribute attr)

◆ asSymbolRefAttr() [1/3]

mlir::SymbolRefAttr llzk::asSymbolRefAttr ( llvm::ArrayRef< mlir::FlatSymbolRefAttr > path)
inline

Build a SymbolRefAttr from the list of pieces.

Definition at line 44 of file SymbolHelper.h.

◆ asSymbolRefAttr() [2/3]

mlir::SymbolRefAttr llzk::asSymbolRefAttr ( mlir::StringAttr root,
mlir::SymbolRefAttr tail )
inline

Build a SymbolRefAttr that prepends tail with root, i.e. root::tail.

Definition at line 39 of file SymbolHelper.h.

◆ asSymbolRefAttr() [3/3]

mlir::SymbolRefAttr llzk::asSymbolRefAttr ( std::vector< mlir::FlatSymbolRefAttr > path)
inline

Build a SymbolRefAttr from the list of pieces.

Definition at line 49 of file SymbolHelper.h.

◆ buildStringViaCallback()

template<typename Func, typename... Args>
std::string llzk::buildStringViaCallback ( Func && appendFn,
Args &&... args )
inline

Generate a string by calling the given appendFn with an llvm::raw_ostream & as the first argument followed by the additional Args provided (if any).

Definition at line 41 of file StreamHelper.h.

◆ buildStringViaInsertionOp()

template<typename... Args>
std::string llzk::buildStringViaInsertionOp ( Args &&... args)
inline

Generate a string by using the insertion operator (<<) to append all args to a stream backed by the returned string.

Definition at line 56 of file StreamHelper.h.

◆ buildStringViaPrint()

template<typename T>
std::string llzk::buildStringViaPrint ( const T & base)
inline

Generate a string by calling base.print(llvm::raw_ostream &) on a stream backed by the returned string.

Definition at line 50 of file StreamHelper.h.

◆ checkValidType()

mlir::LogicalResult llzk::checkValidType ( EmitErrorFn emitError,
mlir::Type type )
inline

Definition at line 107 of file TypeHelper.h.

◆ cmp()

ExpressionValue llzk::cmp ( llvm::SMTSolverRef solver,
boolean::CmpOp op,
const ExpressionValue & lhs,
const ExpressionValue & rhs )

Definition at line 536 of file IntervalAnalysis.cpp.

◆ createArrayToScalarPass()

std::unique_ptr< mlir::Pass > llzk::createArrayToScalarPass ( )

◆ createCallGraphPrinterPass()

std::unique_ptr< mlir::Pass > llzk::createCallGraphPrinterPass ( llvm::raw_ostream & os = llvm::errs())

Definition at line 50 of file CallGraphPasses.cpp.

◆ createCallGraphSCCsPrinterPass()

std::unique_ptr< mlir::Pass > llzk::createCallGraphSCCsPrinterPass ( llvm::raw_ostream & os = llvm::errs())

Definition at line 95 of file CallGraphPasses.cpp.

◆ createConstraintDependencyGraphPrinterPass()

std::unique_ptr< mlir::Pass > llzk::createConstraintDependencyGraphPrinterPass ( llvm::raw_ostream & os = llvm::errs())

Definition at line 65 of file ConstraintDependencyGraphPass.cpp.

◆ createFieldWriteValidatorPass()

std::unique_ptr< mlir::Pass > llzk::createFieldWriteValidatorPass ( )

Definition at line 82 of file LLZKValidationPasses.cpp.

◆ createFlatteningPass()

std::unique_ptr< mlir::Pass > llzk::createFlatteningPass ( )

◆ createIntervalAnalysisPrinterPass()

std::unique_ptr< mlir::Pass > llzk::createIntervalAnalysisPrinterPass ( llvm::raw_ostream & os = llvm::errs())

Definition at line 73 of file IntervalAnalysisPass.cpp.

◆ createLLZKModule() [1/3]

mlir::OwningOpRef< mlir::ModuleOp > llzk::createLLZKModule ( mlir::MLIRContext * context)
inline

Definition at line 31 of file Builders.h.

◆ createLLZKModule() [2/3]

mlir::OwningOpRef< mlir::ModuleOp > llzk::createLLZKModule ( mlir::MLIRContext * context,
mlir::Location loc )

◆ createLLZKModule() [3/3]

OwningOpRef< ModuleOp > llzk::createLLZKModule ( MLIRContext * context,
Location loc )

Definition at line 22 of file Builders.cpp.

◆ createPolyLoweringPass() [1/2]

std::unique_ptr< mlir::Pass > llzk::createPolyLoweringPass ( )

Definition at line 488 of file LLZKPolyLoweringPass.cpp.

◆ createPolyLoweringPass() [2/2]

std::unique_ptr< mlir::Pass > llzk::createPolyLoweringPass ( unsigned maxDegree)

Definition at line 492 of file LLZKPolyLoweringPass.cpp.

◆ createRedundantOperationEliminationPass()

std::unique_ptr< mlir::Pass > llzk::createRedundantOperationEliminationPass ( )

Definition at line 285 of file LLZKRedundantOperationEliminationPass.cpp.

◆ createRedundantReadAndWriteEliminationPass()

std::unique_ptr< mlir::Pass > llzk::createRedundantReadAndWriteEliminationPass ( )

◆ createUnusedDeclarationEliminationPass()

std::unique_ptr< mlir::Pass > llzk::createUnusedDeclarationEliminationPass ( )

Definition at line 233 of file LLZKUnusedDeclarationEliminationPass.cpp.

◆ delegate_to_build()

template<typename OpClass, typename... Args>
OpClass llzk::delegate_to_build ( mlir::Location location,
Args &&... args )
inline

Definition at line 18 of file BuilderHelper.h.

◆ div()

ExpressionValue llzk::div ( llvm::SMTSolverRef solver,
felt::DivFeltOp op,
const ExpressionValue & lhs,
const ExpressionValue & rhs )

Definition at line 510 of file IntervalAnalysis.cpp.

◆ ensure()

void llzk::ensure ( bool condition,
llvm::Twine errMsg )
inline

Definition at line 32 of file ErrorHelper.h.

◆ expandingAdd()

llvm::APSInt llzk::expandingAdd ( const llvm::APSInt & lhs,
const llvm::APSInt & rhs )

Safely add lhs and rhs, expanding the width of the result as necessary.

Numbers are never truncated here, as this assumes that truncation will occur with the reduction to the prime field.

Parameters
lhsan N bit number with an allocated width of X
rhsan M bit number with an allocated width of Y
Returns
A number that is max(N, M) + 1 bits wide with an allocated with of max(max(N, M) + 1, X, Y) bits.

Definition at line 14 of file APIntHelper.cpp.

◆ expandingMul()

llvm::APSInt llzk::expandingMul ( const llvm::APSInt & lhs,
const llvm::APSInt & rhs )

Safely multiple lhs and rhs, expanding the width of the result as necessary.

Numbers are never truncated here, as this assumes that truncation will occur with the reduction to the prime field.

Parameters
lhsan N bit number with an allocated width of X
rhsan M bit number with an allocated width of Y
Returns
A number that is N + M bits wide with an allocated with of max(N + M, X, Y) bits.

Definition at line 26 of file APIntHelper.cpp.

◆ expandingSub()

llvm::APSInt llzk::expandingSub ( const llvm::APSInt & lhs,
const llvm::APSInt & rhs )

Safely subtract lhs and rhs, expanding the width of the result as necessary.

Numbers are never truncated here, as this assumes that truncation will occur with the reduction to the prime field.

Parameters
lhsan N bit number with an allocated width of X
rhsan M bit number with an allocated width of Y
Returns
A number that is max(N, M) + 1 bits wide with an allocated with of max(max(N, M) + 1, X, Y) bits.

Definition at line 20 of file APIntHelper.cpp.

◆ fallbackBinaryOp()

ExpressionValue llzk::fallbackBinaryOp ( llvm::SMTSolverRef solver,
Operation * op,
const ExpressionValue & lhs,
const ExpressionValue & rhs )

Definition at line 563 of file IntervalAnalysis.cpp.

◆ fallbackUnaryOp()

ExpressionValue llzk::fallbackUnaryOp ( llvm::SMTSolverRef solver,
Operation * op,
const ExpressionValue & val )

Definition at line 608 of file IntervalAnalysis.cpp.

◆ forceIntAttrType() [1/2]

Attribute llzk::forceIntAttrType ( Attribute attr)

Definition at line 800 of file TypeHelper.cpp.

◆ forceIntAttrType() [2/2]

mlir::Attribute llzk::forceIntAttrType ( mlir::Attribute attr)

Convert any IntegerAttr with a type other than IndexType to use IndexType.

◆ forceIntAttrTypes() [1/2]

SmallVector< Attribute > llzk::forceIntAttrTypes ( ArrayRef< Attribute > attrList)

Definition at line 807 of file TypeHelper.cpp.

◆ forceIntAttrTypes() [2/2]

llvm::SmallVector< mlir::Attribute > llzk::forceIntAttrTypes ( llvm::ArrayRef< mlir::Attribute > attrList)

Convert any IntegerAttr with a type other than IndexType to use IndexType.

◆ forceIntType() [1/2]

IntegerAttr llzk::forceIntType ( IntegerAttr attr)

Definition at line 793 of file TypeHelper.cpp.

◆ forceIntType() [2/2]

mlir::IntegerAttr llzk::forceIntType ( mlir::IntegerAttr attr)

Convert an IntegerAttr with a type other than IndexType to use IndexType.

◆ fromAPInt()

int64_t llzk::fromAPInt ( llvm::APInt i)
inline

Definition at line 34 of file AttributeHelper.h.

◆ getAtIndex()

template<typename TypeClass>
TypeClass llzk::getAtIndex ( mlir::TypeRange types,
size_t index )
inline

Definition at line 255 of file TypeHelper.h.

◆ getEmitOpErrFn() [1/2]

OwningEmitErrorFn llzk::getEmitOpErrFn ( mlir::Operation * op)
inline

Definition at line 24 of file ErrorHelper.h.

◆ getEmitOpErrFn() [2/2]

template<typename TypeClass>
OwningEmitErrorFn llzk::getEmitOpErrFn ( TypeClass * opImpl)
inline

Definition at line 28 of file ErrorHelper.h.

◆ getFlatSymbolRefAttr()

mlir::FlatSymbolRefAttr llzk::getFlatSymbolRefAttr ( mlir::MLIRContext * context,
const mlir::Twine & twine )
inline

Construct a FlatSymbolRefAttr with the given content.

Definition at line 34 of file SymbolHelper.h.

◆ getIfSingleton()

template<typename TypeClass>
TypeClass llzk::getIfSingleton ( mlir::TypeRange types)
inline

Definition at line 251 of file TypeHelper.h.

◆ getNames() [1/2]

llvm::SmallVector< mlir::StringRef > llzk::getNames ( mlir::SymbolRefAttr ref)

◆ getNames() [2/2]

llvm::SmallVector< StringRef > llzk::getNames ( SymbolRefAttr ref)

Definition at line 138 of file SymbolHelper.cpp.

◆ getOperationName()

template<typename OpClass>
llvm::StringLiteral llzk::getOperationName ( )
inline

Get the operation name, like "constrain.eq" for the given OpClass.

This function can be used when the compiler would complain about incomplete types if OpClass::getOperationName() were called directly.

Definition at line 27 of file OpHelpers.h.

◆ getParentOfType()

template<typename OpClass>
mlir::FailureOr< OpClass > llzk::getParentOfType ( mlir::Operation * op)
inline

Return the closest surrounding parent operation that is of type 'OpClass'.

Definition at line 32 of file OpHelpers.h.

◆ getPathFromRoot() [1/2]

mlir::FailureOr< mlir::SymbolRefAttr > llzk::getPathFromRoot ( FuncDefOp & to)

Definition at line 208 of file SymbolHelper.cpp.

◆ getPathFromRoot() [2/2]

mlir::FailureOr< mlir::SymbolRefAttr > llzk::getPathFromRoot ( StructDefOp & to)

Definition at line 204 of file SymbolHelper.cpp.

◆ getPathFromTopRoot() [1/2]

mlir::FailureOr< mlir::SymbolRefAttr > llzk::getPathFromTopRoot ( FuncDefOp & to)

Definition at line 221 of file SymbolHelper.cpp.

◆ getPathFromTopRoot() [2/2]

mlir::FailureOr< mlir::SymbolRefAttr > llzk::getPathFromTopRoot ( StructDefOp & to)

Definition at line 217 of file SymbolHelper.cpp.

◆ getPieces() [1/2]

llvm::SmallVector< mlir::FlatSymbolRefAttr > llzk::getPieces ( mlir::SymbolRefAttr ref)

◆ getPieces() [2/2]

llvm::SmallVector< FlatSymbolRefAttr > llzk::getPieces ( SymbolRefAttr ref)

Definition at line 147 of file SymbolHelper.cpp.

◆ getPrefixAsSymbolRefAttr()

mlir::SymbolRefAttr llzk::getPrefixAsSymbolRefAttr ( mlir::SymbolRefAttr symbol)
inline

Return SymbolRefAttr like the one given but with the leaf/final element removed.

Definition at line 59 of file SymbolHelper.h.

◆ getRootModule() [1/2]

mlir::FailureOr< mlir::ModuleOp > llzk::getRootModule ( mlir::Operation * from)

◆ getRootModule() [2/2]

FailureOr< ModuleOp > llzk::getRootModule ( Operation * from)

Definition at line 199 of file SymbolHelper.cpp.

◆ getStructDef()

SymbolLookupResult< StructDefOp > llzk::getStructDef ( mlir::SymbolTableCollection & tables,
mlir::ModuleOp mod,
StructType ty )

Lookup a StructDefOp from a given StructType.

Parameters
tables
mod
ty
Returns
A SymbolLookupResult for the StructDefOp found. Note that returning the lookup result is important, as it may manage a ModuleOp if the struct is found via an include.

Definition at line 76 of file ConstrainRef.cpp.

◆ getTailAsSymbolRefAttr()

mlir::SymbolRefAttr llzk::getTailAsSymbolRefAttr ( mlir::SymbolRefAttr symbol)
inline

Return SymbolRefAttr like the one given but with the root/head element removed.

Definition at line 54 of file SymbolHelper.h.

◆ getTopRootModule() [1/2]

mlir::FailureOr< mlir::ModuleOp > llzk::getTopRootModule ( mlir::Operation * from)

With include statements, there may be root modules nested within other root modules.

This function resolves the topmost root module.

◆ getTopRootModule() [2/2]

FailureOr< ModuleOp > llzk::getTopRootModule ( Operation * from)

Definition at line 212 of file SymbolHelper.cpp.

◆ getUnknownLoc()

mlir::Location llzk::getUnknownLoc ( mlir::MLIRContext * context)
inline

Definition at line 25 of file Builders.h.

◆ hasAffineMapAttr() [1/2]

bool llzk::hasAffineMapAttr ( mlir::Type type)

Return true iff the given type contains an AffineMapAttr.

◆ hasAffineMapAttr() [2/2]

bool llzk::hasAffineMapAttr ( Type type)

Definition at line 494 of file TypeHelper.cpp.

◆ hasUsesWithin() [1/2]

bool llzk::hasUsesWithin ( mlir::Operation * symbol,
mlir::Operation * from )

Equivalent to SymbolTable::getSymbolUses(...).has_value() but without fully computing uses.

◆ hasUsesWithin() [2/2]

bool llzk::hasUsesWithin ( Operation * symbol,
Operation * from )

Definition at line 225 of file SymbolHelper.cpp.

◆ intersection()

ExpressionValue llzk::intersection ( llvm::SMTSolverRef solver,
const ExpressionValue & lhs,
const ExpressionValue & rhs )
Parameters
solver
lhs
rhs
Returns

Definition at line 479 of file IntervalAnalysis.cpp.

◆ isConcreteType() [1/2]

bool llzk::isConcreteType ( mlir::Type type,
bool allowStructParams = true )

Return false iff the type contains any TypeVarType

◆ isConcreteType() [2/2]

bool llzk::isConcreteType ( Type type,
bool allowStructParams )

Definition at line 476 of file TypeHelper.cpp.

◆ isDynamic() [1/2]

bool llzk::isDynamic ( IntegerAttr intAttr)

Definition at line 503 of file TypeHelper.cpp.

◆ isDynamic() [2/2]

bool llzk::isDynamic ( mlir::IntegerAttr intAttr)

◆ isLocationLess()

template<OpComparable Op>
mlir::FailureOr< bool > llzk::isLocationLess ( const Op & l,
const Op & r )

Definition at line 29 of file Compare.h.

◆ isMoreConcreteUnification() [1/2]

bool llzk::isMoreConcreteUnification ( mlir::Type oldTy,
mlir::Type newTy,
llvm::function_ref< bool(mlir::Type oldTy, mlir::Type newTy)> knownOldToNew = nullptr )

Return true iff the types unify and newTy is "more concrete" than oldTy.

The types i1, index, felt.type, and string.type are concrete whereas poly.tvar is not (because it may be substituted with any type during struct instantiation). When considering the attributes with array.type and struct.type types, we define IntegerAttr and TypeAttr as concrete, AffineMapAttr as less concrete than those, and SymbolRefAttr as least concrete.

◆ isMoreConcreteUnification() [2/2]

bool llzk::isMoreConcreteUnification ( Type oldTy,
Type newTy,
llvm::function_ref< bool(Type oldTy, Type newTy)> knownOldToNew )

Definition at line 771 of file TypeHelper.cpp.

◆ isNullOrEmpty() [1/3]

bool llzk::isNullOrEmpty ( mlir::ArrayAttr a)
inline

Definition at line 36 of file AttributeHelper.h.

◆ isNullOrEmpty() [2/3]

bool llzk::isNullOrEmpty ( mlir::DenseArrayAttr a)
inline

Definition at line 37 of file AttributeHelper.h.

◆ isNullOrEmpty() [3/3]

bool llzk::isNullOrEmpty ( mlir::DictionaryAttr a)
inline

Definition at line 38 of file AttributeHelper.h.

◆ isSignalType() [1/3]

bool llzk::isSignalType ( StructType sType)

Return true iff the given StructType is referencing the COMPONENT_NAME_SIGNAL struct.

Definition at line 487 of file TypeHelper.cpp.

◆ isSignalType() [2/3]

bool llzk::isSignalType ( mlir::Type type)

Return true iff the given type is a StructType referencing the COMPONENT_NAME_SIGNAL struct.

◆ isSignalType() [3/3]

bool llzk::isSignalType ( Type type)

Definition at line 480 of file TypeHelper.cpp.

◆ isValidArrayElemType() [1/2]

bool llzk::isValidArrayElemType ( mlir::Type type)

valid types: isValidType() - {ArrayType}

◆ isValidArrayElemType() [2/2]

bool llzk::isValidArrayElemType ( Type type)

Definition at line 472 of file TypeHelper.cpp.

◆ isValidArrayType() [1/2]

bool llzk::isValidArrayType ( mlir::Type type)

Checks if the type is a LLZK Array and it also contains a valid LLZK type.

◆ isValidArrayType() [2/2]

bool llzk::isValidArrayType ( Type type)

Definition at line 474 of file TypeHelper.cpp.

◆ isValidColumnType() [1/2]

bool llzk::isValidColumnType ( mlir::Type type,
mlir::SymbolTableCollection & symbolTable,
mlir::Operation * op )

valid types: {FeltType, StructType (with columns), ArrayType (that contains a valid column type)}

◆ isValidColumnType() [2/2]

bool llzk::isValidColumnType ( Type type,
SymbolTableCollection & symbolTable,
Operation * op )

Definition at line 457 of file TypeHelper.cpp.

◆ isValidConstReadType() [1/2]

bool llzk::isValidConstReadType ( mlir::Type type)

valid types: {I1, Index, FeltType, TypeVarType}

◆ isValidConstReadType() [2/2]

bool llzk::isValidConstReadType ( Type type)

Definition at line 468 of file TypeHelper.cpp.

◆ isValidEmitEqType() [1/2]

bool llzk::isValidEmitEqType ( mlir::Type type)

valid types: isValidType() - {String, StructType} (excluded via any type parameter nesting)

◆ isValidEmitEqType() [2/2]

bool llzk::isValidEmitEqType ( Type type)

Definition at line 463 of file TypeHelper.cpp.

◆ isValidGlobalType() [1/2]

bool llzk::isValidGlobalType ( mlir::Type type)

valid types: isValidType() - {TypeVarType} - {types with variable parameters}

◆ isValidGlobalType() [2/2]

bool llzk::isValidGlobalType ( Type type)

Definition at line 461 of file TypeHelper.cpp.

◆ isValidType() [1/2]

bool llzk::isValidType ( mlir::Type type)

valid types: {I1, Index, String, FeltType, StructType, ArrayType, TypeVarType}

◆ isValidType() [2/2]

bool llzk::isValidType ( Type type)

Definition at line 455 of file TypeHelper.cpp.

◆ lookupSymbolIn() [1/2]

template<typename T>
mlir::FailureOr< SymbolLookupResult< T > > llzk::lookupSymbolIn ( mlir::SymbolTableCollection & tables,
mlir::SymbolRefAttr symbol,
Within && lookupWithin,
mlir::Operation * origin )
inline

Definition at line 142 of file SymbolLookup.h.

◆ lookupSymbolIn() [2/2]

mlir::FailureOr< SymbolLookupResultUntyped > llzk::lookupSymbolIn ( mlir::SymbolTableCollection & tables,
mlir::SymbolRefAttr symbol,
Within && lookupWithin,
mlir::Operation * origin,
bool reportMissing = true )
inline

Definition at line 127 of file SymbolLookup.h.

◆ lookupTopLevelSymbol() [1/2]

template<typename T>
mlir::FailureOr< SymbolLookupResult< T > > llzk::lookupTopLevelSymbol ( mlir::SymbolTableCollection & tables,
mlir::SymbolRefAttr symbol,
mlir::Operation * origin )
inline

Definition at line 162 of file SymbolLookup.h.

◆ lookupTopLevelSymbol() [2/2]

mlir::FailureOr< SymbolLookupResultUntyped > llzk::lookupTopLevelSymbol ( mlir::SymbolTableCollection & tables,
mlir::SymbolRefAttr symbol,
mlir::Operation * origin,
bool reportMissing = true )
inline

Definition at line 134 of file SymbolLookup.h.

◆ mod()

ExpressionValue llzk::mod ( llvm::SMTSolverRef solver,
const ExpressionValue & lhs,
const ExpressionValue & rhs )

Definition at line 528 of file IntervalAnalysis.cpp.

◆ mul()

ExpressionValue llzk::mul ( llvm::SMTSolverRef solver,
const ExpressionValue & lhs,
const ExpressionValue & rhs )

Definition at line 502 of file IntervalAnalysis.cpp.

◆ neg()

ExpressionValue llzk::neg ( llvm::SMTSolverRef solver,
const ExpressionValue & val )

Definition at line 585 of file IntervalAnalysis.cpp.

◆ notOp()

ExpressionValue llzk::notOp ( llvm::SMTSolverRef solver,
const ExpressionValue & val )

Definition at line 592 of file IntervalAnalysis.cpp.

◆ operator%()

Interval llzk::operator% ( const Interval & lhs,
const Interval & rhs )

Definition at line 449 of file IntervalAnalysis.cpp.

◆ operator*() [1/2]

Interval llzk::operator* ( const Interval & lhs,
const Interval & rhs )

Definition at line 417 of file IntervalAnalysis.cpp.

◆ operator*() [2/2]

UnreducedInterval llzk::operator* ( const UnreducedInterval & lhs,
const UnreducedInterval & rhs )

Definition at line 160 of file IntervalAnalysis.cpp.

◆ operator+() [1/2]

Interval llzk::operator+ ( const Interval & lhs,
const Interval & rhs )

Definition at line 410 of file IntervalAnalysis.cpp.

◆ operator+() [2/2]

UnreducedInterval llzk::operator+ ( const UnreducedInterval & lhs,
const UnreducedInterval & rhs )

Definition at line 151 of file IntervalAnalysis.cpp.

◆ operator-() [1/2]

Interval llzk::operator- ( const Interval & lhs,
const Interval & rhs )

Definition at line 415 of file IntervalAnalysis.cpp.

◆ operator-() [2/2]

UnreducedInterval llzk::operator- ( const UnreducedInterval & lhs,
const UnreducedInterval & rhs )

Definition at line 156 of file IntervalAnalysis.cpp.

◆ operator/()

FailureOr< Interval > llzk::operator/ ( const Interval & lhs,
const Interval & rhs )

Definition at line 437 of file IntervalAnalysis.cpp.

◆ operator<<() [1/4]

llvm::raw_ostream & llzk::operator<< ( llvm::raw_ostream & os,
const ConstrainRefLattice & lattice )

Definition at line 236 of file ConstrainRefLattice.cpp.

◆ operator<<() [2/4]

mlir::raw_ostream & llzk::operator<< ( mlir::raw_ostream & os,
const ConstrainRef & rhs )

Definition at line 371 of file ConstrainRef.cpp.

◆ operator<<() [3/4]

mlir::raw_ostream & llzk::operator<< ( mlir::raw_ostream & os,
const ConstrainRefLatticeValue & v )

Definition at line 167 of file ConstrainRefLattice.cpp.

◆ operator<<() [4/4]

mlir::raw_ostream & llzk::operator<< ( mlir::raw_ostream & os,
const ConstrainRefSet & rhs )

Definition at line 383 of file ConstrainRef.cpp.

◆ operator<=>()

std::strong_ordering llzk::operator<=> ( const UnreducedInterval & lhs,
const UnreducedInterval & rhs )

Definition at line 176 of file IntervalAnalysis.cpp.

◆ parseAttrDictWithWarnings()

mlir::ParseResult llzk::parseAttrDictWithWarnings ( mlir::OpAsmParser & parser,
mlir::NamedAttrList & extraAttrs,
mlir::OperationState & state )
inline

Definition at line 109 of file OpHelpers.h.

◆ parseDimAndSymbolList()

template<unsigned N>
mlir::ParseResult llzk::parseDimAndSymbolList ( mlir::OpAsmParser & parser,
mlir::SmallVector< mlir::OpAsmParser::UnresolvedOperand, N > & mapOperands,
mlir::IntegerAttr & numDims )
inline

Definition at line 79 of file OpHelpers.h.

◆ parseMultiDimAndSymbolList()

mlir::ParseResult llzk::parseMultiDimAndSymbolList ( mlir::OpAsmParser & parser,
mlir::SmallVector< mlir::SmallVector< mlir::OpAsmParser::UnresolvedOperand > > & multiMapOperands,
mlir::DenseI32ArrayAttr & numDimsPerMap )
inline

Definition at line 94 of file OpHelpers.h.

◆ printAttrDictWithWarnings()

template<typename ConcreteOp>
void llzk::printAttrDictWithWarnings ( mlir::OpAsmPrinter & printer,
ConcreteOp op,
mlir::DictionaryAttr extraAttrs,
typename mlir::PropertiesSelector< ConcreteOp >::type state )
inline

Definition at line 116 of file OpHelpers.h.

◆ printAttrs() [1/2]

void llzk::printAttrs ( AsmPrinter & printer,
ArrayRef< Attribute > attrs,
const StringRef & separator )

Definition at line 18 of file AttributeHelper.cpp.

◆ printAttrs() [2/2]

void llzk::printAttrs ( mlir::AsmPrinter & printer,
mlir::ArrayRef< mlir::Attribute > attrs,
const mlir::StringRef & separator )

◆ printDimAndSymbolList()

void llzk::printDimAndSymbolList ( mlir::OpAsmPrinter & printer,
mlir::Operation * op,
mlir::OperandRange mapOperands,
mlir::IntegerAttr numDims )
inline

Definition at line 87 of file OpHelpers.h.

◆ printMultiDimAndSymbolList()

void llzk::printMultiDimAndSymbolList ( mlir::OpAsmPrinter & printer,
mlir::Operation * op,
mlir::OperandRangeRange multiMapOperands,
mlir::DenseI32ArrayAttr numDimsPerMap )
inline

Definition at line 102 of file OpHelpers.h.

◆ registerAllDialects()

void llzk::registerAllDialects ( mlir::DialectRegistry & registry)

Definition at line 30 of file InitDialects.cpp.

◆ registerAnalysisPasses()

void llzk::registerAnalysisPasses ( )
inline

Definition at line 380 of file AnalysisPasses.h.

◆ registerCallGraphPrinterPass()

void llzk::registerCallGraphPrinterPass ( )
inline

Definition at line 312 of file AnalysisPasses.h.

◆ registerCallGraphPrinterPassPass()

void llzk::registerCallGraphPrinterPassPass ( )
inline

Definition at line 319 of file AnalysisPasses.h.

◆ registerCallGraphSCCsPrinterPass()

void llzk::registerCallGraphSCCsPrinterPass ( )
inline

Definition at line 329 of file AnalysisPasses.h.

◆ registerCallGraphSCCsPrinterPassPass()

void llzk::registerCallGraphSCCsPrinterPassPass ( )
inline

Definition at line 336 of file AnalysisPasses.h.

◆ registerConstraintDependencyGraphPrinterPass()

void llzk::registerConstraintDependencyGraphPrinterPass ( )
inline

Definition at line 346 of file AnalysisPasses.h.

◆ registerConstraintDependencyGraphPrinterPassPass()

void llzk::registerConstraintDependencyGraphPrinterPassPass ( )
inline

Definition at line 353 of file AnalysisPasses.h.

◆ registerFieldWriteValidatorPass()

void llzk::registerFieldWriteValidatorPass ( )
inline

Definition at line 86 of file LLZKValidationPasses.h.

◆ registerFieldWriteValidatorPassPass()

void llzk::registerFieldWriteValidatorPassPass ( )
inline

Definition at line 93 of file LLZKValidationPasses.h.

◆ registerIntervalAnalysisPrinterPass()

void llzk::registerIntervalAnalysisPrinterPass ( )
inline

Definition at line 363 of file AnalysisPasses.h.

◆ registerIntervalAnalysisPrinterPassPass()

void llzk::registerIntervalAnalysisPrinterPassPass ( )
inline

Definition at line 370 of file AnalysisPasses.h.

◆ registerPolyLoweringPass()

void llzk::registerPolyLoweringPass ( )
inline

Definition at line 316 of file LLZKTransformationPasses.h.

◆ registerPolyLoweringPassPass()

void llzk::registerPolyLoweringPassPass ( )
inline

Definition at line 323 of file LLZKTransformationPasses.h.

◆ registerRedundantOperationEliminationPass()

void llzk::registerRedundantOperationEliminationPass ( )
inline

Definition at line 333 of file LLZKTransformationPasses.h.

◆ registerRedundantOperationEliminationPassPass()

void llzk::registerRedundantOperationEliminationPassPass ( )
inline

Definition at line 340 of file LLZKTransformationPasses.h.

◆ registerRedundantReadAndWriteEliminationPass()

void llzk::registerRedundantReadAndWriteEliminationPass ( )
inline

Definition at line 350 of file LLZKTransformationPasses.h.

◆ registerRedundantReadAndWriteEliminationPassPass()

void llzk::registerRedundantReadAndWriteEliminationPassPass ( )
inline

Definition at line 357 of file LLZKTransformationPasses.h.

◆ registerTransformationPasses()

void llzk::registerTransformationPasses ( )
inline

Definition at line 384 of file LLZKTransformationPasses.h.

◆ registerTransformationPassPipelines()

void llzk::registerTransformationPassPipelines ( )

Definition at line 38 of file TransformationPassPipelines.cpp.

◆ registerUnusedDeclarationEliminationPass()

void llzk::registerUnusedDeclarationEliminationPass ( )
inline

Definition at line 367 of file LLZKTransformationPasses.h.

◆ registerUnusedDeclarationEliminationPassPass()

void llzk::registerUnusedDeclarationEliminationPassPass ( )
inline

Definition at line 374 of file LLZKTransformationPasses.h.

◆ registerValidationPasses()

void llzk::registerValidationPasses ( )
inline

Definition at line 103 of file LLZKValidationPasses.h.

◆ replaceLeaf() [1/4]

mlir::SymbolRefAttr llzk::replaceLeaf ( mlir::SymbolRefAttr orig,
const mlir::Twine & newLeaf )
inline

Definition at line 70 of file SymbolHelper.h.

◆ replaceLeaf() [2/4]

mlir::SymbolRefAttr llzk::replaceLeaf ( mlir::SymbolRefAttr orig,
mlir::FlatSymbolRefAttr newLeaf )

Return SymbolRefAttr like the one given but with the leaf (final) element replaced.

◆ replaceLeaf() [3/4]

mlir::SymbolRefAttr llzk::replaceLeaf ( mlir::SymbolRefAttr orig,
mlir::StringAttr newLeaf )
inline

Definition at line 67 of file SymbolHelper.h.

◆ replaceLeaf() [4/4]

SymbolRefAttr llzk::replaceLeaf ( SymbolRefAttr orig,
FlatSymbolRefAttr newLeaf )

Definition at line 170 of file SymbolHelper.cpp.

◆ resolveCallable() [1/2]

template<typename T>
mlir::FailureOr< SymbolLookupResult< T > > llzk::resolveCallable ( mlir::CallOpInterface call)
inline

Definition at line 125 of file SymbolHelper.h.

◆ resolveCallable() [2/2]

template<typename T>
mlir::FailureOr< SymbolLookupResult< T > > llzk::resolveCallable ( mlir::SymbolTableCollection & symbolTable,
mlir::CallOpInterface call )
inline

Based on mlir::CallOpInterface::resolveCallable, but using LLZK lookup helpers.

Template Parameters
Tthe type of symbol being resolved (e.g., function::FuncDefOp)
Parameters
symbolTable
call
Returns
the symbol or failure

Definition at line 104 of file SymbolHelper.h.

◆ reverse()

Side llzk::reverse ( Side in)
inline

Definition at line 143 of file TypeHelper.h.

◆ safeCmp()

std::strong_ordering llzk::safeCmp ( const llvm::APSInt & lhs,
const llvm::APSInt & rhs )

Compares lhs and rhs, regardless of the bitwidth of lhs and rhs.

Returns
lhs is less, equal, or greater than rhs

Definition at line 32 of file APIntHelper.cpp.

◆ safeEq()

bool llzk::safeEq ( const llvm::APSInt & lhs,
const llvm::APSInt & rhs )
inline

Definition at line 66 of file APIntHelper.h.

◆ safeGe()

bool llzk::safeGe ( const llvm::APSInt & lhs,
const llvm::APSInt & rhs )
inline

Definition at line 78 of file APIntHelper.h.

◆ safeGt()

bool llzk::safeGt ( const llvm::APSInt & lhs,
const llvm::APSInt & rhs )
inline

Definition at line 74 of file APIntHelper.h.

◆ safeLe()

bool llzk::safeLe ( const llvm::APSInt & lhs,
const llvm::APSInt & rhs )
inline

Definition at line 62 of file APIntHelper.h.

◆ safeLt()

bool llzk::safeLt ( const llvm::APSInt & lhs,
const llvm::APSInt & rhs )
inline

Definition at line 58 of file APIntHelper.h.

◆ safeMax() [1/2]

llvm::APSInt llzk::safeMax ( const llvm::APSInt & lhs,
const llvm::APSInt & rhs )
inline

Definition at line 90 of file APIntHelper.h.

◆ safeMax() [2/2]

llvm::APSInt llzk::safeMax ( std::initializer_list< llvm::APSInt > ilist)
inline

Definition at line 94 of file APIntHelper.h.

◆ safeMin() [1/2]

llvm::APSInt llzk::safeMin ( const llvm::APSInt & lhs,
const llvm::APSInt & rhs )
inline

Definition at line 82 of file APIntHelper.h.

◆ safeMin() [2/2]

llvm::APSInt llzk::safeMin ( std::initializer_list< llvm::APSInt > ilist)
inline

Definition at line 86 of file APIntHelper.h.

◆ safeNe()

bool llzk::safeNe ( const llvm::APSInt & lhs,
const llvm::APSInt & rhs )
inline

Definition at line 70 of file APIntHelper.h.

◆ singletonTypeListsUnify()

template<typename Iter1, typename Iter2>
bool llzk::singletonTypeListsUnify ( Iter1 lhs,
Iter2 rhs,
mlir::ArrayRef< llvm::StringRef > rhsReversePrefix = {},
UnificationMap * unifications = nullptr )
inline

Definition at line 232 of file TypeHelper.h.

◆ stringWithoutType()

std::string llzk::stringWithoutType ( mlir::Attribute a)
inline

Definition at line 41 of file AttributeHelper.h.

◆ structTypesUnify() [1/2]

bool llzk::structTypesUnify ( component::StructType lhs,
component::StructType rhs,
mlir::ArrayRef< llvm::StringRef > rhsReversePrefix = {},
UnificationMap * unifications = nullptr )

Return true iff the two StructType instances are equivalent or could be equivalent after full instantiation of struct parameters.

◆ structTypesUnify() [2/2]

bool llzk::structTypesUnify ( StructType lhs,
StructType rhs,
ArrayRef< StringRef > rhsReversePrefix,
UnificationMap * unifications )

Definition at line 758 of file TypeHelper.cpp.

◆ sub()

ExpressionValue llzk::sub ( llvm::SMTSolverRef solver,
const ExpressionValue & lhs,
const ExpressionValue & rhs )

Definition at line 494 of file IntervalAnalysis.cpp.

◆ toAPInt()

llvm::APInt llzk::toAPInt ( int64_t i)
inline

Definition at line 33 of file AttributeHelper.h.

◆ typeListsUnify()

template<typename Iter1, typename Iter2>
bool llzk::typeListsUnify ( Iter1 lhs,
Iter2 rhs,
mlir::ArrayRef< llvm::StringRef > rhsReversePrefix = {},
UnificationMap * unifications = nullptr )
inline

Return true iff the two lists of Type instances are equivalent or could be equivalent after full instantiation of struct parameters (if applicable within the given types).

Definition at line 221 of file TypeHelper.h.

◆ typeParamsUnify() [1/4]

bool llzk::typeParamsUnify ( const ArrayAttr & lhsParams,
const ArrayAttr & rhsParams,
UnificationMap * unifications )

Return true iff the two ArrayAttr instances containing StructType or ArrayType parameters are equivalent or could be equivalent after full instantiation of struct parameters.

Definition at line 746 of file TypeHelper.cpp.

◆ typeParamsUnify() [2/4]

bool llzk::typeParamsUnify ( const ArrayRef< Attribute > & lhsParams,
const ArrayRef< Attribute > & rhsParams,
UnificationMap * unifications )

Definition at line 737 of file TypeHelper.cpp.

◆ typeParamsUnify() [3/4]

bool llzk::typeParamsUnify ( const mlir::ArrayAttr & lhsParams,
const mlir::ArrayAttr & rhsParams,
UnificationMap * unifications = nullptr )

Return true iff the two ArrayAttr instances containing StructType or ArrayType parameters are equivalent or could be equivalent after full instantiation of struct parameters.

◆ typeParamsUnify() [4/4]

bool llzk::typeParamsUnify ( const mlir::ArrayRef< mlir::Attribute > & lhsParams,
const mlir::ArrayRef< mlir::Attribute > & rhsParams,
UnificationMap * unifications = nullptr )

Return true iff the two ArrayRef instances containing StructType or ArrayType parameters are equivalent or could be equivalent after full instantiation of struct parameters.

◆ typesUnify() [1/2]

bool llzk::typesUnify ( mlir::Type lhs,
mlir::Type rhs,
mlir::ArrayRef< llvm::StringRef > rhsReversePrefix = {},
UnificationMap * unifications = nullptr )

Return true iff the two Type instances are equivalent or could be equivalent after full instantiation of struct parameters (if applicable within the given types).

◆ typesUnify() [2/2]

bool llzk::typesUnify ( Type lhs,
Type rhs,
ArrayRef< StringRef > rhsReversePrefix,
UnificationMap * unifications )

Definition at line 765 of file TypeHelper.cpp.

◆ verifyAffineMapAttrType() [1/2]

LogicalResult llzk::verifyAffineMapAttrType ( EmitErrorFn emitError,
Attribute in )

Definition at line 826 of file TypeHelper.cpp.

◆ verifyAffineMapAttrType() [2/2]

mlir::LogicalResult llzk::verifyAffineMapAttrType ( EmitErrorFn emitError,
mlir::Attribute in )

Verify that all AffineMapAttr only have a single result.

◆ verifyArrayDimSizes() [1/2]

LogicalResult llzk::verifyArrayDimSizes ( EmitErrorFn emitError,
ArrayRef< Attribute > dimensionSizes )

Definition at line 848 of file TypeHelper.cpp.

◆ verifyArrayDimSizes() [2/2]

mlir::LogicalResult llzk::verifyArrayDimSizes ( EmitErrorFn emitError,
mlir::ArrayRef< mlir::Attribute > dimensionSizes )

Verify that the array dimensions are valid.

◆ verifyArrayType() [1/2]

mlir::LogicalResult llzk::verifyArrayType ( EmitErrorFn emitError,
mlir::Type elementType,
mlir::ArrayRef< mlir::Attribute > dimensionSizes )

Verify that the ArrayType is valid.

◆ verifyArrayType() [2/2]

LogicalResult llzk::verifyArrayType ( EmitErrorFn emitError,
Type elementType,
ArrayRef< Attribute > dimensionSizes )

Definition at line 853 of file TypeHelper.cpp.

◆ verifyIntAttrType() [1/2]

LogicalResult llzk::verifyIntAttrType ( EmitErrorFn emitError,
Attribute in )

Definition at line 811 of file TypeHelper.cpp.

◆ verifyIntAttrType() [2/2]

mlir::LogicalResult llzk::verifyIntAttrType ( EmitErrorFn emitError,
mlir::Attribute in )

Verify that all IntegerAttr have type IndexType.

◆ verifyParamOfType() [1/2]

mlir::LogicalResult llzk::verifyParamOfType ( mlir::SymbolTableCollection & tables,
mlir::SymbolRefAttr param,
mlir::Type structOrArrayType,
mlir::Operation * origin )

Ensure that the given symbol (that is used as a parameter of the given type) can be resolved.

◆ verifyParamOfType() [2/2]

LogicalResult llzk::verifyParamOfType ( SymbolTableCollection & tables,
SymbolRefAttr param,
Type parameterizedType,
Operation * origin )

Definition at line 248 of file SymbolHelper.cpp.

◆ verifyParamsOfType() [1/2]

mlir::LogicalResult llzk::verifyParamsOfType ( mlir::SymbolTableCollection & tables,
mlir::ArrayRef< mlir::Attribute > tyParams,
mlir::Type structOrArrayType,
mlir::Operation * origin )

Ensure that any symbols that appear within the given attributes (that are parameters of the given type) can be resolved.

◆ verifyParamsOfType() [2/2]

LogicalResult llzk::verifyParamsOfType ( SymbolTableCollection & tables,
ArrayRef< Attribute > tyParams,
Type parameterizedType,
Operation * origin )

Definition at line 276 of file SymbolHelper.cpp.

◆ verifyStructTypeParams() [1/2]

LogicalResult llzk::verifyStructTypeParams ( EmitErrorFn emitError,
ArrayAttr params )

Definition at line 844 of file TypeHelper.cpp.

◆ verifyStructTypeParams() [2/2]

mlir::LogicalResult llzk::verifyStructTypeParams ( EmitErrorFn emitError,
mlir::ArrayAttr params )

Verify that the StructType parameters are valid.

◆ verifyStructTypeResolution() [1/2]

mlir::FailureOr< component::StructDefOp > llzk::verifyStructTypeResolution ( mlir::SymbolTableCollection & tables,
component::StructType ty,
mlir::Operation * origin )

Ensure that all symbols used within the type can be resolved.

◆ verifyStructTypeResolution() [2/2]

FailureOr< StructDefOp > llzk::verifyStructTypeResolution ( SymbolTableCollection & tables,
StructType ty,
Operation * origin )

Definition at line 300 of file SymbolHelper.cpp.

◆ verifyTypeResolution() [1/3]

template<std::ranges::input_range Range>
mlir::LogicalResult llzk::verifyTypeResolution ( mlir::SymbolTableCollection & tables,
mlir::Operation * origin,
const Range & types )

Ensure that all symbols used within all Type instances can be resolved.

Definition at line 157 of file SymbolHelper.h.

◆ verifyTypeResolution() [2/3]

mlir::LogicalResult llzk::verifyTypeResolution ( mlir::SymbolTableCollection & tables,
mlir::Operation * origin,
mlir::Type type )

Ensure that all symbols used within the given Type instance can be resolved.

◆ verifyTypeResolution() [3/3]

LogicalResult llzk::verifyTypeResolution ( SymbolTableCollection & tables,
Operation * origin,
Type ty )

Definition at line 324 of file SymbolHelper.cpp.

Variable Documentation

◆ COMPONENT_NAME_MAIN

char llzk::COMPONENT_NAME_MAIN[] = "Main"
constexpr

Symbol name for the main entry point struct/component (if any).

There are additional restrictions on the struct with this name:

  1. It cannot have struct parameters.
  2. The parameter types of its functions (besides the required "self" parameter) can only be struct<Signal> or array<.. x struct<Signal>>.

Definition at line 23 of file Constants.h.

◆ COMPONENT_NAME_SIGNAL

char llzk::COMPONENT_NAME_SIGNAL[] = "Signal"
constexpr

Symbol name for the struct/component representing a signal.

A "signal" has direct correspondence to a circom signal or AIR/PLONK column, opposed to intermediate values or other expressions.

Definition at line 16 of file Constants.h.

◆ FUNC_NAME_COMPUTE

char llzk::FUNC_NAME_COMPUTE[] = "compute"
constexpr

Symbol name for the witness generation (and resp.

constraint generation) functions within a component.

Definition at line 27 of file Constants.h.

◆ FUNC_NAME_CONSTRAIN

char llzk::FUNC_NAME_CONSTRAIN[] = "constrain"
constexpr

Definition at line 28 of file Constants.h.

◆ LANG_ATTR_NAME

char llzk::LANG_ATTR_NAME[] = "veridise.lang"
constexpr

Name of the attribute on the top-level ModuleOp that specifies the IR language name.

Definition at line 31 of file Constants.h.