[Mlir-commits] [mlir] [MLIR] Harmonize the behavior of the folding API functions (PR #88508)

Matthias Springer llvmlistbot at llvm.org
Mon Apr 22 09:58:35 PDT 2024


================
@@ -568,6 +568,15 @@ OpFoldResult TestOpInPlaceFold::fold(FoldAdaptor adaptor) {
   return {};
 }
 
+OpFoldResult TestOpInPlaceSelfFold::fold(FoldAdaptor adaptor) {
+  if (!getProperties().folded) {
+    // The folder adds the "folded" if not present.
+    getProperties().folded = BoolAttr::get(getContext(), true);
----------------
matthias-springer wrote:

Can we use `setFolded` here?

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


More information about the Mlir-commits mailing list