aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Support/VirtualFileSystem.cpp
diff options
context:
space:
mode:
authorQuentin Colombet <quentin.colombet@gmail.com>2022-12-05 15:11:44 +0000
committerQuentin Colombet <quentin.colombet@gmail.com>2022-12-08 07:32:01 +0000
commit64f99842a6c03fdb57349fcaed3f4821ef612ed1 (patch)
tree534c27f14c3c9934c1dfe1e93f6f50bbc5309a9e /llvm/lib/Support/VirtualFileSystem.cpp
parentab3dd9ad532d63248f731d207afecf71b2fa5b29 (diff)
downloadllvm-64f99842a6c03fdb57349fcaed3f4821ef612ed1.zip
llvm-64f99842a6c03fdb57349fcaed3f4821ef612ed1.tar.gz
llvm-64f99842a6c03fdb57349fcaed3f4821ef612ed1.tar.bz2
[mlir][ExpandStridedMetadata] Handle collapse_shape of dim of size 1 gracefully
Collapsing dimensions of size 1 with random strides (a.k.a. non-contiguous w.r.t. collapsed dimensions) is a grey area that we'd like to clean-up. (See https://reviews.llvm.org/D136483#3909856) That said, the implementation in `memref-to-llvm` currently skips dimensions of size 1 when computing the stride of a group. While longer term we may want to clean that up, for now matches this behavior, at least in the static case. For the dynamic case, for this patch we stick to `min(group strides)`. However, if we want to handle the dynamic cases correctly while allowing non-truly-contiguous dynamic size of 1, we would need to `if-then-else` every dynamic size. In other words `min(stride_i, for all i in group and dim_i != 1)`. I didn't implement that in this patch at the moment since `memref-to-llvm` is technically broken in the general case for this. (It currently would only produce something sensible for row major tensors.) Differential Revision: https://reviews.llvm.org/D139329
Diffstat (limited to 'llvm/lib/Support/VirtualFileSystem.cpp')
0 files changed, 0 insertions, 0 deletions