@@ -321,7 +321,7 @@ static Function *jlisa_func;
321321static Function *jlsubtype_func;
322322static Function *jlapplytype_func;
323323static Function *setjmp_func;
324- static Function *memcmp_func ;
324+ static Function *memcmp_derived_func ;
325325static Function *box_int8_func;
326326static Function *box_uint8_func;
327327static Function *box_int16_func;
@@ -2280,7 +2280,7 @@ static Value *emit_bits_compare(jl_codectx_t &ctx, const jl_cgval_t &arg1, const
22802280 assert (arg1.ispointer () && arg2.ispointer ());
22812281 size_t sz = jl_datatype_size (arg1.typ );
22822282 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 ),
22842284 {
22852285 data_pointer (ctx, arg1, T_pint8),
22862286 data_pointer (ctx, arg2, T_pint8),
@@ -6138,6 +6138,8 @@ static void init_julia_llvm_env(Module *m)
61386138 T_void = Type::getVoidTy (jl_LLVMContext);
61396139 T_pvoidfunc = FunctionType::get (T_void, /* isVarArg*/ false )->getPointerTo ();
61406140
6141+ auto T_pint8_derived = PointerType::get (T_int8, AddressSpace::Derived);
6142+
61416143 // This type is used to create undef Values for use in struct declarations to skip indices
61426144 NoopType = ArrayType::get (T_int1, 0 );
61436145
@@ -6352,7 +6354,7 @@ static void init_julia_llvm_env(Module *m)
63526354 add_named_global (jlvboundserror_func, &jl_bounds_error_tuple_int);
63536355
63546356 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 );
63566358 args3_uboundserror.push_back (T_prjlvalue);
63576359 args3_uboundserror.push_back (T_size);
63586360 jluboundserror_func =
@@ -6379,13 +6381,13 @@ static void init_julia_llvm_env(Module *m)
63796381 add_named_global (setjmp_func, &jl_setjmp_f);
63806382
63816383 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 );
63846386 args_memcmp.push_back (T_size);
6385- memcmp_func =
6387+ memcmp_derived_func =
63866388 Function::Create (FunctionType::get (T_int32, args_memcmp, false ),
63876389 Function::ExternalLinkage, " memcmp" , m);
6388- add_named_global (memcmp_func , &memcmp);
6390+ add_named_global (memcmp_derived_func , &memcmp);
63896391
63906392 std::vector<Type*> te_args (0 );
63916393 te_args.push_back (T_pint8);
0 commit comments