# `Beaver.MLIR.Transform`

Transform dialect execution and transformations MLIR provides by default.

`apply_named_sequence/3` executes a named Transform dialect sequence without
routing it through a pass manager. Transform IR may be supplied as a module,
an operation nested in a module, textual MLIR, bytecode, or a resolved tuning
schedule produced by `Beaver.MLIR.Transform.Schedule`.

Handles remain owned by MLIR's transform state and never escape this call.
Keeping expensive checks enabled (the default) makes use-after-consume handle
errors visible as processed diagnostics.

# `execution_option`

```elixir
@type execution_option() ::
  {:sequence, String.t()}
  | {:expensive_checks, boolean()}
  | {:enforce_single_top_level_transform_op, boolean()}
```

# `schedule_input`

```elixir
@type schedule_input() ::
  Beaver.MLIR.Module.t()
  | Beaver.MLIR.Operation.t()
  | binary()
  | Beaver.MLIR.Transform.Schedule.Resolved.t()
```

# `any_op_type`

Creates Transform dialect's `!transform.any_op` type.

# `any_param_type`

Creates Transform dialect's `!transform.any_param` type.

# `any_value_type`

Creates Transform dialect's `!transform.any_value` type.

# `apply_named_sequence`

```elixir
@spec apply_named_sequence(
  Beaver.MLIR.Module.t() | Beaver.MLIR.Operation.t(),
  schedule_input(),
  [execution_option()]
) ::
  {:ok, Beaver.MLIR.Transform.Result.t()}
  | {:error, Beaver.MLIR.Transform.Error.t()}
```

Applies a named Transform dialect sequence to a payload operation or module.

The default sequence is `__transform_main`. LLVM's expensive handle checks
and single-top-level-transform enforcement both default to `true` and can be
configured independently.

# `apply_named_sequence!`

```elixir
@spec apply_named_sequence!(
  Beaver.MLIR.Module.t() | Beaver.MLIR.Operation.t(),
  schedule_input(),
  [execution_option()]
) :: Beaver.MLIR.Module.t() | Beaver.MLIR.Operation.t()
```

Bang variant of `apply_named_sequence/3`.

# `bubble_down_memory_space_casts`

Bubbles down memory-space cast operations.
### Argument name in MLIR CLI
`bubble-down-memory-space-casts`
### Pass name in TableGen
`BubbleDownMemorySpaceCasts`

# `bubble_down_memory_space_casts`

# `canonicalize`

Canonicalize operations
### Argument name in MLIR CLI
`canonicalize`
### Pass name in TableGen
`CanonicalizerPass`

# `canonicalize`

# `composite_fixed_point_pass`

Composite fixed point pass
### Argument name in MLIR CLI
`composite-fixed-point-pass`
### Pass name in TableGen
`CompositeFixedPointPass`

# `composite_fixed_point_pass`

# `control_flow_sink`

Sink operations into conditional blocks
### Argument name in MLIR CLI
`control-flow-sink`
### Pass name in TableGen
`ControlFlowSinkPass`

# `control_flow_sink`

# `convert_elementwise_to_linalg`

Convert ElementwiseMappable ops to linalg
### Argument name in MLIR CLI
`convert-elementwise-to-linalg`
### Pass name in TableGen
`ConvertElementwiseToLinalgPass`

# `convert_elementwise_to_linalg`

# `convert_linalg_to_affine_loops`

Lower the operations from the linalg dialect into affine loops
### Argument name in MLIR CLI
`convert-linalg-to-affine-loops`
### Pass name in TableGen
`ConvertLinalgToAffineLoopsPass`

# `convert_linalg_to_affine_loops`

# `convert_linalg_to_loops`

Lower the operations from the linalg dialect into loops
### Argument name in MLIR CLI
`convert-linalg-to-loops`
### Pass name in TableGen
`ConvertLinalgToLoopsPass`

# `convert_linalg_to_loops`

# `convert_linalg_to_parallel_loops`

Lower the operations from the linalg dialect into parallel loops
### Argument name in MLIR CLI
`convert-linalg-to-parallel-loops`
### Pass name in TableGen
`ConvertLinalgToParallelLoopsPass`

# `convert_linalg_to_parallel_loops`

# `cse`

Eliminate common sub-expressions
### Argument name in MLIR CLI
`cse`
### Pass name in TableGen
`CSEPass`

# `cse`

# `execute`

Alias for `apply_named_sequence/3`.

# `execute!`

Alias for `apply_named_sequence!/3`.

# `generate_runtime_verification`

Generate additional runtime op verification checks
### Argument name in MLIR CLI
`generate-runtime-verification`
### Pass name in TableGen
`GenerateRuntimeVerificationPass`

# `generate_runtime_verification`

# `gpu_async_region`

Make GPU ops async
### Argument name in MLIR CLI
`gpu-async-region`
### Pass name in TableGen
`GpuAsyncRegionPass`

# `gpu_async_region`

# `gpu_decompose_memrefs`

Decomposes memref index computation into explicit ops.
### Argument name in MLIR CLI
`gpu-decompose-memrefs`
### Pass name in TableGen
`GpuDecomposeMemrefsPass`

# `gpu_decompose_memrefs`

# `gpu_eliminate_barriers`

Erase unnecessary barriers
### Argument name in MLIR CLI
`gpu-eliminate-barriers`
### Pass name in TableGen
`GpuEliminateBarriers`

# `gpu_eliminate_barriers`

# `gpu_kernel_outlining`

Outline gpu.launch bodies to kernel functions
### Argument name in MLIR CLI
`gpu-kernel-outlining`
### Pass name in TableGen
`GpuKernelOutliningPass`

# `gpu_kernel_outlining`

# `gpu_launch_sink_index_computations`

Sink index computations into gpu.launch body
### Argument name in MLIR CLI
`gpu-launch-sink-index-computations`
### Pass name in TableGen
`GpuLaunchSinkIndexComputationsPass`

# `gpu_launch_sink_index_computations`

# `gpu_map_parallel_loops`

Greedily maps loops to GPU hardware dimensions.
### Argument name in MLIR CLI
`gpu-map-parallel-loops`
### Pass name in TableGen
`GpuMapParallelLoopsPass`

# `gpu_map_parallel_loops`

# `gpu_module_to_binary`

Transforms a GPU module into a GPU binary.
### Argument name in MLIR CLI
`gpu-module-to-binary`
### Pass name in TableGen
`GpuModuleToBinaryPass`

# `gpu_module_to_binary`

# `inline`

Inline function calls
### Argument name in MLIR CLI
`inline`
### Pass name in TableGen
`InlinerPass`

# `inline`

# `linalg_block_pack_matmul`

Convert linalg matmul ops to block layout and back
### Argument name in MLIR CLI
`linalg-block-pack-matmul`
### Pass name in TableGen
`LinalgBlockPackMatmul`

# `linalg_block_pack_matmul`

# `linalg_fold_into_elementwise`

Fold transpose and broadcast ops into elementwise consumers
### Argument name in MLIR CLI
`linalg-fold-into-elementwise`
### Pass name in TableGen
`LinalgFoldIntoElementwisePass`

# `linalg_fold_into_elementwise`

# `linalg_fold_unit_extent_dims`

Remove unit-extent dimension in Linalg ops on tensors
### Argument name in MLIR CLI
`linalg-fold-unit-extent-dims`
### Pass name in TableGen
`LinalgFoldUnitExtentDimsPass`

# `linalg_fold_unit_extent_dims`

# `linalg_fuse_elementwise_ops`

Fuse elementwise operations on tensors
### Argument name in MLIR CLI
`linalg-fuse-elementwise-ops`
### Pass name in TableGen
`LinalgElementwiseOpFusionPass`

# `linalg_fuse_elementwise_ops`

# `linalg_generalize_named_ops`

Convert named ops into generic ops
### Argument name in MLIR CLI
`linalg-generalize-named-ops`
### Pass name in TableGen
`LinalgGeneralizeNamedOpsPass`

# `linalg_generalize_named_ops`

# `linalg_inline_scalar_operands`

Inline scalar operands into linalg generic ops
### Argument name in MLIR CLI
`linalg-inline-scalar-operands`
### Pass name in TableGen
`LinalgInlineScalarOperandsPass`

# `linalg_inline_scalar_operands`

# `linalg_morph_ops`

Convert linalg ops between forms
### Argument name in MLIR CLI
`linalg-morph-ops`
### Pass name in TableGen
`LinalgMorphOpsPass`

# `linalg_morph_ops`

# `linalg_specialize_generic_ops`

Convert generic ops back to named ops
### Argument name in MLIR CLI
`linalg-specialize-generic-ops`
### Pass name in TableGen
`LinalgSpecializeGenericOpsPass`

# `linalg_specialize_generic_ops`

# `loop_invariant_code_motion`

Hoist loop invariant instructions outside of the loop
### Argument name in MLIR CLI
`loop-invariant-code-motion`
### Pass name in TableGen
`LoopInvariantCodeMotionPass`

# `loop_invariant_code_motion`

# `loop_invariant_subset_hoisting`

Hoist loop invariant subset ops outside of the loop
### Argument name in MLIR CLI
`loop-invariant-subset-hoisting`
### Pass name in TableGen
`LoopInvariantSubsetHoistingPass`

# `loop_invariant_subset_hoisting`

# `mem2reg`

Promotes memory slots into values.
### Argument name in MLIR CLI
`mem2reg`
### Pass name in TableGen
`Mem2Reg`

# `mem2reg`

# `nvvm_attach_target`

Attaches an NVVM target attribute to a GPU Module.
### Argument name in MLIR CLI
`nvvm-attach-target`
### Pass name in TableGen
`GpuNVVMAttachTarget`

# `nvvm_attach_target`

# `operation_type`

Creates an operation-specific Transform handle type.

# `param_type`

Creates a Transform parameter type wrapping an MLIR type.

# `print_ir`

Print IR on the debug stream
### Argument name in MLIR CLI
`print-ir`
### Pass name in TableGen
`PrintIRPass`

# `print_ir`

# `print_op_stats`

Print statistics of operations
### Argument name in MLIR CLI
`print-op-stats`
### Pass name in TableGen
`PrintOpStatsPass`

# `print_op_stats`

# `remove_dead_values`

Remove dead values
### Argument name in MLIR CLI
`remove-dead-values`
### Pass name in TableGen
`RemoveDeadValuesPass`

# `remove_dead_values`

# `rocdl_attach_target`

Attaches a ROCDL target attribute to a GPU Module.
### Argument name in MLIR CLI
`rocdl-attach-target`
### Pass name in TableGen
`GpuROCDLAttachTarget`

# `rocdl_attach_target`

# `sccp`

Sparse Conditional Constant Propagation
### Argument name in MLIR CLI
`sccp`
### Pass name in TableGen
`SCCPPass`

# `sccp`

# `simplify_depthwise_conv`

Simplify depthwise convolution.
### Argument name in MLIR CLI
`simplify-depthwise-conv`
### Pass name in TableGen
`SimplifyDepthwiseConvPass`

# `simplify_depthwise_conv`

# `snapshot_op_locations`

Generate new locations from the current IR
### Argument name in MLIR CLI
`snapshot-op-locations`
### Pass name in TableGen
`LocationSnapshot`

# `snapshot_op_locations`

# `spirv_attach_target`

Attaches an SPIR-V target attribute to a GPU Module.
### Argument name in MLIR CLI
`spirv-attach-target`
### Pass name in TableGen
`GpuSPIRVAttachTarget`

# `spirv_attach_target`

# `sroa`

Scalar Replacement of Aggregates
### Argument name in MLIR CLI
`sroa`
### Pass name in TableGen
`SROA`

# `sroa`

# `strip_debuginfo`

Strip debug info from all operations
### Argument name in MLIR CLI
`strip-debuginfo`
### Pass name in TableGen
`StripDebugInfoPass`

# `strip_debuginfo`

# `symbol_dce`

Eliminate dead symbols
### Argument name in MLIR CLI
`symbol-dce`
### Pass name in TableGen
`SymbolDCEPass`

# `symbol_dce`

# `symbol_privatize`

Mark symbols private
### Argument name in MLIR CLI
`symbol-privatize`
### Pass name in TableGen
`SymbolPrivatizePass`

# `symbol_privatize`

# `topological_sort`

Sort regions without SSA dominance in topological order
### Argument name in MLIR CLI
`topological-sort`
### Pass name in TableGen
`TopologicalSortPass`

# `topological_sort`

# `trivial_dce`

Remove trivially dead operations and blocks
### Argument name in MLIR CLI
`trivial-dce`
### Pass name in TableGen
`TrivialDeadCodeEliminationPass`

# `trivial_dce`

# `view_op_graph`

Print Graphviz visualization of an operation
### Argument name in MLIR CLI
`view-op-graph`
### Pass name in TableGen
`ViewOpGraphPass`

# `view_op_graph`

# `xevm_attach_target`

Attaches a XeVM target attribute to a GPU Module.
### Argument name in MLIR CLI
`xevm-attach-target`
### Pass name in TableGen
`GpuXeVMAttachTarget`

# `xevm_attach_target`

