[LLVMdev] RFC: add "cmpxchg weak" to LLVM IR

Chandler Carruth
2014-06-12T18:23:40Z

On Thu, Jun 12, 2014 at 5:50 PM, Chandler Carruth <chandlerc at
google.com>
wrote:

> On Thu, Jun 12, 2014 at 5:22 PM, Tim Northover <t.p.northover at
gmail.com>
> wrote:
>
>> 1. All cmpxchg instructions now return { iN, i1 } where the first
>> value is what we got before (the loaded result), the second == 1 if an
>> exchange took place.
>>
>
> Having to do extractvalue to get stuff out of these kinds of aggregates
> is... somewhat horrible... have you thought of any alternatives?


Having thought about this a bit, I don't see anything better.

If we lived in a world w/o the select instruction, there might be a better
design for this (and for the overflow observing arithmetic intrinsics).

It is a bit sad, especially because I can't see a good reason to make the
weak variant an intrinsic and force this through the call path...


going back to the meat of the proposal...
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://lists.llvm.org/pipermail/llvm-dev/attachments/20140612/9a2467b1/attachment.html>