diff --git a/llvm/include/llvm/IR/Intrinsics.h b/llvm/include/llvm/IR/Intrinsics.h --- a/llvm/include/llvm/IR/Intrinsics.h +++ b/llvm/include/llvm/IR/Intrinsics.h @@ -128,7 +128,6 @@ TruncArgument, HalfVecArgument, SameVecWidthArgument, - PtrToElt, VecOfAnyPtrsToElt, VecElementArgument, Subdivide2Argument, @@ -136,7 +135,6 @@ VecOfBitcastsToInt, AMX, PPCQuad, - AnyPtrToElt, AArch64Svcount, } Kind; @@ -159,8 +157,7 @@ unsigned getArgumentNumber() const { assert(Kind == Argument || Kind == ExtendArgument || Kind == TruncArgument || Kind == HalfVecArgument || - Kind == SameVecWidthArgument || - Kind == PtrToElt || Kind == VecElementArgument || + Kind == SameVecWidthArgument || Kind == VecElementArgument || Kind == Subdivide2Argument || Kind == Subdivide4Argument || Kind == VecOfBitcastsToInt); return Argument_Info >> 3; @@ -174,15 +171,14 @@ return (ArgKind)(Argument_Info & 7); } - // VecOfAnyPtrsToElt and AnyPtrToElt uses both an overloaded argument (for - // address space) and a reference argument (for matching vector width and - // element types) + // VecOfAnyPtrsToElt uses both an overloaded argument (for address space) + // and a reference argument (for matching vector width and element types) unsigned getOverloadArgNumber() const { - assert(Kind == VecOfAnyPtrsToElt || Kind == AnyPtrToElt); + assert(Kind == VecOfAnyPtrsToElt); return Argument_Info >> 16; } unsigned getRefArgNumber() const { - assert(Kind == VecOfAnyPtrsToElt || Kind == AnyPtrToElt); + assert(Kind == VecOfAnyPtrsToElt); return Argument_Info & 0xFFFF; } diff --git a/llvm/include/llvm/IR/Intrinsics.td b/llvm/include/llvm/IR/Intrinsics.td --- a/llvm/include/llvm/IR/Intrinsics.td +++ b/llvm/include/llvm/IR/Intrinsics.td @@ -294,7 +294,6 @@ def IIT_VARARG : IIT_VT; def IIT_HALF_VEC_ARG : IIT_Base<30>; def IIT_SAME_VEC_WIDTH_ARG : IIT_Base<31>; -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>; def IIT_V512 : IIT_Vec<512, 36>; @@ -317,7 +316,6 @@ def IIT_V3 : IIT_Vec<3, 53>; def IIT_EXTERNREF : IIT_VT; def IIT_FUNCREF : IIT_VT; -def IIT_ANYPTR_TO_ELT : IIT_Base<56>; def IIT_I2 : IIT_Int<2, 57>; def IIT_I4 : IIT_Int<4, 58>; def IIT_AARCH64_SVCOUNT : IIT_VT; @@ -448,9 +446,6 @@ ], elty.Sig); } -class LLVMPointerToElt : LLVMMatchType; -class LLVMAnyPointerToElt - : LLVMMatchTypeNextArg; class LLVMVectorOfAnyPointersToElt : LLVMMatchTypeNextArg; class LLVMVectorElementType : LLVMMatchType; @@ -2202,13 +2197,13 @@ def int_masked_expandload: DefaultAttrsIntrinsic<[llvm_anyvector_ty], - [LLVMPointerToElt<0>, LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>, + [llvm_ptr_ty, LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>, LLVMMatchType<0>], [IntrReadMem, IntrWillReturn, NoCapture>]>; def int_masked_compressstore: DefaultAttrsIntrinsic<[], - [llvm_anyvector_ty, LLVMPointerToElt<0>, + [llvm_anyvector_ty, llvm_ptr_ty, LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>], [IntrWriteMem, IntrArgMemOnly, IntrWillReturn, NoCapture>]>; @@ -2347,7 +2342,7 @@ def int_matrix_column_major_load : DefaultAttrsIntrinsic<[llvm_anyvector_ty], - [LLVMPointerToElt<0>, llvm_anyint_ty, llvm_i1_ty, + [llvm_ptr_ty, llvm_anyint_ty, llvm_i1_ty, llvm_i32_ty, llvm_i32_ty], [IntrNoSync, IntrWillReturn, IntrArgMemOnly, IntrReadMem, NoCapture>, ImmArg>, ImmArg>, @@ -2355,7 +2350,7 @@ def int_matrix_column_major_store : DefaultAttrsIntrinsic<[], - [llvm_anyvector_ty, LLVMPointerToElt<0>, + [llvm_anyvector_ty, llvm_ptr_ty, llvm_anyint_ty, llvm_i1_ty, llvm_i32_ty, llvm_i32_ty], [IntrNoSync, IntrWillReturn, IntrArgMemOnly, IntrWriteMem, WriteOnly>, NoCapture>, diff --git a/llvm/include/llvm/IR/IntrinsicsAArch64.td b/llvm/include/llvm/IR/IntrinsicsAArch64.td --- a/llvm/include/llvm/IR/IntrinsicsAArch64.td +++ b/llvm/include/llvm/IR/IntrinsicsAArch64.td @@ -956,59 +956,53 @@ class AdvSIMD_1Vec_PredLoad_Intrinsic : DefaultAttrsIntrinsic<[llvm_anyvector_ty], - [LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>, - LLVMPointerToElt<0>], + [LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>, llvm_ptr_ty], [IntrReadMem, IntrArgMemOnly]>; class AdvSIMD_2Vec_PredLoad_Intrinsic : DefaultAttrsIntrinsic<[llvm_anyvector_ty, LLVMMatchType<0>], - [LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>, - LLVMPointerToElt<0>], + [LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>, llvm_ptr_ty], [IntrReadMem, IntrArgMemOnly]>; class AdvSIMD_3Vec_PredLoad_Intrinsic : DefaultAttrsIntrinsic<[llvm_anyvector_ty, LLVMMatchType<0>, LLVMMatchType<0>], - [LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>, - LLVMPointerToElt<0>], + [LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>, llvm_ptr_ty], [IntrReadMem, IntrArgMemOnly]>; class AdvSIMD_4Vec_PredLoad_Intrinsic : DefaultAttrsIntrinsic<[llvm_anyvector_ty, LLVMMatchType<0>, LLVMMatchType<0>, LLVMMatchType<0>], - [LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>, - LLVMPointerToElt<0>], + [LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>, llvm_ptr_ty], [IntrReadMem, IntrArgMemOnly]>; class AdvSIMD_1Vec_PredLoad_WriteFFR_Intrinsic : DefaultAttrsIntrinsic<[llvm_anyvector_ty], - [LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>, - LLVMPointerToElt<0>], + [LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>, llvm_ptr_ty], [IntrInaccessibleMemOrArgMemOnly]>; class AdvSIMD_1Vec_PredStore_Intrinsic : DefaultAttrsIntrinsic<[], [llvm_anyvector_ty, - LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>, - LLVMPointerToElt<0>], + LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>, llvm_ptr_ty], [IntrArgMemOnly, NoCapture>]>; class AdvSIMD_2Vec_PredStore_Intrinsic : DefaultAttrsIntrinsic<[], [llvm_anyvector_ty, LLVMMatchType<0>, - LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>, LLVMPointerToElt<0>], + LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>, llvm_ptr_ty], [IntrArgMemOnly, NoCapture>]>; class AdvSIMD_3Vec_PredStore_Intrinsic : DefaultAttrsIntrinsic<[], [llvm_anyvector_ty, LLVMMatchType<0>, LLVMMatchType<0>, - LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>, LLVMPointerToElt<0>], + LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>, llvm_ptr_ty], [IntrArgMemOnly, NoCapture>]>; class AdvSIMD_4Vec_PredStore_Intrinsic : DefaultAttrsIntrinsic<[], [llvm_anyvector_ty, LLVMMatchType<0>, LLVMMatchType<0>, LLVMMatchType<0>, - LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>, LLVMPointerToElt<0>], + LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>, llvm_ptr_ty], [IntrArgMemOnly, NoCapture>]>; class AdvSIMD_SVE_Index_Intrinsic @@ -1422,7 +1416,7 @@ : DefaultAttrsIntrinsic<[llvm_anyvector_ty], [ LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>, - LLVMPointerToElt<0>, + llvm_ptr_ty, LLVMScalarOrSameVectorWidth<0, llvm_i64_ty> ], [IntrReadMem, IntrArgMemOnly]>; @@ -1431,7 +1425,7 @@ : DefaultAttrsIntrinsic<[llvm_anyvector_ty], [ LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>, - LLVMPointerToElt<0>, + llvm_ptr_ty, LLVMScalarOrSameVectorWidth<0, llvm_i64_ty> ], [IntrInaccessibleMemOrArgMemOnly]>; @@ -1440,7 +1434,7 @@ : DefaultAttrsIntrinsic<[llvm_anyvector_ty], [ LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>, - LLVMPointerToElt<0>, + llvm_ptr_ty, LLVMScalarOrSameVectorWidth<0, llvm_i32_ty> ], [IntrReadMem, IntrArgMemOnly]>; @@ -1449,7 +1443,7 @@ : DefaultAttrsIntrinsic<[llvm_anyvector_ty], [ LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>, - LLVMPointerToElt<0>, + llvm_ptr_ty, LLVMScalarOrSameVectorWidth<0, llvm_i32_ty> ], [IntrInaccessibleMemOrArgMemOnly]>; @@ -1477,7 +1471,7 @@ [ llvm_anyvector_ty, LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>, - LLVMPointerToElt<0>, + llvm_ptr_ty, LLVMScalarOrSameVectorWidth<0, llvm_i64_ty> ], [IntrWriteMem, IntrArgMemOnly]>; @@ -1487,7 +1481,7 @@ [ llvm_anyvector_ty, LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>, - LLVMPointerToElt<0>, + llvm_ptr_ty, LLVMScalarOrSameVectorWidth<0, llvm_i32_ty> ], [IntrWriteMem, IntrArgMemOnly]>; diff --git a/llvm/include/llvm/IR/IntrinsicsRISCV.td b/llvm/include/llvm/IR/IntrinsicsRISCV.td --- a/llvm/include/llvm/IR/IntrinsicsRISCV.td +++ b/llvm/include/llvm/IR/IntrinsicsRISCV.td @@ -1006,7 +1006,7 @@ : DefaultAttrsIntrinsic, !add(nf, -1))), !listconcat(!listsplat(LLVMMatchType<0>, nf), - [LLVMPointerToElt<0>, llvm_anyint_ty]), + [llvm_ptr_ty, llvm_anyint_ty]), [NoCapture>, IntrReadMem]>, RISCVVIntrinsic { let VLOperand = !add(nf, 1); } @@ -1016,7 +1016,7 @@ : DefaultAttrsIntrinsic, !add(nf, -1))), !listconcat(!listsplat(LLVMMatchType<0>, nf), - [LLVMPointerToElt<0>, + [llvm_ptr_ty, LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>, llvm_anyint_ty, LLVMMatchType<1>]), [ImmArg>, NoCapture>, IntrReadMem]>, @@ -1033,7 +1033,7 @@ : DefaultAttrsIntrinsic, !add(nf, -1)), [llvm_anyint_ty]), !listconcat(!listsplat(LLVMMatchType<0>, nf), - [LLVMPointerToElt<0>, LLVMMatchType<1>]), + [llvm_ptr_ty, LLVMMatchType<1>]), [NoCapture>]>, RISCVVIntrinsic { let VLOperand = !add(nf, 1); } @@ -1046,7 +1046,7 @@ : DefaultAttrsIntrinsic, !add(nf, -1)), [llvm_anyint_ty]), !listconcat(!listsplat(LLVMMatchType<0>, nf), - [LLVMPointerToElt<0>, + [llvm_ptr_ty, LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>, LLVMMatchType<1>, LLVMMatchType<1>]), [ImmArg>, NoCapture>]>, @@ -1060,7 +1060,7 @@ : DefaultAttrsIntrinsic, !add(nf, -1))), !listconcat(!listsplat(LLVMMatchType<0>, nf), - [LLVMPointerToElt<0>, llvm_anyint_ty, LLVMMatchType<1>]), + [llvm_ptr_ty, llvm_anyint_ty, LLVMMatchType<1>]), [NoCapture>, IntrReadMem]>, RISCVVIntrinsic { let VLOperand = !add(nf, 2); } @@ -1070,7 +1070,7 @@ : DefaultAttrsIntrinsic, !add(nf, -1))), !listconcat(!listsplat(LLVMMatchType<0>, nf), - [LLVMPointerToElt<0>, + [llvm_ptr_ty, llvm_anyint_ty, LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>, LLVMMatchType<1>, LLVMMatchType<1>]), @@ -1085,7 +1085,7 @@ : DefaultAttrsIntrinsic, !add(nf, -1))), !listconcat(!listsplat(LLVMMatchType<0>, nf), - [LLVMPointerToElt<0>, llvm_anyvector_ty, llvm_anyint_ty]), + [llvm_ptr_ty, llvm_anyvector_ty, llvm_anyint_ty]), [NoCapture>, IntrReadMem]>, RISCVVIntrinsic { let VLOperand = !add(nf, 2); } @@ -1095,7 +1095,7 @@ : DefaultAttrsIntrinsic, !add(nf, -1))), !listconcat(!listsplat(LLVMMatchType<0>, nf), - [LLVMPointerToElt<0>, + [llvm_ptr_ty, llvm_anyvector_ty, LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>, llvm_anyint_ty, LLVMMatchType<2>]), @@ -1110,7 +1110,7 @@ : DefaultAttrsIntrinsic<[], !listconcat([llvm_anyvector_ty], !listsplat(LLVMMatchType<0>, !add(nf, -1)), - [LLVMPointerToElt<0>, llvm_anyint_ty]), + [llvm_ptr_ty, llvm_anyint_ty]), [NoCapture>, IntrWriteMem]>, RISCVVIntrinsic { let VLOperand = !add(nf, 1); } @@ -1120,7 +1120,7 @@ : DefaultAttrsIntrinsic<[], !listconcat([llvm_anyvector_ty], !listsplat(LLVMMatchType<0>, !add(nf, -1)), - [LLVMPointerToElt<0>, + [llvm_ptr_ty, LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>, llvm_anyint_ty]), [NoCapture>, IntrWriteMem]>, RISCVVIntrinsic { @@ -1133,7 +1133,7 @@ : DefaultAttrsIntrinsic<[], !listconcat([llvm_anyvector_ty], !listsplat(LLVMMatchType<0>, !add(nf, -1)), - [LLVMPointerToElt<0>, llvm_anyint_ty, + [llvm_ptr_ty, llvm_anyint_ty, LLVMMatchType<1>]), [NoCapture>, IntrWriteMem]>, RISCVVIntrinsic { let VLOperand = !add(nf, 2); @@ -1144,7 +1144,7 @@ : DefaultAttrsIntrinsic<[], !listconcat([llvm_anyvector_ty], !listsplat(LLVMMatchType<0>, !add(nf, -1)), - [LLVMPointerToElt<0>, llvm_anyint_ty, + [llvm_ptr_ty, llvm_anyint_ty, LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>, LLVMMatchType<1>]), [NoCapture>, IntrWriteMem]>, RISCVVIntrinsic { @@ -1157,7 +1157,7 @@ : DefaultAttrsIntrinsic<[], !listconcat([llvm_anyvector_ty], !listsplat(LLVMMatchType<0>, !add(nf, -1)), - [LLVMPointerToElt<0>, llvm_anyvector_ty, + [llvm_ptr_ty, llvm_anyvector_ty, llvm_anyint_ty]), [NoCapture>, IntrWriteMem]>, RISCVVIntrinsic { let VLOperand = !add(nf, 2); @@ -1168,7 +1168,7 @@ : DefaultAttrsIntrinsic<[], !listconcat([llvm_anyvector_ty], !listsplat(LLVMMatchType<0>, !add(nf, -1)), - [LLVMPointerToElt<0>, llvm_anyvector_ty, + [llvm_ptr_ty, llvm_anyvector_ty, LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>, llvm_anyint_ty]), [NoCapture>, IntrWriteMem]>, RISCVVIntrinsic { diff --git a/llvm/lib/IR/Function.cpp b/llvm/lib/IR/Function.cpp --- a/llvm/lib/IR/Function.cpp +++ b/llvm/lib/IR/Function.cpp @@ -1207,18 +1207,6 @@ ArgInfo)); return; } - case IIT_PTR_TO_ELT: { - unsigned ArgInfo = (NextElt == Infos.size() ? 0 : Infos[NextElt++]); - OutputTable.push_back(IITDescriptor::get(IITDescriptor::PtrToElt, ArgInfo)); - return; - } - case IIT_ANYPTR_TO_ELT: { - unsigned short ArgNo = (NextElt == Infos.size() ? 0 : Infos[NextElt++]); - unsigned short RefNo = (NextElt == Infos.size() ? 0 : Infos[NextElt++]); - OutputTable.push_back( - IITDescriptor::get(IITDescriptor::AnyPtrToElt, ArgNo, RefNo)); - return; - } case IIT_VEC_OF_ANYPTRS_TO_ELT: { unsigned short ArgNo = (NextElt == Infos.size() ? 0 : Infos[NextElt++]); unsigned short RefNo = (NextElt == Infos.size() ? 0 : Infos[NextElt++]); @@ -1384,14 +1372,6 @@ return VectorType::get(EltTy, VTy->getElementCount()); return EltTy; } - case IITDescriptor::PtrToElt: { - Type *Ty = Tys[D.getArgumentNumber()]; - VectorType *VTy = dyn_cast(Ty); - if (!VTy) - llvm_unreachable("Expected an argument of Vector Type"); - Type *EltTy = VTy->getElementType(); - return PointerType::getUnqual(EltTy); - } case IITDescriptor::VecElementArgument: { Type *Ty = Tys[D.getArgumentNumber()]; if (VectorType *VTy = dyn_cast(Ty)) @@ -1407,9 +1387,6 @@ case IITDescriptor::VecOfAnyPtrsToElt: // Return the overloaded type (which determines the pointers address space) return Tys[D.getOverloadArgNumber()]; - case IITDescriptor::AnyPtrToElt: - // Return the overloaded type (which determines the pointers address space) - return Tys[D.getOverloadArgNumber()]; } llvm_unreachable("unhandled"); } @@ -1612,42 +1589,6 @@ return matchIntrinsicType(EltTy, Infos, ArgTys, DeferredChecks, IsDeferredCheck); } - case IITDescriptor::PtrToElt: { - if (D.getArgumentNumber() >= ArgTys.size()) - return IsDeferredCheck || DeferCheck(Ty); - VectorType * ReferenceType = - dyn_cast (ArgTys[D.getArgumentNumber()]); - PointerType *ThisArgType = dyn_cast(Ty); - - if (!ThisArgType || !ReferenceType) - return true; - return !ThisArgType->isOpaqueOrPointeeTypeMatches( - ReferenceType->getElementType()); - } - case IITDescriptor::AnyPtrToElt: { - unsigned RefArgNumber = D.getRefArgNumber(); - if (RefArgNumber >= ArgTys.size()) { - if (IsDeferredCheck) - return true; - // If forward referencing, already add the pointer type and - // defer the checks for later. - ArgTys.push_back(Ty); - return DeferCheck(Ty); - } - - if (!IsDeferredCheck) { - assert(D.getOverloadArgNumber() == ArgTys.size() && - "Table consistency error"); - ArgTys.push_back(Ty); - } - - auto *ReferenceType = dyn_cast(ArgTys[RefArgNumber]); - auto *ThisArgType = dyn_cast(Ty); - if (!ThisArgType || !ReferenceType) - return true; - return !ThisArgType->isOpaqueOrPointeeTypeMatches( - ReferenceType->getElementType()); - } case IITDescriptor::VecOfAnyPtrsToElt: { unsigned RefArgNumber = D.getRefArgNumber(); if (RefArgNumber >= ArgTys.size()) {