LLZK 2.0.0
An open-source IR for Zero Knowledge (ZK) circuits
Loading...
Searching...
No Matches
TypeConversionPatterns.h File Reference

Reusable MLIR dialect conversion functions for LLZK StructType replacement. More...

#include "llzk/Dialect/Array/IR/Ops.h"
#include "llzk/Dialect/Constrain/IR/Ops.h"
#include "llzk/Dialect/Function/IR/Ops.h"
#include "llzk/Dialect/Global/IR/Ops.h"
#include "llzk/Dialect/LLZK/IR/AttributeHelper.h"
#include "llzk/Dialect/Polymorphic/IR/Ops.h"
#include "llzk/Dialect/Struct/IR/Ops.h"
#include <mlir/Dialect/SCF/Transforms/Patterns.h>
#include <mlir/IR/Attributes.h>
#include <mlir/IR/BuiltinAttributes.h>
#include <mlir/IR/BuiltinTypes.h>
#include <mlir/IR/MLIRContext.h>
#include <mlir/IR/Operation.h>
#include <mlir/IR/PatternMatch.h>
#include <mlir/Transforms/DialectConversion.h>
#include <llvm/ADT/SmallVector.h>
#include <tuple>
Include dependency graph for TypeConversionPatterns.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  llzk::OpClassesWithStructTypes
 Lists all LLZK op classes that may contain a StructType in their results or attributes.

Namespaces

namespace  llzk

Functions

bool llzk::defaultLegalityCheck (const mlir::TypeConverter &tyConv, mlir::Operation *op)
 Check whether an op is legal with respect to the given type converter, including TypeAttr attributes (with special handling for FunctionType stored inside a TypeAttr).
template<typename OpClass, typename Rewriter, typename... Args>
OpClass llzk::replaceOpWithNewOp (Rewriter &rewriter, mlir::Operation *op, Args &&...args)
 Wrapper for PatternRewriter::replaceOpWithNewOp() that automatically copies discardable attributes (i.e., attributes other than those specifically defined as part of the op in ODS).
template<typename... AdditionalOpClasses>
mlir::RewritePatternSet llzk::newGeneralRewritePatternSet (mlir::TypeConverter &tyConv, mlir::MLIRContext *ctx, mlir::ConversionTarget &target)
 Return a new RewritePatternSet covering all LLZK op types that may contain a StructType.

Detailed Description

Reusable MLIR dialect conversion functions for LLZK StructType replacement.

Definition in file TypeConversionPatterns.h.