[llvm-commits] [llvm] r47435 - in /llvm/trunk: include/llvm/CodeGen/SelectionDAG.h include/llvm/CodeGen/SelectionDAGNodes.h lib/CodeGen/SelectionDAG/SelectionDAG.cpp
Andrew Lenharth
alenhar2 at cs.uiuc.edu
Thu Feb 21 08:11:38 PST 2008
Author: alenhar2
Date: Thu Feb 21 10:11:38 2008
New Revision: 47435
URL: http://llvm.org/viewvc/llvm-project?rev=47435&view=rev
Log:
Better names as per Evan's request
Modified:
llvm/trunk/include/llvm/CodeGen/SelectionDAG.h
llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h
llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
Modified: llvm/trunk/include/llvm/CodeGen/SelectionDAG.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/SelectionDAG.h?rev=47435&r1=47434&r2=47435&view=diff
==============================================================================
--- llvm/trunk/include/llvm/CodeGen/SelectionDAG.h (original)
+++ llvm/trunk/include/llvm/CodeGen/SelectionDAG.h Thu Feb 21 10:11:38 2008
@@ -359,12 +359,12 @@
/// getAtomic - Gets a node for an atomic op, produces result and chain, takes
// 3 operands
SDOperand getAtomic(unsigned Opcode, SDOperand Chain, SDOperand Ptr,
- SDOperand A2, SDOperand A3, MVT::ValueType VT);
+ SDOperand Cmp, SDOperand Swp, MVT::ValueType VT);
/// getAtomic - Gets a node for an atomic op, produces result and chain, takes
// 2 operands
SDOperand getAtomic(unsigned Opcode, SDOperand Chain, SDOperand Ptr,
- SDOperand A2, MVT::ValueType VT);
+ SDOperand Val, MVT::ValueType VT);
/// getLoad - Loads are not normal binary operators: their result type is not
/// determined by their operands, and they produce a value AND a token chain.
Modified: llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h?rev=47435&r1=47434&r2=47435&view=diff
==============================================================================
--- llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h (original)
+++ llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h Thu Feb 21 10:11:38 2008
@@ -1193,26 +1193,27 @@
SDOperand Ops[4];
MVT::ValueType OrigVT;
public:
- AtomicSDNode(unsigned Opc, SDVTList VTL, SDOperand Chain, SDOperand X,
- SDOperand Y, SDOperand Z, MVT::ValueType VT)
+ AtomicSDNode(unsigned Opc, SDVTList VTL, SDOperand Chain, SDOperand Ptr,
+ SDOperand Cmp, SDOperand Swp, MVT::ValueType VT)
: SDNode(Opc, VTL) {
Ops[0] = Chain;
- Ops[1] = X;
- Ops[2] = Y;
- Ops[3] = Z;
+ Ops[1] = Ptr;
+ Ops[2] = Swp;
+ Ops[3] = Cmp;
InitOperands(Ops, 4);
OrigVT=VT;
}
- AtomicSDNode(unsigned Opc, SDVTList VTL, SDOperand Chain, SDOperand X,
- SDOperand Y, MVT::ValueType VT)
+ AtomicSDNode(unsigned Opc, SDVTList VTL, SDOperand Chain, SDOperand Ptr,
+ SDOperand Val, MVT::ValueType VT)
: SDNode(Opc, VTL) {
Ops[0] = Chain;
- Ops[1] = X;
- Ops[2] = Y;
+ Ops[1] = Ptr;
+ Ops[2] = Val;
InitOperands(Ops, 3);
OrigVT=VT;
}
MVT::ValueType getVT() const { return OrigVT; }
+ bool isCompareAndSwap() const { return getOpcode() == ISD::ATOMIC_LCS; }
};
class StringSDNode : public SDNode {
Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp?rev=47435&r1=47434&r2=47435&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp Thu Feb 21 10:11:38 2008
@@ -2428,37 +2428,38 @@
}
SDOperand SelectionDAG::getAtomic(unsigned Opcode, SDOperand Chain,
- SDOperand Ptr, SDOperand A2,
- SDOperand A3, MVT::ValueType VT) {
+ SDOperand Ptr, SDOperand Cmp,
+ SDOperand Swp, MVT::ValueType VT) {
assert(Opcode == ISD::ATOMIC_LCS && "Invalid Atomic Op");
- SDVTList VTs = getVTList(A2.getValueType(), MVT::Other);
+ assert(Cmp.getValueType() == Swp.getValueType() && "Invalid Atomic Op Types");
+ SDVTList VTs = getVTList(Cmp.getValueType(), MVT::Other);
FoldingSetNodeID ID;
- SDOperand Ops[] = {Chain, Ptr, A2, A3};
+ SDOperand Ops[] = {Chain, Ptr, Cmp, Swp};
AddNodeIDNode(ID, Opcode, VTs, Ops, 4);
ID.AddInteger((unsigned int)VT);
void* IP = 0;
if (SDNode *E = CSEMap.FindNodeOrInsertPos(ID, IP))
return SDOperand(E, 0);
- SDNode* N = new AtomicSDNode(Opcode, VTs, Chain, Ptr, A2, A3, VT);
+ SDNode* N = new AtomicSDNode(Opcode, VTs, Chain, Ptr, Cmp, Swp, VT);
CSEMap.InsertNode(N, IP);
AllNodes.push_back(N);
return SDOperand(N, 0);
}
SDOperand SelectionDAG::getAtomic(unsigned Opcode, SDOperand Chain,
- SDOperand Ptr, SDOperand A2,
+ SDOperand Ptr, SDOperand Val,
MVT::ValueType VT) {
assert((Opcode == ISD::ATOMIC_LAS || Opcode == ISD::ATOMIC_SWAP)
&& "Invalid Atomic Op");
- SDVTList VTs = getVTList(A2.getValueType(), MVT::Other);
+ SDVTList VTs = getVTList(Val.getValueType(), MVT::Other);
FoldingSetNodeID ID;
- SDOperand Ops[] = {Chain, Ptr, A2};
+ SDOperand Ops[] = {Chain, Ptr, Val};
AddNodeIDNode(ID, Opcode, VTs, Ops, 3);
ID.AddInteger((unsigned int)VT);
void* IP = 0;
if (SDNode *E = CSEMap.FindNodeOrInsertPos(ID, IP))
return SDOperand(E, 0);
- SDNode* N = new AtomicSDNode(Opcode, VTs, Chain, Ptr, A2, VT);
+ SDNode* N = new AtomicSDNode(Opcode, VTs, Chain, Ptr, Val, VT);
CSEMap.InsertNode(N, IP);
AllNodes.push_back(N);
return SDOperand(N, 0);
More information about the llvm-commits
mailing list