aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm/CodeGen/SelectionDAGNodes.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/llvm/CodeGen/SelectionDAGNodes.h')
-rw-r--r--include/llvm/CodeGen/SelectionDAGNodes.h79
1 files changed, 38 insertions, 41 deletions
diff --git a/include/llvm/CodeGen/SelectionDAGNodes.h b/include/llvm/CodeGen/SelectionDAGNodes.h
index 081b0e1903..c2e4f1f816 100644
--- a/include/llvm/CodeGen/SelectionDAGNodes.h
+++ b/include/llvm/CodeGen/SelectionDAGNodes.h
@@ -48,7 +48,7 @@ template<typename NodeTy> class ilist_iterator;
/// SelectionDAG::getVTList(...).
///
struct SDVTList {
- const MVT::ValueType *VTs;
+ const MVT *VTs;
unsigned short NumVTs;
};
@@ -834,12 +834,12 @@ public:
/// getValueType - Return the ValueType of the referenced return value.
///
- inline MVT::ValueType getValueType() const;
+ inline MVT getValueType() const;
- /// getValueSizeInBits - Returns MVT::getSizeInBits(getValueType()).
+ /// getValueSizeInBits - Returns the size of the value in bits.
///
unsigned getValueSizeInBits() const {
- return MVT::getSizeInBits(getValueType());
+ return getValueType().getSizeInBits();
}
// Forwarding methods - These forward to the corresponding methods in SDNode.
@@ -1045,7 +1045,7 @@ private:
/// ValueList - The types of the values this node defines. SDNode's may
/// define multiple values simultaneously.
- const MVT::ValueType *ValueList;
+ const MVT *ValueList;
/// NumOperands/NumValues - The number of entries in the Operand/Value list.
unsigned short NumOperands, NumValues;
@@ -1216,7 +1216,7 @@ public:
/// getValueType - Return the type of a specified result.
///
- MVT::ValueType getValueType(unsigned ResNo) const {
+ MVT getValueType(unsigned ResNo) const {
assert(ResNo < NumValues && "Illegal result number!");
return ValueList[ResNo];
}
@@ -1224,10 +1224,10 @@ public:
/// getValueSizeInBits - Returns MVT::getSizeInBits(getValueType(ResNo)).
///
unsigned getValueSizeInBits(unsigned ResNo) const {
- return MVT::getSizeInBits(getValueType(ResNo));
+ return getValueType(ResNo).getSizeInBits();
}
- typedef const MVT::ValueType* value_iterator;
+ typedef const MVT* value_iterator;
value_iterator value_begin() const { return ValueList; }
value_iterator value_end() const { return ValueList+NumValues; }
@@ -1249,8 +1249,8 @@ protected:
/// getValueTypeList - Return a pointer to the specified value type.
///
- static const MVT::ValueType *getValueTypeList(MVT::ValueType VT);
- static SDVTList getSDVTList(MVT::ValueType VT) {
+ static const MVT *getValueTypeList(MVT VT);
+ static SDVTList getSDVTList(MVT VT) {
SDVTList Ret = { getValueTypeList(VT), 1 };
return Ret;
}
@@ -1344,7 +1344,7 @@ protected:
inline unsigned SDOperand::getOpcode() const {
return Val->getOpcode();
}
-inline MVT::ValueType SDOperand::getValueType() const {
+inline MVT SDOperand::getValueType() const {
return Val->getValueType(ResNo);
}
inline unsigned SDOperand::getNumOperands() const {
@@ -1439,10 +1439,10 @@ public:
class AtomicSDNode : public SDNode {
virtual void ANCHOR(); // Out-of-line virtual method to give class a home.
SDUse Ops[4];
- MVT::ValueType OrigVT;
+ MVT OrigVT;
public:
AtomicSDNode(unsigned Opc, SDVTList VTL, SDOperand Chain, SDOperand Ptr,
- SDOperand Cmp, SDOperand Swp, MVT::ValueType VT)
+ SDOperand Cmp, SDOperand Swp, MVT VT)
: SDNode(Opc, VTL) {
Ops[0] = Chain;
Ops[1] = Ptr;
@@ -1452,7 +1452,7 @@ public:
OrigVT=VT;
}
AtomicSDNode(unsigned Opc, SDVTList VTL, SDOperand Chain, SDOperand Ptr,
- SDOperand Val, MVT::ValueType VT)
+ SDOperand Val, MVT VT)
: SDNode(Opc, VTL) {
Ops[0] = Chain;
Ops[1] = Ptr;
@@ -1460,7 +1460,7 @@ public:
InitOperands(Ops, 3);
OrigVT=VT;
}
- MVT::ValueType getVT() const { return OrigVT; }
+ MVT getVT() const { return OrigVT; }
bool isCompareAndSwap() const { return getOpcode() == ISD::ATOMIC_LCS; }
};
@@ -1485,7 +1485,7 @@ class ConstantSDNode : public SDNode {
virtual void ANCHOR(); // Out-of-line virtual method to give class a home.
protected:
friend class SelectionDAG;
- ConstantSDNode(bool isTarget, const APInt &val, MVT::ValueType VT)
+ ConstantSDNode(bool isTarget, const APInt &val, MVT VT)
: SDNode(isTarget ? ISD::TargetConstant : ISD::Constant, getSDVTList(VT)),
Value(val) {
}
@@ -1495,13 +1495,13 @@ public:
uint64_t getValue() const { return Value.getZExtValue(); }
int64_t getSignExtended() const {
- unsigned Bits = MVT::getSizeInBits(getValueType(0));
+ unsigned Bits = getValueType(0).getSizeInBits();
return ((int64_t)Value.getZExtValue() << (64-Bits)) >> (64-Bits);
}
bool isNullValue() const { return Value == 0; }
bool isAllOnesValue() const {
- return Value == MVT::getIntVTBitMask(getValueType(0));
+ return Value == getValueType(0).getIntegerVTBitMask();
}
static bool classof(const ConstantSDNode *) { return true; }
@@ -1516,7 +1516,7 @@ class ConstantFPSDNode : public SDNode {
virtual void ANCHOR(); // Out-of-line virtual method to give class a home.
protected:
friend class SelectionDAG;
- ConstantFPSDNode(bool isTarget, const APFloat& val, MVT::ValueType VT)
+ ConstantFPSDNode(bool isTarget, const APFloat& val, MVT VT)
: SDNode(isTarget ? ISD::TargetConstantFP : ISD::ConstantFP,
getSDVTList(VT)), Value(val) {
}
@@ -1542,7 +1542,7 @@ public:
}
bool isExactlyValue(const APFloat& V) const;
- bool isValueValidForType(MVT::ValueType VT, const APFloat& Val);
+ bool isValueValidForType(MVT VT, const APFloat& Val);
static bool classof(const ConstantFPSDNode *) { return true; }
static bool classof(const SDNode *N) {
@@ -1557,8 +1557,7 @@ class GlobalAddressSDNode : public SDNode {
virtual void ANCHOR(); // Out-of-line virtual method to give class a home.
protected:
friend class SelectionDAG;
- GlobalAddressSDNode(bool isTarget, const GlobalValue *GA, MVT::ValueType VT,
- int o = 0);
+ GlobalAddressSDNode(bool isTarget, const GlobalValue *GA, MVT VT, int o = 0);
public:
GlobalValue *getGlobal() const { return TheGlobal; }
@@ -1578,7 +1577,7 @@ class FrameIndexSDNode : public SDNode {
virtual void ANCHOR(); // Out-of-line virtual method to give class a home.
protected:
friend class SelectionDAG;
- FrameIndexSDNode(int fi, MVT::ValueType VT, bool isTarg)
+ FrameIndexSDNode(int fi, MVT VT, bool isTarg)
: SDNode(isTarg ? ISD::TargetFrameIndex : ISD::FrameIndex, getSDVTList(VT)),
FI(fi) {
}
@@ -1598,7 +1597,7 @@ class JumpTableSDNode : public SDNode {
virtual void ANCHOR(); // Out-of-line virtual method to give class a home.
protected:
friend class SelectionDAG;
- JumpTableSDNode(int jti, MVT::ValueType VT, bool isTarg)
+ JumpTableSDNode(int jti, MVT VT, bool isTarg)
: SDNode(isTarg ? ISD::TargetJumpTable : ISD::JumpTable, getSDVTList(VT)),
JTI(jti) {
}
@@ -1623,22 +1622,20 @@ class ConstantPoolSDNode : public SDNode {
virtual void ANCHOR(); // Out-of-line virtual method to give class a home.
protected:
friend class SelectionDAG;
- ConstantPoolSDNode(bool isTarget, Constant *c, MVT::ValueType VT,
- int o=0)
+ ConstantPoolSDNode(bool isTarget, Constant *c, MVT VT, int o=0)
: SDNode(isTarget ? ISD::TargetConstantPool : ISD::ConstantPool,
getSDVTList(VT)), Offset(o), Alignment(0) {
assert((int)Offset >= 0 && "Offset is too large");
Val.ConstVal = c;
}
- ConstantPoolSDNode(bool isTarget, Constant *c, MVT::ValueType VT, int o,
- unsigned Align)
+ ConstantPoolSDNode(bool isTarget, Constant *c, MVT VT, int o, unsigned Align)
: SDNode(isTarget ? ISD::TargetConstantPool : ISD::ConstantPool,
getSDVTList(VT)), Offset(o), Alignment(Align) {
assert((int)Offset >= 0 && "Offset is too large");
Val.ConstVal = c;
}
ConstantPoolSDNode(bool isTarget, MachineConstantPoolValue *v,
- MVT::ValueType VT, int o=0)
+ MVT VT, int o=0)
: SDNode(isTarget ? ISD::TargetConstantPool : ISD::ConstantPool,
getSDVTList(VT)), Offset(o), Alignment(0) {
assert((int)Offset >= 0 && "Offset is too large");
@@ -1646,7 +1643,7 @@ protected:
Offset |= 1 << (sizeof(unsigned)*8-1);
}
ConstantPoolSDNode(bool isTarget, MachineConstantPoolValue *v,
- MVT::ValueType VT, int o, unsigned Align)
+ MVT VT, int o, unsigned Align)
: SDNode(isTarget ? ISD::TargetConstantPool : ISD::ConstantPool,
getSDVTList(VT)), Offset(o), Alignment(Align) {
assert((int)Offset >= 0 && "Offset is too large");
@@ -1760,7 +1757,7 @@ class RegisterSDNode : public SDNode {
virtual void ANCHOR(); // Out-of-line virtual method to give class a home.
protected:
friend class SelectionDAG;
- RegisterSDNode(unsigned reg, MVT::ValueType VT)
+ RegisterSDNode(unsigned reg, MVT VT)
: SDNode(ISD::Register, getSDVTList(VT)), Reg(reg) {
}
public:
@@ -1778,7 +1775,7 @@ class ExternalSymbolSDNode : public SDNode {
virtual void ANCHOR(); // Out-of-line virtual method to give class a home.
protected:
friend class SelectionDAG;
- ExternalSymbolSDNode(bool isTarget, const char *Sym, MVT::ValueType VT)
+ ExternalSymbolSDNode(bool isTarget, const char *Sym, MVT VT)
: SDNode(isTarget ? ISD::TargetExternalSymbol : ISD::ExternalSymbol,
getSDVTList(VT)), Symbol(Sym) {
}
@@ -1914,19 +1911,19 @@ public:
}
};
-/// VTSDNode - This class is used to represent MVT::ValueType's, which are used
+/// VTSDNode - This class is used to represent MVT's, which are used
/// to parameterize some operations.
class VTSDNode : public SDNode {
- MVT::ValueType ValueType;
+ MVT ValueType;
virtual void ANCHOR(); // Out-of-line virtual method to give class a home.
protected:
friend class SelectionDAG;
- explicit VTSDNode(MVT::ValueType VT)
+ explicit VTSDNode(MVT VT)
: SDNode(ISD::VALUETYPE, getSDVTList(MVT::Other)), ValueType(VT) {
}
public:
- MVT::ValueType getVT() const { return ValueType; }
+ MVT getVT() const { return ValueType; }
static bool classof(const VTSDNode *) { return true; }
static bool classof(const SDNode *N) {
@@ -1942,7 +1939,7 @@ private:
ISD::MemIndexedMode AddrMode;
// MemoryVT - VT of in-memory value.
- MVT::ValueType MemoryVT;
+ MVT MemoryVT;
//! SrcValue - Memory location for alias analysis.
const Value *SrcValue;
@@ -1965,7 +1962,7 @@ protected:
SDUse Ops[4];
public:
LSBaseSDNode(ISD::NodeType NodeTy, SDOperand *Operands, unsigned numOperands,
- SDVTList VTs, ISD::MemIndexedMode AM, MVT::ValueType VT,
+ SDVTList VTs, ISD::MemIndexedMode AM, MVT VT,
const Value *SV, int SVO, unsigned Align, bool Vol)
: SDNode(NodeTy, VTs),
AddrMode(AM), MemoryVT(VT),
@@ -1989,7 +1986,7 @@ public:
const Value *getSrcValue() const { return SrcValue; }
int getSrcValueOffset() const { return SVOffset; }
unsigned getAlignment() const { return Alignment; }
- MVT::ValueType getMemoryVT() const { return MemoryVT; }
+ MVT getMemoryVT() const { return MemoryVT; }
bool isVolatile() const { return IsVolatile; }
ISD::MemIndexedMode getAddressingMode() const { return AddrMode; }
@@ -2022,7 +2019,7 @@ class LoadSDNode : public LSBaseSDNode {
protected:
friend class SelectionDAG;
LoadSDNode(SDOperand *ChainPtrOff, SDVTList VTs,
- ISD::MemIndexedMode AM, ISD::LoadExtType ETy, MVT::ValueType LVT,
+ 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,
VTs, AM, LVT, SV, O, Align, Vol),
@@ -2049,7 +2046,7 @@ class StoreSDNode : public LSBaseSDNode {
protected:
friend class SelectionDAG;
StoreSDNode(SDOperand *ChainValuePtrOff, SDVTList VTs,
- ISD::MemIndexedMode AM, bool isTrunc, MVT::ValueType SVT,
+ ISD::MemIndexedMode AM, bool isTrunc, MVT SVT,
const Value *SV, int O=0, unsigned Align=0, bool Vol=false)
: LSBaseSDNode(ISD::STORE, ChainValuePtrOff, 4,
VTs, AM, SVT, SV, O, Align, Vol),