[llvm-commits] CVS: llvm/include/llvm/CodeGen/SelectionDAG.h SelectionDAGNodes.h
Chris Lattner
lattner at cs.uiuc.edu
Sat Jul 9 18:55:25 PDT 2005
Changes in directory llvm/include/llvm/CodeGen:
SelectionDAG.h updated: 1.29 -> 1.30
SelectionDAGNodes.h updated: 1.43 -> 1.44
---
Log message:
Change *EXTLOAD to use an VTSDNode operand instead of being an MVTSDNode.
This is the last MVTSDNode.
This allows us to eliminate a bunch of special case code for handling
MVTSDNodes.
---
Diffs of the changes: (+8 -59)
SelectionDAG.h | 29 +++--------------------------
SelectionDAGNodes.h | 38 +++++---------------------------------
2 files changed, 8 insertions(+), 59 deletions(-)
Index: llvm/include/llvm/CodeGen/SelectionDAG.h
diff -u llvm/include/llvm/CodeGen/SelectionDAG.h:1.29 llvm/include/llvm/CodeGen/SelectionDAG.h:1.30
--- llvm/include/llvm/CodeGen/SelectionDAG.h:1.29 Sat Jul 9 19:28:25 2005
+++ llvm/include/llvm/CodeGen/SelectionDAG.h Sat Jul 9 20:55:14 2005
@@ -178,21 +178,14 @@
SDOperand getNode(unsigned Opcode, std::vector<MVT::ValueType> &ResultTys,
std::vector<SDOperand> &Ops);
- // getNode - These versions take an extra value type for extending and
- // truncating loads, stores, rounds, extends etc.
- SDOperand getNode(unsigned Opcode, MVT::ValueType VT, SDOperand N1,
- SDOperand N2, MVT::ValueType EVT);
- SDOperand getNode(unsigned Opcode, MVT::ValueType VT,
- SDOperand N, MVT::ValueType EVT);
- SDOperand getNode(unsigned Opcode, MVT::ValueType VT, SDOperand N1,
- SDOperand N2, SDOperand N3, MVT::ValueType EVT);
-
/// 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::ValueType VT, SDOperand Chain, SDOperand Ptr,
SDOperand SV);
+ SDOperand getExtLoad(unsigned Opcode, MVT::ValueType VT, SDOperand Chain,
+ SDOperand Ptr, SDOperand SV, MVT::ValueType EVT);
// getSrcValue - construct a node to track a Value* through the backend
SDOperand getSrcValue(const Value* I, int offset = 0);
@@ -227,6 +220,7 @@
std::map<unsigned, SDNode*> ConstantPoolIndices;
std::map<MachineBasicBlock *, SDNode*> BBNodes;
std::vector<SDNode*> ValueTypeNodes;
+ std::map<std::string, SDNode*> ExternalSymbols;
std::map<std::pair<unsigned,
std::pair<MVT::ValueType, std::vector<SDOperand> > >,
SDNode*> OneResultNodes;
@@ -234,23 +228,6 @@
std::pair<std::vector<MVT::ValueType>,
std::vector<SDOperand> > >,
SDNode*> ArbitraryNodes;
-
- std::map<std::string, SDNode*> ExternalSymbols;
- struct EVTStruct {
- unsigned Opcode;
- MVT::ValueType VT, EVT;
- std::vector<SDOperand> Ops;
- bool operator<(const EVTStruct &RHS) const {
- if (Opcode < RHS.Opcode) return true;
- if (Opcode > RHS.Opcode) return false;
- if (VT < RHS.VT) return true;
- if (VT > RHS.VT) return false;
- if (EVT < RHS.EVT) return true;
- if (EVT > RHS.EVT) return false;
- return Ops < RHS.Ops;
- }
- };
- std::map<EVTStruct, SDNode*> MVTSDNodes;
};
template <> struct GraphTraits<SelectionDAG*> : public GraphTraits<SDNode*> {
Index: llvm/include/llvm/CodeGen/SelectionDAGNodes.h
diff -u llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1.43 llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1.44
--- llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1.43 Sat Jul 9 19:28:25 2005
+++ llvm/include/llvm/CodeGen/SelectionDAGNodes.h Sat Jul 9 20:55:14 2005
@@ -180,11 +180,11 @@
// SRCVALUE node that provides alias analysis information.
LOAD, STORE,
- // EXTLOAD, SEXTLOAD, ZEXTLOAD - These three operators are instances of the
- // MVTSDNode. All of these load a value from memory and extend them to a
- // larger value (e.g. load a byte into a word register). All three of these
- // have two operands, a chain and a pointer to load from. The extra value
- // type is the source type being loaded.
+ // EXTLOAD, SEXTLOAD, ZEXTLOAD - These three operators all load a value from
+ // memory and extend them to a larger value (e.g. load a byte into a word
+ // register). All three of these have four operands, a token chain, a
+ // pointer to load from, a SRCVALUE for alias analysis, and a VALUETYPE node
+ // indicating the type to load.
//
// SEXTLOAD loads the integer operand and sign extends it to a larger
// integer result type.
@@ -863,34 +863,6 @@
};
-/// MVTSDNode - This class is used for operators that require an extra
-/// value-type to be kept with the node.
-class MVTSDNode : public SDNode {
- MVT::ValueType ExtraValueType;
-protected:
- friend class SelectionDAG;
- MVTSDNode(unsigned Opc, MVT::ValueType VT1, SDOperand Op0, MVT::ValueType EVT)
- : SDNode(Opc, Op0), ExtraValueType(EVT) {
- setValueTypes(VT1);
- }
- MVTSDNode(unsigned Opc, MVT::ValueType VT1, MVT::ValueType VT2,
- SDOperand Op0, SDOperand Op1, SDOperand Op2, MVT::ValueType EVT)
- : SDNode(Opc, Op0, Op1, Op2), ExtraValueType(EVT) {
- setValueTypes(VT1, VT2);
- }
-public:
-
- MVT::ValueType getExtraValueType() const { return ExtraValueType; }
-
- static bool classof(const MVTSDNode *) { return true; }
- static bool classof(const SDNode *N) {
- return
- N->getOpcode() == ISD::EXTLOAD ||
- N->getOpcode() == ISD::SEXTLOAD ||
- N->getOpcode() == ISD::ZEXTLOAD;
- }
-};
-
class SDNodeIterator : public forward_iterator<SDNode, ptrdiff_t> {
SDNode *Node;
unsigned Operand;
More information about the llvm-commits
mailing list