[Mlir-commits] [mlir] d66ed10 - [mlir][affine][doc] Fix example snippet for AffineParallelOp. (NFC)

Ingo Müller llvmlistbot at llvm.org
Mon Jun 26 00:50:08 PDT 2023


Author: Ingo Müller
Date: 2023-06-26T07:50:05Z
New Revision: d66ed10f869865e0041a5a56a55d5d524d3d2042

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

LOG: [mlir][affine][doc] Fix example snippet for AffineParallelOp. (NFC)

There were various syntax errors; all have pretty trivial fixes but
might distract novice users (like me).

Reviewed By: ingomueller-net

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

Added: 
    

Modified: 
    mlir/include/mlir/Dialect/Affine/IR/AffineOps.td

Removed: 
    


################################################################################
diff  --git a/mlir/include/mlir/Dialect/Affine/IR/AffineOps.td b/mlir/include/mlir/Dialect/Affine/IR/AffineOps.td
index da0cc83684487..0ba7782a2645b 100644
--- a/mlir/include/mlir/Dialect/Affine/IR/AffineOps.td
+++ b/mlir/include/mlir/Dialect/Affine/IR/AffineOps.td
@@ -676,17 +676,17 @@ def AffineParallelOp : Affine_Op<"parallel",
 
     ```mlir
     func.func @conv_2d(%D : memref<100x100xf32>, %K : memref<3x3xf32>) -> (memref<98x98xf32>) {
-      %O = alloc memref<98x98xf32>
+      %O = memref.alloc() : memref<98x98xf32>
       affine.parallel (%x, %y) = (0, 0) to (98, 98) {
-        %0 = affine.parallel (%kx, %ky) = (0, 0) to (2, 2) reduce ("addf") {
+        %0 = affine.parallel (%kx, %ky) = (0, 0) to (2, 2) reduce ("addf") -> f32 {
           %1 = affine.load %D[%x + %kx, %y + %ky] : memref<100x100xf32>
           %2 = affine.load %K[%kx, %ky] : memref<3x3xf32>
           %3 = arith.mulf %1, %2 : f32
           affine.yield %3 : f32
         }
-        affine.store %0, O[%x, %y] : memref<98x98xf32>
+        affine.store %0, %O[%x, %y] : memref<98x98xf32>
       }
-      return %O
+      return %O : memref<98x98xf32>
     }
     ```
 


        


More information about the Mlir-commits mailing list