[mlir][Shape] Add a pattern to turn extract from shape_of into tensor.dim
authorBenjamin Kramer <benny.kra@googlemail.com>
Tue, 12 Oct 2021 16:01:54 +0000 (18:01 +0200)
committerBenjamin Kramer <benny.kra@googlemail.com>
Tue, 12 Oct 2021 17:09:21 +0000 (19:09 +0200)
commitf67d57c95f50fabdfa0bbd454faa564f5059d5f4
treed59bfadeaf6da3a59e24f0fd7475bb265f69f297
parent9cf995be6bb7096747710876f2f2239b4d8367a8
[mlir][Shape] Add a pattern to turn extract from shape_of into tensor.dim

If I remember correctly this wasn't done previously because dim used to
be in the memref dialect.

Differential Revision: https://reviews.llvm.org/D111651
mlir/lib/Dialect/Shape/IR/Shape.cpp
mlir/lib/Dialect/Shape/IR/ShapeCanonicalization.td
mlir/test/Dialect/Shape/canonicalize.mlir