[Mlir-commits] [mlir] [MLIR][NFC] Add fast path to fused loc flattening. (PR #75312)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Wed Dec 13 02:24:31 PST 2023


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 41aa0d4690a25366a5acbd4f3cbc94ca89176dfe a980bd57a9989268293c541c825fd12ffd949173 -- mlir/lib/Transforms/Utils/FoldUtils.cpp
``````````

</details>

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

``````````diff
diff --git a/mlir/lib/Transforms/Utils/FoldUtils.cpp b/mlir/lib/Transforms/Utils/FoldUtils.cpp
index aa1e1ce017..3d61f8e97f 100644
--- a/mlir/lib/Transforms/Utils/FoldUtils.cpp
+++ b/mlir/lib/Transforms/Utils/FoldUtils.cpp
@@ -341,7 +341,8 @@ OperationFolder::tryGetOrCreateConstant(ConstantMap &uniquedConstants,
 /// metadata matter.
 static Location FlattenFusedLocationRecursively(const Location loc) {
   auto fusedLoc = dyn_cast<FusedLoc>(loc);
-  if (!fusedLoc) return loc;
+  if (!fusedLoc)
+    return loc;
 
   SetVector<Location> flattenedLocs;
   Attribute metadata = fusedLoc.getMetadata();
@@ -372,7 +373,7 @@ static Location FlattenFusedLocationRecursively(const Location loc) {
   }
 
   return FusedLoc::get(loc->getContext(), flattenedLocs.takeVector(),
-                        fusedLoc.getMetadata());
+                       fusedLoc.getMetadata());
 }
 
 void OperationFolder::appendFoldedLocation(Operation *retainedOp,

``````````

</details>


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


More information about the Mlir-commits mailing list