3 Commits

Author SHA1 Message Date
Prathamesh Tagore
f397bdf5ae
[mlir][tensor] Fold consumer linalg transpose with producer tensor pack (#74206)
Partial fix to https://github.com/openxla/iree/issues/15367
2023-12-13 14:26:19 -08:00
Hanhan Wang
3cb0128d26 [mlir][tensor] Do not fold rank-reduced extract_slice into unpack op.
Differential Revision: https://reviews.llvm.org/D157927
2023-08-15 10:28:21 -07:00
Hanhan Wang
65388086e6 [mlir][tensor] Add patterns that fold ops into pack and unpack ops.
The tensor.pack ops have pad semantic, so we can fold pad + pack into
pack when

1. They have the same padding values or the pack op does not have
   padding values.
2. The pad op does not have low paddings.

The tensor.unpack ops have extract_slice semantic, so we can fold unpack
+ extract_slice into unpack when

1. All the offsets are 0s.
2. All the strides are 1s.

Reviewed By: tyb0807

Differential Revision: https://reviews.llvm.org/D141099
2023-01-11 13:51:49 -08:00