Skip to content
Commit 7d6ef5ca authored by Gaurav Shukla's avatar Gaurav Shukla Committed by Prashant Kumar
Browse files

[mlir][tensor] Fold `tensor.cast` into `tensor.collapse_shape` op



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: default avatarGaurav Shukla <gaurav@nod-labs.com>

Reviewed By: mravishankar

Differential Revision: https://reviews.llvm.org/D130650
parent 8a61749f
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment