]> granicus.if.org Git - llvm/commit
[X86] Use movq for i64 atomic load on 32-bit targets when sse2 is enable
authorCraig Topper <craig.topper@intel.com>
Fri, 22 Mar 2019 20:46:56 +0000 (20:46 +0000)
committerCraig Topper <craig.topper@intel.com>
Fri, 22 Mar 2019 20:46:56 +0000 (20:46 +0000)
commit962427e90b0b65e803c14e948b1073c3c429016c
tree5dbc3f5a58a1dbd7bb6c61e755dd0928b78e1998
parentb1aec70893fc169ccab9a0017a318744d12e82a9
[X86] Use movq for i64 atomic load on 32-bit targets when sse2 is enable

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.

Differential Revision: https://reviews.llvm.org/D59679

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@356807 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/X86/X86ISelLowering.cpp
test/CodeGen/X86/atomic-load-store-wide.ll
test/CodeGen/X86/atomic-non-integer.ll