aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2008-07-27 21:46:04 +0000
committerDan Gohman <gohman@apple.com>2008-07-27 21:46:04 +0000
commit8181bd1f95ae9994edb390dd9acd0b7b12375219 (patch)
treeadeddbc1f7871c2215b6ca4d9d914eee53a33961 /include
parent0c97f1da6784c4097fd6c9d1a15813ad9802cc5b (diff)
downloadexternal_llvm-8181bd1f95ae9994edb390dd9acd0b7b12375219.zip
external_llvm-8181bd1f95ae9994edb390dd9acd0b7b12375219.tar.gz
external_llvm-8181bd1f95ae9994edb390dd9acd0b7b12375219.tar.bz2
Rename SDOperand to SDValue.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54128 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/llvm/CodeGen/DAGISelHeader.h14
-rw-r--r--include/llvm/CodeGen/ScheduleDAG.h14
-rw-r--r--include/llvm/CodeGen/SelectionDAG.h354
-rw-r--r--include/llvm/CodeGen/SelectionDAGISel.h12
-rw-r--r--include/llvm/CodeGen/SelectionDAGNodes.h179
-rw-r--r--include/llvm/Target/TargetLowering.h124
6 files changed, 349 insertions, 348 deletions
diff --git a/include/llvm/CodeGen/DAGISelHeader.h b/include/llvm/CodeGen/DAGISelHeader.h
index 79f6276..48050ed 100644
--- a/include/llvm/CodeGen/DAGISelHeader.h
+++ b/include/llvm/CodeGen/DAGISelHeader.h
@@ -35,7 +35,7 @@ static bool IsChainCompatible(SDNode *Chain, SDNode *Op) {
else if (Chain->getOpcode() == ISD::TokenFactor)
return false;
else if (Chain->getNumOperands() > 0) {
- SDOperand C0 = Chain->getOperand(0);
+ SDValue C0 = Chain->getOperand(0);
if (C0.getValueType() == MVT::Other)
return C0.Val != Op && IsChainCompatible(C0.Val, Op);
}
@@ -75,7 +75,7 @@ inline bool isSelected(int Id) {
/// AddToISelQueue - adds a node to the instruction
/// selection queue.
-void AddToISelQueue(SDOperand N) DISABLE_INLINE {
+void AddToISelQueue(SDValue N) DISABLE_INLINE {
int Id = N.Val->getNodeId();
if (Id != -1 && !isQueued(Id)) {
ISelQueue.push_back(N.Val);
@@ -117,7 +117,7 @@ inline void UpdateQueue(const ISelQueueUpdater &ISQU) {
/// ReplaceUses - replace all uses of the old node F with the use
/// of the new node T.
-void ReplaceUses(SDOperand F, SDOperand T) DISABLE_INLINE {
+void ReplaceUses(SDValue F, SDValue T) DISABLE_INLINE {
ISelQueueUpdater ISQU(ISelQueue);
CurDAG->ReplaceAllUsesOfValueWith(F, T, &ISQU);
setSelected(F.Val->getNodeId());
@@ -126,7 +126,7 @@ void ReplaceUses(SDOperand F, SDOperand T) DISABLE_INLINE {
/// ReplaceUses - replace all uses of the old nodes F with the use
/// of the new nodes T.
-void ReplaceUses(const SDOperand *F, const SDOperand *T,
+void ReplaceUses(const SDValue *F, const SDValue *T,
unsigned Num) DISABLE_INLINE {
ISelQueueUpdater ISQU(ISelQueue);
CurDAG->ReplaceAllUsesOfValuesWith(F, T, Num, &ISQU);
@@ -143,7 +143,7 @@ void ReplaceUses(SDNode *F, SDNode *T) DISABLE_INLINE {
ISelQueueUpdater ISQU(ISelQueue);
if (FNumVals != TNumVals) {
for (unsigned i = 0, e = std::min(FNumVals, TNumVals); i < e; ++i)
- CurDAG->ReplaceAllUsesOfValueWith(SDOperand(F, i), SDOperand(T, i), &ISQU);
+ CurDAG->ReplaceAllUsesOfValueWith(SDValue(F, i), SDValue(T, i), &ISQU);
} else {
CurDAG->ReplaceAllUsesWith(F, T, &ISQU);
}
@@ -153,7 +153,7 @@ void ReplaceUses(SDNode *F, SDNode *T) DISABLE_INLINE {
/// SelectRoot - Top level entry to DAG instruction selector.
/// Selects instructions starting at the root of the current DAG.
-SDOperand SelectRoot(SDOperand Root) {
+SDValue SelectRoot(SDValue Root) {
SelectRootInit();
unsigned NumBytes = (DAGSize + 7) / 8;
ISelQueued = new unsigned char[NumBytes];
@@ -176,7 +176,7 @@ SDOperand SelectRoot(SDOperand Root) {
// Skip already selected nodes.
if (isSelected(Node->getNodeId()))
continue;
- SDNode *ResNode = Select(SDOperand(Node, 0));
+ SDNode *ResNode = Select(SDValue(Node, 0));
// If node should not be replaced,
// continue with the next one.
if (ResNode == Node)
diff --git a/include/llvm/CodeGen/ScheduleDAG.h b/include/llvm/CodeGen/ScheduleDAG.h
index 0225b12..67f3dbb 100644
--- a/include/llvm/CodeGen/ScheduleDAG.h
+++ b/include/llvm/CodeGen/ScheduleDAG.h
@@ -330,7 +330,7 @@ namespace llvm {
/// register number for the results of the node.
///
void EmitNode(SDNode *Node, bool IsClone,
- DenseMap<SDOperand, unsigned> &VRBaseMap);
+ DenseMap<SDValue, unsigned> &VRBaseMap);
/// EmitNoop - Emit a noop instruction.
///
@@ -349,19 +349,19 @@ namespace llvm {
/// EmitSubregNode - Generate machine code for subreg nodes.
///
void EmitSubregNode(SDNode *Node,
- DenseMap<SDOperand, unsigned> &VRBaseMap);
+ DenseMap<SDValue, unsigned> &VRBaseMap);
/// getVR - Return the virtual register corresponding to the specified result
/// of the specified node.
- unsigned getVR(SDOperand Op, DenseMap<SDOperand, unsigned> &VRBaseMap);
+ unsigned getVR(SDValue Op, DenseMap<SDValue, unsigned> &VRBaseMap);
/// getDstOfCopyToRegUse - If the only use of the specified result number of
/// node is a CopyToReg, return its destination register. Return 0 otherwise.
unsigned getDstOfOnlyCopyToRegUse(SDNode *Node, unsigned ResNo) const;
- void AddOperand(MachineInstr *MI, SDOperand Op, unsigned IIOpNum,
+ void AddOperand(MachineInstr *MI, SDValue Op, unsigned IIOpNum,
const TargetInstrDesc *II,
- DenseMap<SDOperand, unsigned> &VRBaseMap);
+ DenseMap<SDValue, unsigned> &VRBaseMap);
void AddMemOperand(MachineInstr *MI, const MachineMemOperand &MO);
@@ -371,11 +371,11 @@ namespace llvm {
/// implicit physical register output.
void EmitCopyFromReg(SDNode *Node, unsigned ResNo, bool IsClone,
unsigned SrcReg,
- DenseMap<SDOperand, unsigned> &VRBaseMap);
+ DenseMap<SDValue, unsigned> &VRBaseMap);
void CreateVirtualRegisters(SDNode *Node, MachineInstr *MI,
const TargetInstrDesc &II,
- DenseMap<SDOperand, unsigned> &VRBaseMap);
+ DenseMap<SDValue, unsigned> &VRBaseMap);
/// EmitLiveInCopy - Emit a copy for a live in physical register. If the
/// physical register has only a single copy use, then coalesced the copy
diff --git a/include/llvm/CodeGen/SelectionDAG.h b/include/llvm/CodeGen/SelectionDAG.h
index fee46b3..692d902 100644
--- a/include/llvm/CodeGen/SelectionDAG.h
+++ b/include/llvm/CodeGen/SelectionDAG.h
@@ -52,7 +52,7 @@ class SelectionDAG {
MachineModuleInfo *MMI;
/// Root - The root of the entire DAG. EntryNode - The starting token.
- SDOperand Root, EntryNode;
+ SDValue Root, EntryNode;
/// AllNodes - A linked list of nodes in the current DAG.
alist<SDNode, LargestSDNode> &AllNodes;
@@ -120,15 +120,15 @@ public:
/// getRoot - Return the root tag of the SelectionDAG.
///
- const SDOperand &getRoot() const { return Root; }
+ const SDValue &getRoot() const { return Root; }
/// getEntryNode - Return the token chain corresponding to the entry of the
/// function.
- const SDOperand &getEntryNode() const { return EntryNode; }
+ const SDValue &getEntryNode() const { return EntryNode; }
/// setRoot - Set the current root tag of the SelectionDAG.
///
- const SDOperand &setRoot(SDOperand N) {
+ const SDValue &setRoot(SDValue N) {
assert((!N.Val || N.getValueType() == MVT::Other) &&
"DAG root value is not a chain!");
return Root = N;
@@ -188,61 +188,61 @@ public:
//===--------------------------------------------------------------------===//
// Node creation methods.
//
- SDOperand getConstant(uint64_t Val, MVT VT, bool isTarget = false);
- SDOperand getConstant(const APInt &Val, MVT VT, bool isTarget = false);
- SDOperand getIntPtrConstant(uint64_t Val, bool isTarget = false);
- SDOperand getTargetConstant(uint64_t Val, MVT VT) {
+ SDValue getConstant(uint64_t Val, MVT VT, bool isTarget = false);
+ SDValue getConstant(const APInt &Val, MVT VT, bool isTarget = false);
+ SDValue getIntPtrConstant(uint64_t Val, bool isTarget = false);
+ SDValue getTargetConstant(uint64_t Val, MVT VT) {
return getConstant(Val, VT, true);
}
- SDOperand getTargetConstant(const APInt &Val, MVT VT) {
+ SDValue getTargetConstant(const APInt &Val, MVT VT) {
return getConstant(Val, VT, true);
}
- SDOperand getConstantFP(double Val, MVT VT, bool isTarget = false);
- SDOperand getConstantFP(const APFloat& Val, MVT VT, bool isTarget = false);
- SDOperand getTargetConstantFP(double Val, MVT VT) {
+ SDValue getConstantFP(double Val, MVT VT, bool isTarget = false);
+ SDValue getConstantFP(const APFloat& Val, MVT VT, bool isTarget = false);
+ SDValue getTargetConstantFP(double Val, MVT VT) {
return getConstantFP(Val, VT, true);
}
- SDOperand getTargetConstantFP(const APFloat& Val, MVT VT) {
+ SDValue getTargetConstantFP(const APFloat& Val, MVT VT) {
return getConstantFP(Val, VT, true);
}
- SDOperand getGlobalAddress(const GlobalValue *GV, MVT VT,
+ SDValue getGlobalAddress(const GlobalValue *GV, MVT VT,
int offset = 0, bool isTargetGA = false);
- SDOperand getTargetGlobalAddress(const GlobalValue *GV, MVT VT,
+ SDValue getTargetGlobalAddress(const GlobalValue *GV, MVT VT,
int offset = 0) {
return getGlobalAddress(GV, VT, offset, true);
}
- SDOperand getFrameIndex(int FI, MVT VT, bool isTarget = false);
- SDOperand getTargetFrameIndex(int FI, MVT VT) {
+ SDValue getFrameIndex(int FI, MVT VT, bool isTarget = false);
+ SDValue getTargetFrameIndex(int FI, MVT VT) {
return getFrameIndex(FI, VT, true);
}
- SDOperand getJumpTable(int JTI, MVT VT, bool isTarget = false);
- SDOperand getTargetJumpTable(int JTI, MVT VT) {
+ SDValue getJumpTable(int JTI, MVT VT, bool isTarget = false);
+ SDValue getTargetJumpTable(int JTI, MVT VT) {
return getJumpTable(JTI, VT, true);
}
- SDOperand getConstantPool(Constant *C, MVT VT,
+ SDValue getConstantPool(Constant *C, MVT VT,
unsigned Align = 0, int Offs = 0, bool isT=false);
- SDOperand getTargetConstantPool(Constant *C, MVT VT,
+ SDValue getTargetConstantPool(Constant *C, MVT VT,
unsigned Align = 0, int Offset = 0) {
return getConstantPool(C, VT, Align, Offset, true);
}
- SDOperand getConstantPool(MachineConstantPoolValue *C, MVT VT,
+ SDValue getConstantPool(MachineConstantPoolValue *C, MVT VT,
unsigned Align = 0, int Offs = 0, bool isT=false);
- SDOperand getTargetConstantPool(MachineConstantPoolValue *C,
+ SDValue getTargetConstantPool(MachineConstantPoolValue *C,
MVT VT, unsigned Align = 0,
int Offset = 0) {
return getConstantPool(C, VT, Align, Offset, true);
}
- SDOperand getBasicBlock(MachineBasicBlock *MBB);
- SDOperand getExternalSymbol(const char *Sym, MVT VT);
- SDOperand getTargetExternalSymbol(const char *Sym, MVT VT);
- SDOperand getArgFlags(ISD::ArgFlagsTy Flags);
- SDOperand getValueType(MVT);
- SDOperand getRegister(unsigned Reg, MVT VT);
- SDOperand getDbgStopPoint(SDOperand Root, unsigned Line, unsigned Col,
+ SDValue getBasicBlock(MachineBasicBlock *MBB);
+ SDValue getExternalSymbol(const char *Sym, MVT VT);
+ SDValue getTargetExternalSymbol(const char *Sym, MVT VT);
+ SDValue getArgFlags(ISD::ArgFlagsTy Flags);
+ SDValue getValueType(MVT);
+ SDValue getRegister(unsigned Reg, MVT VT);
+ SDValue getDbgStopPoint(SDValue Root, unsigned Line, unsigned Col,
const CompileUnitDesc *CU);
- SDOperand getLabel(unsigned Opcode, SDOperand Root, unsigned LabelID);
+ SDValue getLabel(unsigned Opcode, SDValue Root, unsigned LabelID);
- SDOperand getCopyToReg(SDOperand Chain, unsigned Reg, SDOperand N) {
+ SDValue getCopyToReg(SDValue Chain, unsigned Reg, SDValue N) {
return getNode(ISD::CopyToReg, MVT::Other, Chain,
getRegister(Reg, N.getValueType()), N);
}
@@ -250,57 +250,57 @@ public:
// This version of the getCopyToReg method takes an extra operand, which
// indicates that there is potentially an incoming flag value (if Flag is not
// null) and that there should be a flag result.
- SDOperand getCopyToReg(SDOperand Chain, unsigned Reg, SDOperand N,
- SDOperand Flag) {
+ SDValue getCopyToReg(SDValue Chain, unsigned Reg, SDValue N,
+ SDValue Flag) {
const MVT *VTs = getNodeValueTypes(MVT::Other, MVT::Flag);
- SDOperand Ops[] = { Chain, getRegister(Reg, N.getValueType()), N, Flag };
+ SDValue Ops[] = { Chain, getRegister(Reg, N.getValueType()), N, Flag };
return getNode(ISD::CopyToReg, VTs, 2, Ops, Flag.Val ? 4 : 3);
}
- // Similar to last getCopyToReg() except parameter Reg is a SDOperand
- SDOperand getCopyToReg(SDOperand Chain, SDOperand Reg, SDOperand N,
- SDOperand Flag) {
+ // Similar to last getCopyToReg() except parameter Reg is a SDValue
+ SDValue getCopyToReg(SDValue Chain, SDValue Reg, SDValue N,
+ SDValue Flag) {
const MVT *VTs = getNodeValueTypes(MVT::Other, MVT::Flag);
- SDOperand Ops[] = { Chain, Reg, N, Flag };
+ SDValue Ops[] = { Chain, Reg, N, Flag };
return getNode(ISD::CopyToReg, VTs, 2, Ops, Flag.Val ? 4 : 3);
}
- SDOperand getCopyFromReg(SDOperand Chain, unsigned Reg, MVT VT) {
+ SDValue getCopyFromReg(SDValue Chain, unsigned Reg, MVT VT) {
const MVT *VTs = getNodeValueTypes(VT, MVT::Other);
- SDOperand Ops[] = { Chain, getRegister(Reg, VT) };
+ SDValue Ops[] = { Chain, getRegister(Reg, VT) };
return getNode(ISD::CopyFromReg, VTs, 2, Ops, 2);
}
// This version of the getCopyFromReg method takes an extra operand, which
// indicates that there is potentially an incoming flag value (if Flag is not
// null) and that there should be a flag result.
- SDOperand getCopyFromReg(SDOperand Chain, unsigned Reg, MVT VT,
- SDOperand Flag) {
+ SDValue getCopyFromReg(SDValue Chain, unsigned Reg, MVT VT,
+ SDValue Flag) {
const MVT *VTs = getNodeValueTypes(VT, MVT::Other, MVT::Flag);
- SDOperand Ops[] = { Chain, getRegister(Reg, VT), Flag };
+ SDValue Ops[] = { Chain, getRegister(Reg, VT), Flag };
return getNode(ISD::CopyFromReg, VTs, 3, Ops, Flag.Val ? 3 : 2);
}
- SDOperand getCondCode(ISD::CondCode Cond);
+ SDValue getCondCode(ISD::CondCode Cond);
/// getZeroExtendInReg - Return the expression required to zero extend the Op
/// value assuming it was the smaller SrcTy value.
- SDOperand getZeroExtendInReg(SDOperand Op, MVT SrcTy);
+ SDValue getZeroExtendInReg(SDValue Op, MVT SrcTy);
/// getCALLSEQ_START - Return a new CALLSEQ_START node, which always must have
/// a flag result (to ensure it's not CSE'd).
- SDOperand getCALLSEQ_START(SDOperand Chain, SDOperand Op) {
+ SDValue getCALLSEQ_START(SDValue Chain, SDValue Op) {
const MVT *VTs = getNodeValueTypes(MVT::Other, MVT::Flag);
- SDOperand Ops[] = { Chain, Op };
+ SDValue Ops[] = { Chain, Op };
return getNode(ISD::CALLSEQ_START, VTs, 2, Ops, 2);
}
/// getCALLSEQ_END - Return a new CALLSEQ_END node, which always must have a
/// flag result (to ensure it's not CSE'd).
- SDOperand getCALLSEQ_END(SDOperand Chain, SDOperand Op1, SDOperand Op2,
- SDOperand InFlag) {
+ SDValue getCALLSEQ_END(SDValue Chain, SDValue Op1, SDValue Op2,
+ SDValue InFlag) {
SDVTList NodeTys = getVTList(MVT::Other, MVT::Flag);
- SmallVector<SDOperand, 4> Ops;
+ SmallVector<SDValue, 4> Ops;
Ops.push_back(Chain);
Ops.push_back(Op1);
Ops.push_back(Op2);
@@ -311,103 +311,103 @@ public:
/// getNode - Gets or creates the specified node.
///
- SDOperand getNode(unsigned Opcode, MVT VT);
- SDOperand getNode(unsigned Opcode, MVT VT, SDOperand N);
- SDOperand getNode(unsigned Opcode, MVT VT, SDOperand N1, SDOperand N2);
- SDOperand getNode(unsigned Opcode, MVT VT,
- SDOperand N1, SDOperand N2, SDOperand N3);
- SDOperand getNode(unsigned Opcode, MVT VT,
- SDOperand N1, SDOperand N2, SDOperand N3, SDOperand N4);
- SDOperand getNode(unsigned Opcode, MVT VT,
- SDOperand N1, SDOperand N2, SDOperand N3, SDOperand N4,
- SDOperand N5);
- SDOperand getNode(unsigned Opcode, MVT VT,
- const SDOperand *Ops, unsigned NumOps);
- SDOperand getNode(unsigned Opcode, MVT VT,
+ SDValue getNode(unsigned Opcode, MVT VT);
+ SDValue getNode(unsigned Opcode, MVT VT, SDValue N);
+ SDValue getNode(unsigned Opcode, MVT VT, SDValue N1, SDValue N2);
+ SDValue getNode(unsigned Opcode, MVT VT,
+ SDValue N1, SDValue N2, SDValue N3);
+ SDValue getNode(unsigned Opcode, MVT VT,
+ SDValue N1, SDValue N2, SDValue N3, SDValue N4);
+ SDValue getNode(unsigned Opcode, MVT VT,
+ SDValue N1, SDValue N2, SDValue N3, SDValue N4,
+ SDValue N5);
+ SDValue getNode(unsigned Opcode, MVT VT,
+ const SDValue *Ops, unsigned NumOps);
+ SDValue getNode(unsigned Opcode, MVT VT,
const SDUse *Ops, unsigned NumOps);
- SDOperand getNode(unsigned Opcode, const std::vector<MVT> &ResultTys,
- const SDOperand *Ops, unsigned NumOps);
- SDOperand getNode(unsigned Opcode, const MVT *VTs, unsigned NumVTs,
- const SDOperand *Ops, unsigned NumOps);
- SDOperand getNode(unsigned Opcode, SDVTList VTs);
- SDOperand getNode(unsigned Opcode, SDVTList VTs, SDOperand N);
- SDOperand getNode(unsigned Opcode, SDVTList VTs, SDOperand N1, SDOperand N2);
- SDOperand getNode(unsigned Opcode, SDVTList VTs,
- SDOperand N1, SDOperand N2, SDOperand N3);
- SDOperand getNode(unsigned Opcode, SDVTList VTs,
- SDOperand N1, SDOperand N2, SDOperand N3, SDOperand N4);
- SDOperand getNode(unsigned Opcode, SDVTList VTs,
- SDOperand N1, SDOperand N2, SDOperand N3, SDOperand N4,
- SDOperand N5);
- SDOperand getNode(unsigned Opcode, SDVTList VTs,
- const SDOperand *Ops, unsigned NumOps);
-
- SDOperand getMemcpy(SDOperand Chain, SDOperand Dst, SDOperand Src,
- SDOperand Size, unsigned Align,
+ SDValue getNode(unsigned Opcode, const std::vector<MVT> &ResultTys,
+ const SDValue *Ops, unsigned NumOps);
+ SDValue getNode(unsigned Opcode, const MVT *VTs, unsigned NumVTs,
+ const SDValue *Ops, unsigned NumOps);
+ SDValue getNode(unsigned Opcode, SDVTList VTs);
+ SDValue getNode(unsigned Opcode, SDVTList VTs, SDValue N);
+ SDValue getNode(unsigned Opcode, SDVTList VTs, SDValue N1, SDValue N2);
+ SDValue getNode(unsigned Opcode, SDVTList VTs,
+ SDValue N1, SDValue N2, SDValue N3);
+ SDValue getNode(unsigned Opcode, SDVTList VTs,
+ SDValue N1, SDValue N2, SDValue N3, SDValue N4);
+ SDValue getNode(unsigned Opcode, SDVTList VTs,
+ SDValue N1, SDValue N2, SDValue N3, SDValue N4,
+ SDValue N5);
+ SDValue getNode(unsigned Opcode, SDVTList VTs,
+ const SDValue *Ops, unsigned NumOps);
+
+ SDValue getMemcpy(SDValue Chain, SDValue Dst, SDValue Src,
+ SDValue Size, unsigned Align,
bool AlwaysInline,
const Value *DstSV, uint64_t DstSVOff,
const Value *SrcSV, uint64_t SrcSVOff);
- SDOperand getMemmove(SDOperand Chain, SDOperand Dst, SDOperand Src,
- SDOperand Size, unsigned Align,
+ SDValue getMemmove(SDValue Chain, SDValue Dst, SDValue Src,
+ SDValue Size, unsigned Align,
const Value *DstSV, uint64_t DstOSVff,
const Value *SrcSV, uint64_t SrcSVOff);
- SDOperand getMemset(SDOperand Chain, SDOperand Dst, SDOperand Src,
- SDOperand Size, unsigned Align,
+ SDValue getMemset(SDValue Chain, SDValue Dst, SDValue Src,
+ SDValue Size, unsigned Align,
const Value *DstSV, uint64_t DstSVOff);
/// getSetCC - Helper function to make it easier to build SetCC's if you just
- /// have an ISD::CondCode instead of an SDOperand.
+ /// have an ISD::CondCode instead of an SDValue.
///
- SDOperand getSetCC(MVT VT, SDOperand LHS, SDOperand RHS,
+ SDValue getSetCC(MVT VT, SDValue LHS, SDValue RHS,
ISD::CondCode Cond) {
return getNode(ISD::SETCC, VT, LHS, RHS, getCondCode(Cond));
}
/// getVSetCC - Helper function to make it easier to build VSetCC's nodes
- /// if you just have an ISD::CondCode instead of an SDOperand.
+ /// if you just have an ISD::CondCode instead of an SDValue.
///
- SDOperand getVSetCC(MVT VT, SDOperand LHS, SDOperand RHS,
+ SDValue getVSetCC(MVT VT, SDValue LHS, SDValue RHS,
ISD::CondCode Cond) {
return getNode(ISD::VSETCC, VT, LHS, RHS, getCondCode(Cond));
}
/// getSelectCC - Helper function to make it easier to build SelectCC's if you
- /// just have an ISD::CondCode instead of an SDOperand.
+ /// just have an ISD::CondCode instead of an SDValue.
///
- SDOperand getSelectCC(SDOperand LHS, SDOperand RHS,
- SDOperand True, SDOperand False, ISD::CondCode Cond) {
+ SDValue getSelectCC(SDValue LHS, SDValue RHS,
+ SDValue True, SDValue False, ISD::CondCode Cond) {
return getNode(ISD::SELECT_CC, True.getValueType(), LHS, RHS, True, False,
getCondCode(Cond));
}
/// getVAArg - VAArg produces a result and token chain, and takes a pointer
/// and a source value as input.
- SDOperand getVAArg(MVT VT, SDOperand Chain, SDOperand Ptr,
- SDOperand SV);
+ SDValue getVAArg(MVT VT, SDValue Chain, SDValue Ptr,
+ SDValue SV);
/// getAtomic - Gets a node for an atomic op, produces result and chain, takes
/// 3 operands
- SDOperand getAtomic(unsigned Opcode, SDOperand Chain, SDOperand Ptr,
- SDOperand Cmp, SDOperand Swp, const Value* PtrVal,
+ SDValue getAtomic(unsigned Opcode, SDValue Chain, SDValue Ptr,
+ SDValue Cmp, SDValue Swp, const Value* PtrVal,
unsigned Alignment=0);
/// getAtomic - Gets a node for an atomic op, produces result and chain, takes
/// 2 operands
- SDOperand getAtomic(unsigned Opcode, SDOperand Chain, SDOperand Ptr,
- SDOperand Val, const Value* PtrVal,
+ SDValue getAtomic(unsigned Opcode, SDValue Chain, SDValue Ptr,
+ SDValue Val, const Value* PtrVal,
unsigned Alignment = 0);
/// getMergeValues - Create a MERGE_VALUES node from the given operands.
/// Allowed to return something different (and simpler) if Simplify is true.
- SDOperand getMergeValues(const SDOperand *Ops, unsigned NumOps,
+ SDValue getMergeValues(const SDValue *Ops, unsigned NumOps,
bool Simplify = true);
/// getMergeValues - Create a MERGE_VALUES node from the given types and ops.
/// Allowed to return something different (and simpler) if Simplify is true.
/// May be faster than the above version if VTs is known and NumOps is large.
- SDOperand getMergeValues(SDVTList VTs, const SDOperand *Ops, unsigned NumOps,
+ SDValue getMergeValues(SDVTList VTs, const SDValue *Ops, unsigned NumOps,
bool Simplify = true) {
if (Simplify && NumOps == 1)
return Ops[0];
@@ -417,38 +417,38 @@ public:
/// 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.
///
- SDOperand getLoad(MVT VT, SDOperand Chain, SDOperand Ptr,
+ SDValue getLoad(MVT VT, SDValue Chain, SDValue Ptr,
const Value *SV, int SVOffset, bool isVolatile=false,
unsigned Alignment=0);
- SDOperand getExtLoad(ISD::LoadExtType ExtType, MVT VT,
- SDOperand Chain, SDOperand Ptr, const Value *SV,
+ SDValue getExtLoad(ISD::LoadExtType ExtType, MVT VT,
+ SDValue Chain, SDValue Ptr, const Value *SV,
int SVOffset, MVT EVT, bool isVolatile=false,
unsigned Alignment=0);
- SDOperand getIndexedLoad(SDOperand OrigLoad, SDOperand Base,
- SDOperand Offset, ISD::MemIndexedMode AM);
- SDOperand getLoad(ISD::MemIndexedMode AM, ISD::LoadExtType ExtType,
- MVT VT, SDOperand Chain,
- SDOperand Ptr, SDOperand Offset,
+ SDValue getIndexedLoad(SDValue OrigLoad, SDValue Base,
+ SDValue Offset, ISD::MemIndexedMode AM);
+ SDValue getLoad(ISD::MemIndexedMode AM, ISD::LoadExtType ExtType,
+ MVT VT, SDValue Chain,
+ SDValue Ptr, SDValue Offset,
const Value *SV, int SVOffset, MVT EVT,
bool isVolatile=false, unsigned Alignment=0);
/// getStore - Helper function to build ISD::STORE nodes.
///
- SDOperand getStore(SDOperand Chain, SDOperand Val, SDOperand Ptr,
+ SDValue getStore(SDValue Chain, SDValue Val, SDValue Ptr,
const Value *SV, int SVOffset, bool isVolatile=false,
unsigned Alignment=0);
- SDOperand getTruncStore(SDOperand Chain, SDOperand Val, SDOperand Ptr,
+ SDValue getTruncStore(SDValue Chain, SDValue Val, SDValue Ptr,
const Value *SV, int SVOffset, MVT TVT,
bool isVolatile=false, unsigned Alignment=0);
- SDOperand getIndexedStore(SDOperand OrigStoe, SDOperand Base,
- SDOperand Offset, ISD::MemIndexedMode AM);
+ SDValue getIndexedStore(SDValue OrigStoe, SDValue Base,
+ SDValue Offset, ISD::MemIndexedMode AM);
// getSrcValue - Construct a node to track a Value* through the backend.
- SDOperand getSrcValue(const Value *v);
+ SDValue getSrcValue(const Value *v);
// getMemOperand - Construct a node to track a memory reference
// through the backend.
- SDOperand getMemOperand(const MachineMemOperand &MO);
+ SDValue getMemOperand(const MachineMemOperand &MO);
/// UpdateNodeOperands - *Mutate* the specified node in-place to have the
/// specified operands. If the resultant node already exists in the DAG,
@@ -456,66 +456,66 @@ public:
/// already exists. If the resultant node does not exist in the DAG, the
/// input node is returned. As a degenerate case, if you specify the same
/// input operands as the node already has, the input node is returned.
- SDOperand UpdateNodeOperands(SDOperand N, SDOperand Op);
- SDOperand UpdateNodeOperands(SDOperand N, SDOperand Op1, SDOperand Op2);
- SDOperand UpdateNodeOperands(SDOperand N, SDOperand Op1, SDOperand Op2,
- SDOperand Op3);
- SDOperand UpdateNodeOperands(SDOperand N, SDOperand Op1, SDOperand Op2,
- SDOperand Op3, SDOperand Op4);
- SDOperand UpdateNodeOperands(SDOperand N, SDOperand Op1, SDOperand Op2,
- SDOperand Op3, SDOperand Op4, SDOperand Op5);
- SDOperand UpdateNodeOperands(SDOperand N,
- const SDOperand *Ops, unsigned NumOps);
+ SDValue UpdateNodeOperands(SDValue N, SDValue Op);
+ SDValue UpdateNodeOperands(SDValue N, SDValue Op1, SDValue Op2);
+ SDValue UpdateNodeOperands(SDValue N, SDValue Op1, SDValue Op2,
+ SDValue Op3);
+ SDValue UpdateNodeOperands(SDValue N, SDValue Op1, SDValue Op2,
+ SDValue Op3, SDValue Op4);
+ SDValue UpdateNodeOperands(SDValue N, SDValue Op1, SDValue Op2,
+ SDValue Op3, SDValue Op4, SDValue Op5);
+ SDValue UpdateNodeOperands(SDValue N,
+ const SDValue *Ops, unsigned NumOps);
/// SelectNodeTo - These are used for target selectors to *mutate* the
/// specified node to have the specified return type, Target opcode, and
/// operands. Note that target opcodes are stored as
/// ~TargetOpcode in the node opcode field. The resultant node is returned.
SDNode *SelectNodeTo(SDNode *N, unsigned TargetOpc, MVT VT);
- SDNode *SelectNodeTo(SDNode *N, unsigned TargetOpc, MVT VT, SDOperand Op1);
+ SDNode *SelectNodeTo(SDNode *N, unsigned TargetOpc, MVT VT, SDValue Op1);
SDNode *SelectNodeTo(SDNode *N, unsigned TargetOpc, MVT VT,
- SDOperand Op1, SDOperand Op2);
+ SDValue Op1, SDValue Op2);
SDNode *SelectNodeTo(SDNode *N, unsigned TargetOpc, MVT VT,
- SDOperand Op1, SDOperand Op2, SDOperand Op3);
+ SDValue Op1, SDValue Op2, SDValue Op3);
SDNode *SelectNodeTo(SDNode *N, unsigned TargetOpc, MVT VT,
- const SDOperand *Ops, unsigned NumOps);
+ const SDValue *Ops, unsigned NumOps);
SDNode *SelectNodeTo(SDNode *N, unsigned TargetOpc, MVT VT1, MVT VT2);
SDNode *SelectNodeTo(SDNode *N, unsigned TargetOpc, MVT VT1,
- MVT VT2, const SDOperand *Ops, unsigned NumOps);
+ MVT VT2, const SDValue *Ops, unsigned NumOps);
SDNode *SelectNodeTo(SDNode *N, unsigned TargetOpc, MVT VT1,
- MVT VT2, MVT VT3, const SDOperand *Ops, unsigned NumOps);
+ MVT VT2, MVT VT3, const SDValue *Ops, unsigned NumOps);
SDNode *SelectNodeTo(SDNode *N, unsigned TargetOpc, MVT VT1,
- MVT VT2, SDOperand Op1);
+ MVT VT2, SDValue Op1);
SDNode *SelectNodeTo(SDNode *N, unsigned TargetOpc, MVT VT1,
- MVT VT2, SDOperand Op1, SDOperand Op2);
+ MVT VT2, SDValue Op1, SDValue Op2);
SDNode *SelectNodeTo(SDNode *N, unsigned TargetOpc, MVT VT1,
- MVT VT2, SDOperand Op1, SDOperand Op2, SDOperand Op3);
+ MVT VT2, SDValue Op1, SDValue Op2, SDValue Op3);
SDNode *SelectNodeTo(SDNode *N, unsigned TargetOpc, SDVTList VTs,
- const SDOperand *Ops, unsigned NumOps);
+ const SDValue *Ops, unsigned NumOps);
/// MorphNodeTo - These *mutate* the specified node to have the specified
/// return type, opcode, and operands.
SDNode *MorphNodeTo(SDNode *N, unsigned Opc, MVT VT);
- SDNode *MorphNodeTo(SDNode *N, unsigned Opc, MVT VT, SDOperand Op1);
+ SDNode *MorphNodeTo(SDNode *N, unsigned Opc, MVT VT, SDValue Op1);
SDNode *MorphNodeTo(SDNode *N, unsigned Opc, MVT VT,
- SDOperand Op1, SDOperand Op2);
+ SDValue Op1, SDValue Op2);
SDNode *MorphNodeTo(SDNode *N, unsigned Opc, MVT VT,
- SDOperand Op1, SDOperand Op2, SDOperand Op3);
+ SDValue Op1, SDValue Op2, SDValue Op3);
SDNode *MorphNodeTo(SDNode *N, unsigned Opc, MVT VT,
- const SDOperand *Ops, unsigned NumOps);
+ const SDValue *Ops, unsigned NumOps);
SDNode *MorphNodeTo(SDNode *N, unsigned Opc, MVT VT1, MVT VT2);
SDNode *MorphNodeTo(SDNode *N, unsigned Opc, MVT VT1,
- MVT VT2, const SDOperand *Ops, unsigned NumOps);
+ MVT VT2, const SDValue *Ops, unsigned NumOps);
SDNode *MorphNodeTo(SDNode *N, unsigned Opc, MVT VT1,
- MVT VT2, MVT VT3, const SDOperand *Ops, unsigned NumOps);
+ MVT VT2, MVT VT3, const SDValue *Ops, unsigned NumOps);
SDNode *MorphNodeTo(SDNode *N, unsigned Opc, MVT VT1,
- MVT VT2, SDOperand Op1);
+ MVT VT2, SDValue Op1);
SDNode *MorphNodeTo(SDNode *N, unsigned Opc, MVT VT1,
- MVT VT2, SDOperand Op1, SDOperand Op2);
+ MVT VT2, SDValue Op1, SDValue Op2);
SDNode *MorphNodeTo(SDNode *N, unsigned Opc, MVT VT1,
- MVT VT2, SDOperand Op1, SDOperand Op2, SDOperand Op3);
+ MVT VT2, SDValue Op1, SDValue Op2, SDValue Op3);
SDNode *MorphNodeTo(SDNode *N, unsigned Opc, SDVTList VTs,
- const SDOperand *Ops, unsigned NumOps);
+ const SDValue *Ops, unsigned NumOps);
/// getTargetNode - These are used for target selectors to create a new node
/// with specified return type(s), target opcode, and operands.
@@ -524,35 +524,35 @@ public:
/// node of the specified opcode and operands, it returns that node instead of
/// the current one.
SDNode *getTargetNode(unsigned Opcode, MVT VT);
- SDNode *getTargetNode(unsigned Opcode, MVT VT, SDOperand Op1);
- SDNode *getTargetNode(unsigned Opcode, MVT VT, SDOperand Op1, SDOperand Op2);
+ SDNode *getTargetNode(unsigned Opcode, MVT VT, SDValue Op1);
+ SDNode *getTargetNode(unsigned Opcode, MVT VT, SDValue Op1, SDValue Op2);
SDNode *getTargetNode(unsigned Opcode, MVT VT,
- SDOperand Op1, SDOperand Op2, SDOperand Op3);
+ SDValue Op1, SDValue Op2, SDValue Op3);
SDNode *getTargetNode(unsigned Opcode, MVT VT,
- const SDOperand *Ops, unsigned NumOps);
+ const SDValue *Ops, unsigned NumOps);
SDNode *getTargetNode(unsigned Opcode, MVT VT1, MVT VT2);
- SDNode *getTargetNode(unsigned Opcode, MVT VT1, MVT VT2, SDOperand Op1);
+ SDNode *getTargetNode(unsigned Opcode, MVT VT1, MVT VT2, SDValue Op1);
SDNode *getTargetNode(unsigned Opcode, MVT VT1,
- MVT VT2, SDOperand Op1, SDOperand Op2);
+ MVT VT2, SDValue Op1, SDValue Op2);
SDNode *getTargetNode(unsigned Opcode, MVT VT1,
- MVT VT2, SDOperand Op1, SDOperand Op2, SDOperand Op3);
+ MVT VT2, SDValue Op1, SDValue Op2, SDValue Op3);
SDNode *getTargetNode(unsigned Opcode, MVT VT1, MVT VT2,
- const SDOperand *Ops, unsigned NumOps);
+ const SDValue *Ops, unsigned NumOps);
SDNode *getTargetNode(unsigned Opcode, MVT VT1, MVT VT2, MVT VT3,
- SDOperand Op1, SDOperand Op2);
+ SDValue Op1, SDValue Op2);
SDNode *getTargetNode(unsigned Opcode, MVT VT1, MVT VT2, MVT VT3,
- SDOperand Op1, SDOperand Op2, SDOperand Op3);
+ SDValue Op1, SDValue Op2, SDValue Op3);
SDNode *getTargetNode(unsigned Opcode, MVT VT1, MVT VT2, MVT VT3,
- const SDOperand *Ops, unsigned NumOps);
+ const SDValue *Ops, unsigned NumOps);
SDNode *getTargetNode(unsigned Opcode, MVT VT1, MVT VT2, MVT VT3, MVT VT4,
- const SDOperand *Ops, unsigned NumOps);
+ const SDValue *Ops, unsigned NumOps);
SDNode *getTargetNode(unsigned Opcode, const std::vector<MVT> &ResultTys,
- const SDOperand *Ops, unsigned NumOps);
+ const SDValue *Ops, unsigned NumOps);
/// getNodeIfExists - Get the specified node if it's already available, or
/// else return NULL.
SDNode *getNodeIfExists(unsigned Opcode, SDVTList VTs,
- const SDOperand *Ops, unsigned NumOps);
+ const SDValue *Ops, unsigned NumOps);
/// DAGUpdateListener - Clients of various APIs that cause global effects on
/// the DAG can optionally implement this interface. This allows the clients
@@ -588,22 +588,22 @@ public:
/// informed about nodes that are deleted and modified due to recursive
/// changes in the dag.
///
- void ReplaceAllUsesWith(SDOperand From, SDOperand Op,
+ void ReplaceAllUsesWith(SDValue From, SDValue Op,
DAGUpdateListener *UpdateListener = 0);
void ReplaceAllUsesWith(SDNode *From, SDNode *To,
DAGUpdateListener *UpdateListener = 0);
- void ReplaceAllUsesWith(SDNode *From, const SDOperand *To,
+ void ReplaceAllUsesWith(SDNode *From, const SDValue *To,
DAGUpdateListener *UpdateListener = 0);
/// ReplaceAllUsesOfValueWith - Replace any uses of From with To, leaving
/// uses of other values produced by From.Val alone.
- void ReplaceAllUsesOfValueWith(SDOperand From, SDOperand To,
+ void ReplaceAllUsesOfValueWith(SDValue From, SDValue To,
DAGUpdateListener *UpdateListener = 0);
/// ReplaceAllUsesOfValuesWith - Like ReplaceAllUsesOfValueWith, but
/// for multiple values at once. This correctly handles the case where
/// there is an overlap between the From values and the To values.
- void ReplaceAllUsesOfValuesWith(const SDOperand *From, const SDOperand *To,
+ void ReplaceAllUsesOfValuesWith(const SDValue *From, const SDValue *To,
unsigned Num,
DAGUpdateListener *UpdateListener = 0);
@@ -640,20 +640,20 @@ public:
/// CreateStackTemporary - Create a stack temporary, suitable for holding the
/// specified value type. If minAlign is specified, the slot size will have
/// at least that alignment.
- SDOperand CreateStackTemporary(MVT VT, unsigned minAlign = 1);
+ SDValue CreateStackTemporary(MVT VT, unsigned minAlign = 1);
/// FoldSetCC - Constant fold a setcc to true or false.
- SDOperand FoldSetCC(MVT VT, SDOperand N1,
- SDOperand N2, ISD::CondCode Cond);
+ SDValue FoldSetCC(MVT VT, SDValue N1,
+ SDValue N2, ISD::CondCode Cond);
/// SignBitIsZero - Return true if the sign bit of Op is known to be zero. We
/// use this predicate to simplify operations downstream.
- bool SignBitIsZero(SDOperand Op, unsigned Depth = 0) const;
+ bool SignBitIsZero(SDValue Op, unsigned Depth = 0) const;
/// MaskedValueIsZero - Return true if 'Op & Mask' is known to be zero. We
/// use this predicate to simplify operations downstream. Op and Mask are
/// known to be the same type.
- bool MaskedValueIsZero(SDOperand Op, const APInt &Mask, unsigned Depth = 0)
+ bool MaskedValueIsZero(SDValue Op, const APInt &Mask, unsigned Depth = 0)
const;
/// ComputeMaskedBits - Determine which of the bits specified in Mask are
@@ -661,7 +661,7 @@ public:
/// bitsets. This code only analyzes bits in Mask, in order to short-circuit
/// processing. Targets can implement the computeMaskedBitsForTargetNode
/// method in the TargetLowering class to allow target nodes to be understood.
- void ComputeMaskedBits(SDOperand Op, const APInt &Mask, APInt &KnownZero,
+ void ComputeMaskedBits(SDValue Op, const APInt &Mask, APInt &KnownZero,
APInt &KnownOne, unsigned Depth = 0) const;
/// ComputeNumSignBits - Return the number of times the sign bit of the
@@ -671,24 +671,24 @@ public:
/// the top 3 bits are all equal to each other, so we return 3. Targets can
/// implement the ComputeNumSignBitsForTarget method in the TargetLowering
/// class to allow target nodes to be understood.
- unsigned ComputeNumSignBits(SDOperand Op, unsigned Depth = 0) const;
+ unsigned ComputeNumSignBits(SDValue Op, unsigned Depth = 0) const;
- /// isVerifiedDebugInfoDesc - Returns true if the specified SDOperand has
+ /// isVerifiedDebugInfoDesc - Returns true if the specified SDValue has
/// been verified as a debug information descriptor.
- bool isVerifiedDebugInfoDesc(SDOperand Op) const;
+ bool isVerifiedDebugInfoDesc(SDValue Op) const;
/// getShuffleScalarElt - Returns the scalar element that will make up the ith
/// element of the result of the vector shuffle.
- SDOperand getShuffleScalarElt(const SDNode *N, unsigned Idx);
+ SDValue getShuffleScalarElt(const SDNode *N, unsigned Idx);
private:
inline alist_traits<SDNode, LargestSDNode>::AllocatorType &getAllocator();
void RemoveNodeFromCSEMaps(SDNode *N);
SDNode *AddNonLeafNodeToCSEMaps(SDNode *N);
- SDNode *FindModifiedNodeSlot(SDNode *N, SDOperand Op, void *&InsertPos);
- SDNode *FindModifiedNodeSlot(SDNode *N, SDOperand Op1, SDOperand Op2,
+ SDNode *FindModifiedNodeSlot(SDNode *N, SDValue Op, void *&InsertPos);
+ SDNode *FindModifiedNodeSlot(SDNode *N, SDValue Op1, SDValue Op2,
void *&InsertPos);
- SDNode *FindModifiedNodeSlot(SDNode *N, const SDOperand *Ops, unsigned NumOps,
+ SDNode *FindModifiedNodeSlot(SDNode *N, const SDValue *Ops, unsigned NumOps,
void *&InsertPos);
void DeleteNodeNotInCSEMaps(SDNode *N);
diff --git a/include/llvm/CodeGen/SelectionDAGISel.h b/include/llvm/CodeGen/SelectionDAGISel.h
index e9b3f52..c384fa5 100644
--- a/include/llvm/CodeGen/SelectionDAGISel.h
+++ b/include/llvm/CodeGen/SelectionDAGISel.h
@@ -21,7 +21,7 @@
namespace llvm {
class SelectionDAGLowering;
- class SDOperand;
+ class SDValue;
class MachineRegisterInfo;
class MachineBasicBlock;
class MachineFunction;
@@ -70,9 +70,9 @@ public:
/// not match or is not implemented, return true. The resultant operands
/// (which will appear in the machine instruction) should be added to the
/// OutOps vector.
- virtual bool SelectInlineAsmMemoryOperand(const SDOperand &Op,
+ virtual bool SelectInlineAsmMemoryOperand(const SDValue &Op,
char ConstraintCode,
- std::vector<SDOperand> &OutOps,
+ std::vector<SDValue> &OutOps,
SelectionDAG &DAG) {
return true;
}
@@ -168,13 +168,13 @@ protected:
/// SelectInlineAsmMemoryOperands - Calls to this are automatically generated
/// by tblgen. Others should not call it.
- void SelectInlineAsmMemoryOperands(std::vector<SDOperand> &Ops,
+ void SelectInlineAsmMemoryOperands(std::vector<SDValue> &Ops,
SelectionDAG &DAG);
// Calls to these predicates are generated by tblgen.
- bool CheckAndMask(SDOperand LHS, ConstantSDNode *RHS,
+ bool CheckAndMask(SDValue LHS, ConstantSDNode *RHS,
int64_t DesiredMaskS) const;
- bool CheckOrMask(SDOperand LHS, ConstantSDNode *RHS,
+ bool CheckOrMask(SDValue LHS, ConstantSDNode *RHS,
int64_t DesiredMaskS) const;
private:
diff --git a/include/llvm/CodeGen/SelectionDAGNodes.h b/include/llvm/CodeGen/SelectionDAGNodes.h
index dae3a55..d690732 100644
--- a/include/llvm/CodeGen/SelectionDAGNodes.h
+++ b/include/llvm/CodeGen/SelectionDAGNodes.h
@@ -795,7 +795,7 @@ namespace ISD {
//===----------------------------------------------------------------------===//
-/// SDOperand - Unlike LLVM values, Selection DAG nodes may return multiple
+/// SDValue - Unlike LLVM values, Selection DAG nodes may return multiple
/// values as the result of a computation. Many nodes return multiple values,
/// from loads (which define a token and a return value) to ADDC (which returns
/// a result and a carry value), to calls (which may return an arbitrary number
@@ -803,28 +803,28 @@ namespace ISD {
///
/// As such, each use of a SelectionDAG computation must indicate the node that
/// computes it as well as which return value to use from that node. This pair
-/// of information is represented with the SDOperand value type.
+/// of information is represented with the SDValue value type.
///
-class SDOperand {
+class SDValue {
public:
SDNode *Val; // The node defining the value we are using.
unsigned ResNo; // Which return value of the node we are using.
- SDOperand() : Val(0), ResNo(0) {}
- SDOperand(SDNode *val, unsigned resno) : Val(val), ResNo(resno) {}
+ SDValue() : Val(0), ResNo(0) {}
+ SDValue(SDNode *val, unsigned resno) : Val(val), ResNo(resno) {}
- bool operator==(const SDOperand &O) const {
+ bool operator==(const SDValue &O) const {
return Val == O.Val && ResNo == O.ResNo;
}
- bool operator!=(const SDOperand &O) const {
+ bool operator!=(const SDValue &O) const {
return !operator==(O);
}
- bool operator<(const SDOperand &O) const {
+ bool operator<(const SDValue &O) const {
return Val < O.Val || (Val == O.Val && ResNo < O.ResNo);
}
- SDOperand getValue(unsigned R) const {
- return SDOperand(Val, R);
+ SDValue getValue(unsigned R) const {
+ return SDValue(Val, R);
}
// isOperandOf - Return true if this node is an operand of N.
@@ -843,7 +843,7 @@ public:
// Forwarding methods - These forward to the corresponding methods in SDNode.
inline unsigned getOpcode() const;
inline unsigned getNumOperands() const;
- inline const SDOperand &getOperand(unsigned i) const;
+ inline const SDValue &getOperand(unsigned i) const;
inline uint64_t getConstantOperandVal(unsigned i) const;
inline bool isTargetOpcode() const;
inline bool isMachineOpcode() const;
@@ -855,7 +855,7 @@ public:
/// side-effecting instructions. In practice, this looks through token
/// factors and non-volatile loads. In order to remain efficient, this only
/// looks a couple of nodes in, it does not do an exhaustive search.
- bool reachesChainWithoutSideEffects(SDOperand Dest,
+ bool reachesChainWithoutSideEffects(SDValue Dest,
unsigned Depth = 2) const;
/// use_empty - Return true if there are no nodes using value ResNo
@@ -870,42 +870,42 @@ public:
};
-template<> struct DenseMapInfo<SDOperand> {
- static inline SDOperand getEmptyKey() {
- return SDOperand((SDNode*)-1, -1U);
+template<> struct DenseMapInfo<SDValue> {
+ static inline SDValue getEmptyKey() {
+ return SDValue((SDNode*)-1, -1U);
}
- static inline SDOperand getTombstoneKey() {
- return SDOperand((SDNode*)-1, 0);
+ static inline SDValue getTombstoneKey() {
+ return SDValue((SDNode*)-1, 0);
}
- static unsigned getHashValue(const SDOperand &Val) {
+ static unsigned getHashValue(const SDValue &Val) {
return ((unsigned)((uintptr_t)Val.Val >> 4) ^
(unsigned)((uintptr_t)Val.Val >> 9)) + Val.ResNo;
}
- static bool isEqual(const SDOperand &LHS, const SDOperand &RHS) {
+ static bool isEqual(const SDValue &LHS, const SDValue &RHS) {
return LHS == RHS;
}
static bool isPod() { return true; }
};
/// simplify_type specializations - Allow casting operators to work directly on
-/// SDOperands as if they were SDNode*'s.
-template<> struct simplify_type<SDOperand> {
+/// SDValues as if they were SDNode*'s.
+template<> struct simplify_type<SDValue> {
typedef SDNode* SimpleType;
- static SimpleType getSimplifiedValue(const SDOperand &Val) {
+ static SimpleType getSimplifiedValue(const SDValue &Val) {
return static_cast<SimpleType>(Val.Val);
}
};
-template<> struct simplify_type<const SDOperand> {
+template<> struct simplify_type<const SDValue> {
typedef SDNode* SimpleType;
- static SimpleType getSimplifiedValue(const SDOperand &Val) {
+ static SimpleType getSimplifiedValue(const SDValue &Val) {
return static_cast<SimpleType>(Val.Val);
}
};
/// SDUse - Represents a use of the SDNode referred by
-/// the SDOperand.
+/// the SDValue.
class SDUse {
- SDOperand Operand;
+ SDValue Operand;
/// User - Parent node of this operand.
SDNode *User;
/// Prev, next - Pointers to the uses list of the SDNode referred by
@@ -918,7 +918,7 @@ public:
SDUse(SDNode *val, unsigned resno) :
Operand(val,resno), User(NULL), Prev(NULL), Next(NULL) {}
- SDUse& operator= (const SDOperand& Op) {
+ SDUse& operator= (const SDValue& Op) {
Operand = Op;
Next = NULL;
Prev = NULL;
@@ -938,21 +938,22 @@ public:
void setUser(SDNode *p) { User = p; }
- operator SDOperand() const { return Operand; }
+ operator SDValue() const { return Operand; }
- const SDOperand& getSDOperand() const { return Operand; }
+ const SDValue& getSDValue() const { return Operand; }
SDNode *&getVal() { return Operand.Val; }
+ SDNode *const &getVal() const { return Operand.Val; }
- bool operator==(const SDOperand &O) const {
+ bool operator==(const SDValue &O) const {
return Operand == O;
}
- bool operator!=(const SDOperand &O) const {
+ bool operator!=(const SDValue &O) const {
return !(Operand == O);
}
- bool operator<(const SDOperand &O) const {
+ bool operator<(const SDValue &O) const {
return Operand < O;
}
@@ -972,56 +973,56 @@ protected:
/// simplify_type specializations - Allow casting operators to work directly on
-/// SDOperands as if they were SDNode*'s.
+/// SDValues as if they were SDNode*'s.
template<> struct simplify_type<SDUse> {
typedef SDNode* SimpleType;
static SimpleType getSimplifiedValue(const SDUse &Val) {
- return static_cast<SimpleType>(Val.getSDOperand().Val);
+ return static_cast<SimpleType>(Val.getVal());
}
};
template<> struct simplify_type<const SDUse> {
typedef SDNode* SimpleType;
static SimpleType getSimplifiedValue(const SDUse &Val) {
- return static_cast<SimpleType>(Val.getSDOperand().Val);
+ return static_cast<SimpleType>(Val.getVal());
}
};
-/// SDOperandPtr - A helper SDOperand pointer class, that can handle
-/// arrays of SDUse and arrays of SDOperand objects. This is required
+/// SDOperandPtr - A helper SDValue pointer class, that can handle
+/// arrays of SDUse and arrays of SDValue objects. This is required
/// in many places inside the SelectionDAG.
///
class SDOperandPtr {
- const SDOperand *ptr; // The pointer to the SDOperand object
- int object_size; // The size of the object containg the SDOperand
+ const SDValue *ptr; // The pointer to the SDValue object
+ int object_size; // The size of the object containg the SDValue
public:
SDOperandPtr() : ptr(0), object_size(0) {}
SDOperandPtr(SDUse * use_ptr) {
- ptr = &use_ptr->getSDOperand();
+ ptr = &use_ptr->getSDValue();
object_size = (int)sizeof(SDUse);
}
- SDOperandPtr(const SDOperand * op_ptr) {
+ SDOperandPtr(const SDValue * op_ptr) {
ptr = op_ptr;
- object_size = (int)sizeof(SDOperand);
+ object_size = (int)sizeof(SDValue);
}
- const SDOperand operator *() { return *ptr; }
- const SDOperand *operator ->() { return ptr; }
+ const SDValue operator *() { return *ptr; }
+ const SDValue *operator ->() { return ptr; }
SDOperandPtr operator ++ () {
- ptr = (SDOperand*)((char *)ptr + object_size);
+ ptr = (SDValue*)((char *)ptr + object_size);
return *this;
}
SDOperandPtr operator ++ (int) {
SDOperandPtr tmp = *this;
- ptr = (SDOperand*)((char *)ptr + object_size);
+ ptr = (SDValue*)((char *)ptr + object_size);
return tmp;
}
- SDOperand operator[] (int idx) const {
- return *(SDOperand*)((char*) ptr + object_size * idx);
+ SDValue operator[] (int idx) const {
+ return *(SDValue*)((char*) ptr + object_size * idx);
}
};
@@ -1215,9 +1216,9 @@ public:
/// ConstantSDNode operand.
uint64_t getConstantOperandVal(unsigned Num) const;
- const SDOperand &getOperand(unsigned Num) const {
+ const SDValue &getOperand(unsigned Num) const {
assert(Num < NumOperands && "Invalid child # of SDNode!");
- return OperandList[Num].getSDOperand();
+ return OperandList[Num].getSDValue();
}
typedef SDUse* op_iterator;
@@ -1276,7 +1277,7 @@ protected:
return Ret;
}
- SDNode(unsigned Opc, SDVTList VTs, const SDOperand *Ops, unsigned NumOps)
+ SDNode(unsigned Opc, SDVTList VTs, const SDValue *Ops, unsigned NumOps)
: NodeType(Opc), OperandsNeedDelete(true), SubclassData(0),
NodeId(-1), Uses(NULL) {
NumOperands = NumOps;
@@ -1302,7 +1303,7 @@ protected:
for (unsigned i = 0; i != NumOps; ++i) {
OperandList[i] = Ops[i];
OperandList[i].setUser(this);
- Ops[i].getSDOperand().Val->addUse(OperandList[i]);
+ Ops[i].getVal()->addUse(OperandList[i]);
}
ValueList = VTs.VTs;
@@ -1352,36 +1353,36 @@ protected:
};
-// Define inline functions from the SDOperand class.
+// Define inline functions from the SDValue class.
-inline unsigned SDOperand::getOpcode() const {
+inline unsigned SDValue::getOpcode() const {
return Val->getOpcode();
}
-inline MVT SDOperand::getValueType() const {
+inline MVT SDValue::getValueType() const {
return Val->getValueType(ResNo);
}
-inline unsigned SDOperand::getNumOperands() const {
+inline unsigned SDValue::getNumOperands() const {
return Val->getNumOperands();
}
-inline const SDOperand &SDOperand::getOperand(unsigned i) const {
+inline const SDValue &SDValue::getOperand(unsigned i) const {
return Val->getOperand(i);
}
-inline uint64_t SDOperand::getConstantOperandVal(unsigned i) const {
+inline uint64_t SDValue::getConstantOperandVal(unsigned i) const {
return Val->getConstantOperandVal(i);
}
-inline bool SDOperand::isTargetOpcode() const {
+inline bool SDValue::isTargetOpcode() const {
return Val->isTargetOpcode();
}
-inline bool SDOperand::isMachineOpcode() const {
+inline bool SDValue::isMachineOpcode() const {
return Val->isMachineOpcode();
}
-inline unsigned SDOperand::getMachineOpcode() const {
+inline unsigned SDValue::getMachineOpcode() const {
return Val->getMachineOpcode();
}
-inline bool SDOperand::use_empty() const {
+inline bool SDValue::use_empty() const {
return !Val->hasAnyUseOfValue(ResNo);
}
-inline bool SDOperand::hasOneUse() const {
+inline bool SDValue::hasOneUse() const {
return Val->hasNUsesOfValue(1, ResNo);
}
@@ -1391,7 +1392,7 @@ class UnarySDNode : public SDNode {
virtual void ANCHOR(); // Out-of-line virtual method to give class a home.
SDUse Op;
public:
- UnarySDNode(unsigned Opc, SDVTList VTs, SDOperand X)
+ UnarySDNode(unsigned Opc, SDVTList VTs, SDValue X)
: SDNode(Opc, VTs) {
Op = X;
InitOperands(&Op, 1);
@@ -1404,7 +1405,7 @@ class BinarySDNode : public SDNode {
virtual void ANCHOR(); // Out-of-line virtual method to give class a home.
SDUse Ops[2];
public:
- BinarySDNode(unsigned Opc, SDVTList VTs, SDOperand X, SDOperand Y)
+ BinarySDNode(unsigned Opc, SDVTList VTs, SDValue X, SDValue Y)
: SDNode(Opc, VTs) {
Ops[0] = X;
Ops[1] = Y;
@@ -1418,8 +1419,8 @@ class TernarySDNode : public SDNode {
virtual void ANCHOR(); // Out-of-line virtual method to give class a home.
SDUse Ops[3];
public:
- TernarySDNode(unsigned Opc, SDVTList VTs, SDOperand X, SDOperand Y,
- SDOperand Z)
+ TernarySDNode(unsigned Opc, SDVTList VTs, SDValue X, SDValue Y,
+ SDValue Z)
: SDNode(Opc, VTs) {
Ops[0] = X;
Ops[1] = Y;
@@ -1440,9 +1441,9 @@ public:
// FIXME: Remove the "noinline" attribute once <rdar://problem/5852746> is
// fixed.
#ifdef __GNUC__
- explicit __attribute__((__noinline__)) HandleSDNode(SDOperand X)
+ explicit __attribute__((__noinline__)) HandleSDNode(SDValue X)
#else
- explicit HandleSDNode(SDOperand X)
+ explicit HandleSDNode(SDValue X)
#endif
: SDNode(ISD::HANDLENODE, getSDVTList(MVT::Other)) {
Op = X;
@@ -1490,8 +1491,8 @@ public:
/// reference performed by operation.
MachineMemOperand getMemOperand() const;
- const SDOperand &getChain() const { return getOperand(0); }
- const SDOperand &getBasePtr() const {
+ const SDValue &getChain() const { return getOperand(0); }
+ const SDValue &getBasePtr() const {
return getOperand(getOpcode() == ISD::STORE ? 2 : 1);
}
@@ -1524,13 +1525,13 @@ class AtomicSDNode : public MemSDNode {
// Opc: opcode for atomic
// VTL: value type list
// Chain: memory chain for operaand
- // Ptr: address to update as a SDOperand
+ // Ptr: address to update as a SDValue
// Cmp: compare value
// Swp: swap value
// SrcVal: address to update as a Value (used for MemOperand)
// Align: alignment of memory
- AtomicSDNode(unsigned Opc, SDVTList VTL, SDOperand Chain, SDOperand Ptr,
- SDOperand Cmp, SDOperand Swp, const Value* SrcVal,
+ AtomicSDNode(unsigned Opc, SDVTList VTL, SDValue Chain, SDValue Ptr,
+ SDValue Cmp, SDValue Swp, const Value* SrcVal,
unsigned Align=0)
: MemSDNode(Opc, VTL, Cmp.getValueType(), SrcVal, /*SVOffset=*/0,
Align, /*isVolatile=*/true) {
@@ -1540,8 +1541,8 @@ class AtomicSDNode : public MemSDNode {
Ops[3] = Cmp;
InitOperands(Ops, 4);
}
- AtomicSDNode(unsigned Opc, SDVTList VTL, SDOperand Chain, SDOperand Ptr,
- SDOperand Val, const Value* SrcVal, unsigned Align=0)
+ AtomicSDNode(unsigned Opc, SDVTList VTL, SDValue Chain, SDValue Ptr,
+ SDValue Val, const Value* SrcVal, unsigned Align=0)
: MemSDNode(Opc, VTL, Val.getValueType(), SrcVal, /*SVOffset=*/0,
Align, /*isVolatile=*/true) {
Ops[0] = Chain;
@@ -1550,8 +1551,8 @@ class AtomicSDNode : public MemSDNode {
InitOperands(Ops, 3);
}
- const SDOperand &getBasePtr() const { return getOperand(1); }
- const SDOperand &getVal() const { return getOperand(2); }
+ const SDValue &getBasePtr() const { return getOperand(1); }
+ const SDValue &getVal() const { return getOperand(2); }
bool isCompareAndSwap() const { return getOpcode() == ISD::ATOMIC_CMP_SWAP; }
@@ -1871,7 +1872,7 @@ class DbgStopPointSDNode : public SDNode {
virtual void ANCHOR(); // Out-of-line virtual method to give class a home.
protected:
friend class SelectionDAG;
- DbgStopPointSDNode(SDOperand ch, unsigned l, unsigned c,
+ DbgStopPointSDNode(SDValue ch, unsigned l, unsigned c,
const CompileUnitDesc *cu)
: SDNode(ISD::DBG_STOPPOINT, getSDVTList(MVT::Other)),
Line(l), Column(c), CU(cu) {
@@ -1895,7 +1896,7 @@ class LabelSDNode : public SDNode {
virtual void ANCHOR(); // Out-of-line virtual method to give class a home.
protected:
friend class SelectionDAG;
- LabelSDNode(unsigned NodeTy, SDOperand ch, unsigned id)
+ LabelSDNode(unsigned NodeTy, SDValue ch, unsigned id)
: SDNode(NodeTy, getSDVTList(MVT::Other)), LabelID(id) {
Chain = ch;
InitOperands(&Chain, 1);
@@ -2083,7 +2084,7 @@ protected:
*/
SDUse Ops[4];
public:
- LSBaseSDNode(ISD::NodeType NodeTy, SDOperand *Operands, unsigned numOperands,
+ LSBaseSDNode(ISD::NodeType NodeTy, SDValue *Operands, unsigned numOperands,
SDVTList VTs, ISD::MemIndexedMode AM, MVT VT,
const Value *SV, int SVO, unsigned Align, bool Vol)
: MemSDNode(NodeTy, VTs, VT, SV, SVO, Align, Vol) {
@@ -2096,7 +2097,7 @@ public:
"Only indexed loads and stores have a non-undef offset operand");
}
- const SDOperand &getOffset() const {
+ const SDValue &getOffset() const {
return getOperand(getOpcode() == ISD::LOAD ? 2 : 3);
}
@@ -2125,7 +2126,7 @@ class LoadSDNode : public LSBaseSDNode {
virtual void ANCHOR(); // Out-of-line virtual method to give class a home.
protected:
friend class SelectionDAG;
- LoadSDNode(SDOperand *ChainPtrOff, SDVTList VTs,
+ LoadSDNode(SDValue *ChainPtrOff, SDVTList VTs,
ISD::MemIndexedMode AM, ISD::LoadExtType ETy, MVT LVT,
const Value *SV, int O=0, unsigned Align=0, bool Vol=false)
: LSBaseSDNode(ISD::LOAD, ChainPtrOff, 3,
@@ -2140,8 +2141,8 @@ public:
return ISD::LoadExtType((SubclassData >> 3) & 3);
}
- const SDOperand &getBasePtr() const { return getOperand(1); }
- const SDOperand &getOffset() const { return getOperand(2); }
+ const SDValue &getBasePtr() const { return getOperand(1); }
+ const SDValue &getOffset() const { return getOperand(2); }
static bool classof(const LoadSDNode *) { return true; }
static bool classof(const SDNode *N) {
@@ -2155,7 +2156,7 @@ class StoreSDNode : public LSBaseSDNode {
virtual void ANCHOR(); // Out-of-line virtual method to give class a home.
protected:
friend class SelectionDAG;
- StoreSDNode(SDOperand *ChainValuePtrOff, SDVTList VTs,
+ StoreSDNode(SDValue *ChainValuePtrOff, SDVTList VTs,
ISD::MemIndexedMode AM, bool isTrunc, MVT SVT,
const Value *SV, int O=0, unsigned Align=0, bool Vol=false)
: LSBaseSDNode(ISD::STORE, ChainValuePtrOff, 4,
@@ -2169,9 +2170,9 @@ public:
/// For floats, it is the same as doing an FP_ROUND and storing the result.
bool isTruncatingStore() const { return (SubclassData >> 3) & 1; }
- const SDOperand &getValue() const { return getOperand(1); }
- const SDOperand &getBasePtr() const { return getOperand(2); }
- const SDOperand &getOffset() const { return getOperand(3); }
+ const SDValue &getValue() const { return getOperand(1); }
+ const SDValue &getBasePtr() const { return getOperand(2); }
+ const SDValue &getOffset() const { return getOperand(3); }
static bool classof(const StoreSDNode *) { return true; }
static bool classof(const SDNode *N) {
diff --git a/include/llvm/Target/TargetLowering.h b/include/llvm/Target/TargetLowering.h
index 559004a..3c2ef00 100644
--- a/include/llvm/Target/TargetLowering.h
+++ b/include/llvm/Target/TargetLowering.h
@@ -37,7 +37,7 @@ namespace llvm {
class MachineFrameInfo;
class MachineInstr;
class SDNode;
- class SDOperand;
+ class SDValue;
class SelectionDAG;
class TargetData;
class TargetMachine;
@@ -112,7 +112,7 @@ public:
/// getSetCCResultType - Return the ValueType of the result of setcc
/// operations.
- virtual MVT getSetCCResultType(const SDOperand &) const;
+ virtual MVT getSetCCResultType(const SDValue &) const;
/// getSetCCResultContents - For targets without boolean registers, this flag
/// returns information about the contents of the high-bits in the setcc
@@ -266,7 +266,7 @@ public:
/// support *some* VECTOR_SHUFFLE operations, those with specific masks.
/// By default, if a target supports the VECTOR_SHUFFLE node, all mask values
/// are assumed to be legal.
- virtual bool isShuffleMaskLegal(SDOperand Mask, MVT VT) const {
+ virtual bool isShuffleMaskLegal(SDValue Mask, MVT VT) const {
return true;
}
@@ -274,7 +274,7 @@ public:
/// used by Targets can use this to indicate if there is a suitable
/// VECTOR_SHUFFLE that can be used to replace a VAND with a constant
/// pool entry.
- virtual bool isVectorClearMaskLegal(const std::vector<SDOperand> &BVOps,
+ virtual bool isVectorClearMaskLegal(const std::vector<SDValue> &BVOps,
MVT EVT,
SelectionDAG &DAG) const {
return false;
@@ -603,8 +603,8 @@ public:
/// getPreIndexedAddressParts - returns true by value, base pointer and
/// offset pointer and addressing mode by reference if the node's address
/// can be legally represented as pre-indexed load / store address.
- virtual bool getPreIndexedAddressParts(SDNode *N, SDOperand &Base,
- SDOperand &Offset,
+ virtual bool getPreIndexedAddressParts(SDNode *N, SDValue &Base,
+ SDValue &Offset,
ISD::MemIndexedMode &AM,
SelectionDAG &DAG) {
return false;
@@ -614,7 +614,7 @@ public:
/// offset pointer and addressing mode by reference if this node can be
/// combined with a load / store to form a post-indexed load / store.
virtual bool getPostIndexedAddressParts(SDNode *N, SDNode *Op,
- SDOperand &Base, SDOperand &Offset,
+ SDValue &Base, SDValue &Offset,
ISD::MemIndexedMode &AM,
SelectionDAG &DAG) {
return false;
@@ -622,7 +622,7 @@ public:
/// getPICJumpTableRelocaBase - Returns relocation base for the given PIC
/// jumptable.
- virtual SDOperand getPICJumpTableRelocBase(SDOperand Table,
+ virtual SDValue getPICJumpTableRelocBase(SDValue Table,
SelectionDAG &DAG) const;
//===--------------------------------------------------------------------===//
@@ -630,18 +630,18 @@ public:
//
/// TargetLoweringOpt - A convenience struct that encapsulates a DAG, and two
- /// SDOperands for returning information from TargetLowering to its clients
+ /// SDValues for returning information from TargetLowering to its clients
/// that want to combine
struct TargetLoweringOpt {
SelectionDAG &DAG;
bool AfterLegalize;
- SDOperand Old;
- SDOperand New;
+ SDValue Old;
+ SDValue New;
explicit TargetLoweringOpt(SelectionDAG &InDAG, bool afterLegalize)
: DAG(InDAG), AfterLegalize(afterLegalize) {}
- bool CombineTo(SDOperand O, SDOperand N) {
+ bool CombineTo(SDValue O, SDValue N) {
Old = O;
New = N;
return true;
@@ -651,7 +651,7 @@ public:
/// specified instruction is a constant integer. If so, check to see if
/// there are any bits set in the constant that are not demanded. If so,
/// shrink the constant and return true.
- bool ShrinkDemandedConstant(SDOperand Op, const APInt &Demanded);
+ bool ShrinkDemandedConstant(SDValue Op, const APInt &Demanded);
};
/// SimplifyDemandedBits - Look at Op. At this point, we know that only the
@@ -662,14 +662,14 @@ public:
/// KnownZero bits for the expression (used to simplify the caller).
/// The KnownZero/One bits may only be accurate for those bits in the
/// DemandedMask.
- bool SimplifyDemandedBits(SDOperand Op, const APInt &DemandedMask,
+ bool SimplifyDemandedBits(SDValue Op, const APInt &DemandedMask,
APInt &KnownZero, APInt &KnownOne,
TargetLoweringOpt &TLO, unsigned Depth = 0) const;
/// computeMaskedBitsForTargetNode - Determine which of the bits specified in
/// Mask are known to be either zero or one and return them in the
/// KnownZero/KnownOne bitsets.
- virtual void computeMaskedBitsForTargetNode(const SDOperand Op,
+ virtual void computeMaskedBitsForTargetNode(const SDValue Op,
const APInt &Mask,
APInt &KnownZero,
APInt &KnownOne,
@@ -679,7 +679,7 @@ public:
/// ComputeNumSignBitsForTargetNode - This method can be implemented by
/// targets that want to expose additional information about sign bits to the
/// DAG Combiner.
- virtual unsigned ComputeNumSignBitsForTargetNode(SDOperand Op,
+ virtual unsigned ComputeNumSignBitsForTargetNode(SDValue Op,
unsigned Depth = 0) const;
struct DAGCombinerInfo {
@@ -696,14 +696,14 @@ public:
bool isCalledByLegalizer() const { return CalledByLegalizer; }
void AddToWorklist(SDNode *N);
- SDOperand CombineTo(SDNode *N, const std::vector<SDOperand> &To);
- SDOperand CombineTo(SDNode *N, SDOperand Res);
- SDOperand CombineTo(SDNode *N, SDOperand Res0, SDOperand Res1);
+ SDValue CombineTo(SDNode *N, const std::vector<SDValue> &To);
+ SDValue CombineTo(SDNode *N, SDValue Res);
+ SDValue CombineTo(SDNode *N, SDValue Res0, SDValue Res1);
};
/// SimplifySetCC - Try to simplify a setcc built with the specified operands
- /// and cc. If it is unable to simplify it, return a null SDOperand.
- SDOperand SimplifySetCC(MVT VT, SDOperand N0, SDOperand N1,
+ /// and cc. If it is unable to simplify it, return a null SDValue.
+ SDValue SimplifySetCC(MVT VT, SDValue N0, SDValue N1,
ISD::CondCode Cond, bool foldBooleans,
DAGCombinerInfo &DCI) const;
@@ -724,14 +724,14 @@ public:
///
/// The semantics are as follows:
/// Return Value:
- /// SDOperand.Val == 0 - No change was made
- /// SDOperand.Val == N - N was replaced, is dead, and is already handled.
+ /// SDValue.Val == 0 - No change was made
+ /// SDValue.Val == N - N was replaced, is dead, and is already handled.
/// otherwise - N should be replaced by the returned Operand.
///
/// In addition, methods provided by DAGCombinerInfo may be used to perform
/// more complex transformations.
///
- virtual SDOperand PerformDAGCombine(SDNode *N, DAGCombinerInfo &DCI) const;
+ virtual SDValue PerformDAGCombine(SDNode *N, DAGCombinerInfo &DCI) const;
//===--------------------------------------------------------------------===//
// TargetLowering Configuration Methods - These methods should be invoked by
@@ -966,14 +966,14 @@ public:
/// lower the arguments for the specified function, into the specified DAG.
virtual void
LowerArguments(Function &F, SelectionDAG &DAG,
- SmallVectorImpl<SDOperand>& ArgValues);
+ SmallVectorImpl<SDValue>& ArgValues);
/// LowerCallTo - This hook lowers an abstract call to a function into an
/// actual call. This returns a pair of operands. The first element is the
/// return value for the function (if RetTy is not VoidTy). The second
/// element is the outgoing token chain.
struct ArgListEntry {
- SDOperand Node;
+ SDValue Node;
const Type* Ty;
bool isSExt : 1;
bool isZExt : 1;
@@ -987,17 +987,17 @@ public:
isSRet(false), isNest(false), isByVal(false), Alignment(0) { }
};
typedef std::vector<ArgListEntry> ArgListTy;
- virtual std::pair<SDOperand, SDOperand>
- LowerCallTo(SDOperand Chain, const Type *RetTy, bool RetSExt, bool RetZExt,
+ virtual std::pair<SDValue, SDValue>
+ LowerCallTo(SDValue Chain, const Type *RetTy, bool RetSExt, bool RetZExt,
bool isVarArg, unsigned CallingConv, bool isTailCall,
- SDOperand Callee, ArgListTy &Args, SelectionDAG &DAG);
+ SDValue Callee, ArgListTy &Args, SelectionDAG &DAG);
/// EmitTargetCodeForMemcpy - Emit target-specific code that performs a
/// memcpy. This can be used by targets to provide code sequences for cases
/// that don't fit the target's parameters for simple loads/stores and can be
/// more efficient than using a library call. This function can return a null
- /// SDOperand if the target declines to use custom code and a different
+ /// SDValue if the target declines to use custom code and a different
/// lowering strategy should be used.
///
/// If AlwaysInline is true, the size is constant and the target should not
@@ -1006,46 +1006,46 @@ public:
/// expanded in a place where calls are not feasible (e.g. within the prologue
/// for another call). If the target chooses to decline an AlwaysInline
/// request here, legalize will resort to using simple loads and stores.
- virtual SDOperand
+ virtual SDValue
EmitTargetCodeForMemcpy(SelectionDAG &DAG,
- SDOperand Chain,
- SDOperand Op1, SDOperand Op2,
- SDOperand Op3, unsigned Align,
+ SDValue Chain,
+ SDValue Op1, SDValue Op2,
+ SDValue Op3, unsigned Align,
bool AlwaysInline,
const Value *DstSV, uint64_t DstOff,
const Value *SrcSV, uint64_t SrcOff) {
- return SDOperand();
+ return SDValue();
}
/// EmitTargetCodeForMemmove - Emit target-specific code that performs a
/// memmove. This can be used by targets to provide code sequences for cases
/// that don't fit the target's parameters for simple loads/stores and can be
/// more efficient than using a library call. This function can return a null
- /// SDOperand if the target declines to use custom code and a different
+ /// SDValue if the target declines to use custom code and a different
/// lowering strategy should be used.
- virtual SDOperand
+ virtual SDValue
EmitTargetCodeForMemmove(SelectionDAG &DAG,
- SDOperand Chain,
- SDOperand Op1, SDOperand Op2,
- SDOperand Op3, unsigned Align,
+ SDValue Chain,
+ SDValue Op1, SDValue Op2,
+ SDValue Op3, unsigned Align,
const Value *DstSV, uint64_t DstOff,
const Value *SrcSV, uint64_t SrcOff) {
- return SDOperand();
+ return SDValue();
}
/// EmitTargetCodeForMemset - Emit target-specific code that performs a
/// memset. This can be used by targets to provide code sequences for cases
/// that don't fit the target's parameters for simple stores and can be more
/// efficient than using a library call. This function can return a null
- /// SDOperand if the target declines to use custom code and a different
+ /// SDValue if the target declines to use custom code and a different
/// lowering strategy should be used.
- virtual SDOperand
+ virtual SDValue
EmitTargetCodeForMemset(SelectionDAG &DAG,
- SDOperand Chain,
- SDOperand Op1, SDOperand Op2,
- SDOperand Op3, unsigned Align,
+ SDValue Chain,
+ SDValue Op1, SDValue Op2,
+ SDValue Op3, unsigned Align,
const Value *DstSV, uint64_t DstOff) {
- return SDOperand();
+ return SDValue();
}
/// LowerOperation - This callback is invoked for operations that are
@@ -1053,7 +1053,7 @@ public:
/// and whose defined values are all legal.
/// If the target has no operations that require custom lowering, it need not
/// implement this. The default implementation of this aborts.
- virtual SDOperand LowerOperation(SDOperand Op, SelectionDAG &DAG);
+ virtual SDValue LowerOperation(SDValue Op, SelectionDAG &DAG);
/// ReplaceNodeResults - This callback is invoked for operations that are
/// unsupported by the target, which are registered to use 'custom' lowering,
@@ -1071,8 +1071,8 @@ public:
/// IsEligibleForTailCallOptimization - Check whether the call is eligible for
/// tail call optimization. Targets which want to do tail call optimization
/// should override this function.
- virtual bool IsEligibleForTailCallOptimization(SDOperand Call,
- SDOperand Ret,
+ virtual bool IsEligibleForTailCallOptimization(SDValue Call,
+ SDValue Ret,
SelectionDAG &DAG) const {
return false;
}
@@ -1081,21 +1081,21 @@ public:
/// preceeds the RET node and whether the return uses the result of the node
/// or is a void return. This function can be used by the target to determine
/// eligiblity of tail call optimization.
- static bool CheckTailCallReturnConstraints(SDOperand Call, SDOperand Ret) {
+ static bool CheckTailCallReturnConstraints(SDValue Call, SDValue Ret) {
unsigned NumOps = Ret.getNumOperands();
if ((NumOps == 1 &&
- (Ret.getOperand(0) == SDOperand(Call.Val,1) ||
- Ret.getOperand(0) == SDOperand(Call.Val,0))) ||
+ (Ret.getOperand(0) == SDValue(Call.Val,1) ||
+ Ret.getOperand(0) == SDValue(Call.Val,0))) ||
(NumOps > 1 &&
- Ret.getOperand(0) == SDOperand(Call.Val,Call.Val->getNumValues()-1) &&
- Ret.getOperand(1) == SDOperand(Call.Val,0)))
+ Ret.getOperand(0) == SDValue(Call.Val,Call.Val->getNumValues()-1) &&
+ Ret.getOperand(1) == SDValue(Call.Val,0)))
return true;
return false;
}
/// GetPossiblePreceedingTailCall - Get preceeding TailCallNodeOpCode node if
/// it exists skip possible ISD:TokenFactor.
- static SDOperand GetPossiblePreceedingTailCall(SDOperand Chain,
+ static SDValue GetPossiblePreceedingTailCall(SDValue Chain,
unsigned TailCallNodeOpCode) {
if (Chain.getOpcode() == TailCallNodeOpCode) {
return Chain;
@@ -1152,9 +1152,9 @@ public:
/// type to use for the specific AsmOperandInfo, setting
/// OpInfo.ConstraintCode and OpInfo.ConstraintType. If the actual operand
/// being passed in is available, it can be passed in as Op, otherwise an
- /// empty SDOperand can be passed.
+ /// empty SDValue can be passed.
virtual void ComputeConstraintToUse(AsmOperandInfo &OpInfo,
- SDOperand Op,
+ SDValue Op,
SelectionDAG *DAG = 0) const;
/// getConstraintType - Given a constraint, return the type of constraint it
@@ -1190,8 +1190,8 @@ public:
/// LowerAsmOperandForConstraint - Lower the specified operand into the Ops
/// vector. If it is invalid, don't add anything to Ops.
- virtual void LowerAsmOperandForConstraint(SDOperand Op, char ConstraintLetter,
- std::vector<SDOperand> &Ops,
+ virtual void LowerAsmOperandForConstraint(SDValue Op, char ConstraintLetter,
+ std::vector<SDValue> &Ops,
SelectionDAG &DAG) const;
//===--------------------------------------------------------------------===//
@@ -1245,9 +1245,9 @@ public:
//===--------------------------------------------------------------------===//
// Div utility functions
//
- SDOperand BuildSDIV(SDNode *N, SelectionDAG &DAG,
+ SDValue BuildSDIV(SDNode *N, SelectionDAG &DAG,
std::vector<SDNode*>* Created) const;
- SDOperand BuildUDIV(SDNode *N, SelectionDAG &DAG,
+ SDValue BuildUDIV(SDNode *N, SelectionDAG &DAG,
std::vector<SDNode*>* Created) const;