Beaver.MLIR.RewritePattern behaviour (beaver v0.4.8)

Copy Markdown

This module defines functions working with MLIR Rewrite Patterns.

Summary

Types

state()

@type state() :: any()

t()

@type t() :: %Beaver.MLIR.RewritePattern{ref: term()}

Callbacks

construct(state)

(optional)
@callback construct(state :: state()) :: state()

destruct(state)

(optional)
@callback destruct(state :: state()) :: any()

match_and_rewrite(pattern, op, rewriter, state)

@callback match_and_rewrite(
  pattern :: t(),
  op :: Beaver.MLIR.Operation.t(),
  rewriter :: Beaver.MLIR.PatternRewriter.t(),
  state :: state()
) :: {:ok, state()} | {:error, state()}

Functions

create(root_name, opts)

make(value)