@@ -321,7 +321,7 @@ static Function *jlisa_func;
321
321
static Function *jlsubtype_func;
322
322
static Function *jlapplytype_func;
323
323
static Function *setjmp_func;
324
- static Function *memcmp_func ;
324
+ static Function *memcmp_derived_func ;
325
325
static Function *box_int8_func;
326
326
static Function *box_uint8_func;
327
327
static Function *box_int16_func;
@@ -2280,7 +2280,7 @@ static Value *emit_bits_compare(jl_codectx_t &ctx, const jl_cgval_t &arg1, const
2280
2280
assert (arg1.ispointer () && arg2.ispointer ());
2281
2281
size_t sz = jl_datatype_size (arg1.typ );
2282
2282
if (sz > 512 && !((jl_datatype_t *)arg1.typ )->layout ->haspadding ) {
2283
- Value *answer = ctx.builder .CreateCall (prepare_call (memcmp_func ),
2283
+ Value *answer = ctx.builder .CreateCall (prepare_call (memcmp_derived_func ),
2284
2284
{
2285
2285
data_pointer (ctx, arg1, T_pint8),
2286
2286
data_pointer (ctx, arg2, T_pint8),
@@ -6138,6 +6138,8 @@ static void init_julia_llvm_env(Module *m)
6138
6138
T_void = Type::getVoidTy (jl_LLVMContext);
6139
6139
T_pvoidfunc = FunctionType::get (T_void, /* isVarArg*/ false )->getPointerTo ();
6140
6140
6141
+ auto T_pint8_derived = PointerType::get (T_int8, AddressSpace::Derived);
6142
+
6141
6143
// This type is used to create undef Values for use in struct declarations to skip indices
6142
6144
NoopType = ArrayType::get (T_int1, 0 );
6143
6145
@@ -6352,7 +6354,7 @@ static void init_julia_llvm_env(Module *m)
6352
6354
add_named_global (jlvboundserror_func, &jl_bounds_error_tuple_int);
6353
6355
6354
6356
std::vector<Type*> args3_uboundserror (0 );
6355
- args3_uboundserror.push_back (PointerType::get (T_int8, AddressSpace::Derived) );
6357
+ args3_uboundserror.push_back (T_pint8_derived );
6356
6358
args3_uboundserror.push_back (T_prjlvalue);
6357
6359
args3_uboundserror.push_back (T_size);
6358
6360
jluboundserror_func =
@@ -6379,13 +6381,13 @@ static void init_julia_llvm_env(Module *m)
6379
6381
add_named_global (setjmp_func, &jl_setjmp_f);
6380
6382
6381
6383
std::vector<Type*> args_memcmp (0 );
6382
- args_memcmp.push_back (T_pint8 );
6383
- args_memcmp.push_back (T_pint8 );
6384
+ args_memcmp.push_back (T_pint8_derived );
6385
+ args_memcmp.push_back (T_pint8_derived );
6384
6386
args_memcmp.push_back (T_size);
6385
- memcmp_func =
6387
+ memcmp_derived_func =
6386
6388
Function::Create (FunctionType::get (T_int32, args_memcmp, false ),
6387
6389
Function::ExternalLinkage, " memcmp" , m);
6388
- add_named_global (memcmp_func , &memcmp );
6390
+ add_named_global (memcmp_derived_func , &memcmp );
6389
6391
6390
6392
std::vector<Type*> te_args (0 );
6391
6393
te_args.push_back (T_pint8);
0 commit comments