mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-26 11:16:09 +00:00

This commit folds a `tensor.cast` op into a `tensor.collapse_shape` op when following two conditions meet: 1. the `tensor.collapse_shape` op consumes result of the `tensor.cast` op. 2. `tensor.cast` op casts to a more dynamic version of the source tensor. This is added as a canonicalization pattern in `tensor.collapse_shape` op. Signed-Off-By: Gaurav Shukla <gaurav@nod-labs.com> Reviewed By: mravishankar Differential Revision: https://reviews.llvm.org/D130650