From cc56aad06d35e002e0debb616dd838f2a88f4ce8 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Fri, 2 Feb 2007 20:57:39 +0000 Subject: [PATCH] Convert an std::set to SmallSet, this speeds up IPSCCP 17% on kimwitu. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33794 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Transforms/Scalar/SCCP.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/Transforms/Scalar/SCCP.cpp b/lib/Transforms/Scalar/SCCP.cpp index fdb5b1602a3..d26f5d2eacc 100644 --- a/lib/Transforms/Scalar/SCCP.cpp +++ b/lib/Transforms/Scalar/SCCP.cpp @@ -34,11 +34,11 @@ #include "llvm/Support/Debug.h" #include "llvm/Support/InstVisitor.h" #include "llvm/ADT/DenseMap.h" +#include "llvm/ADT/SmallSet.h" #include "llvm/ADT/SmallVector.h" #include "llvm/ADT/Statistic.h" #include "llvm/ADT/STLExtras.h" #include -#include using namespace llvm; STATISTIC(NumInstRemoved, "Number of instructions removed"); @@ -137,7 +137,7 @@ public: /// Constant Propagation. /// class SCCPSolver : public InstVisitor { - std::set BBExecutable;// The basic blocks that are executable + SmallSet BBExecutable;// The basic blocks that are executable DenseMap ValueState; // The state each value is in. /// GlobalValue - If we are tracking any values for the contents of a global @@ -216,7 +216,7 @@ public: /// getExecutableBlocks - Once we have solved for constants, return the set of /// blocks that is known to be executable. - std::set &getExecutableBlocks() { + SmallSet &getExecutableBlocks() { return BBExecutable; } @@ -1384,7 +1384,7 @@ bool SCCP::runOnFunction(Function &F) { // delete their contents now. Note that we cannot actually delete the blocks, // as we cannot modify the CFG of the function. // - std::set &ExecutableBBs = Solver.getExecutableBlocks(); + SmallSet &ExecutableBBs = Solver.getExecutableBlocks(); for (Function::iterator BB = F.begin(), E = F.end(); BB != E; ++BB) if (!ExecutableBBs.count(BB)) { DOUT << " BasicBlock Dead:" << *BB; @@ -1523,7 +1523,7 @@ bool IPSCCP::runOnModule(Module &M) { // Iterate over all of the instructions in the module, replacing them with // constants if we have found them to be of constant values. // - std::set &ExecutableBBs = Solver.getExecutableBlocks(); + SmallSet &ExecutableBBs = Solver.getExecutableBlocks(); for (Module::iterator F = M.begin(), E = M.end(); F != E; ++F) { for (Function::arg_iterator AI = F->arg_begin(), E = F->arg_end(); AI != E; ++AI)