Skip to content

Commit

Permalink
Fix minor typos and add missing syntax in the documentation.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 264281501
  • Loading branch information
Chintan Kaur authored and tensorflower-gardener committed Aug 20, 2019
1 parent b628194 commit 92c485a
Showing 1 changed file with 39 additions and 15 deletions.
54 changes: 39 additions & 15 deletions mlir/g3doc/LangRef.md
Expand Up @@ -940,8 +940,8 @@ function ::= `func` function-signature function-attributes? function-body?
function-signature ::= symbol-ref-id `(` argument-list `)`
(`->` function-result-type)?
argument-list ::= named-argument (`,` named-argument)* | /*empty*/
argument-list ::= type attribute-dict? (`,` type attribute-dict?)* | /*empty*/
argument-list ::= (named-argument (`,` named-argument)*) | /*empty*/
argument-list ::= (type attribute-dict? (`,` type attribute-dict?)*) | /*empty*/
named-argument ::= ssa-id `:` type attribute-dict?
function-attributes ::= `attributes` attribute-dict
Expand Down Expand Up @@ -1003,7 +1003,7 @@ it would have been legal to use them as operands to the enclosing operation.
Example:

```mlir {.mlir}
func $@accelerator_compute(i64, i1) -> i64 {
func @accelerator_compute(i64, i1) -> i64 {
^bb0(%a: i64, %cond: i1): // Code dominated by ^bb0 may refer to %a
cond_br %cond, ^bb1, ^bb2
Expand Down Expand Up @@ -1436,7 +1436,7 @@ Syntax:
``` {.ebnf}
operation ::= `dma_start` ssa-use`[`ssa-use-list`]` `,`
ssa-use`[`ssa-use-list`]` `,` ssa-use `,`
ssa-use`[`ssa-use-list`]` (`,` ssa-use, ssa-use)?
ssa-use`[`ssa-use-list`]` (`,` ssa-use `,` ssa-use)?
`:` memref-type `,` memref-type `,` memref-type
```

Expand Down Expand Up @@ -1468,8 +1468,8 @@ Example:
%tag = alloc() : memref<1 x i32, (d0) -> (d0), 4>
%idx = constant 0 : index
dma_start %src[%i, %j], %dst[%k, %l], %size, %tag[%idx] :
memref<40 x 8 x vector<16xf32>, (d0) -> (d0), 0>,
memref<2 x 4 x vector<16xf32>, (d0) -> (d0), 2>,
memref<40 x 8 x vector<16xf32>, (d0, d1) -> (d0, d1), 0>,
memref<2 x 4 x vector<16xf32>, (d0, d1) -> (d0, d1), 2>,
memref<1 x i32>, (d0) -> (d0), 4>
```

Expand All @@ -1490,7 +1490,7 @@ load/store indices.
Example:

```mlir {.mlir}
dma_wait %tag[%index], %num_elements : memref<1 x i32, (d0) -> (d0), 4>
dma_wait %tag[%idx], %size : memref<1 x i32, (d0) -> (d0), 4>
```

#### 'extract_element' operation
Expand Down Expand Up @@ -1644,6 +1644,12 @@ supported by HLO and LLVM.

#### 'addi' operation

Syntax:

``` {.ebnf}
operation ::= ssa-id `=` `addi` ssa-use `,` ssa-use `:` type
```

Examples:

```mlir {.mlir}
Expand All @@ -1664,6 +1670,12 @@ attributes.

#### 'addf' operation

Syntax:

``` {.ebnf}
operation ::= ssa-id `=` `addf` ssa-use `,` ssa-use `:` type
```

Examples:

```mlir {.mlir}
Expand Down Expand Up @@ -1694,7 +1706,7 @@ Bitwise integer and.
Syntax:

``` {.ebnf}
operation ::= ssa-id `=` `and` ssa-use, ssa-use `:` type
operation ::= ssa-id `=` `and` ssa-use `,` ssa-use `:` type
```

Examples:
Expand All @@ -1717,6 +1729,12 @@ attributes.

#### 'cmpi' operation

Syntax:

``` {.ebnf}
operation ::= ssa-id `=` `cmpi` string-literal `,` ssa-id `,` ssa-id `:` type
```

Examples:

```mlir {.mlir}
Expand All @@ -1731,7 +1749,7 @@ Examples:
// Generic form of the same operation.
%x = "std.cmpi"(%lhs, %rhs){predicate: 0}
: (vector<4xi64>, vector<4xi64> -> vector<4xi1>
: (vector<4xi64>, vector<4xi64>) -> vector<4xi1>
```

The `cmpi` operation is a generic comparison for integer-like types. Its two
Expand Down Expand Up @@ -1826,7 +1844,7 @@ value divided by -1) is TBD; do NOT assume any specific behavior.
Syntax:

``` {.ebnf}
operation ::= ssa-id `=` `divis` ssa-use, ssa-use `:` type
operation ::= ssa-id `=` `divis` ssa-use `,` ssa-use `:` type
```

Examples:
Expand Down Expand Up @@ -1859,7 +1877,7 @@ behavior.
Syntax:

``` {.ebnf}
operation ::= ssa-id `=` `diviu` ssa-use, ssa-use `:` type
operation ::= ssa-id `=` `diviu` ssa-use `,` ssa-use `:` type
```

Examples:
Expand Down Expand Up @@ -1905,6 +1923,12 @@ operation is invalid if converting to a mismatching constant dimension.

#### 'mulf' operation

Syntax:

``` {.ebnf}
operation ::= ssa-id `=` `mulf` ssa-use `,` ssa-use `:` type
```

Examples:

```mlir {.mlir}
Expand Down Expand Up @@ -1935,7 +1959,7 @@ Bitwise integer or.
Syntax:

``` {.ebnf}
operation ::= ssa-id `=` `or` ssa-use, ssa-use `:` type
operation ::= ssa-id `=` `or` ssa-use `,` ssa-use `:` type
```

Examples:
Expand Down Expand Up @@ -1967,7 +1991,7 @@ behavior.
Syntax:

``` {.ebnf}
operation ::= ssa-id `=` `remis` ssa-use, ssa-use `:` type
operation ::= ssa-id `=` `remis` ssa-use `,` ssa-use `:` type
```

Examples:
Expand Down Expand Up @@ -1999,7 +2023,7 @@ behavior.
Syntax:

``` {.ebnf}
operation ::= ssa-id `=` `remiu` ssa-use, ssa-use `:` type
operation ::= ssa-id `=` `remiu` ssa-use `,` ssa-use `:` type
```

Examples:
Expand All @@ -2025,7 +2049,7 @@ standard attributes.
Syntax:

``` {.ebnf}
operation ::= ssa-id `=` `select` ssa-use, ssa-use, ssa-use `:` type
operation ::= ssa-id `=` `select` ssa-use `,` ssa-use `,` ssa-use `:` type
```

Examples:
Expand Down

0 comments on commit 92c485a

Please sign in to comment.