[PATCH] Replace the result usages while legalizing cmpxchg

Logan Chien tzuhsiang.chien at gmail.com
Thu Jul 17 10:13:09 PDT 2014


Hi,

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.

    %0 = cmpxchg i8* %ptr, i8 %desire, i8 %new monotonic monotonic
    %1 = extractvalue { i8, i1 } %0, 1

This will result in assertion failure because the dag for extractvalue will
be processed before the legalization of the new dag for cmpxchg.

The attached patch should fixed this problem.  Please have a look.  Thanks.

Sincerely,
Logan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140718/b6dab507/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Replace-the-result-usages-while-legalizing-cmpxchg.patch
Type: text/x-patch
Size: 3783 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140718/b6dab507/attachment.bin>


More information about the llvm-commits mailing list