24 #ifndef TVM_RELAX_DATAFLOW_MATCHER_H_
25 #define TVM_RELAX_DATAFLOW_MATCHER_H_
27 #include <tvm/ffi/function.h>
28 #include <tvm/ffi/optional.h>
51 Optional<Map<Var, Expr>> bindings = std::nullopt);
73 ffi::TypedFunction<Map<Var, Expr>(Map<DFPattern, Var>, Map<Var, Expr>)> rewriter,
Function f);
99 ffi::TypedFunction<
Expr(
Expr, Map<DFPattern, Expr>)> rewriter,
Managed reference to RelaxExprNode.
Definition: expr.h:446
Managed reference to dataflow patterns.
Definition: dataflow_pattern.h:102
Managed reference to a pattern context.
Definition: dataflow_pattern.h:281
A pattern language for matching dataflow properties.
Function RewriteBindings(const PatternContext &ctx, ffi::TypedFunction< Map< Var, Expr >(Map< DFPattern, Var >, Map< Var, Expr >)> rewriter, Function f)
Rewrite a function with the given pattern and the rewriter function.
bool MatchExpr(DFPattern pattern, Expr expr, Optional< Map< Var, Expr >> bindings=std::nullopt)
Determine if a pattern matches an expression.
Function RewriteCall(const DFPattern &pattern, ffi::TypedFunction< Expr(Expr, Map< DFPattern, Expr >)> rewriter, Function func)
Rewrite a function with the given pattern and the rewriter function.
Optional< 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.
Optional< Map< DFPattern, Expr > > ExtractMatchedExpr(DFPattern pattern, Expr expr, Optional< Map< Var, Expr >> bindings=std::nullopt)
RelaxExpr Expr
Definition: expr.h:39
Performance counters for profiling via the PAPI library.
Definition: analyzer.h:37