diff options
author | Chris Lattner <sabre@nondot.org> | 2007-02-04 00:24:41 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2007-02-04 00:24:41 +0000 |
commit | d48c5e871a0f3386e536e0987ca06dbc4e274acf (patch) | |
tree | 6a23bd1a6ef59f966e554c99b235c285ae265dab /lib/CodeGen/SelectionDAG/SelectionDAG.cpp | |
parent | a3e60626b45546b0afbf3794ce3e0b7012c0e862 (diff) |
Eliminate some std::sets. This speeds up isel of kimwitu by about 0.9%
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33852 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SelectionDAG/SelectionDAG.cpp')
-rw-r--r-- | lib/CodeGen/SelectionDAG/SelectionDAG.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/lib/CodeGen/SelectionDAG/SelectionDAG.cpp index cced06be1f..5d21fb18a5 100644 --- a/lib/CodeGen/SelectionDAG/SelectionDAG.cpp +++ b/lib/CodeGen/SelectionDAG/SelectionDAG.cpp @@ -24,9 +24,9 @@ #include "llvm/Target/TargetInstrInfo.h" #include "llvm/Target/TargetMachine.h" #include "llvm/ADT/SetVector.h" +#include "llvm/ADT/SmallPtrSet.h" #include "llvm/ADT/SmallVector.h" #include "llvm/ADT/StringExtras.h" -#include <set> #include <algorithm> #include <cmath> using namespace llvm; @@ -2548,12 +2548,12 @@ bool SDNode::hasNUsesOfValue(unsigned NUses, unsigned Value) const { SDOperand TheValue(const_cast<SDNode *>(this), Value); - std::set<SDNode*> UsersHandled; + SmallPtrSet<SDNode*, 32> UsersHandled; for (SDNode::use_iterator UI = Uses.begin(), E = Uses.end(); UI != E; ++UI) { SDNode *User = *UI; if (User->getNumOperands() == 1 || - UsersHandled.insert(User).second) // First time we've seen this? + UsersHandled.insert(User)) // First time we've seen this? for (unsigned i = 0, e = User->getNumOperands(); i != e; ++i) if (User->getOperand(i) == TheValue) { if (NUses == 0) @@ -2599,8 +2599,8 @@ bool SDNode::isOperand(SDNode *N) const { } static void findPredecessor(SDNode *N, const SDNode *P, bool &found, - std::set<SDNode *> &Visited) { - if (found || !Visited.insert(N).second) + SmallPtrSet<SDNode *, 32> &Visited) { + if (found || !Visited.insert(N)) return; for (unsigned i = 0, e = N->getNumOperands(); !found && i != e; ++i) { @@ -2618,7 +2618,7 @@ static void findPredecessor(SDNode *N, const SDNode *P, bool &found, /// up the operands. /// NOTE: this is an expensive method. Use it carefully. bool SDNode::isPredecessor(SDNode *N) const { - std::set<SDNode *> Visited; + SmallPtrSet<SDNode *, 32> Visited; bool found = false; findPredecessor(N, this, found, Visited); return found; |