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

Mehdi Amini llvmlistbot at llvm.org
Sun May 19 12:45:15 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:

I would go further: if we consider this unsafe, we should just deprecate this mode entirely.

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


More information about the Mlir-commits mailing list