Skip to content

Reland [EquivClasses] Introduce members iterator-helper #130319

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 7, 2025

Conversation

artagnon
Copy link
Contributor

@artagnon artagnon commented Mar 7, 2025

Changes: Fix the expectations in EquivalenceClassesTest.MemberIterator, also fixing a build failure.

Changes: Fix the expectations in EquivalenceClassesTest.MemberIterator,
also fixing a build failure.
@artagnon artagnon requested a review from kuhar March 7, 2025 18:18
@llvmbot llvmbot added llvm:analysis Includes value tracking, cost tables and constant folding llvm:adt labels Mar 7, 2025
@llvmbot
Copy link
Member

llvmbot commented Mar 7, 2025

@llvm/pr-subscribers-llvm-analysis

Author: Ramkumar Ramachandra (artagnon)

Changes

Changes: Fix the expectations in EquivalenceClassesTest.MemberIterator, also fixing a build failure.

-- 8< --
Sorry, the CI seems to be red due to a pre-existing breakage, which partly led to confusion and the merge of the previous patch. I will rebase this when we have a CI-green base, before merging.


Full diff: https://github.com/llvm/llvm-project/pull/130319.diff

4 Files Affected:

  • (modified) llvm/include/llvm/ADT/EquivalenceClasses.h (+4)
  • (modified) llvm/lib/Analysis/LoopAccessAnalysis.cpp (+2-3)
  • (modified) llvm/lib/Analysis/VectorUtils.cpp (+3-3)
  • (modified) llvm/unittests/ADT/EquivalenceClassesTest.cpp (+14)
diff --git a/llvm/include/llvm/ADT/EquivalenceClasses.h b/llvm/include/llvm/ADT/EquivalenceClasses.h
index 4f98b84cf97d2..345107c7777b0 100644
--- a/llvm/include/llvm/ADT/EquivalenceClasses.h
+++ b/llvm/include/llvm/ADT/EquivalenceClasses.h
@@ -15,6 +15,7 @@
 #ifndef LLVM_ADT_EQUIVALENCECLASSES_H
 #define LLVM_ADT_EQUIVALENCECLASSES_H
 
+#include "llvm/ADT/iterator_range.h"
 #include <cassert>
 #include <cstddef>
 #include <cstdint>
@@ -178,6 +179,9 @@ class EquivalenceClasses {
   member_iterator member_end() const {
     return member_iterator(nullptr);
   }
+  iterator_range<member_iterator> members(iterator I) const {
+    return make_range(member_begin(I), member_end());
+  }
 
   /// findValue - Return an iterator to the specified value.  If it does not
   /// exist, end() is returned.
diff --git a/llvm/lib/Analysis/LoopAccessAnalysis.cpp b/llvm/lib/Analysis/LoopAccessAnalysis.cpp
index 38ee82b77a946..207f5417934e5 100644
--- a/llvm/lib/Analysis/LoopAccessAnalysis.cpp
+++ b/llvm/lib/Analysis/LoopAccessAnalysis.cpp
@@ -527,9 +527,8 @@ void RuntimePointerChecking::groupChecks(
     // iteration order within an equivalence class member is only dependent on
     // the order in which unions and insertions are performed on the
     // equivalence class, the iteration order is deterministic.
-    for (auto MI = DepCands.member_begin(LeaderI), ME = DepCands.member_end();
-         MI != ME; ++MI) {
-      auto PointerI = PositionMap.find(MI->getPointer());
+    for (const auto &MI : DepCands.members(LeaderI)) {
+      auto PointerI = PositionMap.find(MI.getPointer());
       assert(PointerI != PositionMap.end() &&
              "pointer in equivalence class not found in PositionMap");
       for (unsigned Pointer : PointerI->second) {
diff --git a/llvm/lib/Analysis/VectorUtils.cpp b/llvm/lib/Analysis/VectorUtils.cpp
index 91ba68fe03324..c0bc451973c6e 100644
--- a/llvm/lib/Analysis/VectorUtils.cpp
+++ b/llvm/lib/Analysis/VectorUtils.cpp
@@ -845,7 +845,7 @@ llvm::computeMinimumValueSizes(ArrayRef<BasicBlock *> Blocks, DemandedBits &DB,
 
   for (auto I = ECs.begin(), E = ECs.end(); I != E; ++I) {
     uint64_t LeaderDemandedBits = 0;
-    for (Value *M : llvm::make_range(ECs.member_begin(I), ECs.member_end()))
+    for (Value *M : ECs.members(I))
       LeaderDemandedBits |= DBits[M];
 
     uint64_t MinBW = llvm::bit_width(LeaderDemandedBits);
@@ -857,7 +857,7 @@ llvm::computeMinimumValueSizes(ArrayRef<BasicBlock *> Blocks, DemandedBits &DB,
     // indvars.
     // If we are required to shrink a PHI, abandon this entire equivalence class.
     bool Abort = false;
-    for (Value *M : llvm::make_range(ECs.member_begin(I), ECs.member_end()))
+    for (Value *M : ECs.members(I))
       if (isa<PHINode>(M) && MinBW < M->getType()->getScalarSizeInBits()) {
         Abort = true;
         break;
@@ -865,7 +865,7 @@ llvm::computeMinimumValueSizes(ArrayRef<BasicBlock *> Blocks, DemandedBits &DB,
     if (Abort)
       continue;
 
-    for (Value *M : llvm::make_range(ECs.member_begin(I), ECs.member_end())) {
+    for (Value *M : ECs.members(I)) {
       auto *MI = dyn_cast<Instruction>(M);
       if (!MI)
         continue;
diff --git a/llvm/unittests/ADT/EquivalenceClassesTest.cpp b/llvm/unittests/ADT/EquivalenceClassesTest.cpp
index 70e161a03d988..c24c09d8a2815 100644
--- a/llvm/unittests/ADT/EquivalenceClassesTest.cpp
+++ b/llvm/unittests/ADT/EquivalenceClassesTest.cpp
@@ -7,6 +7,7 @@
 //===----------------------------------------------------------------------===//
 
 #include "llvm/ADT/EquivalenceClasses.h"
+#include "gmock/gmock.h"
 #include "gtest/gtest.h"
 
 using namespace llvm;
@@ -66,6 +67,19 @@ TEST(EquivalenceClassesTest, TwoSets) {
         EXPECT_FALSE(EqClasses.isEquivalent(i, j));
 }
 
+TEST(EquivalenceClassesTest, MembersIterator) {
+  EquivalenceClasses<int> EC;
+  EC.unionSets(1, 2);
+  EC.insert(4);
+  EC.insert(5);
+  EC.unionSets(5, 1);
+  EXPECT_EQ(EC.getNumClasses(), 2u);
+
+  EquivalenceClasses<int>::iterator I = EC.findValue(EC.getLeaderValue(1));
+  EXPECT_THAT(EC.members(I), testing::ElementsAre(5, 1, 2));
+  EXPECT_EQ(EC.members(EC.end()).begin(), EC.member_end());
+}
+
 // Type-parameterized tests: Run the same test cases with different element
 // types.
 template <typename T> class ParameterizedTest : public testing::Test {};

@llvmbot
Copy link
Member

llvmbot commented Mar 7, 2025

@llvm/pr-subscribers-llvm-adt

Author: Ramkumar Ramachandra (artagnon)

Changes

Changes: Fix the expectations in EquivalenceClassesTest.MemberIterator, also fixing a build failure.

-- 8< --
Sorry, the CI seems to be red due to a pre-existing breakage, which partly led to confusion and the merge of the previous patch. I will rebase this when we have a CI-green base, before merging.


Full diff: https://github.com/llvm/llvm-project/pull/130319.diff

4 Files Affected:

  • (modified) llvm/include/llvm/ADT/EquivalenceClasses.h (+4)
  • (modified) llvm/lib/Analysis/LoopAccessAnalysis.cpp (+2-3)
  • (modified) llvm/lib/Analysis/VectorUtils.cpp (+3-3)
  • (modified) llvm/unittests/ADT/EquivalenceClassesTest.cpp (+14)
diff --git a/llvm/include/llvm/ADT/EquivalenceClasses.h b/llvm/include/llvm/ADT/EquivalenceClasses.h
index 4f98b84cf97d2..345107c7777b0 100644
--- a/llvm/include/llvm/ADT/EquivalenceClasses.h
+++ b/llvm/include/llvm/ADT/EquivalenceClasses.h
@@ -15,6 +15,7 @@
 #ifndef LLVM_ADT_EQUIVALENCECLASSES_H
 #define LLVM_ADT_EQUIVALENCECLASSES_H
 
+#include "llvm/ADT/iterator_range.h"
 #include <cassert>
 #include <cstddef>
 #include <cstdint>
@@ -178,6 +179,9 @@ class EquivalenceClasses {
   member_iterator member_end() const {
     return member_iterator(nullptr);
   }
+  iterator_range<member_iterator> members(iterator I) const {
+    return make_range(member_begin(I), member_end());
+  }
 
   /// findValue - Return an iterator to the specified value.  If it does not
   /// exist, end() is returned.
diff --git a/llvm/lib/Analysis/LoopAccessAnalysis.cpp b/llvm/lib/Analysis/LoopAccessAnalysis.cpp
index 38ee82b77a946..207f5417934e5 100644
--- a/llvm/lib/Analysis/LoopAccessAnalysis.cpp
+++ b/llvm/lib/Analysis/LoopAccessAnalysis.cpp
@@ -527,9 +527,8 @@ void RuntimePointerChecking::groupChecks(
     // iteration order within an equivalence class member is only dependent on
     // the order in which unions and insertions are performed on the
     // equivalence class, the iteration order is deterministic.
-    for (auto MI = DepCands.member_begin(LeaderI), ME = DepCands.member_end();
-         MI != ME; ++MI) {
-      auto PointerI = PositionMap.find(MI->getPointer());
+    for (const auto &MI : DepCands.members(LeaderI)) {
+      auto PointerI = PositionMap.find(MI.getPointer());
       assert(PointerI != PositionMap.end() &&
              "pointer in equivalence class not found in PositionMap");
       for (unsigned Pointer : PointerI->second) {
diff --git a/llvm/lib/Analysis/VectorUtils.cpp b/llvm/lib/Analysis/VectorUtils.cpp
index 91ba68fe03324..c0bc451973c6e 100644
--- a/llvm/lib/Analysis/VectorUtils.cpp
+++ b/llvm/lib/Analysis/VectorUtils.cpp
@@ -845,7 +845,7 @@ llvm::computeMinimumValueSizes(ArrayRef<BasicBlock *> Blocks, DemandedBits &DB,
 
   for (auto I = ECs.begin(), E = ECs.end(); I != E; ++I) {
     uint64_t LeaderDemandedBits = 0;
-    for (Value *M : llvm::make_range(ECs.member_begin(I), ECs.member_end()))
+    for (Value *M : ECs.members(I))
       LeaderDemandedBits |= DBits[M];
 
     uint64_t MinBW = llvm::bit_width(LeaderDemandedBits);
@@ -857,7 +857,7 @@ llvm::computeMinimumValueSizes(ArrayRef<BasicBlock *> Blocks, DemandedBits &DB,
     // indvars.
     // If we are required to shrink a PHI, abandon this entire equivalence class.
     bool Abort = false;
-    for (Value *M : llvm::make_range(ECs.member_begin(I), ECs.member_end()))
+    for (Value *M : ECs.members(I))
       if (isa<PHINode>(M) && MinBW < M->getType()->getScalarSizeInBits()) {
         Abort = true;
         break;
@@ -865,7 +865,7 @@ llvm::computeMinimumValueSizes(ArrayRef<BasicBlock *> Blocks, DemandedBits &DB,
     if (Abort)
       continue;
 
-    for (Value *M : llvm::make_range(ECs.member_begin(I), ECs.member_end())) {
+    for (Value *M : ECs.members(I)) {
       auto *MI = dyn_cast<Instruction>(M);
       if (!MI)
         continue;
diff --git a/llvm/unittests/ADT/EquivalenceClassesTest.cpp b/llvm/unittests/ADT/EquivalenceClassesTest.cpp
index 70e161a03d988..c24c09d8a2815 100644
--- a/llvm/unittests/ADT/EquivalenceClassesTest.cpp
+++ b/llvm/unittests/ADT/EquivalenceClassesTest.cpp
@@ -7,6 +7,7 @@
 //===----------------------------------------------------------------------===//
 
 #include "llvm/ADT/EquivalenceClasses.h"
+#include "gmock/gmock.h"
 #include "gtest/gtest.h"
 
 using namespace llvm;
@@ -66,6 +67,19 @@ TEST(EquivalenceClassesTest, TwoSets) {
         EXPECT_FALSE(EqClasses.isEquivalent(i, j));
 }
 
+TEST(EquivalenceClassesTest, MembersIterator) {
+  EquivalenceClasses<int> EC;
+  EC.unionSets(1, 2);
+  EC.insert(4);
+  EC.insert(5);
+  EC.unionSets(5, 1);
+  EXPECT_EQ(EC.getNumClasses(), 2u);
+
+  EquivalenceClasses<int>::iterator I = EC.findValue(EC.getLeaderValue(1));
+  EXPECT_THAT(EC.members(I), testing::ElementsAre(5, 1, 2));
+  EXPECT_EQ(EC.members(EC.end()).begin(), EC.member_end());
+}
+
 // Type-parameterized tests: Run the same test cases with different element
 // types.
 template <typename T> class ParameterizedTest : public testing::Test {};

Copy link
Contributor

@fhahn fhahn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks

@artagnon artagnon merged commit 21d973d into llvm:main Mar 7, 2025
12 of 14 checks passed
@artagnon artagnon deleted the equivclass-members-it-reland branch March 7, 2025 21:09
@llvm-ci
Copy link
Collaborator

llvm-ci commented Mar 7, 2025

LLVM Buildbot has detected a new failure on builder ml-opt-dev-x86-64 running on ml-opt-dev-x86-64-b2 while building llvm at step 6 "test-build-unified-tree-check-all".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/137/builds/14679

Here is the relevant piece of the build log for the reference
Step 6 (test-build-unified-tree-check-all) failure: test (failure)
******************** TEST 'LLVM-Unit :: ADT/./ADTTests/12/26' FAILED ********************
Script(shard):
--
GTEST_OUTPUT=json:/b/ml-opt-dev-x86-64-b1/build/unittests/ADT/./ADTTests-LLVM-Unit-91156-12-26.json GTEST_SHUFFLE=0 GTEST_TOTAL_SHARDS=26 GTEST_SHARD_INDEX=12 /b/ml-opt-dev-x86-64-b1/build/unittests/ADT/./ADTTests
--

Script:
--
/b/ml-opt-dev-x86-64-b1/build/unittests/ADT/./ADTTests --gtest_filter=EquivalenceClassesTest.MembersIterator
--
/b/ml-opt-dev-x86-64-b1/llvm-project/llvm/unittests/ADT/EquivalenceClassesTest.cpp:80: Failure
Expected equality of these values:
  EC.members(EC.end()).begin()
    Which is: 8-byte object <28-D4 59-EC FE-7F 00-00>
  EC.member_end()
    Which is: 8-byte object <00-00 00-00 00-00 00-00>


/b/ml-opt-dev-x86-64-b1/llvm-project/llvm/unittests/ADT/EquivalenceClassesTest.cpp:80
Expected equality of these values:
  EC.members(EC.end()).begin()
    Which is: 8-byte object <28-D4 59-EC FE-7F 00-00>
  EC.member_end()
    Which is: 8-byte object <00-00 00-00 00-00 00-00>



********************


@llvm-ci
Copy link
Collaborator

llvm-ci commented Mar 7, 2025

LLVM Buildbot has detected a new failure on builder ml-opt-devrel-x86-64 running on ml-opt-devrel-x86-64-b2 while building llvm at step 6 "test-build-unified-tree-check-all".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/175/builds/14501

Here is the relevant piece of the build log for the reference
Step 6 (test-build-unified-tree-check-all) failure: test (failure)
******************** TEST 'LLVM-Unit :: ADT/./ADTTests/12/26' FAILED ********************
Script(shard):
--
GTEST_OUTPUT=json:/b/ml-opt-devrel-x86-64-b1/build/unittests/ADT/./ADTTests-LLVM-Unit-1421065-12-26.json GTEST_SHUFFLE=0 GTEST_TOTAL_SHARDS=26 GTEST_SHARD_INDEX=12 /b/ml-opt-devrel-x86-64-b1/build/unittests/ADT/./ADTTests
--

Script:
--
/b/ml-opt-devrel-x86-64-b1/build/unittests/ADT/./ADTTests --gtest_filter=EquivalenceClassesTest.MembersIterator
--
/b/ml-opt-devrel-x86-64-b1/llvm-project/llvm/unittests/ADT/EquivalenceClassesTest.cpp:80: Failure
Expected equality of these values:
  EC.members(EC.end()).begin()
    Which is: 8-byte object <78-B5 16-82 FE-7F 00-00>
  EC.member_end()
    Which is: 8-byte object <00-00 00-00 00-00 00-00>


/b/ml-opt-devrel-x86-64-b1/llvm-project/llvm/unittests/ADT/EquivalenceClassesTest.cpp:80
Expected equality of these values:
  EC.members(EC.end()).begin()
    Which is: 8-byte object <78-B5 16-82 FE-7F 00-00>
  EC.member_end()
    Which is: 8-byte object <00-00 00-00 00-00 00-00>



********************


@llvm-ci
Copy link
Collaborator

llvm-ci commented Mar 7, 2025

LLVM Buildbot has detected a new failure on builder clang-aarch64-quick running on linaro-clang-aarch64-quick while building llvm at step 5 "ninja check 1".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/65/builds/13399

Here is the relevant piece of the build log for the reference
Step 5 (ninja check 1) failure: stage 1 checked (failure)
******************** TEST 'LLVM-Unit :: ADT/./ADTTests/67/207' FAILED ********************
Script(shard):
--
GTEST_OUTPUT=json:/home/tcwg-buildbot/worker/clang-aarch64-quick/stage1/unittests/ADT/./ADTTests-LLVM-Unit-1562986-67-207.json GTEST_SHUFFLE=0 GTEST_TOTAL_SHARDS=207 GTEST_SHARD_INDEX=67 /home/tcwg-buildbot/worker/clang-aarch64-quick/stage1/unittests/ADT/./ADTTests
--

Script:
--
/home/tcwg-buildbot/worker/clang-aarch64-quick/stage1/unittests/ADT/./ADTTests --gtest_filter=EquivalenceClassesTest.MembersIterator
--
../llvm/llvm/unittests/ADT/EquivalenceClassesTest.cpp:80: Failure
Expected equality of these values:
  EC.members(EC.end()).begin()
    Which is: 8-byte object <10-02 AC-C8 FF-FF 00-00>
  EC.member_end()
    Which is: 8-byte object <00-00 00-00 00-00 00-00>


../llvm/llvm/unittests/ADT/EquivalenceClassesTest.cpp:80
Expected equality of these values:
  EC.members(EC.end()).begin()
    Which is: 8-byte object <10-02 AC-C8 FF-FF 00-00>
  EC.member_end()
    Which is: 8-byte object <00-00 00-00 00-00 00-00>



********************


@llvm-ci
Copy link
Collaborator

llvm-ci commented Mar 7, 2025

LLVM Buildbot has detected a new failure on builder openmp-offload-sles-build-only running on rocm-worker-hw-04-sles while building llvm at step 8 "Add check check-llvm".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/140/builds/18506

Here is the relevant piece of the build log for the reference
Step 8 (Add check check-llvm) failure: test (failure)
******************** TEST 'LLVM-Unit :: ADT/./ADTTests/12/52' FAILED ********************
Script(shard):
--
GTEST_OUTPUT=json:/home/botworker/bbot/builds/openmp-offload-sles-build/llvm.build/unittests/ADT/./ADTTests-LLVM-Unit-1920373-12-52.json GTEST_SHUFFLE=0 GTEST_TOTAL_SHARDS=52 GTEST_SHARD_INDEX=12 /home/botworker/bbot/builds/openmp-offload-sles-build/llvm.build/unittests/ADT/./ADTTests
--

Script:
--
/home/botworker/bbot/builds/openmp-offload-sles-build/llvm.build/unittests/ADT/./ADTTests --gtest_filter=EquivalenceClassesTest.MembersIterator
--
/home/botworker/bbot/builds/openmp-offload-sles-build/llvm.src/llvm/unittests/ADT/EquivalenceClassesTest.cpp:80: Failure
Expected equality of these values:
  EC.members(EC.end()).begin()
    Which is: 8-byte object <68-D5 A4-68 FE-7F 00-00>
  EC.member_end()
    Which is: 8-byte object <00-00 00-00 00-00 00-00>


/home/botworker/bbot/builds/openmp-offload-sles-build/llvm.src/llvm/unittests/ADT/EquivalenceClassesTest.cpp:80
Expected equality of these values:
  EC.members(EC.end()).begin()
    Which is: 8-byte object <68-D5 A4-68 FE-7F 00-00>
  EC.member_end()
    Which is: 8-byte object <00-00 00-00 00-00 00-00>



********************


@llvm-ci
Copy link
Collaborator

llvm-ci commented Mar 7, 2025

LLVM Buildbot has detected a new failure on builder llvm-clang-x86_64-sie-win running on sie-win-worker while building llvm at step 7 "test-build-unified-tree-check-all".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/46/builds/13196

Here is the relevant piece of the build log for the reference
Step 7 (test-build-unified-tree-check-all) failure: test (failure)
******************** TEST 'LLVM-Unit :: Support/./SupportTests.exe/6/44' FAILED ********************
Script(shard):
--
GTEST_OUTPUT=json:Z:\b\llvm-clang-x86_64-sie-win\build\unittests\Support\.\SupportTests.exe-LLVM-Unit-28444-6-44.json GTEST_SHUFFLE=0 GTEST_TOTAL_SHARDS=44 GTEST_SHARD_INDEX=6 Z:\b\llvm-clang-x86_64-sie-win\build\unittests\Support\.\SupportTests.exe
--

Script:
--
Z:\b\llvm-clang-x86_64-sie-win\build\unittests\Support\.\SupportTests.exe --gtest_filter=Caching.NoCommit
--
Z:\b\llvm-clang-x86_64-sie-win\llvm-project\llvm\unittests\Support\Caching.cpp(142): error: Value of: AddStream
  Actual: false
Expected: true


Z:\b\llvm-clang-x86_64-sie-win\llvm-project\llvm\unittests\Support\Caching.cpp:142
Value of: AddStream
  Actual: false
Expected: true



********************


@llvm-ci
Copy link
Collaborator

llvm-ci commented Mar 7, 2025

LLVM Buildbot has detected a new failure on builder clang-cmake-x86_64-avx512-linux running on avx512-intel64 while building llvm at step 7 "ninja check 1".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/133/builds/12458

Here is the relevant piece of the build log for the reference
Step 7 (ninja check 1) failure: stage 1 checked (failure)
******************** TEST 'LLVM-Unit :: ADT/./ADTTests/64/104' FAILED ********************
Script(shard):
--
GTEST_OUTPUT=json:/localdisk2/buildbot/llvm-worker/clang-cmake-x86_64-avx512-linux/stage1/unittests/ADT/./ADTTests-LLVM-Unit-3264903-64-104.json GTEST_SHUFFLE=0 GTEST_TOTAL_SHARDS=104 GTEST_SHARD_INDEX=64 /localdisk2/buildbot/llvm-worker/clang-cmake-x86_64-avx512-linux/stage1/unittests/ADT/./ADTTests
--

Script:
--
/localdisk2/buildbot/llvm-worker/clang-cmake-x86_64-avx512-linux/stage1/unittests/ADT/./ADTTests --gtest_filter=EquivalenceClassesTest.MembersIterator
--
/localdisk2/buildbot/llvm-worker/clang-cmake-x86_64-avx512-linux/llvm/llvm/unittests/ADT/EquivalenceClassesTest.cpp:80: Failure
Expected equality of these values:
  EC.members(EC.end()).begin()
    Which is: 8-byte object <18-1B DF-D0 FF-7F 00-00>
  EC.member_end()
    Which is: 8-byte object <00-00 00-00 00-00 00-00>


/localdisk2/buildbot/llvm-worker/clang-cmake-x86_64-avx512-linux/llvm/llvm/unittests/ADT/EquivalenceClassesTest.cpp:80
Expected equality of these values:
  EC.members(EC.end()).begin()
    Which is: 8-byte object <18-1B DF-D0 FF-7F 00-00>
  EC.member_end()
    Which is: 8-byte object <00-00 00-00 00-00 00-00>



********************


@llvm-ci
Copy link
Collaborator

llvm-ci commented Mar 7, 2025

LLVM Buildbot has detected a new failure on builder ml-opt-rel-x86-64 running on ml-opt-rel-x86-64-b2 while building llvm at step 6 "test-build-unified-tree-check-all".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/185/builds/14423

Here is the relevant piece of the build log for the reference
Step 6 (test-build-unified-tree-check-all) failure: test (failure)
******************** TEST 'LLVM-Unit :: ADT/./ADTTests/12/26' FAILED ********************
Script(shard):
--
GTEST_OUTPUT=json:/b/ml-opt-rel-x86-64-b1/build/unittests/ADT/./ADTTests-LLVM-Unit-3055046-12-26.json GTEST_SHUFFLE=0 GTEST_TOTAL_SHARDS=26 GTEST_SHARD_INDEX=12 /b/ml-opt-rel-x86-64-b1/build/unittests/ADT/./ADTTests
--

Script:
--
/b/ml-opt-rel-x86-64-b1/build/unittests/ADT/./ADTTests --gtest_filter=EquivalenceClassesTest.MembersIterator
--
/b/ml-opt-rel-x86-64-b1/llvm-project/llvm/unittests/ADT/EquivalenceClassesTest.cpp:80: Failure
Expected equality of these values:
  EC.members(EC.end()).begin()
    Which is: 8-byte object <08-57 3C-71 FD-7F 00-00>
  EC.member_end()
    Which is: 8-byte object <00-00 00-00 00-00 00-00>


/b/ml-opt-rel-x86-64-b1/llvm-project/llvm/unittests/ADT/EquivalenceClassesTest.cpp:80
Expected equality of these values:
  EC.members(EC.end()).begin()
    Which is: 8-byte object <08-57 3C-71 FD-7F 00-00>
  EC.member_end()
    Which is: 8-byte object <00-00 00-00 00-00 00-00>



********************


@llvm-ci
Copy link
Collaborator

llvm-ci commented Mar 7, 2025

LLVM Buildbot has detected a new failure on builder llvm-nvptx-nvidia-win running on as-builder-8 while building llvm at step 7 "test-build-unified-tree-check-llvm".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/54/builds/7105

Here is the relevant piece of the build log for the reference
Step 7 (test-build-unified-tree-check-llvm) failure: test (failure)
******************** TEST 'LLVM-Unit :: ADT/./ADTTests.exe/64/104' FAILED ********************
Script(shard):
--
GTEST_OUTPUT=json:C:\buildbot\as-builder-8\llvm-nvptx-nvidia-win\build\unittests\ADT\.\ADTTests.exe-LLVM-Unit-1464-64-104.json GTEST_SHUFFLE=0 GTEST_TOTAL_SHARDS=104 GTEST_SHARD_INDEX=64 C:\buildbot\as-builder-8\llvm-nvptx-nvidia-win\build\unittests\ADT\.\ADTTests.exe
--

Script:
--
C:\buildbot\as-builder-8\llvm-nvptx-nvidia-win\build\unittests\ADT\.\ADTTests.exe --gtest_filter=EquivalenceClassesTest.MembersIterator
--
C:\buildbot\as-builder-8\llvm-nvptx-nvidia-win\llvm-project\llvm\unittests\ADT\EquivalenceClassesTest.cpp(80): error: Expected equality of these values:
  EC.members(EC.end()).begin()
    Which is: 8-byte object <50-9C C2-E4 DD-01 00-00>
  EC.member_end()
    Which is: 8-byte object <00-00 00-00 00-00 00-00>


C:\buildbot\as-builder-8\llvm-nvptx-nvidia-win\llvm-project\llvm\unittests\ADT\EquivalenceClassesTest.cpp:80
Expected equality of these values:
  EC.members(EC.end()).begin()
    Which is: 8-byte object <50-9C C2-E4 DD-01 00-00>
  EC.member_end()
    Which is: 8-byte object <00-00 00-00 00-00 00-00>



********************


@ormris
Copy link
Collaborator

ormris commented Mar 7, 2025

@artagnon Hi, as the llvm-ci bot notes above, a test in this PR is failing. We would like to revert, if this will take some time to fix. We're also seeing this failure in our internal CI.

@vitalybuka
Copy link
Collaborator

@vitalybuka
Copy link
Collaborator

vitalybuka commented Mar 8, 2025

Changes: Fix the expectations in EquivalenceClassesTest.MemberIterator, also fixing a build failure.

Please include the original PR. The title says reland, but it's not clear why it was reverted.

llvm-sync bot pushed a commit to arm/arm-toolchain that referenced this pull request Mar 8, 2025
jph-13 pushed a commit to jph-13/llvm-project that referenced this pull request Mar 21, 2025
Changes: Fix the expectations in EquivalenceClassesTest.MemberIterator,
also fixing a build failure.
artagnon added a commit to artagnon/llvm-project that referenced this pull request Apr 4, 2025
Introduce members() iterator-helper to shorten the members_{begin,end}
idiom. A previous attempt of this patch was llvm#130319, which had to be
reverted due to unit-test failures when attempting to call members() on
the end iterator. In this patch, members() accepts either an ECValue or
an ElemTy, which is more inututive and doesn't suffer from the same
issue.
artagnon added a commit to artagnon/llvm-project that referenced this pull request Apr 4, 2025
Introduce members() iterator-helper to shorten the members_{begin,end}
idiom. A previous attempt of this patch was llvm#130319, which had to be
reverted due to unit-test failures when attempting to call members() on
the end iterator. In this patch, members() accepts either an ECValue or
an ElemTy, which is more inututive and doesn't suffer from the same
issue.
artagnon added a commit that referenced this pull request Apr 4, 2025
Introduce members() iterator-helper to shorten the members_{begin,end}
idiom. A previous attempt of this patch was #130319, which had to be
reverted due to unit-test failures when attempting to call members() on
the end iterator. In this patch, members() accepts either an ECValue or
an ElemTy, which is more intuitive and doesn't suffer from the same
issue.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
llvm:adt llvm:analysis Includes value tracking, cost tables and constant folding
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants