<div dir="ltr"><div><div><div><div>Hi,<br><br></div>It seems that the not all of the results of ATOMIC_CMP_SWAP_WITH_SUCCESS are updated in the type legalization step.  For example, in the following code sequence, only the first result (oldval) and the third result (outchain) will be updated to the new dag.  The second result (success_bit) will be left unchanged.<br>
<br>    %0 = cmpxchg i8* %ptr, i8 %desire, i8 %new monotonic monotonic<br>    %1 = extractvalue { i8, i1 } %0, 1<br><br></div>This will result in assertion failure because the dag for extractvalue will be processed before the legalization of the new dag for cmpxchg.<br>
<br></div>The attached patch should fixed this problem.  Please have a look.  Thanks.<br><br></div>Sincerely,<br>Logan<br></div>