diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2016-07-23 20:41:05 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2016-07-23 20:41:05 +0000 |
commit | 01095a5d43bbfde13731688ddcf6048ebb8b7721 (patch) | |
tree | 4def12e759965de927d963ac65840d663ef9d1ea /include/llvm/CodeGen/SelectionDAGISel.h | |
parent | f0f4822ed4b66e3579e92a89f368f8fb860e218e (diff) |
Diffstat (limited to 'include/llvm/CodeGen/SelectionDAGISel.h')
-rw-r--r-- | include/llvm/CodeGen/SelectionDAGISel.h | 42 |
1 files changed, 25 insertions, 17 deletions
diff --git a/include/llvm/CodeGen/SelectionDAGISel.h b/include/llvm/CodeGen/SelectionDAGISel.h index a011e4c338c4a..7f4549d3058f4 100644 --- a/include/llvm/CodeGen/SelectionDAGISel.h +++ b/include/llvm/CodeGen/SelectionDAGISel.h @@ -76,8 +76,8 @@ public: /// right after selection. virtual void PostprocessISelDAG() {} - /// Select - Main hook targets implement to select a node. - virtual SDNode *Select(SDNode *N) = 0; + /// Main hook for targets to transform nodes into machine nodes. + virtual void Select(SDNode *N) = 0; /// SelectInlineAsmMemoryOperand - Select the specified address as a target /// addressing mode, according to the specified constraint. If this does @@ -111,6 +111,8 @@ public: OPC_RecordMemRef, OPC_CaptureGlueInput, OPC_MoveChild, + OPC_MoveChild0, OPC_MoveChild1, OPC_MoveChild2, OPC_MoveChild3, + OPC_MoveChild4, OPC_MoveChild5, OPC_MoveChild6, OPC_MoveChild7, OPC_MoveParent, OPC_CheckSame, OPC_CheckChild0Same, OPC_CheckChild1Same, @@ -140,11 +142,15 @@ public: OPC_EmitMergeInputChains, OPC_EmitMergeInputChains1_0, OPC_EmitMergeInputChains1_1, + OPC_EmitMergeInputChains1_2, OPC_EmitCopyToReg, OPC_EmitNodeXForm, OPC_EmitNode, + // Space-optimized forms that implicitly encode number of result VTs. + OPC_EmitNode0, OPC_EmitNode1, OPC_EmitNode2, OPC_MorphNodeTo, - OPC_MarkGlueResults, + // Space-optimized forms that implicitly encode number of result VTs. + OPC_MorphNodeTo0, OPC_MorphNodeTo1, OPC_MorphNodeTo2, OPC_CompleteMatch }; @@ -196,11 +202,16 @@ protected: CurDAG->ReplaceAllUsesWith(F, T); } + /// Replace all uses of \c F with \c T, then remove \c F from the DAG. + void ReplaceNode(SDNode *F, SDNode *T) { + CurDAG->ReplaceAllUsesWith(F, T); + CurDAG->RemoveDeadNode(F); + } /// SelectInlineAsmMemoryOperands - Calls to this are automatically generated /// by tblgen. Others should not call it. - void SelectInlineAsmMemoryOperands(std::vector<SDValue> &Ops, SDLoc DL); - + void SelectInlineAsmMemoryOperands(std::vector<SDValue> &Ops, + const SDLoc &DL); public: // Calls to these predicates are generated by tblgen. @@ -236,9 +247,8 @@ public: llvm_unreachable("Tblgen should generate this!"); } - SDNode *SelectCodeCommon(SDNode *NodeToMatch, - const unsigned char *MatcherTable, - unsigned TableSize); + void SelectCodeCommon(SDNode *NodeToMatch, const unsigned char *MatcherTable, + unsigned TableSize); /// \brief Return true if complex patterns for this target can mutate the /// DAG. @@ -249,10 +259,10 @@ public: private: // Calls to these functions are generated by tblgen. - SDNode *Select_INLINEASM(SDNode *N); - SDNode *Select_READ_REGISTER(SDNode *N); - SDNode *Select_WRITE_REGISTER(SDNode *N); - SDNode *Select_UNDEF(SDNode *N); + void Select_INLINEASM(SDNode *N); + void Select_READ_REGISTER(SDNode *N); + void Select_WRITE_REGISTER(SDNode *N); + void Select_UNDEF(SDNode *N); void CannotYetSelect(SDNode *N); private: @@ -294,11 +304,9 @@ private: /// state machines that start with a OPC_SwitchOpcode node. std::vector<unsigned> OpcodeOffset; - void UpdateChainsAndGlue(SDNode *NodeToMatch, SDValue InputChain, - const SmallVectorImpl<SDNode*> &ChainNodesMatched, - SDValue InputGlue, const SmallVectorImpl<SDNode*> &F, - bool isMorphNodeTo); - + void UpdateChains(SDNode *NodeToMatch, SDValue InputChain, + const SmallVectorImpl<SDNode *> &ChainNodesMatched, + bool isMorphNodeTo); }; } |