Skip to content

Commit 97cce99

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 4048990 commit 97cce99

File tree

11 files changed

+63
-44
lines changed

11 files changed

+63
-44
lines changed

llvm/include/llvm-c/Core.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2816,7 +2816,7 @@ LLVMValueRef LLVMGetIntrinsicDeclaration(LLVMModuleRef Mod,
28162816
*
28172817
* @see llvm::Intrinsic::getType()
28182818
*/
2819-
LLVMTypeRef LLVMIntrinsicGetType(LLVMContextRef Ctx, unsigned ID,
2819+
LLVMTypeRef LLVMIntrinsicGetType(LLVMModuleRef Mod, unsigned ID,
28202820
LLVMTypeRef *ParamTypes, size_t ParamCount);
28212821

28222822
/**

llvm/include/llvm/IR/Intrinsics.h

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222

2323
namespace llvm {
2424

25+
class DataLayout;
2526
class Type;
2627
class FunctionType;
2728
class Function;
@@ -74,7 +75,7 @@ namespace Intrinsic {
7475
std::string getNameNoUnnamedTypes(ID Id, ArrayRef<Type *> Tys);
7576

7677
/// Return the function type for an intrinsic.
77-
FunctionType *getType(LLVMContext &Context, ID id, ArrayRef<Type *> Tys = {});
78+
FunctionType *getType(Module *M, ID id, ArrayRef<Type *> Tys = {});
7879

7980
/// Returns true if the intrinsic can be overloaded.
8081
bool isOverloaded(ID id);
@@ -135,6 +136,7 @@ namespace Intrinsic {
135136
struct IITDescriptor {
136137
enum IITDescriptorKind {
137138
Void,
139+
Byte,
138140
VarArg,
139141
MMX,
140142
Token,
@@ -251,7 +253,8 @@ namespace Intrinsic {
251253
/// Returns false if the given type matches with the constraints, true
252254
/// otherwise.
253255
MatchIntrinsicTypesResult
254-
matchIntrinsicSignature(FunctionType *FTy, ArrayRef<IITDescriptor> &Infos,
256+
matchIntrinsicSignature(const DataLayout &DL, FunctionType *FTy,
257+
ArrayRef<IITDescriptor> &Infos,
255258
SmallVectorImpl<Type *> &ArgTys);
256259

257260
/// Verify if the intrinsic has variable arguments. This method is intended to
@@ -266,8 +269,8 @@ namespace Intrinsic {
266269
///
267270
/// Returns false if the given ID and function type combination is not a
268271
/// valid intrinsic call.
269-
bool getIntrinsicSignature(Intrinsic::ID, FunctionType *FT,
270-
SmallVectorImpl<Type *> &ArgTys);
272+
bool getIntrinsicSignature(const DataLayout &DL, Intrinsic::ID,
273+
FunctionType *FT, SmallVectorImpl<Type *> &ArgTys);
271274

272275
/// Same as previous, but accepts a Function instead of ID and FunctionType.
273276
bool getIntrinsicSignature(Function *F, SmallVectorImpl<Type *> &ArgTys);

llvm/include/llvm/IR/Intrinsics.td

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,7 @@ def IIT_V1 : IIT_Vec<1, 28>;
300300
def IIT_VARARG : IIT_VT<isVoid, 29>;
301301
def IIT_HALF_VEC_ARG : IIT_Base<30>;
302302
def IIT_SAME_VEC_WIDTH_ARG : IIT_Base<31>;
303+
def IIT_BYTE : IIT_Base<32>;
303304
def IIT_VEC_OF_ANYPTRS_TO_ELT : IIT_Base<34>;
304305
def IIT_I128 : IIT_Int<128, 35>;
305306
def IIT_V512 : IIT_Vec<512, 36>;
@@ -385,6 +386,10 @@ class LLVMType<ValueType vt> {
385386
!foreach(iit, IITs, iit.Number));
386387
}
387388

389+
class LLVMByteType : LLVMType<OtherVT> {
390+
let Sig = [IIT_BYTE.Number];
391+
}
392+
388393
class LLVMAnyType<ValueType vt> : LLVMType<vt> {
389394
let ArgCode = !cond(
390395
!eq(vt, Any) : ArgKind.Any,
@@ -493,7 +498,7 @@ class LLVMVectorOfBitcastsToInt<int num>
493498
: LLVMMatchType<num, IIT_VEC_OF_BITCASTS_TO_INT>;
494499

495500
def llvm_void_ty : LLVMType<isVoid>;
496-
501+
def llvm_byte_ty : LLVMByteType;
497502
def llvm_any_ty : LLVMAnyType<Any>;
498503
def llvm_anyint_ty : LLVMAnyType<iAny>;
499504
def llvm_anyfloat_ty : LLVMAnyType<fAny>;
@@ -1003,7 +1008,7 @@ def int_memmove : Intrinsic<[],
10031008
WriteOnly<ArgIndex<0>>, ReadOnly<ArgIndex<1>>,
10041009
ImmArg<ArgIndex<3>>]>;
10051010
def int_memset : Intrinsic<[],
1006-
[llvm_anyptr_ty, llvm_i8_ty, llvm_anyint_ty,
1011+
[llvm_anyptr_ty, llvm_byte_ty, llvm_anyint_ty,
10071012
llvm_i1_ty],
10081013
[IntrWriteMem, IntrArgMemOnly, IntrWillReturn,
10091014
IntrNoFree, IntrNoCallback,
@@ -1016,7 +1021,7 @@ def int_memset : Intrinsic<[],
10161021
// The third argument (specifying the size) must be a constant.
10171022
def int_memset_inline
10181023
: Intrinsic<[],
1019-
[llvm_anyptr_ty, llvm_i8_ty, llvm_anyint_ty, llvm_i1_ty],
1024+
[llvm_anyptr_ty, llvm_byte_ty, llvm_anyint_ty, llvm_i1_ty],
10201025
[IntrWriteMem, IntrArgMemOnly, IntrWillReturn, IntrNoFree, IntrNoCallback,
10211026
NoCapture<ArgIndex<0>>, WriteOnly<ArgIndex<0>>,
10221027
ImmArg<ArgIndex<3>>]>;
@@ -2571,7 +2576,7 @@ def int_memmove_element_unordered_atomic
25712576

25722577
// @llvm.memset.element.unordered.atomic.*(dest, value, length, elementsize)
25732578
def int_memset_element_unordered_atomic
2574-
: Intrinsic<[], [llvm_anyptr_ty, llvm_i8_ty, llvm_anyint_ty, llvm_i32_ty],
2579+
: Intrinsic<[], [llvm_anyptr_ty, llvm_byte_ty, llvm_anyint_ty, llvm_i32_ty],
25752580
[IntrWriteMem, IntrArgMemOnly, IntrWillReturn, IntrNoSync,
25762581
NoCapture<ArgIndex<0>>, WriteOnly<ArgIndex<0>>,
25772582
ImmArg<ArgIndex<3>>]>;

llvm/lib/AsmParser/LLParser.cpp

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

354354
SmallVector<Type *> OverloadTys;
355-
if (!Intrinsic::getIntrinsicSignature(IID, CB->getFunctionType(),
356-
OverloadTys))
355+
if (!Intrinsic::getIntrinsicSignature(
356+
M->getDataLayout(), IID, CB->getFunctionType(), OverloadTys))
357357
return error(Info.second, "invalid intrinsic signature");
358358

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

llvm/lib/IR/Core.cpp

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

2465-
LLVMTypeRef LLVMIntrinsicGetType(LLVMContextRef Ctx, unsigned ID,
2465+
LLVMTypeRef LLVMIntrinsicGetType(LLVMModuleRef Mod, unsigned ID,
24662466
LLVMTypeRef *ParamTypes, size_t ParamCount) {
24672467
auto IID = llvm_map_to_intrinsic_id(ID);
24682468
ArrayRef<Type*> Tys(unwrap(ParamTypes), ParamCount);
2469-
return wrap(llvm::Intrinsic::getType(*unwrap(Ctx), IID, Tys));
2469+
return wrap(llvm::Intrinsic::getType(unwrap(Mod), IID, Tys));
24702470
}
24712471

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

llvm/lib/IR/IRBuilder.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -958,7 +958,7 @@ CallInst *IRBuilderBase::CreateIntrinsic(Type *RetTy, Intrinsic::ID ID,
958958
FunctionType *FTy = FunctionType::get(RetTy, ArgTys, false);
959959
SmallVector<Type *> OverloadTys;
960960
Intrinsic::MatchIntrinsicTypesResult Res =
961-
matchIntrinsicSignature(FTy, TableRef, OverloadTys);
961+
matchIntrinsicSignature(M->getDataLayout(), FTy, TableRef, OverloadTys);
962962
(void)Res;
963963
assert(Res == Intrinsic::MatchIntrinsicTypes_Match && TableRef.empty() &&
964964
"Wrong types for intrinsic!");

llvm/lib/IR/Intrinsics.cpp

Lines changed: 36 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -167,9 +167,9 @@ static std::string getIntrinsicNameImpl(Intrinsic::ID Id, ArrayRef<Type *> Tys,
167167
if (HasUnnamedType) {
168168
assert(M && "unnamed types need a module");
169169
if (!FT)
170-
FT = Intrinsic::getType(M->getContext(), Id, Tys);
170+
FT = Intrinsic::getType(M, Id, Tys);
171171
else
172-
assert((FT == Intrinsic::getType(M->getContext(), Id, Tys)) &&
172+
assert((FT == Intrinsic::getType(M, Id, Tys)) &&
173173
"Provided FunctionType must match arguments");
174174
return M->getUniqueIntrinsicName(Result, Id, FT);
175175
}
@@ -211,6 +211,9 @@ DecodeIITType(unsigned &NextElt, ArrayRef<unsigned char> Infos,
211211
case IIT_Done:
212212
OutputTable.push_back(IITDescriptor::get(IITDescriptor::Void, 0));
213213
return;
214+
case IIT_BYTE:
215+
OutputTable.push_back(IITDescriptor::get(IITDescriptor::Byte, 0));
216+
return;
214217
case IIT_VARARG:
215218
OutputTable.push_back(IITDescriptor::get(IITDescriptor::VarArg, 0));
216219
return;
@@ -498,7 +501,8 @@ void Intrinsic::getIntrinsicInfoTableEntries(
498501
}
499502

500503
static Type *DecodeFixedType(ArrayRef<Intrinsic::IITDescriptor> &Infos,
501-
ArrayRef<Type *> Tys, LLVMContext &Context) {
504+
ArrayRef<Type *> Tys, LLVMContext &Context,
505+
const DataLayout &DL) {
502506
using namespace Intrinsic;
503507

504508
IITDescriptor D = Infos.front();
@@ -507,6 +511,8 @@ static Type *DecodeFixedType(ArrayRef<Intrinsic::IITDescriptor> &Infos,
507511
switch (D.Kind) {
508512
case IITDescriptor::Void:
509513
return Type::getVoidTy(Context);
514+
case IITDescriptor::Byte:
515+
return Type::getIntNTy(Context, DL.getByteWidth());
510516
case IITDescriptor::VarArg:
511517
return Type::getVoidTy(Context);
512518
case IITDescriptor::MMX:
@@ -535,14 +541,14 @@ static Type *DecodeFixedType(ArrayRef<Intrinsic::IITDescriptor> &Infos,
535541
case IITDescriptor::Integer:
536542
return IntegerType::get(Context, D.Integer_Width);
537543
case IITDescriptor::Vector:
538-
return VectorType::get(DecodeFixedType(Infos, Tys, Context),
544+
return VectorType::get(DecodeFixedType(Infos, Tys, Context, DL),
539545
D.Vector_Width);
540546
case IITDescriptor::Pointer:
541547
return PointerType::get(Context, D.Pointer_AddressSpace);
542548
case IITDescriptor::Struct: {
543549
SmallVector<Type *, 8> Elts;
544550
for (unsigned i = 0, e = D.Struct_NumElements; i != e; ++i)
545-
Elts.push_back(DecodeFixedType(Infos, Tys, Context));
551+
Elts.push_back(DecodeFixedType(Infos, Tys, Context, DL));
546552
return StructType::get(Context, Elts);
547553
}
548554
case IITDescriptor::Argument:
@@ -581,7 +587,7 @@ static Type *DecodeFixedType(ArrayRef<Intrinsic::IITDescriptor> &Infos,
581587
cast<VectorType>(Tys[D.getArgumentNumber()]),
582588
3 + (D.Kind - IITDescriptor::OneThirdVecArgument) * 2);
583589
case IITDescriptor::SameVecWidthArgument: {
584-
Type *EltTy = DecodeFixedType(Infos, Tys, Context);
590+
Type *EltTy = DecodeFixedType(Infos, Tys, Context, DL);
585591
Type *Ty = Tys[D.getArgumentNumber()];
586592
if (auto *VTy = dyn_cast<VectorType>(Ty))
587593
return VectorType::get(EltTy, VTy->getElementCount());
@@ -606,17 +612,18 @@ static Type *DecodeFixedType(ArrayRef<Intrinsic::IITDescriptor> &Infos,
606612
llvm_unreachable("unhandled");
607613
}
608614

609-
FunctionType *Intrinsic::getType(LLVMContext &Context, ID id,
610-
ArrayRef<Type *> Tys) {
615+
FunctionType *Intrinsic::getType(Module *M, ID id, ArrayRef<Type *> Tys) {
611616
SmallVector<IITDescriptor, 8> Table;
612617
getIntrinsicInfoTableEntries(id, Table);
613618

614619
ArrayRef<IITDescriptor> TableRef = Table;
615-
Type *ResultTy = DecodeFixedType(TableRef, Tys, Context);
620+
Type *ResultTy =
621+
DecodeFixedType(TableRef, Tys, M->getContext(), M->getDataLayout());
616622

617623
SmallVector<Type *, 8> ArgTys;
618624
while (!TableRef.empty())
619-
ArgTys.push_back(DecodeFixedType(TableRef, Tys, Context));
625+
ArgTys.push_back(
626+
DecodeFixedType(TableRef, Tys, M->getContext(), M->getDataLayout()));
620627

621628
// DecodeFixedType returns Void for IITDescriptor::Void and
622629
// IITDescriptor::VarArg If we see void type as the type of the last argument,
@@ -765,7 +772,7 @@ Function *Intrinsic::getOrInsertDeclaration(Module *M, ID id,
765772
ArrayRef<Type *> Tys) {
766773
// There can never be multiple globals with the same name of different types,
767774
// because intrinsics must be a specific type.
768-
auto *FT = getType(M->getContext(), id, Tys);
775+
auto *FT = getType(M, id, Tys);
769776
return cast<Function>(
770777
M->getOrInsertFunction(
771778
Tys.empty() ? getName(id) : getName(id, Tys, M, FT), FT)
@@ -820,7 +827,8 @@ using DeferredIntrinsicMatchPair =
820827
std::pair<Type *, ArrayRef<Intrinsic::IITDescriptor>>;
821828

822829
static bool
823-
matchIntrinsicType(Type *Ty, ArrayRef<Intrinsic::IITDescriptor> &Infos,
830+
matchIntrinsicType(const DataLayout &DL, Type *Ty,
831+
ArrayRef<Intrinsic::IITDescriptor> &Infos,
824832
SmallVectorImpl<Type *> &ArgTys,
825833
SmallVectorImpl<DeferredIntrinsicMatchPair> &DeferredChecks,
826834
bool IsDeferredCheck) {
@@ -843,6 +851,8 @@ matchIntrinsicType(Type *Ty, ArrayRef<Intrinsic::IITDescriptor> &Infos,
843851
switch (D.Kind) {
844852
case IITDescriptor::Void:
845853
return !Ty->isVoidTy();
854+
case IITDescriptor::Byte:
855+
return !Ty->isIntegerTy(DL.getByteWidth());
846856
case IITDescriptor::VarArg:
847857
return true;
848858
case IITDescriptor::MMX: {
@@ -876,7 +886,7 @@ matchIntrinsicType(Type *Ty, ArrayRef<Intrinsic::IITDescriptor> &Infos,
876886
case IITDescriptor::Vector: {
877887
VectorType *VT = dyn_cast<VectorType>(Ty);
878888
return !VT || VT->getElementCount() != D.Vector_Width ||
879-
matchIntrinsicType(VT->getElementType(), Infos, ArgTys,
889+
matchIntrinsicType(DL, VT->getElementType(), Infos, ArgTys,
880890
DeferredChecks, IsDeferredCheck);
881891
}
882892
case IITDescriptor::Pointer: {
@@ -891,7 +901,7 @@ matchIntrinsicType(Type *Ty, ArrayRef<Intrinsic::IITDescriptor> &Infos,
891901
return true;
892902

893903
for (unsigned i = 0, e = D.Struct_NumElements; i != e; ++i)
894-
if (matchIntrinsicType(ST->getElementType(i), Infos, ArgTys,
904+
if (matchIntrinsicType(DL, ST->getElementType(i), Infos, ArgTys,
895905
DeferredChecks, IsDeferredCheck))
896906
return true;
897907
return false;
@@ -991,7 +1001,7 @@ matchIntrinsicType(Type *Ty, ArrayRef<Intrinsic::IITDescriptor> &Infos,
9911001
return true;
9921002
EltTy = ThisArgType->getElementType();
9931003
}
994-
return matchIntrinsicType(EltTy, Infos, ArgTys, DeferredChecks,
1004+
return matchIntrinsicType(DL, EltTy, Infos, ArgTys, DeferredChecks,
9951005
IsDeferredCheck);
9961006
}
9971007
case IITDescriptor::VecOfAnyPtrsToElt: {
@@ -1055,24 +1065,24 @@ matchIntrinsicType(Type *Ty, ArrayRef<Intrinsic::IITDescriptor> &Infos,
10551065
}
10561066

10571067
Intrinsic::MatchIntrinsicTypesResult
1058-
Intrinsic::matchIntrinsicSignature(FunctionType *FTy,
1068+
Intrinsic::matchIntrinsicSignature(const DataLayout &DL, FunctionType *FTy,
10591069
ArrayRef<Intrinsic::IITDescriptor> &Infos,
10601070
SmallVectorImpl<Type *> &ArgTys) {
10611071
SmallVector<DeferredIntrinsicMatchPair, 2> DeferredChecks;
1062-
if (matchIntrinsicType(FTy->getReturnType(), Infos, ArgTys, DeferredChecks,
1063-
false))
1072+
if (matchIntrinsicType(DL, FTy->getReturnType(), Infos, ArgTys,
1073+
DeferredChecks, false))
10641074
return MatchIntrinsicTypes_NoMatchRet;
10651075

10661076
unsigned NumDeferredReturnChecks = DeferredChecks.size();
10671077

10681078
for (auto *Ty : FTy->params())
1069-
if (matchIntrinsicType(Ty, Infos, ArgTys, DeferredChecks, false))
1079+
if (matchIntrinsicType(DL, Ty, Infos, ArgTys, DeferredChecks, false))
10701080
return MatchIntrinsicTypes_NoMatchArg;
10711081

10721082
for (unsigned I = 0, E = DeferredChecks.size(); I != E; ++I) {
10731083
DeferredIntrinsicMatchPair &Check = DeferredChecks[I];
1074-
if (matchIntrinsicType(Check.first, Check.second, ArgTys, DeferredChecks,
1075-
true))
1084+
if (matchIntrinsicType(DL, Check.first, Check.second, ArgTys,
1085+
DeferredChecks, true))
10761086
return I < NumDeferredReturnChecks ? MatchIntrinsicTypes_NoMatchRet
10771087
: MatchIntrinsicTypes_NoMatchArg;
10781088
}
@@ -1099,7 +1109,8 @@ bool Intrinsic::matchIntrinsicVarArg(
10991109
return true;
11001110
}
11011111

1102-
bool Intrinsic::getIntrinsicSignature(Intrinsic::ID ID, FunctionType *FT,
1112+
bool Intrinsic::getIntrinsicSignature(const DataLayout &DL, Intrinsic::ID ID,
1113+
FunctionType *FT,
11031114
SmallVectorImpl<Type *> &ArgTys) {
11041115
if (!ID)
11051116
return false;
@@ -1108,7 +1119,7 @@ bool Intrinsic::getIntrinsicSignature(Intrinsic::ID ID, FunctionType *FT,
11081119
getIntrinsicInfoTableEntries(ID, Table);
11091120
ArrayRef<Intrinsic::IITDescriptor> TableRef = Table;
11101121

1111-
if (Intrinsic::matchIntrinsicSignature(FT, TableRef, ArgTys) !=
1122+
if (Intrinsic::matchIntrinsicSignature(DL, FT, TableRef, ArgTys) !=
11121123
Intrinsic::MatchIntrinsicTypesResult::MatchIntrinsicTypes_Match) {
11131124
return false;
11141125
}
@@ -1119,8 +1130,8 @@ bool Intrinsic::getIntrinsicSignature(Intrinsic::ID ID, FunctionType *FT,
11191130

11201131
bool Intrinsic::getIntrinsicSignature(Function *F,
11211132
SmallVectorImpl<Type *> &ArgTys) {
1122-
return getIntrinsicSignature(F->getIntrinsicID(), F->getFunctionType(),
1123-
ArgTys);
1133+
return getIntrinsicSignature(F->getDataLayout(), F->getIntrinsicID(),
1134+
F->getFunctionType(), ArgTys);
11241135
}
11251136

11261137
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
@@ -5426,7 +5426,7 @@ void Verifier::visitIntrinsicCall(Intrinsic::ID ID, CallBase &Call) {
54265426
// Walk the descriptors to extract overloaded types.
54275427
SmallVector<Type *, 4> ArgTys;
54285428
Intrinsic::MatchIntrinsicTypesResult Res =
5429-
Intrinsic::matchIntrinsicSignature(IFTy, TableRef, ArgTys);
5429+
Intrinsic::matchIntrinsicSignature(DL, IFTy, TableRef, ArgTys);
54305430
Check(Res != Intrinsic::MatchIntrinsicTypes_NoMatchRet,
54315431
"Intrinsic has incorrect return type!", IF);
54325432
Check(Res != Intrinsic::MatchIntrinsicTypes_NoMatchArg,

llvm/lib/Transforms/IPO/ExpandVariadics.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ Function *getPreexistingDeclaration(Module *M, Intrinsic::ID Id,
147147
ArrayRef<Type *> Tys = {}) {
148148
if (Tys.empty())
149149
return Intrinsic::getDeclarationIfExists(M, Id);
150-
auto *FT = Intrinsic::getType(M->getContext(), Id, Tys);
150+
auto *FT = Intrinsic::getType(M, Id, Tys);
151151
return Intrinsic::getDeclarationIfExists(M, Id, Tys, FT);
152152
}
153153

llvm/lib/Transforms/Instrumentation/NumericalStabilitySanitizer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1587,7 +1587,7 @@ Value *NumericalStabilitySanitizer::maybeHandleKnownCallBase(
15871587
SmallVector<Type *, 4> ArgTys;
15881588
ArrayRef<Intrinsic::IITDescriptor> TableRef = Table;
15891589
[[maybe_unused]] Intrinsic::MatchIntrinsicTypesResult MatchResult =
1590-
Intrinsic::matchIntrinsicSignature(WidenedFnTy, TableRef, ArgTys);
1590+
Intrinsic::matchIntrinsicSignature(DL, WidenedFnTy, TableRef, ArgTys);
15911591
assert(MatchResult == Intrinsic::MatchIntrinsicTypes_Match &&
15921592
"invalid widened intrinsic");
15931593
// For known intrinsic functions, we create a second call to the same

0 commit comments

Comments
 (0)