[mlir] support !shape.value_shape when replace WithOp in OutlineShapeComputationPass.
authorXiang Li <python3kgae@outlook.com>
Sat, 21 Jan 2023 06:50:40 +0000 (01:50 -0500)
committerXiang Li <python3kgae@outlook.com>
Tue, 24 Jan 2023 03:24:23 +0000 (22:24 -0500)
commitc3728d28821e212bd3658261e58e744421668720
treeaa88e20c10c4e98820b1a022c1e298f1fc74e914
parentf2b58eb4ad840f33caf970d6cf2906486647086b
[mlir] support !shape.value_shape when replace WithOp in OutlineShapeComputationPass.

Fixes #60069  https://github.com/llvm/llvm-project/issues/60069

In case like:
  %1 = shape.with_shape %arg1, %0 : !shape.value_shape, !shape.shape
  %2 = shape.value_of %1 : tensor<?xf32>
cannot replace %2 with %arg1.
Transform it into
  %2 = shape.value_of %arg1 : tensor<?xf32>

Differential Revision: https://reviews.llvm.org/D142275
mlir/lib/Dialect/Shape/Transforms/OutlineShapeComputation.cpp
mlir/test/Dialect/Shape/arg_with_shape.mlir [new file with mode: 0644]
mlir/test/Dialect/Shape/outline-shape-computation.mlir