Skip to content

Commit d7ba204

Browse files
vchuravyKristofferC
authored andcommitted
[Codegen] Skip wb emission when they are no children objects
1 parent 302443b commit d7ba204

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/cgutils.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3239,6 +3239,9 @@ static void emit_write_barrier(jl_codectx_t &ctx, Value *parent, Value *ptr)
32393239

32403240
static void emit_write_barrier(jl_codectx_t &ctx, Value *parent, ArrayRef<Value*> ptrs)
32413241
{
3242+
// if there are no child objects we can skip emission
3243+
if (ptrs.empty())
3244+
return;
32423245
SmallVector<Value*, 8> decay_ptrs;
32433246
decay_ptrs.push_back(maybe_decay_untracked(ctx, emit_bitcast(ctx, parent, T_prjlvalue)));
32443247
for (auto ptr : ptrs) {

src/codegen.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4972,7 +4972,7 @@ static Value *get_current_task(jl_codectx_t &ctx)
49724972
const int ptls_offset = offsetof(jl_task_t, gcstack);
49734973
return ctx.builder.CreateInBoundsGEP(
49744974
T_pjlvalue, emit_bitcast(ctx, ctx.pgcstack, T_ppjlvalue),
4975-
ConstantInt::get(T_size, -ptls_offset / sizeof(void *)),
4975+
ConstantInt::get(T_size, -(ptls_offset / sizeof(void *))),
49764976
"current_task");
49774977
}
49784978

0 commit comments

Comments
 (0)