[llvm-commits] [llvm] r137386 - /llvm/trunk/docs/Atomics.html

Jeffrey Yasskin jyasskin at google.com
Thu Aug 11 18:10:04 PDT 2011


On Thu, Aug 11, 2011 at 4:44 PM, Eli Friedman <eli.friedman at gmail.com> wrote:
> +<!-- ======================================================================= -->
> +<h3>
> +     <a name="o_acquire">Release</a>
> +</h3>
> +
> +<div>
>
>  <p>Release is similar to Acquire, but with a barrier of the sort necessary to
> -   release a lock. This corresponds to the C++0x/C1x
> -   <code>memory_order_release</code>. In general, optimizers should treat this
> -   like a nothrow call.</p>
> -
> -<p>AcquireRelease (<code>acq_rel</code> in IR) provides both an Acquire and a Release barrier.
> -   This corresponds to the C++0x/C1x <code>memory_order_acq_rel</code>. In general,
> -   optimizers should treat this like a nothrow call.</p>
> +   release a lock.
>
> -<p>SequentiallyConsistent (<code>seq_cst</code> in IR) provides Acquire and/or
> -   Release semantics, and in addition guarantees a total ordering exists with
> -   all other SequentiallyConsistent operations. This corresponds to the
> -   C++0x/C1x <code>memory_order_seq_cst</code>, and Java volatile.  The intent
> -   of this ordering level is to provide a programming model which is relatively
> -   easy to understand. In general, optimizers should treat this like a
> -   nothrow call.</p>
> +<dl>
> +  <dt>Relevant standard</dt>
> +  <dd>This corresponds to the C++0x/C1x <code>memory_order_release</code>.</dd>
> +  <dt>Notes for frontends</dt>
> +  <dd>If you are writing a frontend which uses this directly, use with caution.
> +      Release only provides a semantic guarantee when paired with a Acquire
> +      operation.</dd>
> +  <dt>Notes for optimizers</dt>
> +  <dd>In general, optimizers should treat this like a nothrow call; the
> +      the possible optimizations are usually not interesting.</dd>
> +  <dt>Notes for code generation</dt>
> +  <dd>Similarly to Acquire, a fence after the relevant operation is usually

You mean a "fence before", right?

> +      sufficient; see the section on Acquire.  Note that a store-store fence
> +      is not sufficient to implement Release semantics; store-store fences
> +      are generally not exposed to IR because they are extremely difficult to
> +      use correctly.</dd>
> +</dl>
>
>  </div>
>




More information about the llvm-commits mailing list