[Mlir-commits] [mlir] [MLIR][MemRef]-Add basic folding for memref ViewOp (PR #146237)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Sat Jun 28 13:11:22 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 31b5a9373..4ce251d6d 100644
--- a/mlir/lib/Dialect/MemRef/IR/MemRefOps.cpp
+++ b/mlir/lib/Dialect/MemRef/IR/MemRefOps.cpp
@@ -3467,8 +3467,7 @@ OpFoldResult ViewOp::fold(FoldAdaptor adaptor) {
   MemRefType sourceMemrefType = getSource().getType();
   MemRefType resultMemrefType = getResult().getType();
 
-  if (resultMemrefType == sourceMemrefType &&
-      resultMemrefType.hasStaticShape())
+  if (resultMemrefType == sourceMemrefType && resultMemrefType.hasStaticShape())
     return getViewSource();
 
   return {};

``````````

</details>


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


More information about the Mlir-commits mailing list