Page MenuHomePhabricator

[CGAtomic] Lift stronger requirements on cmpxch and add support for acquire failure mode

Authored by bruno on Mar 19 2021, 5:31 PM.


  • Fix emitAtomicCmpXchgFailureSet to support release/acquire (succ/fail) memory order.
  • Remove stronger checks for cmpxch.

Implements, related discussions in

A follow patch should attempt to implement the TSAN side of failure mode support.

Diff Detail

Event Timeline

bruno created this revision.Mar 19 2021, 5:31 PM
bruno requested review of this revision.Mar 19 2021, 5:31 PM
Herald added a project: Restricted Project. · View Herald TranscriptMar 19 2021, 5:31 PM
jfb accepted this revision.Mar 20 2021, 1:38 PM
jfb added a reviewer: kubamracek.

Maybe refer to directly in the commit message?

This revision is now accepted and ready to land.Mar 20 2021, 1:39 PM
bruno updated this revision to Diff 332823.Mar 23 2021, 4:44 PM
bruno edited the summary of this revision. (Show Details)

@jfb sure!

Also fix test failures.

This revision was landed with ongoing or failed builds.Mar 23 2021, 4:45 PM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptMar 23 2021, 4:45 PM
yln added a subscriber: yln.Apr 15 2021, 10:25 AM
yln added inline comments.

Should the following assert in AtomicCmpXchgInst::Init() have been changed as well?

assert(!isStrongerThan(FailureOrdering, SuccessOrdering) &&
       "AtomicCmpXchg failure argument shall be no stronger than the success "

I am observing a crash on an internal code base most likely caused by this.

yln added inline comments.Apr 19 2021, 11:18 AM

friendly ping @bruno

bruno added a comment.Jun 1 2021, 10:18 AM

@yln sorry, I didn't get notifications for this somehow. This got fixed as part of the more general support in