This is an archive of the discontinued LLVM Phabricator instance.

[AtomicExpand] Merge cmpxchg success and failure ordering when appropriate.
ClosedPublic

Authored by efriedma on May 28 2021, 2:22 PM.

Details

Summary

If we're not emitting separate fences for the success/failure cases, we need to pass the merged ordering to the target so it can emit the correct instructions.

For the PowerPC testcase, we end up with extra fences, but that seems like an improvement over missing fences. If someone wants to improve that, the PowerPC backed could be taught to emit the fences after isel, instead of depending on fences emitted by AtomicExpand.

Fixes https://bugs.llvm.org/show_bug.cgi?id=33332 .

Diff Detail

Event Timeline

efriedma created this revision.May 28 2021, 2:22 PM
efriedma requested review of this revision.May 28 2021, 2:22 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 28 2021, 2:22 PM
Herald added a subscriber: MaskRay. · View Herald Transcript
reames added a comment.Jun 3 2021, 9:28 AM

LGTM. The code quality regression is non ideal, but that shouldn't block a functional fix.

reames accepted this revision.Jun 3 2021, 9:28 AM
This revision is now accepted and ready to land.Jun 3 2021, 9:28 AM