[shape] Basic constant folding.
authorSean Silva <silvasean@google.com>
Fri, 24 Apr 2020 21:03:44 +0000 (14:03 -0700)
committerSean Silva <silvasean@google.com>
Fri, 24 Apr 2020 22:49:35 +0000 (15:49 -0700)
commitd1ad267a56d33c4a6556c2947c8138123cefc08d
treec11e1a2e72e56ceea9247d888f81663548992e0e
parente4a9190ad7b20a12476e3cccc30e842c0a93f1bb
[shape] Basic constant folding.

- Implement a first constant fold for shape.shape_of (more ops coming in subsequent patches)
- Implement the right builder interfaces for ShapeType and other types
- Splits shape.constant into shape.const_size and shape.const_shape which plays better with dyn_cast and building vs one polymorphic op.

Also, fix the RUN line in ops.mlir to properly verify round-tripping.
mlir/include/mlir/Dialect/Shape/IR/ShapeOps.td
mlir/lib/Dialect/Shape/IR/Shape.cpp
mlir/test/Dialect/Shape/canonicalize.mlir [new file with mode: 0644]
mlir/test/Dialect/Shape/ops.mlir