summaryrefslogtreecommitdiff
path: root/test/CodeGen/SystemZ/atomic-store-02.ll
diff options
context:
space:
mode:
authorUlrich Weigand <ulrich.weigand@de.ibm.com>2017-08-04 18:53:35 +0000
committerUlrich Weigand <ulrich.weigand@de.ibm.com>2017-08-04 18:53:35 +0000
commit48ff7cfe277caa0ecd38a32e10a5a02fe88dfea9 (patch)
tree2d8a25bc56070d3e2a5979d760fc64dd92ac2ea3 /test/CodeGen/SystemZ/atomic-store-02.ll
parentcb6d1820b8ffec7dfbc0727eba3250e48b1ff490 (diff)
[SystemZ] Eliminate unnecessary serialization operations
We currently emit a serialization operation (bcr 14, 0) before every atomic load and after every atomic store. This is overly conservative. The SystemZ architecture actually does not require any serialization for atomic loads, and a serialization after an atomic store only if we need to enforce sequential consistency. This is what other compilers for the platform implement as well. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310093 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/SystemZ/atomic-store-02.ll')
-rw-r--r--test/CodeGen/SystemZ/atomic-store-02.ll9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/CodeGen/SystemZ/atomic-store-02.ll b/test/CodeGen/SystemZ/atomic-store-02.ll
index c9576e55656..f23bac68289 100644
--- a/test/CodeGen/SystemZ/atomic-store-02.ll
+++ b/test/CodeGen/SystemZ/atomic-store-02.ll
@@ -10,3 +10,12 @@ define void @f1(i16 %val, i16 *%src) {
store atomic i16 %val, i16 *%src seq_cst, align 2
ret void
}
+
+define void @f2(i16 %val, i16 *%src) {
+; CHECK-LABEL: f2:
+; CHECK: sth %r2, 0(%r3)
+; CHECK-NOT: bcr 1{{[45]}}, %r0
+; CHECK: br %r14
+ store atomic i16 %val, i16 *%src monotonic, align 2
+ ret void
+}