@@ -27,8 +27,6 @@ TRANSFORMED_CCALL_STAT(jl_get_current_task);
2727TRANSFORMED_CCALL_STAT (jl_set_next_task);
2828TRANSFORMED_CCALL_STAT (jl_sigatomic_begin);
2929TRANSFORMED_CCALL_STAT (jl_sigatomic_end);
30- TRANSFORMED_CCALL_STAT (jl_svec_len);
31- TRANSFORMED_CCALL_STAT (jl_svec_ref);
3230TRANSFORMED_CCALL_STAT (jl_string_ptr);
3331TRANSFORMED_CCALL_STAT (jl_symbol_name);
3432TRANSFORMED_CCALL_STAT (jl_genericmemory_owner);
@@ -1685,61 +1683,6 @@ static jl_cgval_t emit_ccall(jl_codectx_t &ctx, jl_value_t **args, size_t nargs)
16851683 ctx.builder .SetInsertPoint (contBB);
16861684 return ghostValue (ctx, jl_nothing_type);
16871685 }
1688- else if (is_libjulia_func (jl_svec_len)) {
1689- ++CCALL_STAT (jl_svec_len);
1690- assert (!isVa && !llvmcall && nccallargs == 1 );
1691- const jl_cgval_t &svecv = argv[0 ];
1692- Value *len;
1693- if (svecv.constant && svecv.typ == (jl_value_t *)jl_simplevector_type) {
1694- // Check the type as well before we call
1695- len = ConstantInt::get (ctx.types ().T_size , jl_svec_len (svecv.constant ));
1696- }
1697- else {
1698- auto ptr = emit_bitcast (ctx, boxed (ctx, svecv), ctx.types ().T_size ->getPointerTo ());
1699- setName (ctx.emission_context , ptr, " svec_len_ptr" );
1700- len = ctx.builder .CreateAlignedLoad (ctx.types ().T_size , ptr, ctx.types ().alignof_ptr );
1701- setName (ctx.emission_context , len, " svec_len" );
1702- // Only mark with TBAA if we are sure about the type.
1703- // This could otherwise be in a dead branch
1704- if (svecv.typ == (jl_value_t *)jl_simplevector_type) {
1705- jl_aliasinfo_t ai = jl_aliasinfo_t::fromTBAA (ctx, ctx.tbaa ().tbaa_const );
1706- ai.decorateInst (cast<Instruction>(len));
1707- }
1708- MDBuilder MDB (ctx.builder .getContext ());
1709- auto rng = MDB.createRange (
1710- Constant::getNullValue (ctx.types ().T_size ), ConstantInt::get (ctx.types ().T_size , INTPTR_MAX / sizeof (void *) - 1 ));
1711- cast<LoadInst>(len)->setMetadata (LLVMContext::MD_range, rng);
1712- }
1713- JL_GC_POP ();
1714- return mark_or_box_ccall_result (ctx, len, retboxed, rt, unionall, static_rt);
1715- }
1716- else if (is_libjulia_func (jl_svec_ref) && argv[1 ].typ == (jl_value_t *)jl_long_type) {
1717- ++CCALL_STAT (jl_svec_ref);
1718- assert (lrt == ctx.types ().T_prjlvalue );
1719- assert (!isVa && !llvmcall && nccallargs == 2 );
1720- const jl_cgval_t &svecv = argv[0 ];
1721- const jl_cgval_t &idxv = argv[1 ];
1722- Value *idx = emit_unbox (ctx, ctx.types ().T_size , idxv, (jl_value_t *)jl_long_type);
1723- idx = ctx.builder .CreateAdd (idx, ConstantInt::get (ctx.types ().T_size , 1 ));
1724- setName (ctx.emission_context , idx, " svec_idx" );
1725- auto ptr = emit_bitcast (ctx, boxed (ctx, svecv), ctx.types ().T_pprjlvalue );
1726- setName (ctx.emission_context , ptr, " svec_data_ptr" );
1727- Value *slot_addr = ctx.builder .CreateInBoundsGEP (ctx.types ().T_prjlvalue ,
1728- decay_derived (ctx, ptr), idx);
1729- setName (ctx.emission_context , slot_addr, " svec_slot_addr" );
1730- LoadInst *load = ctx.builder .CreateAlignedLoad (ctx.types ().T_prjlvalue , slot_addr,
1731- Align (sizeof (void *)));
1732- setName (ctx.emission_context , load, " svec_slot" );
1733- load->setAtomic (AtomicOrdering::Unordered);
1734- // Only mark with TBAA if we are sure about the type.
1735- // This could otherwise be in a dead branch
1736- if (svecv.typ == (jl_value_t *)jl_simplevector_type) {
1737- jl_aliasinfo_t ai = jl_aliasinfo_t::fromTBAA (ctx, ctx.tbaa ().tbaa_const );
1738- ai.decorateInst (load);
1739- }
1740- JL_GC_POP ();
1741- return mark_or_box_ccall_result (ctx, load, retboxed, rt, unionall, static_rt);
1742- }
17431686 else if (is_libjulia_func (jl_string_ptr)) {
17441687 ++CCALL_STAT (jl_string_ptr);
17451688 assert (lrt == ctx.types ().T_size );
0 commit comments