This change fixes CollapsedLayoutMap for cases where the collapsed
dims are size 1. The cases where inner most dims are size 1 and
noncontiguous can be represented by the strided form and therefore can
be allowed. For such cases, the new stride should be of the next entry
in an association whose dimension is not size 1. If the next entry is
dynamic, it's not possible to decide which stride to use at compilation
time and the stride is set to dynamic.
Details
Details
- Reviewers
springerm - Commits
- rG1cddcfdc3c68: Fix CollapsedLayoutMap for dim size 1 case
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Comment Actions
nice!
mlir/lib/Dialect/MemRef/IR/MemRefOps.cpp | ||
---|---|---|
1824–1830 | Nit: I would rewrite it as follows: The result stride of a reassociation group is the stride of the last entry of the reassociation. (TODO: Should be the minimum stride in the reassociation because strides are not necessarily sorted. E.g., when using memref.transpose.) Dimensions of size 1 should be skipped, because their strides are meaningless and could have any arbitrary value. | |
1839 | Nit: add a comment: Dynamically-sized dims may turn out to be dims of size 1 at runtime, so the corresponding stride may have to be skipped. (See above comment.) Therefore, the result stride cannot be statically determined and must be dynamic. | |
mlir/test/Dialect/Tensor/bufferize.mlir | ||
384 | these must be func.func now |
Nit: I would rewrite it as follows: