@@ -2959,12 +2959,12 @@ Value* LateLowerGCFrame::lowerGCAllocBytesLate(CallInst *target, Function &F)
2959
2959
builder.CreateStore (new_cursor, cursor_ptr);
2960
2960
2961
2961
// ptls->gc_num.allocd += osize;
2962
- // auto pool_alloc_pos = ConstantInt::get(Type::getInt64Ty(target->getContext()), offsetof(jl_tls_states_t, gc_num));
2963
- // auto pool_alloc_i8 = builder.CreateGEP(Type::getInt8Ty(target->getContext()), ptls, pool_alloc_pos);
2964
- // auto pool_alloc_tls = builder.CreateBitCast(pool_alloc_i8, PointerType::get(Type::getInt64Ty(target->getContext()), 0), "pool_alloc");
2965
- // auto pool_allocd = builder.CreateLoad(Type::getInt64Ty(target->getContext()), pool_alloc_tls);
2966
- // auto pool_allocd_total = builder.CreateAdd(pool_allocd, pool_osize);
2967
- // builder.CreateStore(pool_allocd_total, pool_alloc_tls);
2962
+ auto pool_alloc_pos = ConstantInt::get (Type::getInt64Ty (target->getContext ()), offsetof (jl_tls_states_t , gc_tls) + offsetof ( jl_gc_tls_states_t , gc_num));
2963
+ auto pool_alloc_i8 = builder.CreateGEP (Type::getInt8Ty (target->getContext ()), ptls, pool_alloc_pos);
2964
+ auto pool_alloc_tls = builder.CreateBitCast (pool_alloc_i8, PointerType::get (Type::getInt64Ty (target->getContext ()), 0 ), " pool_alloc" );
2965
+ auto pool_allocd = builder.CreateLoad (Type::getInt64Ty (target->getContext ()), pool_alloc_tls);
2966
+ auto pool_allocd_total = builder.CreateAdd (pool_allocd, pool_osize);
2967
+ builder.CreateStore (pool_allocd_total, pool_alloc_tls);
2968
2968
2969
2969
auto v_raw = builder.CreateNSWAdd (result, ConstantInt::get (Type::getInt64Ty (target->getContext ()), sizeof (jl_taggedvalue_t )));
2970
2970
auto v_as_ptr = builder.CreateIntToPtr (v_raw, poolAllocFunc->getReturnType ());
0 commit comments