[mlir][linalg] Enhance FoldInsertPadIntoFill to support op chain
authorLei Zhang <antiagainst@google.com>
Mon, 28 Feb 2022 21:43:03 +0000 (16:43 -0500)
committerLei Zhang <antiagainst@google.com>
Mon, 28 Feb 2022 21:51:17 +0000 (16:51 -0500)
commit96bc2233c49ba1fff67c87dd0ae2fe8a46ca49e9
tree998a1591a8019249f38724b94fe0c840bf879c2c
parent5d47332783d0421ba0da2a723354fb523eb85d0b
[mlir][linalg] Enhance FoldInsertPadIntoFill to support op chain

If we have a chain of `tensor.insert_slice` ops inserting some
`tensor.pad` op into a `linalg.fill` and ranges do not overlap,
we can also elide the `tensor.pad` later.

Reviewed By: ThomasRaoux

Differential Revision: https://reviews.llvm.org/D120446
mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp
mlir/test/Dialect/Linalg/canonicalize.mlir