diff options
author | Mon P Wang <wangmp@apple.com> | 2008-06-25 08:15:39 +0000 |
---|---|---|
committer | Mon P Wang <wangmp@apple.com> | 2008-06-25 08:15:39 +0000 |
commit | 28873106309db515d58889a4c4fa3e0a92d1b60e (patch) | |
tree | 55754230852c1d76c8058edec38ed42a47b3ddc7 /lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp | |
parent | ea9e516e86b3a6ca1b3a5b374365735e1cca414d (diff) |
Added MemOperands to Atomic operations since Atomics touches memory.
Added abstract class MemSDNode for any Node that have an associated MemOperand
Changed atomic.lcs => atomic.cmp.swap, atomic.las => atomic.load.add, and
atomic.lss => atomic.load.sub
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52706 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp')
-rw-r--r-- | lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp index 2671cc3cbb..e20a7a7fd6 100644 --- a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp +++ b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp @@ -3088,7 +3088,8 @@ SelectionDAGLowering::implVisitBinaryAtomic(CallInst& I, ISD::NodeType Op) { SDOperand O2 = getValue(I.getOperand(2)); SDOperand L = DAG.getAtomic(Op, Root, getValue(I.getOperand(1)), - O2, O2.getValueType()); + O2, O2.getValueType(), + I.getOperand(1)); setValue(&I, L); DAG.setRoot(L.getValue(1)); return 0; @@ -3518,21 +3519,22 @@ SelectionDAGLowering::visitIntrinsicCall(CallInst &I, unsigned Intrinsic) { DAG.setRoot(DAG.getNode(ISD::MEMBARRIER, MVT::Other, &Ops[0], 6)); return 0; } - case Intrinsic::atomic_lcs: { + case Intrinsic::atomic_cmp_swap: { SDOperand Root = getRoot(); SDOperand O3 = getValue(I.getOperand(3)); - SDOperand L = DAG.getAtomic(ISD::ATOMIC_LCS, Root, + SDOperand L = DAG.getAtomic(ISD::ATOMIC_CMP_SWAP, Root, getValue(I.getOperand(1)), getValue(I.getOperand(2)), - O3, O3.getValueType()); + O3, O3.getValueType(), + I.getOperand(1)); setValue(&I, L); DAG.setRoot(L.getValue(1)); return 0; } - case Intrinsic::atomic_las: - return implVisitBinaryAtomic(I, ISD::ATOMIC_LAS); - case Intrinsic::atomic_lss: - return implVisitBinaryAtomic(I, ISD::ATOMIC_LSS); + case Intrinsic::atomic_load_add: + return implVisitBinaryAtomic(I, ISD::ATOMIC_LOAD_ADD); + case Intrinsic::atomic_load_sub: + return implVisitBinaryAtomic(I, ISD::ATOMIC_LOAD_SUB); case Intrinsic::atomic_load_and: return implVisitBinaryAtomic(I, ISD::ATOMIC_LOAD_AND); case Intrinsic::atomic_load_or: |