[Mlir-commits] [mlir] [memref] Simplify loads from reinterpret_cast of 1D contiguous memrefs (PR #188459)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Wed Mar 25 04:06:43 PDT 2026


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 origin/main HEAD --extensions cpp -- mlir/lib/Dialect/MemRef/Transforms/ElideReinterpretCast.cpp --diff_from_common_commit
``````````

:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:

</details>

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

``````````diff
diff --git a/mlir/lib/Dialect/MemRef/Transforms/ElideReinterpretCast.cpp b/mlir/lib/Dialect/MemRef/Transforms/ElideReinterpretCast.cpp
index 9d9cda6db..49d764fc5 100644
--- a/mlir/lib/Dialect/MemRef/Transforms/ElideReinterpretCast.cpp
+++ b/mlir/lib/Dialect/MemRef/Transforms/ElideReinterpretCast.cpp
@@ -11,9 +11,9 @@
 #include "mlir/Dialect/Arith/Utils/Utils.h"
 #include "mlir/Dialect/MemRef/IR/MemRef.h"
 #include "mlir/Dialect/MemRef/Transforms/Transforms.h"
+#include "mlir/IR/Matchers.h"
 #include "mlir/IR/TypeUtilities.h"
 #include "mlir/Transforms/DialectConversion.h"
-#include "mlir/IR/Matchers.h"
 #include <cassert>
 
 namespace mlir {
@@ -196,9 +196,7 @@ public:
   }
 };
 
-static bool isConstZero(Value v) {
-  return matchPattern(v, m_Zero());
-}
+static bool isConstZero(Value v) { return matchPattern(v, m_Zero()); }
 
 static bool isPureRankReshape(memref::ReinterpretCastOp rc, memref::LoadOp op) {
   auto inputTy = cast<MemRefType>(rc.getSource().getType());

``````````

</details>


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


More information about the Mlir-commits mailing list