diff options
Diffstat (limited to 'include/llvm/CodeGen/SelectionDAGISel.h')
| -rw-r--r-- | include/llvm/CodeGen/SelectionDAGISel.h | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/include/llvm/CodeGen/SelectionDAGISel.h b/include/llvm/CodeGen/SelectionDAGISel.h index de6849a1eae1..86df0af7303f 100644 --- a/include/llvm/CodeGen/SelectionDAGISel.h +++ b/include/llvm/CodeGen/SelectionDAGISel.h @@ -110,6 +110,11 @@ public: CodeGenOpt::Level OptLevel, bool IgnoreChains = false); + static void InvalidateNodeId(SDNode *N); + static int getUninvalidatedNodeId(SDNode *N); + + static void EnforceNodeIdInvariant(SDNode *N); + // Opcodes used by the DAG state machine: enum BuiltinOpcodes { OPC_Scope, @@ -199,23 +204,28 @@ protected: /// of the new node T. void ReplaceUses(SDValue F, SDValue T) { CurDAG->ReplaceAllUsesOfValueWith(F, T); + EnforceNodeIdInvariant(T.getNode()); } /// ReplaceUses - replace all uses of the old nodes F with the use /// of the new nodes T. void ReplaceUses(const SDValue *F, const SDValue *T, unsigned Num) { CurDAG->ReplaceAllUsesOfValuesWith(F, T, Num); + for (unsigned i = 0; i < Num; ++i) + EnforceNodeIdInvariant(T[i].getNode()); } /// ReplaceUses - replace all uses of the old node F with the use /// of the new node T. void ReplaceUses(SDNode *F, SDNode *T) { CurDAG->ReplaceAllUsesWith(F, T); + EnforceNodeIdInvariant(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); + EnforceNodeIdInvariant(T); CurDAG->RemoveDeadNode(F); } @@ -270,7 +280,7 @@ public: void SelectCodeCommon(SDNode *NodeToMatch, const unsigned char *MatcherTable, unsigned TableSize); - /// \brief Return true if complex patterns for this target can mutate the + /// Return true if complex patterns for this target can mutate the /// DAG. virtual bool ComplexPatternFuncMutatesDAG() const { return false; @@ -282,14 +292,14 @@ private: // Calls to these functions are generated by tblgen. void Select_INLINEASM(SDNode *N); - void Select_READ_REGISTER(SDNode *N); - void Select_WRITE_REGISTER(SDNode *N); + void Select_READ_REGISTER(SDNode *Op); + void Select_WRITE_REGISTER(SDNode *Op); void Select_UNDEF(SDNode *N); void CannotYetSelect(SDNode *N); private: void DoInstructionSelection(); - SDNode *MorphNode(SDNode *Node, unsigned TargetOpc, SDVTList VTs, + SDNode *MorphNode(SDNode *Node, unsigned TargetOpc, SDVTList VTList, ArrayRef<SDValue> Ops, unsigned EmitNodeInfo); SDNode *MutateStrictFPToFP(SDNode *Node, unsigned NewOpc); @@ -299,10 +309,10 @@ private: /// instruction selected, false if no code should be emitted for it. bool PrepareEHLandingPad(); - /// \brief Perform instruction selection on all basic blocks in the function. + /// Perform instruction selection on all basic blocks in the function. void SelectAllBasicBlocks(const Function &Fn); - /// \brief Perform instruction selection on a single basic block, for + /// Perform instruction selection on a single basic block, for /// instructions between \p Begin and \p End. \p HadTailCall will be set /// to true if a call in the block was translated as a tail call. void SelectBasicBlock(BasicBlock::const_iterator Begin, @@ -312,7 +322,7 @@ private: void CodeGenAndEmitDAG(); - /// \brief Generate instructions for lowering the incoming arguments of the + /// Generate instructions for lowering the incoming arguments of the /// given function. void LowerArguments(const Function &F); |
