[llvm] 994d84b - [NFC] Make Type::isVectorTy call isa<VectorType>

Christopher Tetreault via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 9 14:16:01 PDT 2020


Author: Christopher Tetreault
Date: 2020-04-09T14:15:43-07:00
New Revision: 994d84b9192eba70369a4b65f0193c4545ae021b

URL: https://github.com/llvm/llvm-project/commit/994d84b9192eba70369a4b65f0193c4545ae021b
DIFF: https://github.com/llvm/llvm-project/commit/994d84b9192eba70369a4b65f0193c4545ae021b.diff

LOG: [NFC] Make Type::isVectorTy call isa<VectorType>

Reviewers: sdesmalen, efriedma, dexonsmith

Reviewed By: efriedma

Subscribers: tschuett, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D77425

Added: 
    

Modified: 
    llvm/include/llvm/IR/DerivedTypes.h
    llvm/include/llvm/IR/Type.h

Removed: 
    


################################################################################
diff  --git a/llvm/include/llvm/IR/DerivedTypes.h b/llvm/include/llvm/IR/DerivedTypes.h
index 2ddd576484b6..1ce5cedf8522 100644
--- a/llvm/include/llvm/IR/DerivedTypes.h
+++ b/llvm/include/llvm/IR/DerivedTypes.h
@@ -543,6 +543,8 @@ ElementCount Type::getVectorElementCount() const {
   return cast<VectorType>(this)->getElementCount();
 }
 
+bool Type::isVectorTy() const { return isa<VectorType>(this); }
+
 /// Class to represent pointers.
 class PointerType : public Type {
   explicit PointerType(Type *ElType, unsigned AddrSpace);

diff  --git a/llvm/include/llvm/IR/Type.h b/llvm/include/llvm/IR/Type.h
index 067c3b2a2311..79d6964e3b3e 100644
--- a/llvm/include/llvm/IR/Type.h
+++ b/llvm/include/llvm/IR/Type.h
@@ -223,7 +223,7 @@ class Type {
   bool isPtrOrPtrVectorTy() const { return getScalarType()->isPointerTy(); }
 
   /// True if this is an instance of VectorType.
-  bool isVectorTy() const { return getTypeID() == VectorTyID; }
+  inline bool isVectorTy() const;
 
   /// Return true if this type could be converted with a lossless BitCast to
   /// type 'Ty'. For example, i8* to i32*. BitCasts are valid for types of the


        


More information about the llvm-commits mailing list