[llvm] 253a529 - [IR] Remove LLVMPointerTo intrinsic type (NFC)
Nikita Popov via llvm-commits
llvm-commits at lists.llvm.org
Thu Jul 13 01:58:57 PDT 2023
Author: Nikita Popov
Date: 2023-07-13T10:58:49+02:00
New Revision: 253a52988fe37887ba1f7741271d602083fe7dd7
URL: https://github.com/llvm/llvm-project/commit/253a52988fe37887ba1f7741271d602083fe7dd7
DIFF: https://github.com/llvm/llvm-project/commit/253a52988fe37887ba1f7741271d602083fe7dd7.diff
LOG: [IR] Remove LLVMPointerTo intrinsic type (NFC)
With opaque pointers, this is equivalent to llvm_ptr_ty. However,
this particular type was actually completely unused.
Added:
Modified:
llvm/include/llvm/IR/Intrinsics.h
llvm/include/llvm/IR/Intrinsics.td
llvm/lib/IR/Function.cpp
Removed:
################################################################################
diff --git a/llvm/include/llvm/IR/Intrinsics.h b/llvm/include/llvm/IR/Intrinsics.h
index 6ac02567c43b5b..5154b265bbc911 100644
--- a/llvm/include/llvm/IR/Intrinsics.h
+++ b/llvm/include/llvm/IR/Intrinsics.h
@@ -128,7 +128,6 @@ namespace Intrinsic {
TruncArgument,
HalfVecArgument,
SameVecWidthArgument,
- PtrToArgument,
PtrToElt,
VecOfAnyPtrsToElt,
VecElementArgument,
@@ -160,7 +159,7 @@ namespace Intrinsic {
unsigned getArgumentNumber() const {
assert(Kind == Argument || Kind == ExtendArgument ||
Kind == TruncArgument || Kind == HalfVecArgument ||
- Kind == SameVecWidthArgument || Kind == PtrToArgument ||
+ Kind == SameVecWidthArgument ||
Kind == PtrToElt || Kind == VecElementArgument ||
Kind == Subdivide2Argument || Kind == Subdivide4Argument ||
Kind == VecOfBitcastsToInt);
@@ -169,7 +168,7 @@ namespace Intrinsic {
ArgKind getArgumentKind() const {
assert(Kind == Argument || Kind == ExtendArgument ||
Kind == TruncArgument || Kind == HalfVecArgument ||
- Kind == SameVecWidthArgument || Kind == PtrToArgument ||
+ Kind == SameVecWidthArgument ||
Kind == VecElementArgument || Kind == Subdivide2Argument ||
Kind == Subdivide4Argument || Kind == VecOfBitcastsToInt);
return (ArgKind)(Argument_Info & 7);
diff --git a/llvm/include/llvm/IR/Intrinsics.td b/llvm/include/llvm/IR/Intrinsics.td
index 5f4626bd109444..2343ff52ca6e0c 100644
--- a/llvm/include/llvm/IR/Intrinsics.td
+++ b/llvm/include/llvm/IR/Intrinsics.td
@@ -294,7 +294,6 @@ def IIT_V1 : IIT_Vec<1, 28>;
def IIT_VARARG : IIT_VT<isVoid, 29>;
def IIT_HALF_VEC_ARG : IIT_Base<30>;
def IIT_SAME_VEC_WIDTH_ARG : IIT_Base<31>;
-def IIT_PTR_TO_ARG : IIT_Base<32>;
def IIT_PTR_TO_ELT : IIT_Base<33>;
def IIT_VEC_OF_ANYPTRS_TO_ELT : IIT_Base<34>;
def IIT_I128 : IIT_Int<128, 35>;
@@ -449,7 +448,6 @@ class LLVMScalarOrSameVectorWidth<int idx, LLVMType elty>
], elty.Sig);
}
-class LLVMPointerTo<int num> : LLVMMatchType<num, IIT_PTR_TO_ARG>;
class LLVMPointerToElt<int num> : LLVMMatchType<num, IIT_PTR_TO_ELT>;
class LLVMAnyPointerToElt<int num>
: LLVMMatchTypeNextArg<num, IIT_ANYPTR_TO_ELT>;
diff --git a/llvm/lib/IR/Function.cpp b/llvm/lib/IR/Function.cpp
index 17df2c73ef4d86..0986949331ce40 100644
--- a/llvm/lib/IR/Function.cpp
+++ b/llvm/lib/IR/Function.cpp
@@ -1207,12 +1207,6 @@ static void DecodeIITType(unsigned &NextElt, ArrayRef<unsigned char> Infos,
ArgInfo));
return;
}
- case IIT_PTR_TO_ARG: {
- unsigned ArgInfo = (NextElt == Infos.size() ? 0 : Infos[NextElt++]);
- OutputTable.push_back(IITDescriptor::get(IITDescriptor::PtrToArgument,
- ArgInfo));
- return;
- }
case IIT_PTR_TO_ELT: {
unsigned ArgInfo = (NextElt == Infos.size() ? 0 : Infos[NextElt++]);
OutputTable.push_back(IITDescriptor::get(IITDescriptor::PtrToElt, ArgInfo));
@@ -1390,10 +1384,6 @@ static Type *DecodeFixedType(ArrayRef<Intrinsic::IITDescriptor> &Infos,
return VectorType::get(EltTy, VTy->getElementCount());
return EltTy;
}
- case IITDescriptor::PtrToArgument: {
- Type *Ty = Tys[D.getArgumentNumber()];
- return PointerType::getUnqual(Ty);
- }
case IITDescriptor::PtrToElt: {
Type *Ty = Tys[D.getArgumentNumber()];
VectorType *VTy = dyn_cast<VectorType>(Ty);
@@ -1622,14 +1612,6 @@ static bool matchIntrinsicType(
return matchIntrinsicType(EltTy, Infos, ArgTys, DeferredChecks,
IsDeferredCheck);
}
- case IITDescriptor::PtrToArgument: {
- if (D.getArgumentNumber() >= ArgTys.size())
- return IsDeferredCheck || DeferCheck(Ty);
- Type * ReferenceType = ArgTys[D.getArgumentNumber()];
- PointerType *ThisArgType = dyn_cast<PointerType>(Ty);
- return (!ThisArgType ||
- !ThisArgType->isOpaqueOrPointeeTypeMatches(ReferenceType));
- }
case IITDescriptor::PtrToElt: {
if (D.getArgumentNumber() >= ArgTys.size())
return IsDeferredCheck || DeferCheck(Ty);
More information about the llvm-commits
mailing list