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

Copy Markdown

Implements Transform dialect's PatternDescriptorOpInterface for dynamic operations.

The callback receives a borrowed Beaver.MLIR.RewritePatternSet and adds Beaver rewrite patterns to it. An optional state-aware callback also receives a borrowed Beaver.MLIR.TransformState. Borrowed handles must not escape the callback.

Summary

Functions

Attaches a callback-backed pattern descriptor interface model.

Callbacks

populate_patterns(t, t)

@callback populate_patterns(Beaver.MLIR.Operation.t(), Beaver.MLIR.RewritePatternSet.t()) ::
  any()

populate_patterns_with_state(t, t, t)

(optional)
@callback populate_patterns_with_state(
  Beaver.MLIR.Operation.t(),
  Beaver.MLIR.RewritePatternSet.t(),
  Beaver.MLIR.TransformState.t()
) :: any()

Functions

attach(context, operation_name, implementation, opts \\ [])

Attaches a callback-backed pattern descriptor interface model.