summaryrefslogtreecommitdiffstats
path: root/llvm/test/CodeGen
diff options
context:
space:
mode:
authorTim Northover <tnorthover@apple.com>2017-04-20 21:56:52 +0000
committerTim Northover <tnorthover@apple.com>2017-04-20 21:56:52 +0000
commit46e58354daa0e6508a25e3e74b926b8eb6374ccd (patch)
tree65a5169ec9c375748b55a07b92fcab15777388ed /llvm/test/CodeGen
parent906ffb7b8f8e5cb767a4083a44f69684bb42f3ae (diff)
downloadbcm5719-llvm-46e58354daa0e6508a25e3e74b926b8eb6374ccd.tar.gz
bcm5719-llvm-46e58354daa0e6508a25e3e74b926b8eb6374ccd.zip
ARM: lower "fence singlethread" to a pure compiler barrier.
Single-threaded fences aren't required to provide any synchronization with other processing elements so there's no need for a DMB. They should still be a barrier for compiler optimizations though. llvm-svn: 300904
Diffstat (limited to 'llvm/test/CodeGen')
-rw-r--r--llvm/test/CodeGen/ARM/fence-singlethread.ll16
1 files changed, 16 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/ARM/fence-singlethread.ll b/llvm/test/CodeGen/ARM/fence-singlethread.ll
new file mode 100644
index 00000000000..ec032ccac42
--- /dev/null
+++ b/llvm/test/CodeGen/ARM/fence-singlethread.ll
@@ -0,0 +1,16 @@
+; RUN: llc -mtriple=thumbv7-linux-gnueabihf %s -o - | FileCheck %s
+; RUN: llc -mtriple=thumbv7-apple-ios %s -o - | FileCheck %s
+; RUN: llc -mtriple=thumbv7-linux-gnueabihf %s -filetype=obj -o %t
+; RUN: llvm-objdump -d %t | FileCheck %s --check-prefix=OBJ
+
+; OBJ-NOT: dmb
+
+define void @fence_singlethread() {
+; CHECK-LABEL: fence_singlethread:
+; CHECK-NOT: dmb
+; CHECK: @ COMPILER BARRIER
+; CHECK-NOT: dmb
+
+ fence singlethread seq_cst
+ ret void
+}
OpenPOWER on IntegriCloud