Skip to content

Commit 6ac330c

Browse files
committed
Revert "[SVE] Remove default-false VectorType::get"
This reverts commit 1da09b7.
1 parent a66c983 commit 6ac330c

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

llvm/include/llvm/IR/DerivedTypes.h

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -444,6 +444,17 @@ class VectorType : public Type {
444444
/// This static method is the primary way to construct an VectorType.
445445
static VectorType *get(Type *ElementType, ElementCount EC);
446446

447+
/// Base class getter that specifically constructs a FixedVectorType. This
448+
/// function is deprecated, and will be removed after LLVM 11 ships. Since
449+
/// this always returns a FixedVectorType via a base VectorType pointer,
450+
/// FixedVectorType::get(Type *, unsigned) is strictly better since no cast is
451+
/// required to call getNumElements() on the result.
452+
LLVM_ATTRIBUTE_DEPRECATED(
453+
inline static VectorType *get(Type *ElementType, unsigned NumElements),
454+
"The base class version of get with the scalable argument defaulted to "
455+
"false is deprecated. Either call VectorType::get(Type *, unsigned, "
456+
"bool) and pass false, or call FixedVectorType::get(Type *, unsigned).");
457+
447458
static VectorType *get(Type *ElementType, unsigned NumElements,
448459
bool Scalable) {
449460
return VectorType::get(ElementType, {NumElements, Scalable});
@@ -538,6 +549,10 @@ class VectorType : public Type {
538549
}
539550
};
540551

552+
inline VectorType *VectorType::get(Type *ElementType, unsigned NumElements) {
553+
return VectorType::get(ElementType, NumElements, false);
554+
}
555+
541556
/// Class to represent fixed width SIMD vectors
542557
class FixedVectorType : public VectorType {
543558
protected:

0 commit comments

Comments
 (0)