[Mlir-commits] [mlir] [mlir][MemRef] Changed AssumeAlignment into a Pure ViewLikeOp (PR #139521)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Sat May 17 06:31:03 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/Conversion/MemRefToLLVM/MemRefToLLVM.cpp mlir/lib/Dialect/GPU/Transforms/EliminateBarriers.cpp mlir/lib/Dialect/MemRef/IR/MemRefOps.cpp mlir/lib/Dialect/MemRef/Transforms/EmulateNarrowType.cpp mlir/lib/Dialect/MemRef/Transforms/ExpandStridedMetadata.cpp
``````````

</details>

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

``````````diff
diff --git a/mlir/lib/Dialect/GPU/Transforms/EliminateBarriers.cpp b/mlir/lib/Dialect/GPU/Transforms/EliminateBarriers.cpp
index 43e04232f..912d4dc99 100644
--- a/mlir/lib/Dialect/GPU/Transforms/EliminateBarriers.cpp
+++ b/mlir/lib/Dialect/GPU/Transforms/EliminateBarriers.cpp
@@ -44,8 +44,6 @@ using namespace mlir::gpu;
 // The functions below provide interface-like verification, but are too specific
 // to barrier elimination to become interfaces.
 
-
-
 /// Returns `true` if the op is defines the parallel region that is subject to
 /// barrier synchronization.
 static bool isParallelRegionBoundary(Operation *op) {
@@ -96,7 +94,6 @@ collectEffects(Operation *op,
   if (ignoreBarriers && isa<BarrierOp>(op))
     return true;
 
-
   // Collect effect instances the operation. Note that the implementation of
   // getEffects erases all effect instances that have the type other than the
   // template parameter so we collect them first in a local buffer and then
diff --git a/mlir/lib/Dialect/MemRef/IR/MemRefOps.cpp b/mlir/lib/Dialect/MemRef/IR/MemRefOps.cpp
index 9f99035d0..82702789c 100644
--- a/mlir/lib/Dialect/MemRef/IR/MemRefOps.cpp
+++ b/mlir/lib/Dialect/MemRef/IR/MemRefOps.cpp
@@ -527,7 +527,8 @@ LogicalResult AssumeAlignmentOp::verify() {
   return success();
 }
 
-void AssumeAlignmentOp::getAsmResultNames(function_ref<void(Value, StringRef)> setNameFn) {
+void AssumeAlignmentOp::getAsmResultNames(
+    function_ref<void(Value, StringRef)> setNameFn) {
   setNameFn(getResult(), "assume_align");
 }
 
diff --git a/mlir/lib/Dialect/MemRef/Transforms/ExpandStridedMetadata.cpp b/mlir/lib/Dialect/MemRef/Transforms/ExpandStridedMetadata.cpp
index 60838696d..cfd529c46 100644
--- a/mlir/lib/Dialect/MemRef/Transforms/ExpandStridedMetadata.cpp
+++ b/mlir/lib/Dialect/MemRef/Transforms/ExpandStridedMetadata.cpp
@@ -937,12 +937,13 @@ public:
 
   LogicalResult matchAndRewrite(memref::ExtractStridedMetadataOp op,
                                 PatternRewriter &rewriter) const override {
-    auto assumeAlignmentOp = 
+    auto assumeAlignmentOp =
         op.getSource().getDefiningOp<memref::AssumeAlignmentOp>();
     if (!assumeAlignmentOp)
       return failure();
 
-    rewriter.replaceOpWithNewOp<memref::ExtractStridedMetadataOp>(op, assumeAlignmentOp.getViewSource());
+    rewriter.replaceOpWithNewOp<memref::ExtractStridedMetadataOp>(
+        op, assumeAlignmentOp.getViewSource());
     return success();
   }
 };

``````````

</details>


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


More information about the Mlir-commits mailing list