MLIR
20.0.0git
|
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::Listener * | listener = nullptr |
An optional listener that is notified about all IR modifications in case dialect conversion succeeds. More... | |
bool | buildMaterializations = true |
If set to "true", the dialect conversion attempts to build source/target/ argument materializations through the type converter API in lieu of "builtin.unrealized_conversion_cast ops". More... | |
Dialect conversion configuration.
Definition at line 1166 of file DialectConversion.h.
bool mlir::ConversionConfig::buildMaterializations = true |
If set to "true", the dialect conversion attempts to build source/target/ argument materializations through the type converter API in lieu of "builtin.unrealized_conversion_cast ops".
The conversion process fails if at least one materialization could not be built.
If set to "false", the dialect conversion does not build any custom materializations and instead inserts "builtin.unrealized_conversion_cast" ops to ensure that the resulting IR is valid.
Definition at line 1226 of file DialectConversion.h.
Referenced by mlir::OperationConverter::convertOperations().
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 1182 of file DialectConversion.h.
Referenced by mlir::applyAnalysisConversion().
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), or if the dialect conversion is an "analysis conversion", no notifications are sent (apart from notifyPatternBegin
/notifyPatternEnd`).
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 1216 of file DialectConversion.h.
Referenced by mlir::detail::ConversionPatternRewriterImpl::applyRewrites(), mlir::detail::ConversionPatternRewriterImpl::applySignatureConversion(), and mlir::OperationConverter::convertOperations().
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 1170 of file DialectConversion.h.
Referenced by mlir::detail::ConversionPatternRewriterImpl::notifyMatchFailure().
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 1176 of file DialectConversion.h.