24#ifndef TVM_RELAX_DATAFLOW_MATCHER_H_
25#define TVM_RELAX_DATAFLOW_MATCHER_H_
28#include <tvm/ffi/function.h>
29#include <tvm/ffi/optional.h>
49 ffi::Optional<ffi::Map<Var, Expr>> bindings = std::nullopt);
53 DFPattern pattern,
Expr expr, ffi::Optional<ffi::Map<Var, Expr>> bindings = std::nullopt);
75 ffi::TypedFunction<ffi::Map<Var, Expr>(ffi::Map<DFPattern, Var>, ffi::Map<Var, Expr>)> rewriter,
102 ffi::TypedFunction<
Expr(
Expr, ffi::Map<DFPattern, Expr>)> rewriter,
Managed reference to ExprObj.
Definition expr.h:101
Managed reference to dataflow patterns.
Definition dataflow_pattern.h:103
Managed reference to a pattern context.
Definition dataflow_pattern.h:277
A pattern language for matching dataflow properties.
Parent compiler symbol visibility.
ffi::Optional< ffi::Map< DFPattern, Var > > MatchGraph(const PatternContext &ctx, const DataflowBlock &dfb)
Match a sub-graph in a DataflowBlock with a graph of patterns and return the mapping.
Function RewriteCall(const DFPattern &pattern, ffi::TypedFunction< Expr(Expr, ffi::Map< DFPattern, Expr >)> rewriter, Function func)
Rewrite a function with the given pattern and the rewriter function.
ffi::Optional< ffi::Map< DFPattern, Expr > > ExtractMatchedExpr(DFPattern pattern, Expr expr, ffi::Optional< ffi::Map< Var, Expr > > bindings=std::nullopt)
bool MatchExpr(DFPattern pattern, Expr expr, ffi::Optional< ffi::Map< Var, Expr > > bindings=std::nullopt)
Determine if a pattern matches an expression.
tvm::Expr Expr
Definition type.h:42
Function RewriteBindings(const PatternContext &ctx, ffi::TypedFunction< ffi::Map< Var, Expr >(ffi::Map< DFPattern, Var >, ffi::Map< Var, Expr >)> rewriter, Function f)
Rewrite a function with the given pattern and the rewriter function.
An object that builds and maintains block scope and StmtSref mapping for Dependence analysis.
Definition analysis.h:41