Hi All,<div><br></div><div>  I am reading about LLVM IR atomics (<a href="http://llvm.org/docs/Atomics.html">http://llvm.org/docs/Atomics.html</a>) and get confused about the difference between "Unordered" and "Monotonic". In particular, I am not sure I understand the statement of "It essentially guarantees that if you take all the operations affecting a specific address, a consistent ordering exists.". For me, it means that for the following example, if {r1,r2} = {1,2}, {r3,r4} = {2,1} is not allowed under "Monotonic" but allowed under "Unordered". Is this all how "Monotonic" is stronger than "Unordered"? If not, can anyone provide an example where other behaviors are allowed under "Unordered" but not "Monotonic"?</div>
<div><br></div><div><br></div><div>----------------------------------------------------------------------------------------</div><div>T1            T2               T3             T4</div><div>W(X)=1     W(X)=2        r1=R(X)     r3=R(X)</div>
<div>                                   r2=R(X)     r4=R(X)</div><div><br></div><div>* Legend: four threads run in parallel; W(X)/R(X) meaning atomic write/read of X.</div><div>----------------------------------------------------------------------------------------</div>
<div><br></div><div>Thank you.</div><div><br></div><div>- Lei</div>