[mlir][scf] Fold dim(scf.for) to dim(iter_arg)
authorMatthias Springer <springerm@google.com>
Thu, 9 Sep 2021 04:46:02 +0000 (13:46 +0900)
committerMatthias Springer <springerm@google.com>
Thu, 9 Sep 2021 04:47:13 +0000 (13:47 +0900)
commitc7d569b8f73d5f1ff03a65fb2b25d966d98c5a5f
tree14d0910d3ba0d415a605b3ef3ef5b1e712a46d7b
parente2c8fcb9d0bd33fda481f7e27cf0d6ebdde2b5b0
[mlir][scf] Fold dim(scf.for) to dim(iter_arg)

Fold dim ops of scf.for results to dim ops of the respective iter args if the loop is shape preserving.

Differential Revision: https://reviews.llvm.org/D109430
mlir/lib/Dialect/SCF/Transforms/LoopCanonicalization.cpp
mlir/test/Dialect/SCF/for-loop-canonicalization.mlir