summaryrefslogtreecommitdiff
path: root/test/Feature
diff options
context:
space:
mode:
authorEli Bendersky <eliben@google.com>2014-03-18 23:51:07 +0000
committerEli Bendersky <eliben@google.com>2014-03-18 23:51:07 +0000
commit21354ec60d0dde4f1995d816701b895c57f806bd (patch)
treec00e675912eb5ddca01b813594beb3b9d03dd719 /test/Feature
parentcae25dcbf7347d1a04f8746aedd6d6600b528a40 (diff)
downloadllvm-21354ec60d0dde4f1995d816701b895c57f806bd.tar.gz
llvm-21354ec60d0dde4f1995d816701b895c57f806bd.tar.bz2
llvm-21354ec60d0dde4f1995d816701b895c57f806bd.tar.xz
Expose "noduplicate" attribute as a property for intrinsics.
The "noduplicate" function attribute exists to prevent certain optimizations from duplicating calls to the function. This is important on platforms where certain function call duplications are unsafe (for example execution barriers for CUDA and OpenCL). This patch makes it possible to specify intrinsics as "noduplicate" and translates that to the appropriate function attribute. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204200 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Feature')
-rw-r--r--test/Feature/intrinsic-noduplicate.ll9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/Feature/intrinsic-noduplicate.ll b/test/Feature/intrinsic-noduplicate.ll
new file mode 100644
index 0000000000..9a2b0aba5b
--- /dev/null
+++ b/test/Feature/intrinsic-noduplicate.ll
@@ -0,0 +1,9 @@
+; RUN: llvm-as < %s | llvm-dis | FileCheck %s
+
+; Make sure LLVM knows about the noduplicate attribute on the
+; llvm.cuda.syncthreads intrinsic.
+
+declare void @llvm.cuda.syncthreads()
+
+; CHECK: declare void @llvm.cuda.syncthreads() #[[ATTRNUM:[0-9]+]]
+; CHECK: attributes #[[ATTRNUM]] = { noduplicate nounwind }