SequenceOperation

Struct SequenceOperation 

Source
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>

Source

pub fn name() -> &'static str

Returns a name.

Source

pub fn as_operation(&self) -> &Operation<'c>

Returns a generic operation.

Source

pub fn builder( context: &'c Context, location: Location<'c>, ) -> SequenceOperationBuilder<'c, Unset, Unset, Unset, Unset>

Creates a builder.

Source

pub fn results(&self) -> impl Iterator<Item = OperationResult<'c, '_>>

Source

pub fn root(&self) -> Result<Value<'c, '_>, Error>

Source

pub fn extra_bindings( &self, ) -> Result<impl Iterator<Item = Value<'c, '_>>, Error>

Source

pub fn body(&self) -> Result<RegionRef<'c, '_>, Error>

Source

pub fn failure_propagation_mode(&self) -> Result<Attribute<'c>, Error>

Source

pub fn set_failure_propagation_mode(&mut self, value: Attribute<'c>)

Trait Implementations§

Source§

impl<'c> Clone for SequenceOperation<'c>

Source§

fn clone(&self) -> SequenceOperation<'c>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'c> Debug for SequenceOperation<'c>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'b> From<SequenceOperation<'b>> for TransformDialectOperation<'b>

Source§

fn from(op: SequenceOperation<'b>) -> Self

Converts to this type from the input type.
Source§

impl<'c> From<SequenceOperation<'c>> for Operation<'c>

Source§

fn from(operation: SequenceOperation<'c>) -> Self

Converts to this type from the input type.
Source§

impl<'c> PartialEq for SequenceOperation<'c>

Source§

fn eq(&self, other: &SequenceOperation<'c>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<'c> TryFrom<Operation<'c>> for SequenceOperation<'c>

Source§

type Error = Error

The type returned in the event of a conversion error.
Source§

fn try_from(operation: Operation<'c>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<'c> Eq for SequenceOperation<'c>

Source§

impl<'c> StructuralPartialEq for SequenceOperation<'c>

Auto Trait Implementations§

§

impl<'c> Freeze for SequenceOperation<'c>

§

impl<'c> RefUnwindSafe for SequenceOperation<'c>

§

impl<'c> !Send for SequenceOperation<'c>

§

impl<'c> !Sync for SequenceOperation<'c>

§

impl<'c> Unpin for SequenceOperation<'c>

§

impl<'c> UnwindSafe for SequenceOperation<'c>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.