pub struct SequenceOperation<'c> { /* private fields */ }
Expand description
A sequence
operation. Contains a sequence of other transform ops to apply.
The transformations indicated by the sequence are applied in order of their
appearance. Each value produced by a transformation within the sequence
corresponds to a group of operations or values in the payload IR, or to a
group of parameters, depending on the type of the value. The behavior of the
operation when a nested transformation produces a silenceable error is
controlled by the failure_propagation_mode
attribute. When set to
propagate
, the failure of any nested transformation in the sequence
implies immediate failure of the entire sequence with a silenceable error,
and no further transformation is attempted. When set to suppress
,
silenceable errors in nested operations are ignored and further
transformations are applied. Beware that even silenceable errors may leave
the payload IR in a state unsuitable for further transformations. It is the
responsibility of the caller to ensure the following transformations are
robust enough when errors are suppressed. Definite errors reported by nested
transformations abort the sequence regardless of the propagation mode. The
set of modes may be extended in the future, e.g., to collect silenceable
errors and report them after attempting all transformations in the sequence.
The entry block of this operation has a single argument that maps to either the operand if provided or the top-level container operation of the payload IR, typically the root operation of the pass interpreting the transform dialect. Operand omission is only allowed for sequences not contained in another sequence.
The type of the block argument must match the type of the operand. If the sequence is a top-level transform (without an operand), it can be used for matching operations if the specified type within the top-level container payload IR (including the container op itself). E.g.:
transform.sequence failures(propagate) {
^bb1(%arg1: !transform.any_op):
// %arg1 is mapped to the top-level container of the payload IR, which is
// typically a module
}
transform.sequence failures(propagate) {
^bb1(%arg1: !transform.op<"func.func>"):
// %arg1 is mapped to all "func.func" ops within and including the
// top-level container of the payload IR. Nested operations that have the
// specified op type are not included.
}
The body of the sequence terminates with an implicit or explicit
transform.yield
op. The operands of the terminator are returned as the
results of the sequence op.
Implementations§
source§impl<'c> SequenceOperation<'c>
impl<'c> SequenceOperation<'c>
sourcepub fn as_operation(&self) -> &Operation<'c>
pub fn as_operation(&self) -> &Operation<'c>
Returns a generic operation.
sourcepub fn builder(
context: &'c Context,
location: Location<'c>
) -> SequenceOperationBuilder<'c, Unset, Unset, Unset, Unset>
pub fn builder( context: &'c Context, location: Location<'c> ) -> SequenceOperationBuilder<'c, Unset, Unset, Unset, Unset>
Creates a builder.