[PATCH] D59679: [X86] Use movq for i64 atomic load on 32-bit targets when sse2 is enable

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 21 17:22:21 PDT 2019


craig.topper created this revision.
craig.topper added reviewers: reames, jfb, RKSimon, efriedma.
Herald added a subscriber: hiraditya.
Herald added a project: LLVM.

We used a lock cmpxchg8b to do i64 atomic loads. But if we have SSE2 we can do better and use a plain movq to do the load instead.

I tried to just use an f64 atomic load and add isel patterns to MOVSD(which the domain fixing pass can turn to MOVQ), but the atomic_load SDNode in TargetSelectionDAG.td requires the type to be integer.

So I've emitted VZEXT_LOAD instead which should be selected by isel to a MOVQ. Hopefully we don't need a specific atomic flavor of this. I kept the memory operand from the original AtomicSDNode. I wasn't sure if I might need to set the MOVolatile flag?

I've left some FIXMEs for improvements we can do without SSE2.


https://reviews.llvm.org/D59679

Files:
  llvm/lib/Target/X86/X86ISelLowering.cpp
  llvm/test/CodeGen/X86/atomic-load-store-wide.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D59679.191806.patch
Type: text/x-patch
Size: 4266 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190322/b72816e5/attachment.bin>


More information about the llvm-commits mailing list