[Mlir-commits] [mlir] f7c589d - Clarify that fold() can't "erase" an operation in the MLIR Canonicalization doc (NFC)

Mehdi Amini llvmlistbot at llvm.org
Thu Jan 13 10:43:54 PST 2022


Author: Mehdi Amini
Date: 2022-01-13T18:43:18Z
New Revision: f7c589d3e74ff4b06452ecbc94c6bc0dcbc8a09e

URL: https://github.com/llvm/llvm-project/commit/f7c589d3e74ff4b06452ecbc94c6bc0dcbc8a09e
DIFF: https://github.com/llvm/llvm-project/commit/f7c589d3e74ff4b06452ecbc94c6bc0dcbc8a09e.diff

LOG: Clarify that fold() can't "erase" an operation in the MLIR Canonicalization doc (NFC)

Added: 
    

Modified: 
    mlir/docs/Canonicalization.md

Removed: 
    


################################################################################
diff  --git a/mlir/docs/Canonicalization.md b/mlir/docs/Canonicalization.md
index 1b017ad905117..9630497f20c0e 100644
--- a/mlir/docs/Canonicalization.md
+++ b/mlir/docs/Canonicalization.md
@@ -111,10 +111,11 @@ mechanism, and can be invoked directly anywhere with an `OpBuilder` via
 `OpBuilder::createOrFold`.
 
 `fold` has the restriction that no new operations may be created, and only the
-root operation may be replaced. It allows for updating an operation in-place, or
-returning a set of pre-existing values (or attributes) to replace the operation
-with. This ensures that the `fold` method is a truly "local" transformation, and
-can be invoked without the need for a pattern rewriter.
+root operation may be replaced (but not erased). It allows for updating an
+operation in-place, or returning a set of pre-existing values (or attributes) to
+replace the operation with. This ensures that the `fold` method is a truly
+"local" transformation, and can be invoked without the need for a pattern
+rewriter.
 
 In [ODS](OpDefinitions.md), an operation can set the `hasFolder` bit to generate
 a declaration for the `fold` method. This method takes on a 
diff erent form,


        


More information about the Mlir-commits mailing list