A tensor.cast consumer can be folded with its producer. This is
beneficial only if the result of the tensor cast is more static than
the source. This patch adds a utility function to check that this is
the case, and adds a couple of canonicalizations patterns that fold an
operation with tensor.cast conusmers.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp | ||
---|---|---|
1228 | nit: typo | |
1758 | nit: has a result that is more static? | |
1788 | When reading this part of the code I first had the impression that this creates more casts than it removes and failing may be the better option? But I think the idea is that other patterns such as FoldTensorCastOp will clean up the additional casts? Would a comment and maybe a test make sense here? |
I am confused. Could it be that the last update somehow mixed this revision with https://reviews.llvm.org/D120968? At least may review comments are now mismatched...
nit: typo