[PATCH] D49194: [WebAssembly] Add tests for weaker memory consistency orderings

Dan Gohman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 23 15:09:21 PDT 2018


sunfish added a comment.

In https://reviews.llvm.org/D49194#1172051, @jfb wrote:

> I have a talk for you! https://youtu.be/IB57wIf9W1k?t=52m20s
>  I talk about volatile in a few places, but 52m20s is the main one. Basically I'm advocating for something similar to the weird MSVC x86 volatile behavior because some users write code like a loop which updates a volatile variable which another thread reads, and expect it to stay in the loop (not hoisted out). Lowering to regular load / store breaks the guarantee that volatiles effects touch the variable's bytes once per source event. Such user code should really use atomic, but we don't need to be pedants about it.


Your talk mentions `-fms-volatile`, which looks like the functionality you're asking for with volatile here, right? If so, then we seem to be good here. If that's desirable to enable by default, please bring that up with the clang maintainers.


Repository:
  rL LLVM

https://reviews.llvm.org/D49194





More information about the llvm-commits mailing list