[PATCH] D17012: Update document about convergent attribute.

Justin Lebar via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 8 18:13:04 PST 2016


jlebar created this revision.
jlebar added reviewers: hfinkel, resistor, chandlerc, arsenm.
jlebar added subscribers: llvm-commits, jingyue, joker.eph, tra, jhen.

Be more explicit that 'convergent' means that you either are or may
invoke an inherently convergent operation, such as
llvm.cuda.syncthreads.  Where the compiler can prove that you do not
invoke such an operation, it's free to remove the attribute and treat
you as not-convergent.

http://reviews.llvm.org/D17012

Files:
  docs/LangRef.rst

Index: docs/LangRef.rst
===================================================================
--- docs/LangRef.rst
+++ docs/LangRef.rst
@@ -1239,10 +1239,19 @@
     function call are also considered to be cold; and, thus, given low
     weight.
 ``convergent``
-    This attribute indicates that the callee is dependent on a convergent
+    This attribute indicates that the callee might depend on a convergent
     thread execution pattern under certain parallel execution models.
-    Transformations that are execution model agnostic may not make the execution
-    of a convergent operation control dependent on any additional values.
+
+    In these execution models, certain operations have the property that they
+    cannot be made control-dependent on any additional values.  We call these
+    operations ``convergent``.  For example, the ``llvm.cuda.syncthreads``
+    intrinsic is convergent, and so functions which (transitively) invoke it
+    must also be convergent.
+
+    Unless it can be proved that an operation does not transitively invoke any
+    convergent operations, transformations that are execution-model agnostic
+    may not make the execution of a convergent operation control-dependent on
+    any additional values.
 ``inaccessiblememonly``
     This attribute indicates that the function may only access memory that
     is not accessible by the module being compiled. This is a weaker form


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D17012.47281.patch
Type: text/x-patch
Size: 1424 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160209/e29359d5/attachment.bin>


More information about the llvm-commits mailing list