[Mlir-commits] [mlir] [MLIR][Presburger] Implement PresburgerSpace::mergeAndAlignVarKind (PR #76397)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Sat Dec 30 23:12:32 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 b8e4053c062f168db9e3cf8ad34291027a41783d 293644ebc223a71a8f8da948d669f65e67ef9978 -- mlir/include/mlir/Analysis/Presburger/PresburgerSpace.h mlir/lib/Analysis/Presburger/PresburgerSpace.cpp mlir/unittests/Analysis/Presburger/PresburgerSpaceTest.cpp
``````````

</details>

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

``````````diff
diff --git a/mlir/lib/Analysis/Presburger/PresburgerSpace.cpp b/mlir/lib/Analysis/Presburger/PresburgerSpace.cpp
index f11747b581..a6f9af83b9 100644
--- a/mlir/lib/Analysis/Presburger/PresburgerSpace.cpp
+++ b/mlir/lib/Analysis/Presburger/PresburgerSpace.cpp
@@ -303,11 +303,13 @@ void PresburgerSpace::mergeAndAlignSymbols(PresburgerSpace &other) {
   unsigned i = 0;
   for (const Identifier *identifier =
            identifiers.begin() + getVarKindOffset(VarKind::Symbol);
-       identifier != identifiers.begin() + getVarKindEnd(VarKind::Symbol); identifier++) {
+       identifier != identifiers.begin() + getVarKindEnd(VarKind::Symbol);
+       identifier++) {
     // If the identifier exists in `other`, then align it; otherwise insert it
     // assuming it is a new identifier. Search in `other` starting at position
     // `i` since the left of `i` is aligned.
-    auto *findEnd = other.identifiers.begin() + other.getVarKindEnd(VarKind::Symbol);
+    auto *findEnd =
+        other.identifiers.begin() + other.getVarKindEnd(VarKind::Symbol);
     auto *itr = std::find(other.identifiers.begin() + kindBeginOffset + i,
                           findEnd, *identifier);
     if (itr != findEnd) {
diff --git a/mlir/unittests/Analysis/Presburger/PresburgerSpaceTest.cpp b/mlir/unittests/Analysis/Presburger/PresburgerSpaceTest.cpp
index ceef2d6d8e..154cedcd22 100644
--- a/mlir/unittests/Analysis/Presburger/PresburgerSpaceTest.cpp
+++ b/mlir/unittests/Analysis/Presburger/PresburgerSpaceTest.cpp
@@ -252,9 +252,14 @@ TEST(PresburgerSpaceTest, mergeAndAlignSymbols) {
   EXPECT_EQ(space.getId(VarKind::Range, 2), Identifier(&identifiers[4]));
   EXPECT_EQ(3u, otherSpace.getNumDomainVars());
   EXPECT_EQ(2u, otherSpace.getNumRangeVars());
-  EXPECT_EQ(otherSpace.getId(VarKind::Domain, 0), Identifier(&otherIdentifiers[0]));
-  EXPECT_EQ(otherSpace.getId(VarKind::Domain, 1), Identifier(&otherIdentifiers[1]));
-  EXPECT_EQ(otherSpace.getId(VarKind::Domain, 2), Identifier(&otherIdentifiers[2]));
-  EXPECT_EQ(otherSpace.getId(VarKind::Range, 0), Identifier(&otherIdentifiers[3]));
-  EXPECT_EQ(otherSpace.getId(VarKind::Range, 1), Identifier(&otherIdentifiers[4]));
+  EXPECT_EQ(otherSpace.getId(VarKind::Domain, 0),
+            Identifier(&otherIdentifiers[0]));
+  EXPECT_EQ(otherSpace.getId(VarKind::Domain, 1),
+            Identifier(&otherIdentifiers[1]));
+  EXPECT_EQ(otherSpace.getId(VarKind::Domain, 2),
+            Identifier(&otherIdentifiers[2]));
+  EXPECT_EQ(otherSpace.getId(VarKind::Range, 0),
+            Identifier(&otherIdentifiers[3]));
+  EXPECT_EQ(otherSpace.getId(VarKind::Range, 1),
+            Identifier(&otherIdentifiers[4]));
 }

``````````

</details>


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


More information about the Mlir-commits mailing list