From a97eab7d39d4c9203d8a9ff275579cf674117342 Mon Sep 17 00:00:00 2001 From: Dmitry Sidorov Date: Thu, 27 Oct 2022 14:06:22 -0400 Subject: [PATCH] [IR] Allow typed pointers to be used in vector types Reviewed By: nikic, jcranmer-intel Differential Revision: https://reviews.llvm.org/D136768 --- llvm/lib/IR/Type.cpp | 2 +- llvm/lib/IR/Value.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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; } -- 2.7.4