diff options
author | Chris Lattner <sabre@nondot.org> | 2007-02-03 01:12:36 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2007-02-03 01:12:36 +0000 |
commit | 7971514755a08ec156a1b9c0f7f05d67919c56b7 (patch) | |
tree | 2f4d54b563005841782235a52658744df3d2ac67 /lib | |
parent | 865c6698db64c560f3f644507b925703a40ec6a4 (diff) | |
download | llvm-7971514755a08ec156a1b9c0f7f05d67919c56b7.tar.gz llvm-7971514755a08ec156a1b9c0f7f05d67919c56b7.tar.bz2 llvm-7971514755a08ec156a1b9c0f7f05d67919c56b7.tar.xz |
Switch ComputeTopDownOrdering over to using a densemap. This speeds up
isel as a whole by 3.3%.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33809 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/CodeGen/SelectionDAG/LegalizeDAG.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp b/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp index 6aa1360764..22edbf320e 100644 --- a/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp +++ b/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp @@ -25,6 +25,7 @@ #include "llvm/Support/MathExtras.h" #include "llvm/Support/CommandLine.h" #include "llvm/Support/Compiler.h" +#include "llvm/ADT/DenseMap.h" #include "llvm/ADT/SmallVector.h" #include <map> using namespace llvm; @@ -290,7 +291,7 @@ SelectionDAGLegalize::SelectionDAGLegalize(SelectionDAG &dag) /// ComputeTopDownOrdering - Add the specified node to the Order list if it has /// not been visited yet and if all of its operands have already been visited. static void ComputeTopDownOrdering(SDNode *N, std::vector<SDNode*> &Order, - std::map<SDNode*, unsigned> &Visited) { + DenseMap<SDNode*, unsigned> &Visited) { if (++Visited[N] != N->getNumOperands()) return; // Haven't visited all operands yet @@ -318,7 +319,7 @@ void SelectionDAGLegalize::LegalizeDAG() { // practice however, this causes us to run out of stack space on large basic // blocks. To avoid this problem, compute an ordering of the nodes where each // node is only legalized after all of its operands are legalized. - std::map<SDNode*, unsigned> Visited; + DenseMap<SDNode*, unsigned> Visited; std::vector<SDNode*> Order; // Compute ordering from all of the leaves in the graphs, those (like the |