[PATCH] D78841: [SVE] Add specialized overloads of VectorType::get

Christopher Tetreault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 27 16:12:37 PDT 2020


This revision was automatically updated to reflect the committed changes.
Closed by commit rGd52ca3d7e607: [SVE] Add specialized overloads of VectorType::get (authored by ctetreau).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D78841/new/

https://reviews.llvm.org/D78841

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
@@ -549,6 +549,10 @@
 public:
   static FixedVectorType *get(Type *ElementType, unsigned NumElts);
 
+  static FixedVectorType *get(Type *ElementType, const FixedVectorType *FVTy) {
+    return get(ElementType, FVTy->getNumElements());
+  }
+
   static bool classof(const Type *T) {
     return T->getTypeID() == FixedVectorTyID;
   }
@@ -563,6 +567,11 @@
 public:
   static ScalableVectorType *get(Type *ElementType, unsigned MinNumElts);
 
+  static ScalableVectorType *get(Type *ElementType,
+                                 const ScalableVectorType *SVTy) {
+    return get(ElementType, SVTy->getMinNumElements());
+  }
+
   /// Get the minimum number of elements in this vector. The actual number of
   /// elements in the vector is an integer multiple of this value.
   uint64_t getMinNumElements() const { return ElementQuantity; }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D78841.260492.patch
Type: text/x-patch
Size: 1031 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200427/2ecd3037/attachment.bin>


More information about the llvm-commits mailing list