[PATCH] D80342: [SVE] Deprecate default false variant of VectorType::get
Christopher Tetreault via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Jun 11 13:14:02 PDT 2020
ctetreau updated this revision to Diff 270213.
ctetreau added a comment.
rebase
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D80342/new/
https://reviews.llvm.org/D80342
Files:
llvm/include/llvm/IR/DerivedTypes.h
Index: llvm/include/llvm/IR/DerivedTypes.h
===================================================================
--- llvm/include/llvm/IR/DerivedTypes.h
+++ llvm/include/llvm/IR/DerivedTypes.h
@@ -443,8 +443,20 @@
/// This static method is the primary way to construct an VectorType.
static VectorType *get(Type *ElementType, ElementCount EC);
+
+ /// Base class getter that specifically constructs a FixedVectorType. This
+ /// function is deprecated, and will be removed after LLVM 11 ships. Since
+ /// this always returns a FixedVectorType via a base VectorType pointer,
+ /// FixedVectorType::get(Type *, unsigned) is strictly better since no cast is
+ /// required to call getNumElements() on the result.
+ LLVM_ATTRIBUTE_DEPRECATED(
+ inline static VectorType *get(Type *ElementType, unsigned NumElements),
+ "The base class version of get with the scalable argument defaulted to "
+ "false is deprecated. Either call VectorType::get(Type *, unsigned, "
+ "bool) and pass false, or call FixedVectorType::get(Type *, unsigned).");
+
static VectorType *get(Type *ElementType, unsigned NumElements,
- bool Scalable = false) {
+ bool Scalable) {
return VectorType::get(ElementType, {NumElements, Scalable});
}
@@ -537,6 +549,10 @@
}
};
+inline VectorType *VectorType::get(Type *ElementType, unsigned NumElements) {
+ return VectorType::get(ElementType, NumElements, false);
+}
+
/// Class to represent fixed width SIMD vectors
class FixedVectorType : public VectorType {
protected:
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D80342.270213.patch
Type: text/x-patch
Size: 1588 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200611/328ace2d/attachment.bin>
More information about the llvm-commits
mailing list