Beaver.MLIR.IRRewriter (beaver v0.4.8)

Copy Markdown

Owns standalone MLIR IR rewriters.

Use with_rewriter/2 for imperative transformations outside a rewrite pattern. The rewriter is always destroyed when the callback returns, raises, throws, or exits.

Summary

Functions

Creates a standalone rewriter for a context or before an operation.

Destroys a standalone rewriter created by this module.

Runs fun with a standalone rewriter and always destroys it afterward.

Types

owner()

Functions

create(context)

@spec create(owner()) :: Beaver.MLIR.RewriterBase.t()

Creates a standalone rewriter for a context or before an operation.

destroy(rewriter)

@spec destroy(Beaver.MLIR.RewriterBase.t()) :: :ok

Destroys a standalone rewriter created by this module.

with_rewriter(owner, fun)

@spec with_rewriter(owner(), (Beaver.MLIR.RewriterBase.t() -> result)) :: result
when result: var

Runs fun with a standalone rewriter and always destroys it afterward.