3 ms·
> For example, on x86, compilers drop all explicit store fences because they're "unnecessary" on the hardware I mean specifically for new programs that are wri
by kmeisthax 2y ago
> For example, on x86, compilers drop all explicit store fences because they're "unnecessary" on the hardware
I mean specifically for new programs that are written with weaker memory models in mind. So you'd have to enable an -fNOTSO flag on your compiler that emits all the fences that would otherwise be skipped.
Looking at what I can find about nontemporal stores, they sound like they already have a weird kind of release semantics on x86, even though their intent was to avoid cache thrashing, not so much to allow greater memory reordering. Are these actually used in compilers?
- jcranmer 2y agoCompilers will generally expose a nontemporal store intrinsic, but don't expect them to actually try to use it automatically.
- anonymousDan 2y agoI think they were particularly beneficial in some workloads for optane persistent memory
- dzaima 2y agoCompilers can generate non-temporal ops if you ask for it explicitly in some form. And they are problematic: https://github.com/llvm/llvm-project/issues/64521 https://github.com/llvm/llvm-project/issues/64521