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

Markus Böck llvmlistbot at llvm.org
Sun May 19 10:49:57 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;
----------------
zero9178 wrote:

I wonder whether there should be either a TODO such as "change to false in the future" (if we want to take that route) or whether the comment should note that it is true for historic reasons.

Looks funny that the majority of the paragraph discourages using the options but we default to it being true

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


More information about the Mlir-commits mailing list