Skip to content

Commit d48a675

Browse files
authored
codegen: relaxed jl_tls_states_t.safepoint load (#58828)
Every function with a safepoint causes spurious thread sanitizer warnings without this change. Codegen is unaffected, except when we build with `ThreadSanitizerPass`.
1 parent 309b1b1 commit d48a675

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/llvm-codegen-shared.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,7 @@ static inline llvm::Value *get_current_signal_page_from_ptls(llvm::IRBuilder<> &
197197
llvm::Value *psafepoint = builder.CreateConstInBoundsGEP1_32(i8, ptls, nthfield);
198198
LoadInst *ptls_load = builder.CreateAlignedLoad(
199199
T_ptr, psafepoint, Align(sizeof(void *)), "safepoint");
200+
ptls_load->setOrdering(AtomicOrdering::Monotonic);
200201
tbaa_decorate(tbaa, ptls_load);
201202
return ptls_load;
202203
}

0 commit comments

Comments
 (0)