Add syntactic sugar for strided memref parsing.
authorNicolas Vasilache <ntv@google.com>
Thu, 3 Oct 2019 19:33:47 +0000 (12:33 -0700)
committerA. Unique TensorFlower <gardener@tensorflow.org>
Thu, 3 Oct 2019 19:34:36 +0000 (12:34 -0700)
commit218f0e611a624516da2043e9495bc6c0e2bcd8a5
tree734921e9a9dcbf32cc729bb020e7ca2291125587
parent0b93c092b620f0d70987061ad67f621b9c69925b
Add syntactic sugar for strided memref parsing.
This CL implements the last remaining bit of the [strided memref proposal](https://groups.google.com/a/tensorflow.org/forum/#!topic/mlir/MaL8m2nXuio).

The syntax is a bit more explicit than what was originally proposed and resembles:
  `memref<?x?xf32, offset: 0 strides: [?, 1]>`

Nonnegative strides and offsets are currently supported. Future extensions will include negative strides.

This also gives a concrete example of syntactic sugar for the ([RFC] Proposed Changes to MemRef and Tensor MLIR Types)[https://groups.google.com/a/tensorflow.org/forum/#!topic/mlir/-wKHANzDNTg].

The underlying implementation still uses AffineMap layout.

PiperOrigin-RevId: 272717437
14 files changed:
mlir/g3doc/LangRef.md
mlir/lib/IR/StandardTypes.cpp
mlir/lib/Parser/Parser.cpp
mlir/lib/Parser/TokenKinds.def
mlir/test/AffineOps/memref-stride-calculation.mlir
mlir/test/Dialect/Linalg/fusion-2-level.mlir
mlir/test/Dialect/Linalg/fusion.mlir
mlir/test/Dialect/Linalg/llvm.mlir
mlir/test/Dialect/Linalg/loops.mlir
mlir/test/Dialect/Linalg/promote.mlir
mlir/test/Dialect/Linalg/roundtrip.mlir
mlir/test/Dialect/Linalg/tile.mlir
mlir/test/Dialect/Linalg/tile_conv.mlir
mlir/test/IR/invalid.mlir