HomePhabricator

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

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

Description

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

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 .

Differential Revision: https://reviews.llvm.org/D103342

Details