diff options
| author | Dan Gohman <gohman@apple.com> | 2008-07-01 00:05:16 +0000 |
|---|---|---|
| committer | Dan Gohman <gohman@apple.com> | 2008-07-01 00:05:16 +0000 |
| commit | fa607c9cc5d2bd142ad8352bdf5e446517562688 (patch) | |
| tree | e169d28b09c59d954867d6bac98f8fffe8494096 /include/llvm/CodeGen/SelectionDAGNodes.h | |
| parent | 0218d8747c34561eb422dc82f5b79cea9e9f30ac (diff) | |
| download | external_llvm-fa607c9cc5d2bd142ad8352bdf5e446517562688.zip external_llvm-fa607c9cc5d2bd142ad8352bdf5e446517562688.tar.gz external_llvm-fa607c9cc5d2bd142ad8352bdf5e446517562688.tar.bz2 | |
Split ISD::LABEL into ISD::DBG_LABEL and ISD::EH_LABEL, eliminating
the need for a flavor operand, and add a new SDNode subclass,
LabelSDNode, for use with them to eliminate the need for a label id
operand.
Change instruction selection to let these label nodes through
unmodified instead of creating copies of them. Teach the MachineInstr
emitter how to emit a MachineInstr directly from an ISD label node.
This avoids the need for allocating SDNodes for the label id and
flavor value, as well as SDNodes for each of the post-isel label,
label id, and label flavor.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52943 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/CodeGen/SelectionDAGNodes.h')
| -rw-r--r-- | include/llvm/CodeGen/SelectionDAGNodes.h | 38 |
1 files changed, 27 insertions, 11 deletions
diff --git a/include/llvm/CodeGen/SelectionDAGNodes.h b/include/llvm/CodeGen/SelectionDAGNodes.h index addf355..caa077d 100644 --- a/include/llvm/CodeGen/SelectionDAGNodes.h +++ b/include/llvm/CodeGen/SelectionDAGNodes.h @@ -482,14 +482,11 @@ namespace ISD { // Operand #last: Optional, an incoming flag. INLINEASM, - // LABEL - Represents a label in mid basic block used to track - // locations needed for debug and exception handling tables. This node - // returns a chain. - // Operand #0 : input chain. - // Operand #1 : module unique number use to identify the label. - // Operand #2 : 0 indicates a debug label (e.g. stoppoint), 1 indicates - // a EH label, 2 indicates unknown label type. - LABEL, + // DBG_LABEL, EH_LABEL - Represents a label in mid basic block used to track + // locations needed for debug and exception handling tables. These nodes + // take a chain as input and return a chain. + DBG_LABEL, + EH_LABEL, // DECLARE - Represents a llvm.dbg.declare intrinsic. It's used to track // local variable declarations for debugging information. First operand is @@ -642,8 +639,7 @@ namespace ISD { bool isScalarToVector(const SDNode *N); /// isDebugLabel - Return true if the specified node represents a debug - /// label (i.e. ISD::LABEL or TargetInstrInfo::LABEL node and third operand - /// is 0). + /// label (i.e. ISD::DBG_LABEL or TargetInstrInfo::DBG_LABEL node). bool isDebugLabel(const SDNode *N); //===--------------------------------------------------------------------===// @@ -1859,7 +1855,6 @@ protected: InitOperands(&Chain, 1); } public: - unsigned getLine() const { return Line; } unsigned getColumn() const { return Column; } const CompileUnitDesc *getCompileUnit() const { return CU; } @@ -1870,6 +1865,27 @@ public: } }; +class LabelSDNode : public SDNode { + SDUse Chain; + unsigned LabelID; + virtual void ANCHOR(); // Out-of-line virtual method to give class a home. +protected: + friend class SelectionDAG; + LabelSDNode(unsigned NodeTy, SDOperand ch, unsigned id) + : SDNode(NodeTy, getSDVTList(MVT::Other)), LabelID(id) { + Chain = ch; + InitOperands(&Chain, 1); + } +public: + unsigned getLabelID() const { return LabelID; } + + static bool classof(const LabelSDNode *) { return true; } + static bool classof(const SDNode *N) { + return N->getOpcode() == ISD::DBG_LABEL || + N->getOpcode() == ISD::EH_LABEL; + } +}; + class ExternalSymbolSDNode : public SDNode { const char *Symbol; virtual void ANCHOR(); // Out-of-line virtual method to give class a home. |
