[Mlir-commits] [mlir] [mlir][Transforms] Dialect conversion: Add option to disable folding (PR #92683)

Mehdi Amini llvmlistbot at llvm.org
Tue May 21 13:25:34 PDT 2024


================
@@ -1118,6 +1119,14 @@ 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 driver attempts to fold
+  /// operations throughout the conversion. This is problematic because op
+  /// folders may assume that the IR is in a valid state at the beginning of
+  /// the folding process. However, the dialect conversion does not guarantee
+  /// that because some IR modifications are delayed until the end of the
+  /// conversion.
+  bool foldOps = true;
----------------
joker-eph wrote:

Yes we should be setting this to false by default, folks who are broken can set it back to true, but we also document it as deprecated.

https://github.com/llvm/llvm-project/pull/92683


More information about the Mlir-commits mailing list