Skip to content

Commit bc06ac5

Browse files
committed
Fix fast getptls ccall lowering.
1 parent 5230d27 commit bc06ac5

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

src/ccall.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1671,7 +1671,7 @@ static jl_cgval_t emit_ccall(jl_codectx_t &ctx, jl_value_t **args, size_t nargs)
16711671
emit_gc_safepoint(ctx.builder, ctx.types().T_size, get_current_ptls(ctx), ctx.tbaa().tbaa_const);
16721672
return ghostValue(ctx, jl_nothing_type);
16731673
}
1674-
else if (is_libjulia_func("jl_get_ptls_states")) {
1674+
else if (is_libjulia_func(jl_get_ptls_states)) {
16751675
++CCALL_STAT(jl_get_ptls_states);
16761676
assert(lrt == ctx.types().T_size);
16771677
assert(!isVa && !llvmcall && nccallargs == 0);

src/julia_threads.h

-3
Original file line numberDiff line numberDiff line change
@@ -206,10 +206,7 @@ typedef struct _jl_tls_states_t {
206206
#endif
207207
} jl_tls_states_t;
208208

209-
#ifndef JL_LIBRARY_EXPORTS
210-
// deprecated (only for external consumers)
211209
JL_DLLEXPORT void *jl_get_ptls_states(void);
212-
#endif
213210

214211
// Update codegen version in `ccall.cpp` after changing either `pause` or `wake`
215212
#ifdef __MIC__

test/compiler/codegen.jl

+3
Original file line numberDiff line numberDiff line change
@@ -966,3 +966,6 @@ end
966966
let x = Incomplete55396(55396)
967967
@test x.x === (55396,)
968968
end
969+
970+
# Core.getptls() special handling
971+
@test !occursin("call ptr @jlplt", get_llvm(Core.getptls, Tuple{})) #It should lower to a direct load of the ptls and not a ccall

0 commit comments

Comments
 (0)