[llvm] 49a6502 - [SVE] delete VectorType::getNumElements()
Christopher Tetreault via llvm-commits
llvm-commits at lists.llvm.org
Fri Jan 29 13:47:15 PST 2021
Author: Christopher Tetreault
Date: 2021-01-29T13:46:54-08:00
New Revision: 49a6502cd5c2361d9c6f49ae1ee36940afbdeb0a
URL: https://github.com/llvm/llvm-project/commit/49a6502cd5c2361d9c6f49ae1ee36940afbdeb0a
DIFF: https://github.com/llvm/llvm-project/commit/49a6502cd5c2361d9c6f49ae1ee36940afbdeb0a.diff
LOG: [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
Added:
Modified:
llvm/include/llvm/IR/DerivedTypes.h
Removed:
################################################################################
diff --git a/llvm/include/llvm/IR/DerivedTypes.h b/llvm/include/llvm/IR/DerivedTypes.h
index c3d97f4520e1..4c89fc089229 100644
--- a/llvm/include/llvm/IR/DerivedTypes.h
+++ b/llvm/include/llvm/IR/DerivedTypes.h
@@ -421,15 +421,6 @@ class VectorType : public Type {
VectorType(const VectorType &) = delete;
VectorType &operator=(const VectorType &) = delete;
- /// Get the number of elements in this vector. It does not make sense to call
- /// this function on a scalable vector, and this will be moved into
- /// FixedVectorType in a future commit
- LLVM_ATTRIBUTE_DEPRECATED(
- inline unsigned getNumElements() const,
- "Calling this function via a base VectorType is deprecated. Either call "
- "getElementCount() and handle the case where Scalable is true or cast to "
- "FixedVectorType.");
-
Type *getElementType() const { return ContainedType; }
/// This static method is the primary way to construct an VectorType.
@@ -532,21 +523,6 @@ class VectorType : public Type {
}
};
-unsigned VectorType::getNumElements() const {
- ElementCount EC = getElementCount();
-#ifdef STRICT_FIXED_SIZE_VECTORS
- assert(!EC.isScalable() &&
- "Request for fixed number of elements from scalable vector");
-#else
- if (EC.isScalable())
- WithColor::warning()
- << "The code that requested the fixed number of elements has made the "
- "assumption that this vector is not scalable. This assumption was "
- "not correct, and this may lead to broken code\n";
-#endif
- return EC.getKnownMinValue();
-}
-
/// Class to represent fixed width SIMD vectors
class FixedVectorType : public VectorType {
protected:
More information about the llvm-commits
mailing list