Skip to content

Commit 93e8cd2

Browse files
committed
[IR] Remove NumElements tracking from GEP type iterator
After ed0cdb2, this is no longer used by anything, and shouldn't be used by anything.
1 parent 0731f6b commit 93e8cd2

File tree

1 file changed

+3
-19
lines changed

1 file changed

+3
-19
lines changed

llvm/include/llvm/IR/GetElementPtrTypeIterator.h

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,6 @@ class generic_gep_type_iterator {
3232

3333
ItTy OpIt;
3434
PointerUnion<StructType *, Type *> CurTy;
35-
enum : uint64_t { Unbounded = -1ull };
36-
uint64_t NumElements = Unbounded;
3735

3836
generic_gep_type_iterator() = default;
3937

@@ -79,16 +77,11 @@ class generic_gep_type_iterator {
7977

8078
generic_gep_type_iterator &operator++() { // Preincrement
8179
Type *Ty = getIndexedType();
82-
if (auto *ATy = dyn_cast<ArrayType>(Ty)) {
80+
if (auto *ATy = dyn_cast<ArrayType>(Ty))
8381
CurTy = ATy->getElementType();
84-
NumElements = ATy->getNumElements();
85-
} else if (auto *VTy = dyn_cast<VectorType>(Ty)) {
82+
else if (auto *VTy = dyn_cast<VectorType>(Ty))
8683
CurTy = VTy->getElementType();
87-
if (isa<ScalableVectorType>(VTy))
88-
NumElements = Unbounded;
89-
else
90-
NumElements = cast<FixedVectorType>(VTy)->getNumElements();
91-
} else
84+
else
9285
CurTy = dyn_cast<StructType>(Ty);
9386
++OpIt;
9487
return *this;
@@ -123,15 +116,6 @@ class generic_gep_type_iterator {
123116
StructType *getStructTypeOrNull() const {
124117
return CurTy.dyn_cast<StructType *>();
125118
}
126-
127-
bool isBoundedSequential() const {
128-
return isSequential() && NumElements != Unbounded;
129-
}
130-
131-
uint64_t getSequentialNumElements() const {
132-
assert(isBoundedSequential());
133-
return NumElements;
134-
}
135119
};
136120

137121
using gep_type_iterator = generic_gep_type_iterator<>;

0 commit comments

Comments
 (0)