[Mlir-commits] [mlir] 08f31b8 - [docs] Make consistent between MLIR tutorial doc and example code

Hsiangkai Wang llvmlistbot at llvm.org
Sat Feb 11 22:18:03 PST 2023


Author: Hsiangkai Wang
Date: 2023-02-12T06:17:01Z
New Revision: 08f31b8fa85c50cdfc715552730cff26ab70c737

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

LOG: [docs] Make consistent between MLIR tutorial doc and example code

In MLIR tutorial example code, use `Pure` to remove the side-effects of
operations. Update the document to be consistent with the example code.

Reviewed By: mehdi_amini

Differential Revision: https://reviews.llvm.org/D143814

Added: 
    

Modified: 
    mlir/docs/Tutorials/Toy/Ch-3.md
    mlir/docs/Tutorials/Toy/Ch-4.md

Removed: 
    


################################################################################
diff  --git a/mlir/docs/Tutorials/Toy/Ch-3.md b/mlir/docs/Tutorials/Toy/Ch-3.md
index 811a1d205f01b..ac38cbe298d52 100644
--- a/mlir/docs/Tutorials/Toy/Ch-3.md
+++ b/mlir/docs/Tutorials/Toy/Ch-3.md
@@ -144,10 +144,10 @@ eliminated. That is not ideal! What happened is that our pattern replaced the
 last transform with the function input and left behind the now dead transpose
 input. The Canonicalizer knows to clean up dead operations; however, MLIR
 conservatively assumes that operations may have side-effects. We can fix this by
-adding a new trait, `NoMemoryEffect`, to our `TransposeOp`:
+adding a new trait, `Pure`, to our `TransposeOp`:
 
 ```tablegen
-def TransposeOp : Toy_Op<"transpose", [NoMemoryEffect]> {...}
+def TransposeOp : Toy_Op<"transpose", [Pure]> {...}
 ```
 
 Let's retry now `toyc-ch3 test/transpose_transpose.toy -emit=mlir -opt`:

diff  --git a/mlir/docs/Tutorials/Toy/Ch-4.md b/mlir/docs/Tutorials/Toy/Ch-4.md
index df82141c77ba5..77a52163774f2 100644
--- a/mlir/docs/Tutorials/Toy/Ch-4.md
+++ b/mlir/docs/Tutorials/Toy/Ch-4.md
@@ -222,7 +222,7 @@ casts between two 
diff erent shapes.
 ```tablegen
 def CastOp : Toy_Op<"cast", [
     DeclareOpInterfaceMethods<CastOpInterface>,
-    NoMemoryEffect,
+    Pure,
     SameOperandsAndResultShape]
   > {
   let summary = "shape cast operation";


        


More information about the Mlir-commits mailing list