MLIR  19.0.0git
Public Attributes | List of all members
mlir::ConversionConfig Struct Reference

Dialect conversion configuration. More...

#include "mlir/Transforms/DialectConversion.h"

Public Attributes

function_ref< void(Diagnostic &)> notifyCallback = nullptr
 An optional callback used to notify about match failure diagnostics during the conversion. More...
 
DenseSet< Operation * > * unlegalizedOps = nullptr
 Partial conversion only. More...
 
DenseSet< Operation * > * legalizableOps = nullptr
 Analysis conversion only. More...
 
RewriterBase::Listenerlistener = nullptr
 An optional listener that is notified about all IR modifications in case dialect conversion succeeds. More...
 

Detailed Description

Dialect conversion configuration.

Definition at line 1071 of file DialectConversion.h.

Member Data Documentation

◆ legalizableOps

DenseSet<Operation *>* mlir::ConversionConfig::legalizableOps = nullptr

Analysis conversion only.

All operations that are found to be legalizable are placed in this set. Note that no actual rewrites are applied to the IR during an analysis conversion and only pre-existing operations are added to the set.

Definition at line 1087 of file DialectConversion.h.

◆ listener

RewriterBase::Listener* mlir::ConversionConfig::listener = nullptr

An optional listener that is notified about all IR modifications in case dialect conversion succeeds.

If the dialect conversion fails and no IR modifications are visible (i.e., they were all rolled back), no notifications are sent.

Note: Notifications are sent in a delayed fashion, when the dialect conversion is guaranteed to succeed. At that point, some IR modifications may already have been materialized. Consequently, operations/blocks that are passed to listener callbacks should not be accessed. (Ops/blocks are guaranteed to be valid pointers and accessing op names is allowed. But there are no guarantees about the state of ops/blocks at the time that a callback is triggered.)

Example: Consider a dialect conversion a new op ("test.foo") is created and inserted, and later moved to another block. (Moving ops also triggers "notifyOperationInserted".)

(1) notifyOperationInserted: "test.foo" (into block "b1") (2) notifyOperationInserted: "test.foo" (moved to another block "b2")

When querying "op->getBlock()" during the first "notifyOperationInserted", "b2" would be returned because "moving an op" is a kind of rewrite that is immediately performed by the dialect conversion (and rolled back upon failure).

Definition at line 1120 of file DialectConversion.h.

Referenced by mlir::detail::ConversionPatternRewriterImpl::applyRewrites(), and mlir::detail::ConversionPatternRewriterImpl::applySignatureConversion().

◆ notifyCallback

function_ref<void(Diagnostic &)> mlir::ConversionConfig::notifyCallback = nullptr

An optional callback used to notify about match failure diagnostics during the conversion.

Diagnostics reported to this callback may only be available in debug mode.

Definition at line 1075 of file DialectConversion.h.

Referenced by mlir::detail::ConversionPatternRewriterImpl::notifyMatchFailure().

◆ unlegalizedOps

DenseSet<Operation *>* mlir::ConversionConfig::unlegalizedOps = nullptr

Partial conversion only.

All operations that are found not to be legalizable are placed in this set. (Note that if there is an op explicitly marked as illegal, the conversion terminates and the set will not necessarily be complete.)

Definition at line 1081 of file DialectConversion.h.


The documentation for this struct was generated from the following file: