Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/llvm/llvm-project.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/mlir/test
diff options
context:
space:
mode:
authorEli Friedman <efriedma@quicinc.com>2022-10-12 00:00:33 +0300
committerEli Friedman <efriedma@quicinc.com>2022-10-12 00:00:33 +0300
commit1079662d2fff7ae799503d910b299c5108d105fd (patch)
treeb7ab0a158e7e6615117d8f8004cccfcd52239aa2 /mlir/test
parent0456acbfb942f127359a8defd1b4f1f44420df3e (diff)
[clang][codegen] Don't emit atomic loads for threadsafe init if they aren't inline
Performing a load before calling __cxa_guard_acquire is supposed to be an optimization, but it isn't much of one if we're just going to emit a call to __atomic_load_1 instead. Instead, just skip the load, and let __cxa_guard_acquire do whatever it wants. (In practice, on such targets, the C++ library is just built with threading turned off, so the result isn't actually threadsafe, but there's not really anything clang can do about that.) The alternative here is that we try to define some ABI for threadsafe init that allows the speculative load without full atomics. Almost any target without full atomics has a load that's s "atomic enough" for this purpose. But it's not clear how we emit an "atomic enough" load in LLVM IR, and there isn't any ABI document we can refer to. Or I guess we could turn off -fthreadsafe-statics by default on Cortex-M0, but that seems like it would be surprising. Fixes https://github.com/llvm/llvm-project/issues/58184 Differential Revision: https://reviews.llvm.org/D135628
Diffstat (limited to 'mlir/test')
0 files changed, 0 insertions, 0 deletions