From fb4b74ccb3bc9d4eda98e6d7c1739651f7ba4827 Mon Sep 17 00:00:00 2001 From: Jacques Pienaar Date: Wed, 14 Nov 2018 07:58:42 -0800 Subject: [PATCH] Mark mlir code snippets as being written in mlir Forgot to add these in previous change :/ PiperOrigin-RevId: 221444322 --- mlir/g3doc/MLIRForGraphAlgorithms.md | 4 ++-- mlir/g3doc/Rationale.md | 20 ++++++++++---------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/mlir/g3doc/MLIRForGraphAlgorithms.md b/mlir/g3doc/MLIRForGraphAlgorithms.md index 132aed7c0ba8..6e0b0ae38e83 100644 --- a/mlir/g3doc/MLIRForGraphAlgorithms.md +++ b/mlir/g3doc/MLIRForGraphAlgorithms.md @@ -209,7 +209,7 @@ test the dependence analysis infra in the code generator, Andy Davis wrote a simple pass that checks dependencies and emits them as "notes", allowing him to write tests like this: -``` {.mlir} +```mlir {.mlir} // RUN: mlir-opt %s -memref-dependence-check -verify mlfunc @different_memrefs() { %m.a = alloc() : memref<100xf32> @@ -243,7 +243,7 @@ with ShapeRefiner. The [MLIR Tensor Type](g3doc/LangRef.md#tensor-type) directly captures shape information, so you can have things like: -``` {.mlir} +```mlir {.mlir} %x = tf.Add %x, %y : tensor<128 x 8 x ? x f32> ``` diff --git a/mlir/g3doc/Rationale.md b/mlir/g3doc/Rationale.md index e597b27c6bb9..d84d76f8dd31 100644 --- a/mlir/g3doc/Rationale.md +++ b/mlir/g3doc/Rationale.md @@ -140,7 +140,7 @@ unknown dimension can be queried using the "dim" builtin as shown below. Example: -``` {.mlir} +```mlir {.mlir} mlfunc foo(...) { %A = alloc <8x?xf32, #lmap> (%N) ... @@ -334,7 +334,7 @@ functions and CFG functions work together. ### Non-affine control flow {#non-affine-control-flow} -``` {.mlir} +```mlir {.mlir} // A simple linear search in every row of a matrix for (i=0; i %S, i32 %key) { %ni = dim %A, 0 : memref // This loop can be parallelized @@ -410,7 +410,7 @@ for (i=0; i = 0, d1 >= 0, S3 - d0 - 1 >= 0, S4 - d1 - 1 >= 0) @@ -556,7 +556,7 @@ which is called a schedule tree. Each non-leaf node of the tree is an abstract polyhedral dimension corresponding to an abstract fused loop for each ML instruction that appears in that branch. Each leaf node is an ML Instruction. -``` {.mlir} +```mlir {.mlir} // A tiled matmul code (128x128x128) represented in schedule tree form // #map0 = (d0, d1, d2, d3, d4, d5) -> (128*d0 + d3, 128*d1 + d4, 128*d2 + d5) @@ -641,7 +641,7 @@ dimensions. Example: -``` {.mlir} +```mlir {.mlir} // read relation: two elements ( d0 <= r0 <= d0+1 ) ##aff_rel9 = (d0) -> (r0) : r0 - d0 >= 0, d0 - r0 + 1 >= 0 @@ -673,7 +673,7 @@ TODO: figure out the right syntax. Example: -``` {.mlir} +```mlir {.mlir} ##rel9 ( ) [s0] -> (r0, r1) : 0 <= r0 <= 1023, 0 <= r1 <= s0 - 1 extfunc @cblas_reduce_ffi(memref<1024 x ? x f32, #layout_map0, hbm> %M) -> f32 [ @@ -744,7 +744,7 @@ a list of statements that may also include a yield statement. Example: -``` {.mlir} +```mlir {.mlir} // Return sum of elements in 1-dimensional mref A mlfunc int32 @sum(%A : memref, %N : i32) -> (i32) { %init = 0 @@ -774,7 +774,7 @@ situation. Example: -``` {.mlir} +```mlir {.mlir} // Compute sum of half of the array mlfunc int32 @sum_half(%A, %N) { %s0 = 0