[Mlir-commits] [mlir] [mlir] Introduce `trailingNDimsContiguous` for MemRefs (PR #78247)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Tue Jan 16 01:49:56 PST 2024


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 114e6d7ba02f090117f2cb1ffeb9027cf80f335b 7eaa746df865d26d541ff318d60494242eb90a8f -- mlir/include/mlir/IR/BuiltinTypes.h mlir/lib/Dialect/Vector/Utils/VectorUtils.cpp mlir/lib/IR/BuiltinTypes.cpp
``````````

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/mlir/lib/Dialect/Vector/Utils/VectorUtils.cpp b/mlir/lib/Dialect/Vector/Utils/VectorUtils.cpp
index 7e62f0bfe8..cfa4a6e93a 100644
--- a/mlir/lib/Dialect/Vector/Utils/VectorUtils.cpp
+++ b/mlir/lib/Dialect/Vector/Utils/VectorUtils.cpp
@@ -258,7 +258,7 @@ bool vector::isContiguousSlice(MemRefType memrefType, VectorType vectorType) {
   auto vecRank = vectorType.getRank();
 
   if (!trailingNDimsContiguous(memrefType, vecRank))
-      return false;
+    return false;
 
   // Extract the trailing dims and strides of the input memref
   auto memrefShape = memrefType.getShape().take_back(vecRank);
diff --git a/mlir/lib/IR/BuiltinTypes.cpp b/mlir/lib/IR/BuiltinTypes.cpp
index 795fa3e626..c6a919a905 100644
--- a/mlir/lib/IR/BuiltinTypes.cpp
+++ b/mlir/lib/IR/BuiltinTypes.cpp
@@ -971,7 +971,7 @@ bool mlir::isLastMemrefDimUnitStride(MemRefType type) {
 
 bool mlir::trailingNDimsContiguous(MemRefType type, int64_t n) {
   if (!isLastMemrefDimUnitStride(type))
-      return false;
+    return false;
 
   auto memrefShape = type.getShape().take_back(n);
   int64_t offset;

``````````

</details>


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


More information about the Mlir-commits mailing list