diff --git a/include/llvm/CodeGen/SelectionDAG.h b/include/llvm/CodeGen/SelectionDAG.h index 58f0d64792d..df695010bf1 100644 --- a/include/llvm/CodeGen/SelectionDAG.h +++ b/include/llvm/CodeGen/SelectionDAG.h @@ -395,14 +395,20 @@ public: std::vector *Deleted = 0); void ReplaceAllUsesWith(SDNode *From, const std::vector &To, std::vector *Deleted = 0); - - + /// DeleteNode - Remove the specified node from the system. This node must /// have no referrers. void DeleteNode(SDNode *N); void dump() const; + /// InsertISelMapEntry - A helper function to insert a key / element pair + /// into a SDOperand to SDOperand map. This is added to avoid the map + /// insertion operator from being inlined. + static void InsertISelMapEntry(std::map &Map, + SDNode *Key, unsigned KeyResNo, + SDNode *Element, unsigned ElementResNo); + private: void RemoveNodeFromCSEMaps(SDNode *N); SDNode *AddNonLeafNodeToCSEMaps(SDNode *N); diff --git a/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/lib/CodeGen/SelectionDAG/SelectionDAG.cpp index 9c9df11bed2..23d1dc34cc1 100644 --- a/lib/CodeGen/SelectionDAG/SelectionDAG.cpp +++ b/lib/CodeGen/SelectionDAG/SelectionDAG.cpp @@ -2748,3 +2748,12 @@ void SelectionDAG::dump() const { std::cerr << "\n\n"; } +/// InsertISelMapEntry - A helper function to insert a key / element pair +/// into a SDOperand to SDOperand map. This is added to avoid the map +/// insertion operator from being inlined. +void SelectionDAG::InsertISelMapEntry(std::map &Map, + SDNode *Key, unsigned KeyResNo, + SDNode *Element, unsigned ElementResNo) { + Map.insert(std::make_pair(SDOperand(Key, KeyResNo), + SDOperand(Element, ElementResNo))); +}