From: Dmitry Sidorov Date: Thu, 27 Oct 2022 18:06:22 +0000 (-0400) Subject: [IR] Allow typed pointers to be used in vector types X-Git-Tag: upstream/17.0.6~29295 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a97eab7d39d4c9203d8a9ff275579cf674117342;p=platform%2Fupstream%2Fllvm.git [IR] Allow typed pointers to be used in vector types Reviewed By: nikic, jcranmer-intel Differential Revision: https://reviews.llvm.org/D136768 --- diff --git a/llvm/lib/IR/Type.cpp b/llvm/lib/IR/Type.cpp index 85b658c..6676717 100644 --- a/llvm/lib/IR/Type.cpp +++ b/llvm/lib/IR/Type.cpp @@ -674,7 +674,7 @@ VectorType *VectorType::get(Type *ElementType, ElementCount EC) { bool VectorType::isValidElementType(Type *ElemTy) { return ElemTy->isIntegerTy() || ElemTy->isFloatingPointTy() || - ElemTy->isPointerTy(); + ElemTy->isPointerTy() || ElemTy->getTypeID() == TypedPointerTyID; } //===----------------------------------------------------------------------===// diff --git a/llvm/lib/IR/Value.cpp b/llvm/lib/IR/Value.cpp index 13600e3..0fc7f5f 100644 --- a/llvm/lib/IR/Value.cpp +++ b/llvm/lib/IR/Value.cpp @@ -44,7 +44,7 @@ static cl::opt UseDerefAtPointSemantics( //===----------------------------------------------------------------------===// static inline Type *checkType(Type *Ty) { assert(Ty && "Value defined with a null type: Error!"); - assert(!isa(Ty) && + assert(!isa(Ty->getScalarType()) && "Cannot have values with typed pointer types"); return Ty; }