Skip to content

Commit 49a6502

Browse files
[SVE] delete VectorType::getNumElements()
The previously agreed-upon deprecation period for VectorType::getNumElements() has passed. This patch removes this method and completes the refactor proposed in the RFC: https://lists.llvm.org/pipermail/llvm-dev/2020-March/139811.html Reviewed By: david-arm, rjmccall Differential Revision: https://reviews.llvm.org/D95570
1 parent 9a81a4e commit 49a6502

File tree

1 file changed

+0
-24
lines changed

1 file changed

+0
-24
lines changed

llvm/include/llvm/IR/DerivedTypes.h

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -421,15 +421,6 @@ class VectorType : public Type {
421421
VectorType(const VectorType &) = delete;
422422
VectorType &operator=(const VectorType &) = delete;
423423

424-
/// Get the number of elements in this vector. It does not make sense to call
425-
/// this function on a scalable vector, and this will be moved into
426-
/// FixedVectorType in a future commit
427-
LLVM_ATTRIBUTE_DEPRECATED(
428-
inline unsigned getNumElements() const,
429-
"Calling this function via a base VectorType is deprecated. Either call "
430-
"getElementCount() and handle the case where Scalable is true or cast to "
431-
"FixedVectorType.");
432-
433424
Type *getElementType() const { return ContainedType; }
434425

435426
/// This static method is the primary way to construct an VectorType.
@@ -532,21 +523,6 @@ class VectorType : public Type {
532523
}
533524
};
534525

535-
unsigned VectorType::getNumElements() const {
536-
ElementCount EC = getElementCount();
537-
#ifdef STRICT_FIXED_SIZE_VECTORS
538-
assert(!EC.isScalable() &&
539-
"Request for fixed number of elements from scalable vector");
540-
#else
541-
if (EC.isScalable())
542-
WithColor::warning()
543-
<< "The code that requested the fixed number of elements has made the "
544-
"assumption that this vector is not scalable. This assumption was "
545-
"not correct, and this may lead to broken code\n";
546-
#endif
547-
return EC.getKnownMinValue();
548-
}
549-
550526
/// Class to represent fixed width SIMD vectors
551527
class FixedVectorType : public VectorType {
552528
protected:

0 commit comments

Comments
 (0)