Skip to content

Commit

Permalink
[mlir][Transforms][WIP] Dialect conversion: Make materializations opt…
Browse files Browse the repository at this point in the history
…ional

Build all source/target/argument materializations after the conversion has succeeded. Provide a new configuration option for users to opt out of all automatic materializations. In that case, the resulting IR will have `builtin.unrealized_conversion_cast` ops.
  • Loading branch information
matthias-springer committed Aug 17, 2024
1 parent ed5a2dc commit f72f642
Show file tree
Hide file tree
Showing 5 changed files with 108 additions and 298 deletions.
11 changes: 11 additions & 0 deletions mlir/include/mlir/Transforms/DialectConversion.h
Original file line number Diff line number Diff line change
Expand Up @@ -1124,6 +1124,17 @@ struct ConversionConfig {
// already been modified) and iterators into past IR state cannot be
// represented at the moment.
RewriterBase::Listener *listener = nullptr;

/// 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 does not build any
/// custom materializations and instead inserts
/// builtin.unrealized_conversion_cast ops to ensure that the resulting IR
/// is valid.
bool buildMaterializations = true;
};

//===----------------------------------------------------------------------===//
Expand Down
Loading

0 comments on commit f72f642

Please sign in to comment.