diff options
author | Chris Lattner <sabre@nondot.org> | 2005-08-16 21:55:35 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2005-08-16 21:55:35 +0000 |
commit | d5d0f9bd20d9df07d6b4d41b7e8ed6d33b6a649d (patch) | |
tree | 411d221bc8fb4a0221daeac5a4e5574c43b13078 /include/llvm/CodeGen/SelectionDAGNodes.h | |
parent | 7cbd525ba85ebe440d15fa359ec940e404d14906 (diff) |
Eliminate the RegSDNode class, which 3 nodes (CopyFromReg/CopyToReg/ImplicitDef)
used to tack a register number onto the node.
Instead of doing this, make a new node, RegisterSDNode, which is a leaf
containing a register number. These three operations just become normal
DAG nodes now, instead of requiring special handling.
Note that with this change, it is no longer correct to make illegal
CopyFromReg/CopyToReg nodes. The legalizer will not touch them, and this
is bad, so don't do it. :)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22806 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/CodeGen/SelectionDAGNodes.h')
-rw-r--r-- | include/llvm/CodeGen/SelectionDAGNodes.h | 30 |
1 files changed, 11 insertions, 19 deletions
diff --git a/include/llvm/CodeGen/SelectionDAGNodes.h b/include/llvm/CodeGen/SelectionDAGNodes.h index d1c1a34439..4eecb0a6b7 100644 --- a/include/llvm/CodeGen/SelectionDAGNodes.h +++ b/include/llvm/CodeGen/SelectionDAGNodes.h @@ -55,12 +55,10 @@ namespace ISD { // Various leaf nodes. Constant, ConstantFP, GlobalAddress, FrameIndex, ConstantPool, - BasicBlock, ExternalSymbol, VALUETYPE, CONDCODE, + BasicBlock, ExternalSymbol, VALUETYPE, CONDCODE, Register, - // CopyToReg - This node has chain and child nodes, and an associated - // register number. The instruction selector must guarantee that the value - // of the value node is available in the register stored in the RegSDNode - // object. + // CopyToReg - This node has three operands: a chain, a register number to + // set to this value, and a value. CopyToReg, // CopyFromReg - This node indicates that the input value is a virtual or @@ -69,10 +67,9 @@ namespace ISD { CopyFromReg, // ImplicitDef - This node indicates that the specified register is - // implicitly defined by some operation (e.g. its a live-in argument). This - // register is indicated in the RegSDNode object. The only operand to this - // is the token chain coming in, the only result is the token chain going - // out. + // implicitly defined by some operation (e.g. its a live-in argument). The + // two operands to this are the token chain coming in and the register. + // The only result is the token chain going out. ImplicitDef, // UNDEF - An undefined node @@ -830,24 +827,19 @@ public: }; -class RegSDNode : public SDNode { +class RegisterSDNode : public SDNode { unsigned Reg; protected: friend class SelectionDAG; - RegSDNode(unsigned Opc, SDOperand Chain, SDOperand Src, unsigned reg) - : SDNode(Opc, Chain, Src), Reg(reg) { - } - RegSDNode(unsigned Opc, SDOperand Chain, unsigned reg) - : SDNode(Opc, Chain), Reg(reg) {} + RegisterSDNode(unsigned reg, MVT::ValueType VT) + : SDNode(ISD::Register, VT), Reg(reg) {} public: unsigned getReg() const { return Reg; } - static bool classof(const RegSDNode *) { return true; } + static bool classof(const RegisterSDNode *) { return true; } static bool classof(const SDNode *N) { - return N->getOpcode() == ISD::CopyToReg || - N->getOpcode() == ISD::CopyFromReg || - N->getOpcode() == ISD::ImplicitDef; + return N->getOpcode() == ISD::Register; } }; |