[MLIR][Shape] Make dimension an operand of `get_extent`
authorFrederik Gossen <frgossen@google.com>
Wed, 10 Jun 2020 11:43:30 +0000 (11:43 +0000)
committerFrederik Gossen <frgossen@google.com>
Wed, 10 Jun 2020 11:47:18 +0000 (11:47 +0000)
commite4184c84ca0662c73780e94763e83ec245b5a2b0
tree6bd793ac065b108a11cbae0d19ae33829abcefbe
parent97e07d0c352ca469eb07a0cb3162c2807ff1099d
[MLIR][Shape] Make dimension an operand of `get_extent`

The operation `get_extent` now accepts the dimension as an operand and is no
longer limited to constant dimensions.
A helper function facilitates the common constant use case.

Differential Revision: https://reviews.llvm.org/D81248
mlir/include/mlir/Dialect/Shape/IR/ShapeOps.td
mlir/lib/Dialect/Shape/IR/Shape.cpp
mlir/test/Dialect/Shape/canonicalize.mlir