iree-org / iree

A retargetable MLIR-based machine learning compiler and runtime toolkit.
http://iree.dev/
Apache License 2.0
2.86k stars 622 forks source link

[DispatchCreation] Enable bubble up extract slice for `linalg.generic` op with a single use. #19174

Closed MaheshRavishankar closed 1 week ago

MaheshRavishankar commented 1 week ago

For a linalg.generic -> tensor.extract_slice pattern where the producer has a single use, this is always good to do.

TODO: This pattern could be generalized for any LinalgOp, but not done now because of the rank-reduction slices need to fold the unit dimensions.

Fixes #19173