@@ -550,10 +550,12 @@ static Value *julia_to_native(
550
550
// since those are immutable.
551
551
Value *slot = emit_static_alloca (ctx, to);
552
552
if (!jvinfo.ispointer ()) {
553
- tbaa_decorate (jvinfo.tbaa , ctx.builder .CreateStore (emit_unbox (ctx, to, jvinfo, jlto), slot));
553
+ jl_aliasinfo_t ai = jl_aliasinfo_t::fromTBAA (ctx, jvinfo.tbaa );
554
+ ai.decorateInst (ctx.builder .CreateStore (emit_unbox (ctx, to, jvinfo, jlto), slot));
554
555
}
555
556
else {
556
- emit_memcpy (ctx, slot, jvinfo.tbaa , jvinfo, jl_datatype_size (jlto), julia_alignment (jlto));
557
+ jl_aliasinfo_t ai = jl_aliasinfo_t::fromTBAA (ctx, jvinfo.tbaa );
558
+ emit_memcpy (ctx, slot, ai, jvinfo, jl_datatype_size (jlto), julia_alignment (jlto));
557
559
}
558
560
return slot;
559
561
}
@@ -1571,7 +1573,8 @@ static jl_cgval_t emit_ccall(jl_codectx_t &ctx, jl_value_t **args, size_t nargs)
1571
1573
const int tid_offset = offsetof (jl_task_t , tid);
1572
1574
Value *ptid = ctx.builder .CreateInBoundsGEP (getInt16Ty (ctx.builder .getContext ()), ptask_i16, ConstantInt::get (getSizeTy (ctx.builder .getContext ()), tid_offset / sizeof (int16_t )));
1573
1575
LoadInst *tid = ctx.builder .CreateAlignedLoad (getInt16Ty (ctx.builder .getContext ()), ptid, Align (sizeof (int16_t )));
1574
- tbaa_decorate (ctx.tbaa ().tbaa_gcframe , tid);
1576
+ jl_aliasinfo_t ai = jl_aliasinfo_t::fromTBAA (ctx, ctx.tbaa ().tbaa_gcframe );
1577
+ ai.decorateInst (tid);
1575
1578
return mark_or_box_ccall_result (ctx, tid, retboxed, rt, unionall, static_rt);
1576
1579
}
1577
1580
else if (is_libjulia_func (jl_gc_disable_finalizers_internal)
@@ -1675,8 +1678,10 @@ static jl_cgval_t emit_ccall(jl_codectx_t &ctx, jl_value_t **args, size_t nargs)
1675
1678
len = ctx.builder .CreateAlignedLoad (getSizeTy (ctx.builder .getContext ()), ptr, Align (sizeof (size_t )));
1676
1679
// Only mark with TBAA if we are sure about the type.
1677
1680
// This could otherwise be in a dead branch
1678
- if (svecv.typ == (jl_value_t *)jl_simplevector_type)
1679
- tbaa_decorate (ctx.tbaa ().tbaa_const , cast<Instruction>(len));
1681
+ if (svecv.typ == (jl_value_t *)jl_simplevector_type) {
1682
+ jl_aliasinfo_t ai = jl_aliasinfo_t::fromTBAA (ctx, ctx.tbaa ().tbaa_const );
1683
+ ai.decorateInst (cast<Instruction>(len));
1684
+ }
1680
1685
MDBuilder MDB (ctx.builder .getContext ());
1681
1686
auto rng = MDB.createRange (
1682
1687
Constant::getNullValue (getSizeTy (ctx.builder .getContext ())), ConstantInt::get (getSizeTy (ctx.builder .getContext ()), INTPTR_MAX / sizeof (void *) - 1 ));
@@ -1701,8 +1706,10 @@ static jl_cgval_t emit_ccall(jl_codectx_t &ctx, jl_value_t **args, size_t nargs)
1701
1706
load->setAtomic (AtomicOrdering::Unordered);
1702
1707
// Only mark with TBAA if we are sure about the type.
1703
1708
// This could otherwise be in a dead branch
1704
- if (svecv.typ == (jl_value_t *)jl_simplevector_type)
1705
- tbaa_decorate (ctx.tbaa ().tbaa_const , load);
1709
+ if (svecv.typ == (jl_value_t *)jl_simplevector_type) {
1710
+ jl_aliasinfo_t ai = jl_aliasinfo_t::fromTBAA (ctx, ctx.tbaa ().tbaa_const );
1711
+ ai.decorateInst (load);
1712
+ }
1706
1713
JL_GC_POP ();
1707
1714
return mark_or_box_ccall_result (ctx, load, retboxed, rt, unionall, static_rt);
1708
1715
}
@@ -1736,7 +1743,8 @@ static jl_cgval_t emit_ccall(jl_codectx_t &ctx, jl_value_t **args, size_t nargs)
1736
1743
Value *slot_addr = ctx.builder .CreateInBoundsGEP (ctx.types ().T_prjlvalue , arrayptr, idx);
1737
1744
LoadInst *load = ctx.builder .CreateAlignedLoad (ctx.types ().T_prjlvalue , slot_addr, Align (sizeof (void *)));
1738
1745
load->setAtomic (AtomicOrdering::Unordered);
1739
- tbaa_decorate (ctx.tbaa ().tbaa_ptrarraybuf , load);
1746
+ jl_aliasinfo_t ai = jl_aliasinfo_t::fromTBAA (ctx, ctx.tbaa ().tbaa_ptrarraybuf );
1747
+ ai.decorateInst (load);
1740
1748
Value *res = ctx.builder .CreateZExt (ctx.builder .CreateICmpNE (load, Constant::getNullValue (ctx.types ().T_prjlvalue )), getInt32Ty (ctx.builder .getContext ()));
1741
1749
JL_GC_POP ();
1742
1750
return mark_or_box_ccall_result (ctx, res, retboxed, rt, unionall, static_rt);
@@ -1838,7 +1846,8 @@ static jl_cgval_t emit_ccall(jl_codectx_t &ctx, jl_value_t **args, size_t nargs)
1838
1846
Value *ph1 = emit_bitcast (ctx, decay_derived (ctx, boxed (ctx, val)), getSizePtrTy (ctx.builder .getContext ()));
1839
1847
Value *ph2 = ctx.builder .CreateInBoundsGEP (getSizeTy (ctx.builder .getContext ()), ph1, ConstantInt::get (getSizeTy (ctx.builder .getContext ()), hash_offset / sizeof (size_t )));
1840
1848
LoadInst *hashval = ctx.builder .CreateAlignedLoad (getSizeTy (ctx.builder .getContext ()), ph2, Align (sizeof (size_t )));
1841
- tbaa_decorate (ctx.tbaa ().tbaa_const , hashval);
1849
+ jl_aliasinfo_t ai = jl_aliasinfo_t::fromTBAA (ctx, ctx.tbaa ().tbaa_const );
1850
+ ai.decorateInst (hashval);
1842
1851
return mark_or_box_ccall_result (ctx, hashval, retboxed, rt, unionall, static_rt);
1843
1852
}
1844
1853
else if (!val.isboxed ) {
@@ -2128,7 +2137,8 @@ jl_cgval_t function_sig_t::emit_a_ccall(
2128
2137
auto slot = emit_static_alloca (ctx, resultTy);
2129
2138
slot->setAlignment (Align (boxalign));
2130
2139
ctx.builder .CreateAlignedStore (result, slot, Align (boxalign));
2131
- emit_memcpy (ctx, strct, tbaa, slot, tbaa, rtsz, boxalign);
2140
+ jl_aliasinfo_t ai = jl_aliasinfo_t::fromTBAA (ctx, tbaa);
2141
+ emit_memcpy (ctx, strct, ai, slot, ai, rtsz, boxalign);
2132
2142
}
2133
2143
else {
2134
2144
init_bits_value (ctx, strct, result, tbaa, boxalign);
0 commit comments