[Mlir-commits] [mlir] [MLIR][Bufferizer][NFC] Simplify some codes. (PR #77254)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Sun Jan 7 12:46: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 6e1ecd100d7663a91135b1cf6c4a603681b7385b f79452f7543462eb4f95e898d841489aa70d32a7 -- mlir/lib/Dialect/Bufferization/Transforms/BufferViewFlowAnalysis.cpp mlir/lib/Dialect/Bufferization/Transforms/EmptyTensorElimination.cpp
``````````

</details>

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

``````````diff
diff --git a/mlir/lib/Dialect/Bufferization/Transforms/BufferViewFlowAnalysis.cpp b/mlir/lib/Dialect/Bufferization/Transforms/BufferViewFlowAnalysis.cpp
index 943d96b9d5..88ef1b639f 100644
--- a/mlir/lib/Dialect/Bufferization/Transforms/BufferViewFlowAnalysis.cpp
+++ b/mlir/lib/Dialect/Bufferization/Transforms/BufferViewFlowAnalysis.cpp
@@ -49,7 +49,7 @@ void BufferViewFlowAnalysis::rename(Value from, Value to) {
   dependencies[to] = dependencies[from];
   dependencies.erase(from);
 
-  for (auto &[ _, value] : dependencies) {
+  for (auto &[_, value] : dependencies) {
     if (value.contains(from)) {
       value.insert(to);
       value.erase(from);
diff --git a/mlir/lib/Dialect/Bufferization/Transforms/EmptyTensorElimination.cpp b/mlir/lib/Dialect/Bufferization/Transforms/EmptyTensorElimination.cpp
index 78b70114fa..eba1273b36 100644
--- a/mlir/lib/Dialect/Bufferization/Transforms/EmptyTensorElimination.cpp
+++ b/mlir/lib/Dialect/Bufferization/Transforms/EmptyTensorElimination.cpp
@@ -53,9 +53,9 @@ neededValuesDominateInsertionPoint(const DominanceInfo &domInfo,
 static bool insertionPointDominatesUses(const DominanceInfo &domInfo,
                                         Operation *insertionPoint,
                                         Operation *emptyTensorOp) {
-  return llvm::all_of(
-      emptyTensorOp->getUsers(),
-      [&](Operation *user) { return domInfo.dominates(insertionPoint, user); });
+  return llvm::all_of(emptyTensorOp->getUsers(), [&](Operation *user) {
+    return domInfo.dominates(insertionPoint, user);
+  });
 }
 
 /// Find a valid insertion point for a replacement of `emptyTensorOp`, assuming

``````````

</details>


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


More information about the Mlir-commits mailing list