[Mlir-commits] [mlir] [mlir][tensor] Enhance pack/unpack simplification for identity outer_dims_perm cases. (PR #77409)

Han-Chung Wang llvmlistbot at llvm.org
Wed Jan 10 00:15:44 PST 2024


hanhanW wrote:

> I am not sure about this change. If outer dims perm is not a permutation in the first place, would it make more sense to drop it from the op itself (i.e., by canonicalization or folding)?

Good question. I had a similar question, and I decided to add the logic to the patterns. Here is what I'm thinking. We don't force people to run canonicalization patterns or folding patterns after every passes (or using createOrFold method). A pack/unpack op with identity outer dimension permutation is a valid op. The check here is quite simple, so I think the tradeoff (about adding the logic) is acceptable.

https://github.com/llvm/llvm-project/pull/77409


More information about the Mlir-commits mailing list