From: Logan Chien Date: Fri, 15 Nov 2019 21:40:33 +0000 (-0800) Subject: Fix attribute dict syntax in the docs X-Git-Tag: llvmorg-11-init~1466^2~315 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0fbac09473fba2bcd991920fc1c2efe976d0ed66;p=platform%2Fupstream%2Fllvm.git Fix attribute dict syntax in the docs This commit fixes several attribute dict syntax errors in the documentation. PiperOrigin-RevId: 280726269 --- diff --git a/mlir/g3doc/Dialects/GPU.md b/mlir/g3doc/Dialects/GPU.md index b998320..7d27e15 100644 --- a/mlir/g3doc/Dialects/GPU.md +++ b/mlir/g3doc/Dialects/GPU.md @@ -22,7 +22,7 @@ x, y, or z `dimension`. Example: ```mlir {.mlir} - %bDimX = "gpu.block_dim"() {dimension: "x"} : () -> (index) + %bDimX = "gpu.block_dim"() {dimension = "x"} : () -> (index) ``` ### `gpu.block_id` @@ -33,7 +33,7 @@ the x, y, or z `dimension`. Example: ```mlir {.mlir} - %bIdY = "gpu.block_id"() {dimension: "y"} : () -> (index) + %bIdY = "gpu.block_id"() {dimension = "y"} : () -> (index) ``` ### `gpu.grid_dim` @@ -44,7 +44,7 @@ Returns the number of thread blocks in the grid along the x, y, or z Example: ```mlir {.mlir} - %gDimZ = "gpu.grid_dim"() {dimension: "z"} : () -> (index) + %gDimZ = "gpu.grid_dim"() {dimension = "z"} : () -> (index) ``` ### `gpu.launch` @@ -148,25 +148,25 @@ module attributes {gpu.container_module} { // This module creates a separate compilation unit for the GPU compiler. module @kernels attributes {gpu.kernel_module} { func @kernel_1(%arg0 : f32, %arg1 : !llvm<"float*">) - attributes { nvvm.kernel: true } { + attributes { nvvm.kernel = true } { // Operations that produce block/thread IDs and dimensions are injected when // outlining the `gpu.launch` body to a function called by `gpu.launch_func`. - %tIdX = "gpu.thread_id"() {dimension: "x"} : () -> (index) - %tIdY = "gpu.thread_id"() {dimension: "y"} : () -> (index) - %tIdZ = "gpu.thread_id"() {dimension: "z"} : () -> (index) + %tIdX = "gpu.thread_id"() {dimension = "x"} : () -> (index) + %tIdY = "gpu.thread_id"() {dimension = "y"} : () -> (index) + %tIdZ = "gpu.thread_id"() {dimension = "z"} : () -> (index) - %bDimX = "gpu.block_dim"() {dimension: "x"} : () -> (index) - %bDimY = "gpu.block_dim"() {dimension: "y"} : () -> (index) - %bDimZ = "gpu.block_dim"() {dimension: "z"} : () -> (index) + %bDimX = "gpu.block_dim"() {dimension = "x"} : () -> (index) + %bDimY = "gpu.block_dim"() {dimension = "y"} : () -> (index) + %bDimZ = "gpu.block_dim"() {dimension = "z"} : () -> (index) - %bIdX = "gpu.block_id"() {dimension: "x"} : () -> (index) - %bIdY = "gpu.block_id"() {dimension: "y"} : () -> (index) - %bIdZ = "gpu.block_id"() {dimension: "z"} : () -> (index) + %bIdX = "gpu.block_id"() {dimension = "x"} : () -> (index) + %bIdY = "gpu.block_id"() {dimension = "y"} : () -> (index) + %bIdZ = "gpu.block_id"() {dimension = "z"} : () -> (index) - %gDimX = "gpu.grid_dim"() {dimension: "x"} : () -> (index) - %gDimY = "gpu.grid_dim"() {dimension: "y"} : () -> (index) - %gDimZ = "gpu.grid_dim"() {dimension: "z"} : () -> (index) + %gDimX = "gpu.grid_dim"() {dimension = "x"} : () -> (index) + %gDimY = "gpu.grid_dim"() {dimension = "y"} : () -> (index) + %gDimZ = "gpu.grid_dim"() {dimension = "z"} : () -> (index) "some_op"(%bx, %tx) : (index, index) -> () %42 = load %arg1[%bx] : memref @@ -190,7 +190,7 @@ along the x, y, or z `dimension`. Example: ```mlir {.mlir} - %tIdX = "gpu.thread_id"() {dimension: "x"} : () -> (index) + %tIdX = "gpu.thread_id"() {dimension = "x"} : () -> (index) ``` ### `gpu.yield` diff --git a/mlir/g3doc/Dialects/Standard.md b/mlir/g3doc/Dialects/Standard.md index 7533ccc..ed650a5 100644 --- a/mlir/g3doc/Dialects/Standard.md +++ b/mlir/g3doc/Dialects/Standard.md @@ -147,8 +147,8 @@ Examples: %y = dim %A, 1 : tensor<4 x ? x f32> // Equivalent generic form: -%x = "std.dim"(%A){index: 0} : (tensor<4 x ? x f32>) -> index -%y = "std.dim"(%A){index: 1} : (tensor<4 x ? x f32>) -> index +%x = "std.dim"(%A) {index = 0 : i64} : (tensor<4 x ? x f32>) -> index +%y = "std.dim"(%A) {index = 1 : i64} : (tensor<4 x ? x f32>) -> index ``` ## Memory Operations @@ -583,13 +583,13 @@ Examples: %x = cmpi "slt", %lhs, %rhs : i32 // Generic form of the same operation. -%x = "std.cmpi"(%lhs, %rhs){predicate: 2} : (i32, i32) -> i1 +%x = "std.cmpi"(%lhs, %rhs) {predicate = 2 : i64} : (i32, i32) -> i1 // Custom form of vector equality comparison. %x = cmpi "eq", %lhs, %rhs : vector<4xi64> // Generic form of the same operation. -%x = "std.cmpi"(%lhs, %rhs){predicate: 0} +%x = "std.cmpi"(%lhs, %rhs) {predicate = 0 : i64} : (vector<4xi64>, vector<4xi64>) -> vector<4xi1> ``` @@ -664,9 +664,9 @@ Examples: %3 = constant @myfn : (tensor<16xf32>, f32) -> tensor<16xf32> // Equivalent generic forms -%1 = "std.constant"(){value: 42} : i32 -%3 = "std.constant"(){value: @myfn} - : () -> (tensor<16xf32>, f32) -> tensor<16xf32> +%1 = "std.constant"() {value = 42 : i32} : () -> i32 +%3 = "std.constant"() {value = @myfn} + : () -> ((tensor<16xf32>, f32) -> tensor<16xf32>) ``` diff --git a/mlir/g3doc/LangRef.md b/mlir/g3doc/LangRef.md index 21fa8f8..b910446 100644 --- a/mlir/g3doc/LangRef.md +++ b/mlir/g3doc/LangRef.md @@ -1422,8 +1422,8 @@ either is the self/context or it isn't. ```mlir {.mlir} // A unit attribute defined with the `unit` value specifier. -func @verbose_form(i1 {unitAttr : unit}) +func @verbose_form(i1) attributes {unitAttr = unit} // A unit attribute can also be defined without the value specifier. -func @simple_form(i1 {unitAttr}) +func @simple_form(i1) attributes {unitAttr} ```