Beaver. MLIR. MemoryEffects behaviour
(beaver v0.4.8)
Copy Markdown
Implements MLIR's MemoryEffectsOpInterface for dynamic operations.
A callback returns :pure or a list of effect specifications. An effect is
one of :allocate, :free, :read, or :write, optionally associated with
an operand, result, block argument, or symbol:
[
{:read, {:operand, 0}},
{:write, {:result, 0}},
{:read, {:symbol, symbol_ref}, stage: 1}
]A bare effect such as :write is not associated with a particular IR
entity. Options are :parameters, :stage, :effect_on_full_region, and
:resource. The default resource and a null parameters attribute are used
when omitted.
The effects list passed to a two-argument callback is borrowed and valid only until that callback returns. Prefer returning declarative specifications. Callback exceptions are diagnosed and native code adds a conservative unknown write effect.
Summary
Functions
Attaches a callback-backed memory effects interface model.
Adds the standard transform-dialect effects for consumed handle operands.
Marks a transform operation as potentially modifying payload IR.
Adds the standard transform-dialect effects for read-only handle operands.
Marks a transform operation as only reading payload IR.
Adds the standard transform-dialect effects for produced handle results.
Types
@type effect() :: :allocate | :free | :read | :write
@type target() :: nil | :operation | {:operand, non_neg_integer() | Beaver.MLIR.OpOperand.t()} | {:result, non_neg_integer() | Beaver.MLIR.Value.t()} | {:block_argument, Beaver.MLIR.Value.t()} | {:symbol, Beaver.MLIR.Attribute.t()} | Beaver.MLIR.OpOperand.t() | Beaver.MLIR.Value.t() | Beaver.MLIR.Attribute.t()
Callbacks
@callback memory_effects(Beaver.MLIR.Operation.t()) :: :pure | [effect_spec()] | {:ok, [effect_spec()]}
Functions
@spec attach(Beaver.MLIR.Context.t(), String.t(), module() | function(), keyword()) :: Beaver.MLIR.ExternalInterface.Attachment.t()
Attaches a callback-backed memory effects interface model.
Adds the standard transform-dialect effects for consumed handle operands.
Marks a transform operation as potentially modifying payload IR.
Adds the standard transform-dialect effects for read-only handle operands.
Marks a transform operation as only reading payload IR.
Adds the standard transform-dialect effects for produced handle results.