[llvm] r260018 - LangRef: Fix example code for cmpxchg
Duncan P. N. Exon Smith via llvm-commits
llvm-commits at lists.llvm.org
Sat Feb 6 21:06:36 PST 2016
Author: dexonsmith
Date: Sat Feb 6 23:06:35 2016
New Revision: 260018
URL: http://llvm.org/viewvc/llvm-project?rev=260018&view=rev
Log:
LangRef: Fix example code for cmpxchg
Patch by Daniel Robertson!
Modified:
llvm/trunk/docs/LangRef.rst
Modified: llvm/trunk/docs/LangRef.rst
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/LangRef.rst?rev=260018&r1=260017&r2=260018&view=diff
==============================================================================
--- llvm/trunk/docs/LangRef.rst (original)
+++ llvm/trunk/docs/LangRef.rst Sat Feb 6 23:06:35 2016
@@ -7114,11 +7114,11 @@ Example:
.. code-block:: llvm
entry:
- %orig = atomic load i32, i32* %ptr unordered ; yields i32
+ %orig = load atomic i32, i32* %ptr unordered, align 4 ; yields i32
br label %loop
loop:
- %cmp = phi i32 [ %orig, %entry ], [%old, %loop]
+ %cmp = phi i32 [ %orig, %entry ], [%value_loaded, %loop]
%squared = mul i32 %cmp, %cmp
%val_success = cmpxchg i32* %ptr, i32 %cmp, i32 %squared acq_rel monotonic ; yields { i32, i1 }
%value_loaded = extractvalue { i32, i1 } %val_success, 0
More information about the llvm-commits
mailing list