# `Beaver.MLIR.IRRewriter`

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.

# `owner`

```elixir
@type owner() :: Beaver.MLIR.Context.t() | Beaver.MLIR.Operation.t()
```

# `create`

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

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

# `destroy`

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

Destroys a standalone rewriter created by this module.

# `with_rewriter`

```elixir
@spec with_rewriter(owner(), (Beaver.MLIR.RewriterBase.t() -&gt; result)) :: result
when result: var
```

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