mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-19 00:56:41 +00:00
Revert "[EquivClasses] Introduce members iterator-helper" (#130313)
This reverts commit 259624bf6d, as it causes a build failure.
This commit is contained in:
parent
c53e527bf8
commit
86dfd90193
@ -15,7 +15,6 @@
|
||||
#ifndef LLVM_ADT_EQUIVALENCECLASSES_H
|
||||
#define LLVM_ADT_EQUIVALENCECLASSES_H
|
||||
|
||||
#include "llvm/ADT/iterator_range.h"
|
||||
#include <cassert>
|
||||
#include <cstddef>
|
||||
#include <cstdint>
|
||||
@ -179,9 +178,6 @@ public:
|
||||
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.
|
||||
|
@ -527,8 +527,9 @@ 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 (const auto &MI : DepCands.members(LeaderI)) {
|
||||
auto PointerI = PositionMap.find(MI.getPointer());
|
||||
for (auto MI = DepCands.member_begin(LeaderI), ME = DepCands.member_end();
|
||||
MI != ME; ++MI) {
|
||||
auto PointerI = PositionMap.find(MI->getPointer());
|
||||
assert(PointerI != PositionMap.end() &&
|
||||
"pointer in equivalence class not found in PositionMap");
|
||||
for (unsigned Pointer : PointerI->second) {
|
||||
|
@ -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 : ECs.members(I))
|
||||
for (Value *M : llvm::make_range(ECs.member_begin(I), ECs.member_end()))
|
||||
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 : ECs.members(I))
|
||||
for (Value *M : llvm::make_range(ECs.member_begin(I), ECs.member_end()))
|
||||
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 : ECs.members(I)) {
|
||||
for (Value *M : llvm::make_range(ECs.member_begin(I), ECs.member_end())) {
|
||||
auto *MI = dyn_cast<Instruction>(M);
|
||||
if (!MI)
|
||||
continue;
|
||||
|
@ -7,7 +7,6 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "llvm/ADT/EquivalenceClasses.h"
|
||||
#include "gmock/gmock.h"
|
||||
#include "gtest/gtest.h"
|
||||
|
||||
using namespace llvm;
|
||||
@ -67,19 +66,6 @@ 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(1, 2, 5));
|
||||
EXPECT_THAT(EC.members(EC.end()), testing::IsEmpty());
|
||||
}
|
||||
|
||||
// Type-parameterized tests: Run the same test cases with different element
|
||||
// types.
|
||||
template <typename T> class ParameterizedTest : public testing::Test {};
|
||||
|
Loading…
x
Reference in New Issue
Block a user