Skip to content

Commit 2080c3e

Browse files
committed
[IR] Make @llvm.memset prototype byte width dependent
This patch changes the type of the value argument of @llvm.memset and similar intrinsics from i8 to iN, where N is the byte width specified in data layout string. Note that the argument still has fixed type (not overloaded), but type checker will complain if the type does not match the byte width. Ideally, the type of the argument would be dependent on the address space of the pointer argument. It is easy to do this (and I did it downstream as a PoC), but since data layout string doesn't currently allow different byte widths for different address spaces, I refrained from doing it now.
1 parent 3539d10 commit 2080c3e

File tree

13 files changed

+71
-47
lines changed

13 files changed

+71
-47
lines changed

llvm/include/llvm-c/Core.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2930,7 +2930,7 @@ LLVM_C_ABI LLVMValueRef LLVMGetIntrinsicDeclaration(LLVMModuleRef Mod,
29302930
*
29312931
* @see llvm::Intrinsic::getType()
29322932
*/
2933-
LLVM_C_ABI LLVMTypeRef LLVMIntrinsicGetType(LLVMContextRef Ctx, unsigned ID,
2933+
LLVM_C_ABI LLVMTypeRef LLVMIntrinsicGetType(LLVMModuleRef Mod, unsigned ID,
29342934
LLVMTypeRef *ParamTypes,
29352935
size_t ParamCount);
29362936

llvm/include/llvm/IR/Intrinsics.h

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323

2424
namespace llvm {
2525

26+
class DataLayout;
2627
class Type;
2728
class FunctionType;
2829
class Function;
@@ -75,7 +76,7 @@ namespace Intrinsic {
7576
LLVM_ABI std::string getNameNoUnnamedTypes(ID Id, ArrayRef<Type *> Tys);
7677

7778
/// Return the function type for an intrinsic.
78-
LLVM_ABI FunctionType *getType(LLVMContext &Context, ID id,
79+
LLVM_ABI FunctionType *getType(const Module *M, ID id,
7980
ArrayRef<Type *> Tys = {});
8081

8182
/// Returns true if the intrinsic can be overloaded.
@@ -141,6 +142,7 @@ namespace Intrinsic {
141142
struct IITDescriptor {
142143
enum IITDescriptorKind {
143144
Void,
145+
Byte,
144146
VarArg,
145147
MMX,
146148
Token,
@@ -253,9 +255,9 @@ namespace Intrinsic {
253255
///
254256
/// Returns false if the given type matches with the constraints, true
255257
/// otherwise.
256-
LLVM_ABI MatchIntrinsicTypesResult
257-
matchIntrinsicSignature(FunctionType *FTy, ArrayRef<IITDescriptor> &Infos,
258-
SmallVectorImpl<Type *> &ArgTys);
258+
LLVM_ABI MatchIntrinsicTypesResult matchIntrinsicSignature(
259+
const DataLayout &DL, FunctionType *FTy, ArrayRef<IITDescriptor> &Infos,
260+
SmallVectorImpl<Type *> &ArgTys);
259261

260262
/// Verify if the intrinsic has variable arguments. This method is intended to
261263
/// be called after all the fixed arguments have been matched first.
@@ -270,7 +272,8 @@ namespace Intrinsic {
270272
///
271273
/// Returns false if the given ID and function type combination is not a
272274
/// valid intrinsic call.
273-
LLVM_ABI bool getIntrinsicSignature(Intrinsic::ID, FunctionType *FT,
275+
LLVM_ABI bool getIntrinsicSignature(const DataLayout &DL, Intrinsic::ID,
276+
FunctionType *FT,
274277
SmallVectorImpl<Type *> &ArgTys);
275278

276279
/// Same as previous, but accepts a Function instead of ID and FunctionType.

llvm/include/llvm/IR/Intrinsics.td

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,7 @@ def IIT_V1 : IIT_Vec<1, 28>;
308308
def IIT_VARARG : IIT_VT<isVoid, 29>;
309309
def IIT_ONE_NTH_ELTS_VEC_ARG : IIT_Base<30>;
310310
def IIT_SAME_VEC_WIDTH_ARG : IIT_Base<31>;
311+
def IIT_BYTE : IIT_Base<32>;
311312
def IIT_VEC_OF_ANYPTRS_TO_ELT : IIT_Base<34>;
312313
def IIT_I128 : IIT_Int<128, 35>;
313314
def IIT_V512 : IIT_Vec<512, 36>;
@@ -392,6 +393,10 @@ class LLVMType<ValueType vt> {
392393
!foreach(iit, IITs, iit.Number));
393394
}
394395

396+
class LLVMByteType : LLVMType<OtherVT> {
397+
let Sig = [IIT_BYTE.Number];
398+
}
399+
395400
class LLVMAnyType<ValueType vt> : LLVMType<vt> {
396401
let ArgCode = !cond(
397402
!eq(vt, Any) : ArgKind.Any,
@@ -497,7 +502,7 @@ class LLVMVectorOfBitcastsToInt<int num>
497502
: LLVMMatchType<num, IIT_VEC_OF_BITCASTS_TO_INT>;
498503

499504
def llvm_void_ty : LLVMType<isVoid>;
500-
505+
def llvm_byte_ty : LLVMByteType;
501506
def llvm_any_ty : LLVMAnyType<Any>;
502507
def llvm_anyint_ty : LLVMAnyType<iAny>;
503508
def llvm_anyfloat_ty : LLVMAnyType<fAny>;
@@ -1020,7 +1025,7 @@ def int_memmove : Intrinsic<[],
10201025
WriteOnly<ArgIndex<0>>, ReadOnly<ArgIndex<1>>,
10211026
ImmArg<ArgIndex<3>>]>;
10221027
def int_memset : Intrinsic<[],
1023-
[llvm_anyptr_ty, llvm_i8_ty, llvm_anyint_ty,
1028+
[llvm_anyptr_ty, llvm_byte_ty, llvm_anyint_ty,
10241029
llvm_i1_ty],
10251030
[IntrWriteMem, IntrArgMemOnly, IntrWillReturn,
10261031
IntrNoFree, IntrNoCallback,
@@ -1033,7 +1038,7 @@ def int_memset : Intrinsic<[],
10331038
// The third argument (specifying the size) must be a constant.
10341039
def int_memset_inline
10351040
: Intrinsic<[],
1036-
[llvm_anyptr_ty, llvm_i8_ty, llvm_anyint_ty, llvm_i1_ty],
1041+
[llvm_anyptr_ty, llvm_byte_ty, llvm_anyint_ty, llvm_i1_ty],
10371042
[IntrWriteMem, IntrArgMemOnly, IntrWillReturn, IntrNoFree, IntrNoCallback,
10381043
NoCapture<ArgIndex<0>>, WriteOnly<ArgIndex<0>>,
10391044
ImmArg<ArgIndex<3>>]>;
@@ -2606,7 +2611,7 @@ def int_memmove_element_unordered_atomic
26062611

26072612
// @llvm.memset.element.unordered.atomic.*(dest, value, length, elementsize)
26082613
def int_memset_element_unordered_atomic
2609-
: Intrinsic<[], [llvm_anyptr_ty, llvm_i8_ty, llvm_anyint_ty, llvm_i32_ty],
2614+
: Intrinsic<[], [llvm_anyptr_ty, llvm_byte_ty, llvm_anyint_ty, llvm_i32_ty],
26102615
[IntrWriteMem, IntrArgMemOnly, IntrWillReturn, IntrNoSync,
26112616
NoCapture<ArgIndex<0>>, WriteOnly<ArgIndex<0>>,
26122617
ImmArg<ArgIndex<3>>]>;

llvm/lib/AsmParser/LLParser.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -346,8 +346,8 @@ bool LLParser::validateEndOfModule(bool UpgradeDebugInfo) {
346346
return error(Info.second, "intrinsic can only be used as callee");
347347

348348
SmallVector<Type *> OverloadTys;
349-
if (!Intrinsic::getIntrinsicSignature(IID, CB->getFunctionType(),
350-
OverloadTys))
349+
if (!Intrinsic::getIntrinsicSignature(
350+
M->getDataLayout(), IID, CB->getFunctionType(), OverloadTys))
351351
return error(Info.second, "invalid intrinsic signature");
352352

353353
U.set(Intrinsic::getOrInsertDeclaration(M, IID, OverloadTys));

llvm/lib/IR/AutoUpgrade.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1637,7 +1637,9 @@ bool llvm::UpgradeIntrinsicFunction(Function *F, Function *&NewFn,
16371637
if (Intrinsic::ID id = F->getIntrinsicID()) {
16381638
// Only do this if the intrinsic signature is valid.
16391639
SmallVector<Type *> OverloadTys;
1640-
if (Intrinsic::getIntrinsicSignature(id, F->getFunctionType(), OverloadTys))
1640+
assert(F->getParent());
1641+
if (Intrinsic::getIntrinsicSignature(F->getDataLayout(), id,
1642+
F->getFunctionType(), OverloadTys))
16411643
F->setAttributes(
16421644
Intrinsic::getAttributes(F->getContext(), id, F->getFunctionType()));
16431645
}

llvm/lib/IR/Core.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2478,11 +2478,11 @@ const char *LLVMIntrinsicGetName(unsigned ID, size_t *NameLength) {
24782478
return Str.data();
24792479
}
24802480

2481-
LLVMTypeRef LLVMIntrinsicGetType(LLVMContextRef Ctx, unsigned ID,
2481+
LLVMTypeRef LLVMIntrinsicGetType(LLVMModuleRef Mod, unsigned ID,
24822482
LLVMTypeRef *ParamTypes, size_t ParamCount) {
24832483
auto IID = llvm_map_to_intrinsic_id(ID);
24842484
ArrayRef<Type*> Tys(unwrap(ParamTypes), ParamCount);
2485-
return wrap(llvm::Intrinsic::getType(*unwrap(Ctx), IID, Tys));
2485+
return wrap(llvm::Intrinsic::getType(unwrap(Mod), IID, Tys));
24862486
}
24872487

24882488
char *LLVMIntrinsicCopyOverloadedName(unsigned ID, LLVMTypeRef *ParamTypes,

llvm/lib/IR/Function.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -507,7 +507,9 @@ Function::Function(FunctionType *Ty, LinkageTypes Linkage, unsigned AddrSpace,
507507
// Don't set the attributes if the intrinsic signature is invalid. This
508508
// case will either be auto-upgraded or fail verification.
509509
SmallVector<Type *> OverloadTys;
510-
if (!Intrinsic::getIntrinsicSignature(IntID, Ty, OverloadTys))
510+
assert(ParentModule);
511+
if (!Intrinsic::getIntrinsicSignature(ParentModule->getDataLayout(), IntID,
512+
Ty, OverloadTys))
511513
return;
512514

513515
setAttributes(Intrinsic::getAttributes(getContext(), IntID, Ty));

llvm/lib/IR/IRBuilder.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -870,7 +870,7 @@ CallInst *IRBuilderBase::CreateIntrinsic(Type *RetTy, Intrinsic::ID ID,
870870
FunctionType *FTy = FunctionType::get(RetTy, ArgTys, false);
871871
SmallVector<Type *> OverloadTys;
872872
Intrinsic::MatchIntrinsicTypesResult Res =
873-
matchIntrinsicSignature(FTy, TableRef, OverloadTys);
873+
matchIntrinsicSignature(M->getDataLayout(), FTy, TableRef, OverloadTys);
874874
(void)Res;
875875
assert(Res == Intrinsic::MatchIntrinsicTypes_Match && TableRef.empty() &&
876876
"Wrong types for intrinsic!");

llvm/lib/IR/Intrinsics.cpp

Lines changed: 36 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -169,9 +169,9 @@ static std::string getIntrinsicNameImpl(Intrinsic::ID Id, ArrayRef<Type *> Tys,
169169
if (HasUnnamedType) {
170170
assert(M && "unnamed types need a module");
171171
if (!FT)
172-
FT = Intrinsic::getType(M->getContext(), Id, Tys);
172+
FT = Intrinsic::getType(M, Id, Tys);
173173
else
174-
assert((FT == Intrinsic::getType(M->getContext(), Id, Tys)) &&
174+
assert((FT == Intrinsic::getType(M, Id, Tys)) &&
175175
"Provided FunctionType must match arguments");
176176
return M->getUniqueIntrinsicName(Result, Id, FT);
177177
}
@@ -213,6 +213,9 @@ DecodeIITType(unsigned &NextElt, ArrayRef<unsigned char> Infos,
213213
case IIT_Done:
214214
OutputTable.push_back(IITDescriptor::get(IITDescriptor::Void, 0));
215215
return;
216+
case IIT_BYTE:
217+
OutputTable.push_back(IITDescriptor::get(IITDescriptor::Byte, 0));
218+
return;
216219
case IIT_VARARG:
217220
OutputTable.push_back(IITDescriptor::get(IITDescriptor::VarArg, 0));
218221
return;
@@ -491,7 +494,8 @@ void Intrinsic::getIntrinsicInfoTableEntries(
491494
}
492495

493496
static Type *DecodeFixedType(ArrayRef<Intrinsic::IITDescriptor> &Infos,
494-
ArrayRef<Type *> Tys, LLVMContext &Context) {
497+
ArrayRef<Type *> Tys, LLVMContext &Context,
498+
const DataLayout &DL) {
495499
using namespace Intrinsic;
496500

497501
IITDescriptor D = Infos.front();
@@ -500,6 +504,8 @@ static Type *DecodeFixedType(ArrayRef<Intrinsic::IITDescriptor> &Infos,
500504
switch (D.Kind) {
501505
case IITDescriptor::Void:
502506
return Type::getVoidTy(Context);
507+
case IITDescriptor::Byte:
508+
return Type::getIntNTy(Context, DL.getByteWidth());
503509
case IITDescriptor::VarArg:
504510
return Type::getVoidTy(Context);
505511
case IITDescriptor::MMX:
@@ -528,14 +534,14 @@ static Type *DecodeFixedType(ArrayRef<Intrinsic::IITDescriptor> &Infos,
528534
case IITDescriptor::Integer:
529535
return IntegerType::get(Context, D.Integer_Width);
530536
case IITDescriptor::Vector:
531-
return VectorType::get(DecodeFixedType(Infos, Tys, Context),
537+
return VectorType::get(DecodeFixedType(Infos, Tys, Context, DL),
532538
D.Vector_Width);
533539
case IITDescriptor::Pointer:
534540
return PointerType::get(Context, D.Pointer_AddressSpace);
535541
case IITDescriptor::Struct: {
536542
SmallVector<Type *, 8> Elts;
537543
for (unsigned i = 0, e = D.Struct_NumElements; i != e; ++i)
538-
Elts.push_back(DecodeFixedType(Infos, Tys, Context));
544+
Elts.push_back(DecodeFixedType(Infos, Tys, Context, DL));
539545
return StructType::get(Context, Elts);
540546
}
541547
case IITDescriptor::Argument:
@@ -568,7 +574,7 @@ static Type *DecodeFixedType(ArrayRef<Intrinsic::IITDescriptor> &Infos,
568574
return VectorType::getOneNthElementsVectorType(
569575
cast<VectorType>(Tys[D.getRefArgNumber()]), D.getVectorDivisor());
570576
case IITDescriptor::SameVecWidthArgument: {
571-
Type *EltTy = DecodeFixedType(Infos, Tys, Context);
577+
Type *EltTy = DecodeFixedType(Infos, Tys, Context, DL);
572578
Type *Ty = Tys[D.getArgumentNumber()];
573579
if (auto *VTy = dyn_cast<VectorType>(Ty))
574580
return VectorType::get(EltTy, VTy->getElementCount());
@@ -593,17 +599,18 @@ static Type *DecodeFixedType(ArrayRef<Intrinsic::IITDescriptor> &Infos,
593599
llvm_unreachable("unhandled");
594600
}
595601

596-
FunctionType *Intrinsic::getType(LLVMContext &Context, ID id,
597-
ArrayRef<Type *> Tys) {
602+
FunctionType *Intrinsic::getType(const Module *M, ID id, ArrayRef<Type *> Tys) {
598603
SmallVector<IITDescriptor, 8> Table;
599604
getIntrinsicInfoTableEntries(id, Table);
600605

601606
ArrayRef<IITDescriptor> TableRef = Table;
602-
Type *ResultTy = DecodeFixedType(TableRef, Tys, Context);
607+
Type *ResultTy =
608+
DecodeFixedType(TableRef, Tys, M->getContext(), M->getDataLayout());
603609

604610
SmallVector<Type *, 8> ArgTys;
605611
while (!TableRef.empty())
606-
ArgTys.push_back(DecodeFixedType(TableRef, Tys, Context));
612+
ArgTys.push_back(
613+
DecodeFixedType(TableRef, Tys, M->getContext(), M->getDataLayout()));
607614

608615
// DecodeFixedType returns Void for IITDescriptor::Void and
609616
// IITDescriptor::VarArg If we see void type as the type of the last argument,
@@ -752,7 +759,7 @@ Function *Intrinsic::getOrInsertDeclaration(Module *M, ID id,
752759
ArrayRef<Type *> Tys) {
753760
// There can never be multiple globals with the same name of different types,
754761
// because intrinsics must be a specific type.
755-
auto *FT = getType(M->getContext(), id, Tys);
762+
auto *FT = getType(M, id, Tys);
756763
return cast<Function>(
757764
M->getOrInsertFunction(
758765
Tys.empty() ? getName(id) : getName(id, Tys, M, FT), FT)
@@ -807,7 +814,8 @@ using DeferredIntrinsicMatchPair =
807814
std::pair<Type *, ArrayRef<Intrinsic::IITDescriptor>>;
808815

809816
static bool
810-
matchIntrinsicType(Type *Ty, ArrayRef<Intrinsic::IITDescriptor> &Infos,
817+
matchIntrinsicType(const DataLayout &DL, Type *Ty,
818+
ArrayRef<Intrinsic::IITDescriptor> &Infos,
811819
SmallVectorImpl<Type *> &ArgTys,
812820
SmallVectorImpl<DeferredIntrinsicMatchPair> &DeferredChecks,
813821
bool IsDeferredCheck) {
@@ -830,6 +838,8 @@ matchIntrinsicType(Type *Ty, ArrayRef<Intrinsic::IITDescriptor> &Infos,
830838
switch (D.Kind) {
831839
case IITDescriptor::Void:
832840
return !Ty->isVoidTy();
841+
case IITDescriptor::Byte:
842+
return !Ty->isIntegerTy(DL.getByteWidth());
833843
case IITDescriptor::VarArg:
834844
return true;
835845
case IITDescriptor::MMX: {
@@ -863,7 +873,7 @@ matchIntrinsicType(Type *Ty, ArrayRef<Intrinsic::IITDescriptor> &Infos,
863873
case IITDescriptor::Vector: {
864874
VectorType *VT = dyn_cast<VectorType>(Ty);
865875
return !VT || VT->getElementCount() != D.Vector_Width ||
866-
matchIntrinsicType(VT->getElementType(), Infos, ArgTys,
876+
matchIntrinsicType(DL, VT->getElementType(), Infos, ArgTys,
867877
DeferredChecks, IsDeferredCheck);
868878
}
869879
case IITDescriptor::Pointer: {
@@ -878,7 +888,7 @@ matchIntrinsicType(Type *Ty, ArrayRef<Intrinsic::IITDescriptor> &Infos,
878888
return true;
879889

880890
for (unsigned i = 0, e = D.Struct_NumElements; i != e; ++i)
881-
if (matchIntrinsicType(ST->getElementType(i), Infos, ArgTys,
891+
if (matchIntrinsicType(DL, ST->getElementType(i), Infos, ArgTys,
882892
DeferredChecks, IsDeferredCheck))
883893
return true;
884894
return false;
@@ -969,7 +979,7 @@ matchIntrinsicType(Type *Ty, ArrayRef<Intrinsic::IITDescriptor> &Infos,
969979
return true;
970980
EltTy = ThisArgType->getElementType();
971981
}
972-
return matchIntrinsicType(EltTy, Infos, ArgTys, DeferredChecks,
982+
return matchIntrinsicType(DL, EltTy, Infos, ArgTys, DeferredChecks,
973983
IsDeferredCheck);
974984
}
975985
case IITDescriptor::VecOfAnyPtrsToElt: {
@@ -1033,24 +1043,24 @@ matchIntrinsicType(Type *Ty, ArrayRef<Intrinsic::IITDescriptor> &Infos,
10331043
}
10341044

10351045
Intrinsic::MatchIntrinsicTypesResult
1036-
Intrinsic::matchIntrinsicSignature(FunctionType *FTy,
1046+
Intrinsic::matchIntrinsicSignature(const DataLayout &DL, FunctionType *FTy,
10371047
ArrayRef<Intrinsic::IITDescriptor> &Infos,
10381048
SmallVectorImpl<Type *> &ArgTys) {
10391049
SmallVector<DeferredIntrinsicMatchPair, 2> DeferredChecks;
1040-
if (matchIntrinsicType(FTy->getReturnType(), Infos, ArgTys, DeferredChecks,
1041-
false))
1050+
if (matchIntrinsicType(DL, FTy->getReturnType(), Infos, ArgTys,
1051+
DeferredChecks, false))
10421052
return MatchIntrinsicTypes_NoMatchRet;
10431053

10441054
unsigned NumDeferredReturnChecks = DeferredChecks.size();
10451055

10461056
for (auto *Ty : FTy->params())
1047-
if (matchIntrinsicType(Ty, Infos, ArgTys, DeferredChecks, false))
1057+
if (matchIntrinsicType(DL, Ty, Infos, ArgTys, DeferredChecks, false))
10481058
return MatchIntrinsicTypes_NoMatchArg;
10491059

10501060
for (unsigned I = 0, E = DeferredChecks.size(); I != E; ++I) {
10511061
DeferredIntrinsicMatchPair &Check = DeferredChecks[I];
1052-
if (matchIntrinsicType(Check.first, Check.second, ArgTys, DeferredChecks,
1053-
true))
1062+
if (matchIntrinsicType(DL, Check.first, Check.second, ArgTys,
1063+
DeferredChecks, true))
10541064
return I < NumDeferredReturnChecks ? MatchIntrinsicTypes_NoMatchRet
10551065
: MatchIntrinsicTypes_NoMatchArg;
10561066
}
@@ -1077,7 +1087,8 @@ bool Intrinsic::matchIntrinsicVarArg(
10771087
return true;
10781088
}
10791089

1080-
bool Intrinsic::getIntrinsicSignature(Intrinsic::ID ID, FunctionType *FT,
1090+
bool Intrinsic::getIntrinsicSignature(const DataLayout &DL, Intrinsic::ID ID,
1091+
FunctionType *FT,
10811092
SmallVectorImpl<Type *> &ArgTys) {
10821093
if (!ID)
10831094
return false;
@@ -1086,7 +1097,7 @@ bool Intrinsic::getIntrinsicSignature(Intrinsic::ID ID, FunctionType *FT,
10861097
getIntrinsicInfoTableEntries(ID, Table);
10871098
ArrayRef<Intrinsic::IITDescriptor> TableRef = Table;
10881099

1089-
if (Intrinsic::matchIntrinsicSignature(FT, TableRef, ArgTys) !=
1100+
if (Intrinsic::matchIntrinsicSignature(DL, FT, TableRef, ArgTys) !=
10901101
Intrinsic::MatchIntrinsicTypesResult::MatchIntrinsicTypes_Match) {
10911102
return false;
10921103
}
@@ -1097,8 +1108,8 @@ bool Intrinsic::getIntrinsicSignature(Intrinsic::ID ID, FunctionType *FT,
10971108

10981109
bool Intrinsic::getIntrinsicSignature(Function *F,
10991110
SmallVectorImpl<Type *> &ArgTys) {
1100-
return getIntrinsicSignature(F->getIntrinsicID(), F->getFunctionType(),
1101-
ArgTys);
1111+
return getIntrinsicSignature(F->getDataLayout(), F->getIntrinsicID(),
1112+
F->getFunctionType(), ArgTys);
11021113
}
11031114

11041115
std::optional<Function *> Intrinsic::remangleIntrinsicFunction(Function *F) {

llvm/lib/IR/Verifier.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5531,7 +5531,7 @@ void Verifier::visitIntrinsicCall(Intrinsic::ID ID, CallBase &Call) {
55315531
// Walk the descriptors to extract overloaded types.
55325532
SmallVector<Type *, 4> ArgTys;
55335533
Intrinsic::MatchIntrinsicTypesResult Res =
5534-
Intrinsic::matchIntrinsicSignature(IFTy, TableRef, ArgTys);
5534+
Intrinsic::matchIntrinsicSignature(DL, IFTy, TableRef, ArgTys);
55355535
Check(Res != Intrinsic::MatchIntrinsicTypes_NoMatchRet,
55365536
"Intrinsic has incorrect return type!", IF);
55375537
Check(Res != Intrinsic::MatchIntrinsicTypes_NoMatchArg,

0 commit comments

Comments
 (0)