# `Beaver.MLIR.Transform.Schedule.DSL`

An Elixir authoring frontend for upstream Transform dialect schedules.

The DSL creates a verified `Beaver.MLIR.Module` in a caller-owned context.
Its helpers create ordinary Transform dialect operations immediately; there
is no second schedule graph to synchronize with the IR.

A schedule module can mix the focused helpers in this module with Beaver's
normal SSA syntax:

    defmodule MySchedule do
      use Beaver.MLIR.Transform.Schedule.DSL

      defschedule search do
        sequence "__transform_main", [root >>> any_op()] do
          _tile = knob("tile", [8, 16], type: param(MLIR.Type.i64()))
          # Any existing Beaver SSA operation may be emitted here.
          yield()
        end
      end
    end

    schedule = MySchedule.search(ctx: context)

The caller owns both `context` and the returned module.

# `__using__`
*macro* 

Imports `defschedule` and the schedule authoring helpers.

# `alternatives`
*macro* 

Creates `transform.tune.alternatives` from explicit `branch` blocks.

    alternatives "vectorize" do
      branch do
        # Transform SSA operations
      end

      branch do
        # A second alternative
      end
    end

Each branch receives an implicit `transform.yield` when it does not already
end in one.

# `any_op`

Returns a deferred `!transform.any_op` type.

# `any_param`

Returns a deferred `!transform.any_param` type.

# `any_value`

Returns a deferred `!transform.any_value` type.

# `defschedule`
*macro* 

Defines a zero-arity schedule builder with an optional keyword argument.

The generated function requires `:ctx` to be a caller-owned
`Beaver.MLIR.Context`. It returns a verified `Beaver.MLIR.Module`; the caller
must destroy the module before destroying the context.

# `knob`
*macro* 

Creates `transform.tune.knob` and returns its parameter handle.

Integer, float, boolean, string, `:unit`, `MLIR.Attribute`, and deferred
attribute values are accepted. Integer-only knobs default to
`!transform.param<i64>`; other domains default to `!transform.any_param`.
Pass `:type` to select an explicit Transform parameter type.

# `operation`

Returns a deferred operation-specific Transform handle type.

# `param`

Returns a Transform parameter type wrapping an MLIR type.

# `sequence`
*macro* 

Declares the default `__transform_main` sequence with one `any_op` root handle.

# `sequence`
*macro* 

Declares a named sequence with one default `any_op` root handle.

# `sequence`
*macro* 

Declares a named sequence with typed handle arguments.

Arguments use Beaver's `>>>` spelling, for example
`[root >>> any_op(), function >>> operation("func.func")]`. Sequence results
are intentionally expressed by ordinary Transform SSA operations and
`yield/1`; this helper currently declares result-free entry points.

# `yield`
*macro* 

Creates `transform.yield` with zero or more yielded handles.
