<div dir="auto"><div>I'm pretty sure the x86-64 manual said this was *not* guaranteed for accesses that cross a cacheline. <span style="font-family:sans-serif">(On vacation, so am not going to lookup quote)</span></div><div dir="auto"><br></div><div dir="auto">Do you read something that makes you think this is actually safe?</div><div dir="auto"><br></div><div dir="auto"><br></div><div dir="auto"><div class="gmail_extra" dir="auto"><div class="gmail_quote">On Aug 28, 2017 1:36 PM, "Wei Mi via Phabricator" <<a href="mailto:reviews@reviews.llvm.org">reviews@reviews.llvm.org</a>> wrote:<br type="attribution"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">wmi created this revision.<br>
Herald added a subscriber: sanjoy.<br>
<br>
The patch is to fix PR34347.<br>
<br>
Now llvm generates library calls of atomic_load/store for unaligned load/store of atomic primitive integer type vars on x86_64. Since x86_64 support unaligned atomic load/store for primitive integers, this is not efficient. The patch fixes that.<br>
<br>
To fix PR34347, change in clang is also needed. That will be included in another patch.<br>
<br>
<br>
Repository:<br>
  rL LLVM<br>
<br>
<a href="https://reviews.llvm.org/D37221" rel="noreferrer" target="_blank">https://reviews.llvm.org/<wbr>D37221</a><br>
<br>
Files:<br>
  include/llvm/Target/<wbr>TargetLowering.h<br>
  lib/CodeGen/AtomicExpandPass.<wbr>cpp<br>
  lib/CodeGen/SelectionDAG/<wbr>SelectionDAGBuilder.cpp<br>
  lib/Target/X86/<wbr>X86ISelLowering.cpp<br>
  lib/Target/X86/<wbr>X86ISelLowering.h<br>
  test/Transforms/AtomicExpand/<wbr>X86/expand-unaligned-<wbr>expansion.ll<br>
<br>
</blockquote></div><br></div></div></div>