[PATCH] D37463: Fix miscompile in LoopSink pass

Daniel Berlin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 8 00:51:54 PDT 2017


dberlin added a comment.

In https://reviews.llvm.org/D37463#861838, @mkazantsev wrote:

> I need to read what C++ specification says about this particular issue, but basically LLVM is not only used to compile C++. This situation can be illegal in other languages (again, need to dig more through specifications). My proposal is to add an option that prohibits this transform and set it to `false` by default, with abitily to turn it off for languages where it is prohibited.


LLVM has a memory model.
https://llvm.org/docs/LangRef.html#memory-model-for-concurrent-operations

If this violates LLVM's memory model, it's a bug.
It it doesn't, it should not be turned off, and an other-language frontend needs to make sure the code it generates is correct in LLVM's memory model.
(or of course, start a discussion about changing the memory model)


Repository:
  rL LLVM

https://reviews.llvm.org/D37463





More information about the llvm-commits mailing list