diff options
author | Eli Friedman <eli.friedman@gmail.com> | 2011-07-25 23:16:38 +0000 |
---|---|---|
committer | Eli Friedman <eli.friedman@gmail.com> | 2011-07-25 23:16:38 +0000 |
commit | fee02c6c1378f7244e05157aa9b07da77061fb64 (patch) | |
tree | 5fe5c224e99b98699f84e5fc8d0e74c70535ee25 /llvm/docs/LangRef.html | |
parent | 15e2d90746f8ca9f5d4b29cafc0a4493daeb54cb (diff) | |
download | bcm5719-llvm-fee02c6c1378f7244e05157aa9b07da77061fb64.tar.gz bcm5719-llvm-fee02c6c1378f7244e05157aa9b07da77061fb64.zip |
Initial implementation of 'fence' instruction, the new C++0x-style replacement for llvm.memory.barrier.
This is just a LangRef entry and reading/writing/memory representation; optimizer+codegen support coming soon.
llvm-svn: 136009
Diffstat (limited to 'llvm/docs/LangRef.html')
-rw-r--r-- | llvm/docs/LangRef.html | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/llvm/docs/LangRef.html b/llvm/docs/LangRef.html index ec751504dab..ad74b1c5e7e 100644 --- a/llvm/docs/LangRef.html +++ b/llvm/docs/LangRef.html @@ -170,6 +170,7 @@ <li><a href="#i_alloca">'<tt>alloca</tt>' Instruction</a></li> <li><a href="#i_load">'<tt>load</tt>' Instruction</a></li> <li><a href="#i_store">'<tt>store</tt>' Instruction</a></li> + <li><a href="#i_fence">'<tt>fence</tt>' Instruction</a></li> <li><a href="#i_getelementptr">'<tt>getelementptr</tt>' Instruction</a></li> </ol> </li> @@ -4552,6 +4553,63 @@ that the invoke/unwind semantics are likely to change in future versions.</p> </div> <!-- _______________________________________________________________________ --> +<div class="doc_subsubsection"> <a name="i_fence">'<tt>fence</tt>' +Instruction</a> </div> + +<div class="doc_text"> + +<h5>Syntax:</h5> +<pre> + fence [singlethread] <ordering> <i>; yields {void}</i> +</pre> + +<h5>Overview:</h5> +<p>The '<tt>fence</tt>' instruction is used to introduce happens-before edges +between operations.</p> + +<h5>Arguments:</h5> <p>'<code>fence</code>' instructions take an <a +href="#ordering">ordering</a> argument which defines what +<i>synchronizes-with</i> edges they add. They can only be given +<code>acquire</code>, <code>release</code>, <code>acq_rel</code>, and +<code>seq_cst</code> orderings.</p> + +<h5>Semantics:</h5> +<p>A fence <var>A</var> which has (at least) <code>release</code> ordering +semantics <i>synchronizes with</i> a fence <var>B</var> with (at least) +<code>acquire</code> ordering semantics if and only if there exist atomic +operations <var>X</var> and <var>Y</var>, both operating on some atomic object +<var>M</var>, such that <var>A</var> is sequenced before <var>X</var>, +<var>X</var> modifies <var>M</var> (either directly or through some side effect +of a sequence headed by <var>X</var>), <var>Y</var> is sequenced before +<var>B</var>, and <var>Y</var> observes <var>M</var>. This provides a +<i>happens-before</i> dependency between <var>A</var> and <var>B</var>. Rather +than an explicit <code>fence</code>, one (but not both) of the atomic operations +<var>X</var> or <var>Y</var> might provide a <code>release</code> or +<code>acquire</code> (resp.) ordering constraint and still +<i>synchronize-with</i> the explicit <code>fence</code> and establish the +<i>happens-before</i> edge.</p> + +<p>A <code>fence</code> which has <code>seq_cst</code> ordering, in addition to +having both <code>acquire</code> and <code>release</code> semantics specified +above, participates in the global program order of other <code>seq_cst</code> +operations and/or fences.</p> + +<p>The optional "<a href="#singlethread"><code>singlethread</code></a>" argument +specifies that the fence only synchronizes with other fences in the same +thread. (This is useful for interacting with signal handlers.)</p> + +<p>FIXME: This instruction is a work in progress; until it is finished, use + llvm.memory.barrier. + +<h5>Example:</h5> +<pre> + fence acquire <i>; yields {void}</i> + fence singlethread seq_cst <i>; yields {void}</i> +</pre> + +</div> + +<!-- _______________________________________________________________________ --> <h4> <a name="i_getelementptr">'<tt>getelementptr</tt>' Instruction</a> </h4> |