[PATCH] D38392: Disallow sinking of unordered atomic loads into loops

Philip Reames via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 29 10:16:49 PDT 2017


reames added a comment.

In https://reviews.llvm.org/D38392#884577, @danielcdh wrote:

> How about the following case:
>
> while(c1) {
>
>   if (c2)
>    atomic_load;
>
> }
>
> Looks like isSafeToExecuteUnconditionally will not prevent the atomic_load from hoisted to preheader. So in real execution, it may introduce extra atomic loads?


>From an aliasing/ordering perspective nothing has changed in this example.  We have an additional safety requirement (we can't introduce faults), but we haven't changed anything about the memory model legality of the reordering.


https://reviews.llvm.org/D38392





More information about the llvm-commits mailing list