mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-15 19:24:33 +00:00
IR: add a second ordering operand to cmpxhg for failure
The syntax for "cmpxchg" should now look something like: cmpxchg i32* %addr, i32 42, i32 3 acquire monotonic where the second ordering argument gives the required semantics in the case that no exchange takes place. It should be no stronger than the first ordering constraint and cannot be either "release" or "acq_rel" (since no store will have taken place). rdar://problem/15996804 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203559 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -193,10 +193,10 @@ SDValue DAGTypeLegalizer::PromoteIntRes_Atomic1(AtomicSDNode *N) {
|
||||
SDValue DAGTypeLegalizer::PromoteIntRes_Atomic2(AtomicSDNode *N) {
|
||||
SDValue Op2 = GetPromotedInteger(N->getOperand(2));
|
||||
SDValue Op3 = GetPromotedInteger(N->getOperand(3));
|
||||
SDValue Res = DAG.getAtomic(N->getOpcode(), SDLoc(N),
|
||||
N->getMemoryVT(), N->getChain(), N->getBasePtr(),
|
||||
Op2, Op3, N->getMemOperand(), N->getOrdering(),
|
||||
N->getSynchScope());
|
||||
SDValue Res = DAG.getAtomic(N->getOpcode(), SDLoc(N), N->getMemoryVT(),
|
||||
N->getChain(), N->getBasePtr(), Op2, Op3,
|
||||
N->getMemOperand(), N->getSuccessOrdering(),
|
||||
N->getFailureOrdering(), N->getSynchScope());
|
||||
// Legalized the chain result - switch anything that used the old chain to
|
||||
// use the new one.
|
||||
ReplaceValueWith(SDValue(N, 1), Res.getValue(1));
|
||||
@@ -2448,6 +2448,7 @@ void DAGTypeLegalizer::ExpandIntRes_ATOMIC_LOAD(SDNode *N,
|
||||
N->getOperand(1), Zero, Zero,
|
||||
cast<AtomicSDNode>(N)->getMemOperand(),
|
||||
cast<AtomicSDNode>(N)->getOrdering(),
|
||||
cast<AtomicSDNode>(N)->getOrdering(),
|
||||
cast<AtomicSDNode>(N)->getSynchScope());
|
||||
ReplaceValueWith(SDValue(N, 0), Swap.getValue(0));
|
||||
ReplaceValueWith(SDValue(N, 1), Swap.getValue(1));
|
||||
|
Reference in New Issue
Block a user