[mlir][linalg] Canonicalize dim ops of tiled_loop block args
authorMatthias Springer <springerm@google.com>
Thu, 19 Aug 2021 02:23:36 +0000 (11:23 +0900)
committerMatthias Springer <springerm@google.com>
Thu, 19 Aug 2021 02:24:33 +0000 (11:24 +0900)
commit08dbed8a5725087a7be71c293e4d86ca0c4c0510
tree9681bcef7e6380b9bd09b7ffaef9d72f91d59f47
parent8a3675023693093d9f00157d09dda504c999439a
[mlir][linalg] Canonicalize dim ops of tiled_loop block args

E.g.:
```
%y = ... : tensor<...>
linalg.tiled_loop ... ins(%x = %y : tensor<...>) {
  tensor.dim %x, %c0 : tensor<...>
}
```

is rewritten to:
```
%y = ... : tensor<...>
linalg.tiled_loop ... ins(%x = %y : tensor<...>) {
  tensor.dim %y, %c0 : tensor<...>
}
```

Differential Revision: https://reviews.llvm.org/D108272
mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp
mlir/test/Dialect/Linalg/canonicalize.mlir
mlir/test/Dialect/Linalg/fusion-tensor-pattern.mlir