Remove empty AffineExpr stride canonicalization in makeCanonicalStridedLayoutExpr
authorTres Popp <tpopp@google.com>
Fri, 29 Jul 2022 13:04:29 +0000 (15:04 +0200)
committerTres Popp <tpopp@google.com>
Mon, 1 Aug 2022 09:15:32 +0000 (11:15 +0200)
commit984d1bf8c0b9aec2ab7e2ddd1917641ed10f5428
treefd517bfa95a1209b6d95f83f89dbd9ffe3c17a00
parentfacb3ac385c3c5fc6775ea320ed2fcfeb2f595f6
Remove empty AffineExpr stride canonicalization in makeCanonicalStridedLayoutExpr

The "optimization" would replace the AffineMap for an empty shape with a 0 to represent its indexing (stride * dimension) logic. Meanwhile other pieces of core logic (such as getStridesAndOffset and makeStridedLinearLayoutMap) require strides for all dimensions to ensure no aliasing can occur which would occur if the shape was not empty. For now, this optimization is removed as different pieces of core types disagree on this, so the optimization should be caller supplied or should be consistent throughout the infrastructure.

Differential Revision: https://reviews.llvm.org/D130772
mlir/lib/IR/BuiltinTypes.cpp
mlir/test/Conversion/MemRefToLLVM/memref-to-llvm.mlir