[Mlir-commits] [mlir] 45d522d - [mlir] Fix/Clarify parts of MLIR toy tutorial chapter 6+7

River Riddle llvmlistbot at llvm.org
Thu Feb 27 17:53:48 PST 2020


Author: Matthias Kramm
Date: 2020-02-27T17:53:26-08:00
New Revision: 45d522d691cc6e0edf9f2c6297eac01e978f5b3f

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

LOG: [mlir] Fix/Clarify parts of MLIR toy tutorial chapter 6+7

Summary:
* add missing comma.
* remove "having to register them here" phrasing, since register it
  is what we're doing, which made the comment a bit confusing.
* remove duplicate code.
* clarify link to chapter 3, since "folder" doesn't appear in that
  chapter.

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

Added: 
    

Modified: 
    mlir/docs/Tutorials/Toy/Ch-6.md
    mlir/docs/Tutorials/Toy/Ch-7.md

Removed: 
    


################################################################################
diff  --git a/mlir/docs/Tutorials/Toy/Ch-6.md b/mlir/docs/Tutorials/Toy/Ch-6.md
index bfca5c9210b4..0444d2a7690a 100644
--- a/mlir/docs/Tutorials/Toy/Ch-6.md
+++ b/mlir/docs/Tutorials/Toy/Ch-6.md
@@ -94,7 +94,7 @@ by relying on [transitive lowering](../../../getting_started/Glossary.md#transit
   mlir::populateLoopToStdConversionPatterns(patterns, &getContext());
   mlir::populateStdToLLVMConversionPatterns(typeConverter, patterns);
 
-  // The only remaining operation to lower from the `toy` dialect, is the
+  // The only remaining operation, to lower from the `toy` dialect, is the
   // PrintOp.
   patterns.insert<PrintOpLowering>(&getContext());
 ```

diff  --git a/mlir/docs/Tutorials/Toy/Ch-7.md b/mlir/docs/Tutorials/Toy/Ch-7.md
index 64febd4c02c2..75ef4cc5cead 100644
--- a/mlir/docs/Tutorials/Toy/Ch-7.md
+++ b/mlir/docs/Tutorials/Toy/Ch-7.md
@@ -74,7 +74,7 @@ DEFINE_SYM_KIND_RANGE(LINALG) // Linear Algebra Dialect
 DEFINE_SYM_KIND_RANGE(TOY)    // Toy language (tutorial) Dialect
 
 // The following ranges are reserved for experimenting with MLIR dialects in a
-// private context without having to register them here.
+// private context.
 DEFINE_SYM_KIND_RANGE(PRIVATE_EXPERIMENTAL_0)
 ```
 
@@ -401,9 +401,7 @@ that contains a set of constant values for each of the `struct` elements.
 This new operation materializes the Nth element of a `struct` value.
 
 ```mlir
-  %0 = toy.struct_constant [
-    dense<[[1.0, 2.0, 3.0], [4.0, 5.0, 6.0]]> : tensor<2x3xf64>
-  ] : !toy.struct<tensor<*xf64>>
+  // Using %0 from above
   %1 = toy.struct_access %0[0] : !toy.struct<tensor<*xf64>> -> tensor<*xf64>
 ```
 
@@ -481,9 +479,10 @@ module {
 ```
 
 We have several `toy.struct_access` operations that access into a
-`toy.struct_constant`. As detailed in [chapter 3](Ch-3.md), we can add folders
-for these `toy` operations by setting the `hasFolder` bit on the operation
-definition and providing a definition of the `*Op::fold` method.
+`toy.struct_constant`. As detailed in [chapter 3](Ch-3.md) (FoldConstantReshape),
+we can add folders for these `toy` operations by setting the `hasFolder` bit
+on the operation definition and providing a definition of the `*Op::fold`
+method.
 
 ```c++
 /// Fold constants.


        


More information about the Mlir-commits mailing list