1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 11:42:57 +01:00

Update langref to indicate that calls may be convergent.

Summary:
As previously written, only functions could be convergent.  But calls
need to have a notion of convergence as well.

To see why this is important, consider an indirect call.  We may or may
not want to disable optimizations around it and behave as though we're
calling a convergent function -- it depends on the semantics of the
language we're compiling.  Thus the need for this attr on the call.

Reviewers: jingyue, joker.eph

Subscribers: llvm-commits, tra, jhen, arsenm, chandlerc, hfinkel, resistor

Differential Revision: http://reviews.llvm.org/D17314

llvm-svn: 261111
This commit is contained in:
Justin Lebar 2016-02-17 17:46:41 +00:00
parent 88f52cf70a
commit 82b56ffe65

View File

@ -1240,15 +1240,24 @@ example:
``convergent`` ``convergent``
In some parallel execution models, there exist operations that cannot be In some parallel execution models, there exist operations that cannot be
made control-dependent on any additional values. We call such operations made control-dependent on any additional values. We call such operations
``convergent``, and mark them with this function attribute. ``convergent``, and mark them with this attribute.
The ``convergent`` attribute may appear on functions or call/invoke
instructions. When it appears on a function, it indicates that calls to
this function should not be made control-dependent on additional values.
For example, the intrinsic ``llvm.cuda.syncthreads`` is ``convergent``, so For example, the intrinsic ``llvm.cuda.syncthreads`` is ``convergent``, so
calls to this intrinsic cannot be made control-dependent on additional calls to this intrinsic cannot be made control-dependent on additional
values. Other functions may also be marked as convergent; this prevents values.
the same optimization on those functions.
The optimizer may remove the ``convergent`` attribute when it can prove When it appears on a call/invoke, the ``convergent`` attribute indicates
that the function does not execute any convergent operations. that we should treat the call as though we're calling a convergent
function. This is particularly useful on indirect calls; without this we
may treat such calls as though the target is non-convergent.
The optimizer may remove the ``convergent`` attribute on functions when it
can prove that the function does not execute any convergent operations.
Similarly, the optimizer may remove ``convergent`` on calls/invokes when it
can prove that the call/invoke cannot call a convergent function.
``inaccessiblememonly`` ``inaccessiblememonly``
This attribute indicates that the function may only access memory that This attribute indicates that the function may only access memory that
is not accessible by the module being compiled. This is a weaker form is not accessible by the module being compiled. This is a weaker form