[PATCH] D61863: Prefer locked stack op over mfence for seq_cst stores
Philip Reames via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon May 13 10:09:24 PDT 2019
reames updated this revision to Diff 199291.
reames added a comment.
Fix a stale comment.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D61863/new/
https://reviews.llvm.org/D61863
Files:
lib/Target/X86/X86ISelLowering.cpp
test/CodeGen/X86/atomic-load-store-wide.ll
test/CodeGen/X86/atomic-non-integer.ll
Index: test/CodeGen/X86/atomic-non-integer.ll
===================================================================
--- test/CodeGen/X86/atomic-non-integer.ll
+++ test/CodeGen/X86/atomic-non-integer.ll
@@ -710,7 +710,7 @@
; X86-SSE2-NEXT: movl {{[0-9]+}}(%esp), %eax
; X86-SSE2-NEXT: movsd {{.*#+}} xmm0 = mem[0],zero
; X86-SSE2-NEXT: movlps %xmm0, (%eax)
-; X86-SSE2-NEXT: mfence
+; X86-SSE2-NEXT: lock orl $0, (%esp)
; X86-SSE2-NEXT: retl
;
; X86-AVX-LABEL: store_double_seq_cst:
@@ -718,7 +718,7 @@
; X86-AVX-NEXT: movl {{[0-9]+}}(%esp), %eax
; X86-AVX-NEXT: vmovsd {{.*#+}} xmm0 = mem[0],zero
; X86-AVX-NEXT: vmovlps %xmm0, (%eax)
-; X86-AVX-NEXT: mfence
+; X86-AVX-NEXT: lock orl $0, (%esp)
; X86-AVX-NEXT: retl
;
; X86-NOSSE-LABEL: store_double_seq_cst:
Index: test/CodeGen/X86/atomic-load-store-wide.ll
===================================================================
--- test/CodeGen/X86/atomic-load-store-wide.ll
+++ test/CodeGen/X86/atomic-load-store-wide.ll
@@ -11,7 +11,7 @@
; SSE42-NEXT: movl {{[0-9]+}}(%esp), %eax
; SSE42-NEXT: movsd {{.*#+}} xmm0 = mem[0],zero
; SSE42-NEXT: movlps %xmm0, (%eax)
-; SSE42-NEXT: mfence
+; SSE42-NEXT: lock orl $0, (%esp)
; SSE42-NEXT: retl
;
; NOSSE-LABEL: test1:
Index: lib/Target/X86/X86ISelLowering.cpp
===================================================================
--- lib/Target/X86/X86ISelLowering.cpp
+++ lib/Target/X86/X86ISelLowering.cpp
@@ -26423,9 +26423,10 @@
Ops, MVT::i64,
Node->getMemOperand());
- // If this is a sequentially consistent store, also emit an mfence.
+ // If this is a sequentially consistent store, also emit an appropriate
+ // barrier
if (IsSeqCst)
- Chain = DAG.getNode(X86ISD::MFENCE, dl, MVT::Other, Chain);
+ Chain = emitLockedStackOp(DAG, Subtarget, Chain, dl);
return Chain;
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D61863.199291.patch
Type: text/x-patch
Size: 1989 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190513/330767ff/attachment.bin>
More information about the llvm-commits
mailing list