diff options
author | Yaxun Liu <Yaxun.Liu@amd.com> | 2016-11-01 18:45:32 +0000 |
---|---|---|
committer | Yaxun Liu <Yaxun.Liu@amd.com> | 2016-11-01 18:45:32 +0000 |
commit | d0d90368c57fe69d1a4166ec7b61eb482360419e (patch) | |
tree | 38b4ed0972e4d0752f5be8af71d59f8e75bdd23d /include/clang/Basic/Attr.td | |
parent | 63cbcdadcc74a3a6e0ff9f76028758ce97741203 (diff) |
[OpenCL] Mark group functions as convergent in opencl-c.h
Certain OpenCL builtin functions are supposed to be executed by all threads in a work group or sub group. Such functions should not be made divergent during transformation. It makes sense to mark them with convergent attribute.
The adding of convergent attribute is based on Ettore Speziale's work and the original proposal and patch can be found at https://www.mail-archive.com/cfe-commits@lists.llvm.org/msg22271.html.
Differential Revision: https://reviews.llvm.org/D25343
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@285725 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Basic/Attr.td')
-rw-r--r-- | include/clang/Basic/Attr.td | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/include/clang/Basic/Attr.td b/include/clang/Basic/Attr.td index 709af0a6db..11f4a13ab1 100644 --- a/include/clang/Basic/Attr.td +++ b/include/clang/Basic/Attr.td @@ -1026,6 +1026,12 @@ def NoDuplicate : InheritableAttr { let Documentation = [NoDuplicateDocs]; } +def Convergent : InheritableAttr { + let Spellings = [GNU<"convergent">, CXX11<"clang", "convergent">]; + let Subjects = SubjectList<[Function]>; + let Documentation = [ConvergentDocs]; +} + def NoInline : InheritableAttr { let Spellings = [GCC<"noinline">, Declspec<"noinline">]; let Subjects = SubjectList<[Function]>; |