summaryrefslogtreecommitdiffstats
path: root/llvm/test/CodeGen/SystemZ
diff options
context:
space:
mode:
authorUlrich Weigand <ulrich.weigand@de.ibm.com>2016-04-04 12:45:44 +0000
committerUlrich Weigand <ulrich.weigand@de.ibm.com>2016-04-04 12:45:44 +0000
commita9ac6d6cc225a25eb55c7edd8825780c44ee351e (patch)
tree5ade5d942142285fcb628155f98ce498102c7120 /llvm/test/CodeGen/SystemZ
parentf557d083252598cc42ce1b5409edaa91a305c9f9 (diff)
downloadbcm5719-llvm-a9ac6d6cc225a25eb55c7edd8825780c44ee351e.tar.gz
bcm5719-llvm-a9ac6d6cc225a25eb55c7edd8825780c44ee351e.zip
[SystemZ] Support ATOMIC_FENCE
A cross-thread sequentially consistent fence should be lowered into z/Architecture's BCR serialization instruction, instead of causing a fatal error in the back-end. Author: bryanpkc Differential Revision: http://reviews.llvm.org/D18644 llvm-svn: 265292
Diffstat (limited to 'llvm/test/CodeGen/SystemZ')
-rw-r--r--llvm/test/CodeGen/SystemZ/atomic-fence-01.ll16
-rw-r--r--llvm/test/CodeGen/SystemZ/atomic-fence-02.ll13
2 files changed, 29 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/SystemZ/atomic-fence-01.ll b/llvm/test/CodeGen/SystemZ/atomic-fence-01.ll
new file mode 100644
index 00000000000..25566db9078
--- /dev/null
+++ b/llvm/test/CodeGen/SystemZ/atomic-fence-01.ll
@@ -0,0 +1,16 @@
+; Test (fast) serialization.
+;
+; RUN: llc < %s -mtriple=s390x-linux-gnu | FileCheck %s --check-prefix=Z10
+; RUN: llc < %s -mtriple=s390x-linux-gnu -mcpu=z196 | FileCheck %s --check-prefix=Z196
+; RUN: llc < %s -mtriple=s390x-linux-gnu -mcpu=zEC12 | FileCheck %s --check-prefix=ZEC12
+; RUN: llc < %s -mtriple=s390x-linux-gnu -mcpu=z13 | FileCheck %s --check-prefix=Z13
+
+define void @test() {
+; Z10: bcr 15, %r0
+; Z196: bcr 14, %r0
+; ZEC12: bcr 14, %r0
+; Z13: bcr 14, %r0
+ fence seq_cst
+ ret void
+}
+
diff --git a/llvm/test/CodeGen/SystemZ/atomic-fence-02.ll b/llvm/test/CodeGen/SystemZ/atomic-fence-02.ll
new file mode 100644
index 00000000000..4c4375ef669
--- /dev/null
+++ b/llvm/test/CodeGen/SystemZ/atomic-fence-02.ll
@@ -0,0 +1,13 @@
+; Serialization is emitted only for fence seq_cst.
+;
+; RUN: llc < %s -mtriple=s390x-linux-gnu | FileCheck %s
+
+define void @test() {
+; CHECK: #MEMBARRIER
+ fence acquire
+; CHECK: #MEMBARRIER
+ fence release
+; CHECK: #MEMBARRIER
+ fence acq_rel
+ ret void
+}
OpenPOWER on IntegriCloud