Struct melior::dialect::ods::pdl_interp::RecordMatchOperation
source · pub struct RecordMatchOperation<'c> { /* private fields */ }
Expand description
A record_match
operation. Record the metadata for a successful pattern match.
pdl_interp.record_match
operations record a successful pattern match with
the interpreter and branch to the next part of the matcher. The metadata
recorded by these operations correspond to a specific pdl.pattern
, as well
as what values were used during that match that should be propagated to the
rewriter.
Example:
pdl_interp.record_match @rewriters::myRewriter(%root : !pdl.operation) : benefit(1), loc([%root, %op1]), root("foo.op") -> ^nextDest
Implementations§
source§impl<'c> RecordMatchOperation<'c>
impl<'c> RecordMatchOperation<'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>
) -> RecordMatchOperationBuilder<'c, Unset, Unset, Unset, Unset, Unset>
pub fn builder( context: &'c Context, location: Location<'c> ) -> RecordMatchOperationBuilder<'c, Unset, Unset, Unset, Unset, Unset>
Creates a builder.
pub fn inputs(&self) -> Result<impl Iterator<Item = Value<'c, '_>>, Error>
pub fn matched_ops(&self) -> Result<impl Iterator<Item = Value<'c, '_>>, Error>
pub fn dest(&self) -> Result<BlockRef<'c, '_>, Error>
pub fn rewriter(&self) -> Result<Attribute<'c>, Error>
pub fn set_rewriter(&mut self, value: Attribute<'c>)
pub fn root_kind(&self) -> Result<StringAttribute<'c>, Error>
pub fn set_root_kind(&mut self, value: StringAttribute<'c>)
pub fn remove_root_kind(&mut self) -> Result<(), Error>
pub fn generated_ops(&self) -> Result<ArrayAttribute<'c>, Error>
pub fn set_generated_ops(&mut self, value: ArrayAttribute<'c>)
pub fn remove_generated_ops(&mut self) -> Result<(), Error>
pub fn benefit(&self) -> Result<IntegerAttribute<'c>, Error>
pub fn set_benefit(&mut self, value: IntegerAttribute<'c>)
Trait Implementations§
source§impl<'c> From<RecordMatchOperation<'c>> for Operation<'c>
impl<'c> From<RecordMatchOperation<'c>> for Operation<'c>
source§fn from(operation: RecordMatchOperation<'c>) -> Self
fn from(operation: RecordMatchOperation<'c>) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl<'c> RefUnwindSafe for RecordMatchOperation<'c>
impl<'c> !Send for RecordMatchOperation<'c>
impl<'c> !Sync for RecordMatchOperation<'c>
impl<'c> Unpin for RecordMatchOperation<'c>
impl<'c> UnwindSafe for RecordMatchOperation<'c>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more