[PATCH] D59345: Allow code motion (and thus folding) for atomic (but unordered) memory operands

JF Bastien via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 14 10:09:33 PDT 2019


jfb added a comment.

>> I'm trying to figure out if this optimization is only correct for `memory_order_java`, or if it also applies to `memory_order_relaxed`. I can't see a case in your examples which wouldn't apply to `memory_order_relaxed` as well. @__simt__ WDYT?
>>  I'm not asking you to do that work. It just seems like a valid follow-up.
> 
> I'm not sure.  I believe that memory_order_relaxed maps to llvm's monotonic right?  If so, then I *think* moving one is safe, but monotonic is just subtly different enough from unordered and not atomic that a more careful audit would be needed.

Yes, `memory_order_relaxed` is `monotonic`.


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D59345/new/

https://reviews.llvm.org/D59345





More information about the llvm-commits mailing list