[Mlir-commits] [mlir] [mlir][memref] Fix computeCollapsedLayoutMap for contiguous dynamic dim (PR #136485)
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Mon Jun 23 08:05:36 PDT 2025
github-actions[bot] wrote:
<!--LLVM CODE FORMAT COMMENT: {clang-format}-->
:warning: C/C++ code formatter, clang-format found issues in your code. :warning:
<details>
<summary>
You can test this locally with the following command:
</summary>
``````````bash
git-clang-format --diff HEAD~1 HEAD --extensions cpp -- mlir/lib/Dialect/MemRef/IR/MemRefOps.cpp
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/mlir/lib/Dialect/MemRef/IR/MemRefOps.cpp b/mlir/lib/Dialect/MemRef/IR/MemRefOps.cpp
index 28770bffc..27fd72ed9 100644
--- a/mlir/lib/Dialect/MemRef/IR/MemRefOps.cpp
+++ b/mlir/lib/Dialect/MemRef/IR/MemRefOps.cpp
@@ -2414,10 +2414,11 @@ computeCollapsedLayoutMap(MemRefType srcType,
if (!ShapedType::isDynamic(srcShape[ref.back()]) || ref.size() == 1) {
resultStrides.push_back(srcStrides[ref.back()]);
} else {
- // We reach here if the last dimension in the reassociation group is dynamic,
- // and the reassociation group has more than one dimension.
- // If the dynamic dimension is preserved (all other dimensions in the group are of size 1),
- // and the dynamic dimension is originally contiguous, the result stride will be 1.
+ // We reach here if the last dimension in the reassociation group is
+ // dynamic, and the reassociation group has more than one dimension. If
+ // the dynamic dimension is preserved (all other dimensions in the group
+ // are of size 1), and the dynamic dimension is originally contiguous, the
+ // result stride will be 1.
bool contiguousSrcDim = srcStrides[ref.back()] == 1;
bool dynamicSizeIsPreserved =
std::all_of(ref.begin(), ref.end() - 1,
``````````
</details>
https://github.com/llvm/llvm-project/pull/136485
More information about the Mlir-commits
mailing list