# `Beaver.MLIR.RewritePatternSet`

This module defines functions working with MLIR RewritePatternSet.

# `t`

```elixir
@type t() :: %Beaver.MLIR.RewritePatternSet{ref: term()}
```

# `add`

```elixir
@spec add(t(), Beaver.MLIR.RewritePattern.t()) :: t()
```

Add a rewrite pattern into a `MLIR.RewritePatternSet`.

The set takes ownership of a raw `MLIR.RewritePattern`. Native descriptors
are materialized through the existing callback-backed rewrite bridge before
ownership is transferred.

# `add`

```elixir
@spec add(t(), Beaver.Pattern.Native.Descriptor.t(), keyword()) :: t()
@spec add(t(), term(), module() | function() | Beaver.Pattern.Native.Descriptor.t()) ::
  t()
```

# `add`

```elixir
@spec add(
  t(),
  term(),
  module() | function() | Beaver.Pattern.Native.Descriptor.t(),
  keyword()
) :: t()
```

# `add_conversion`

Creates a dialect conversion pattern and transfers it into this set.

# `create`

# `destroy`

# `freeze`

Freeze the given `MLIR.RewritePatternSet` to a `MLIR.FrozenRewritePatternSet`.
Note that the ownership of the input set is transferred into the frozen set after this call.

# `make`

# `threaded_destroy`

Destroy the given `MLIR.RewritePatternSet` or `MLIR.FrozenRewritePatternSet`
outside a BEAM scheduler thread.

# `with_pdl_patterns`

Create a `MLIR.RewritePatternSet` from the given PDL patterns.
The `patterns` is a list of functions that accept two arguments: `ctx` and `block`,
and create PDL patterns in the given `block` under the given `ctx`.
The `opts` may contain:
  * `:ctx` - (required) the `MLIR.Context` to create the patterns in.
  * `:debug` - (optional) if set to `true`, dump each created pattern for debugging.

