diff --git a/mlir/docs/LangRef.md b/mlir/docs/LangRef.md --- a/mlir/docs/LangRef.md +++ b/mlir/docs/LangRef.md @@ -929,15 +929,14 @@ ``` memref-type ::= ranked-memref-type | unranked-memref-type -ranked-memref-type ::= `memref` `<` dimension-list-ranked tensor-memref-element-type +ranked-memref-type ::= `memref` `<` dimension-list-ranked type (`,` layout-specification)? (`,` memory-space)? `>` -unranked-memref-type ::= `memref` `<*x` tensor-memref-element-type - (`,` memory-space)? `>` +unranked-memref-type ::= `memref` `<*x` type (`,` memory-space)? `>` stride-list ::= `[` (dimension (`,` dimension)*)? `]` strided-layout ::= `offset:` dimension `,` `strides: ` stride-list -layout-specification ::= semi-affine-map | strided-layout +layout-specification ::= semi-affine-map-composition | strided-layout memory-space ::= integer-literal /* | TODO: address-space-id */ ``` @@ -1201,10 +1200,8 @@ Syntax: ``` -tensor-type ::= `tensor` `<` dimension-list tensor-memref-element-type `>` -tensor-memref-element-type ::= vector-element-type | vector-type | complex-type +tensor-type ::= `tensor` `<` dimension-list type `>` -// memref requires a known rank, but tensor does not. dimension-list ::= dimension-list-ranked | (`*` `x`) dimension-list-ranked ::= (dimension `x`)* dimension ::= `?` | decimal-literal diff --git a/mlir/lib/Parser/TypeParser.cpp b/mlir/lib/Parser/TypeParser.cpp --- a/mlir/lib/Parser/TypeParser.cpp +++ b/mlir/lib/Parser/TypeParser.cpp @@ -181,12 +181,13 @@ /// memref-type ::= ranked-memref-type | unranked-memref-type /// /// ranked-memref-type ::= `memref` `<` dimension-list-ranked type -/// (`,` semi-affine-map-composition)? (`,` -/// memory-space)? `>` +/// (`,` layout-specification)? (`,` memory-space)? `>` /// /// unranked-memref-type ::= `memref` `<*x` type (`,` memory-space)? `>` /// -/// semi-affine-map-composition ::= (semi-affine-map `,` )* semi-affine-map +/// stride-list ::= `[` (dimension (`,` dimension)*)? `]` +/// strided-layout ::= `offset:` dimension `,` `strides: ` stride-list +/// layout-specification ::= semi-affine-map-composition | strided-layout /// memory-space ::= integer-literal /* | TODO: address-space-id */ /// Type Parser::parseMemRefType() {