[llvm-commits] [llvm] r54792 - /llvm/trunk/lib/Transforms/Scalar/SCCP.cpp

Devang Patel dpatel at apple.com
Thu Aug 14 14:31:10 PDT 2008


Author: dpatel
Date: Thu Aug 14 16:31:10 2008
New Revision: 54792

URL: http://llvm.org/viewvc/llvm-project?rev=54792&view=rev
Log:
Use DenseMap. Patch by Pratik Solanki.


Modified:
    llvm/trunk/lib/Transforms/Scalar/SCCP.cpp

Modified: llvm/trunk/lib/Transforms/Scalar/SCCP.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/SCCP.cpp?rev=54792&r1=54791&r2=54792&view=diff

==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/SCCP.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/SCCP.cpp Thu Aug 14 16:31:10 2008
@@ -138,7 +138,7 @@
 ///
 class SCCPSolver : public InstVisitor<SCCPSolver> {
   SmallSet<BasicBlock*, 16> BBExecutable;// The basic blocks that are executable
-  std::map<Value*, LatticeVal> ValueState;  // The state each value is in.
+  DenseMap<Value*, LatticeVal> ValueState;  // The state each value is in.
 
   /// GlobalValue - If we are tracking any values for the contents of a global
   /// variable, we keep a mapping from the constant accessor to the element of
@@ -231,7 +231,7 @@
 
   /// getValueMapping - Once we have solved for constants, return the mapping of
   /// LLVM values to LatticeVals.
-  std::map<Value*, LatticeVal> &getValueMapping() {
+  DenseMap<Value*, LatticeVal> &getValueMapping() {
     return ValueState;
   }
 
@@ -311,7 +311,7 @@
   // Instruction object, then use this accessor to get its value from the map.
   //
   inline LatticeVal &getValueState(Value *V) {
-    std::map<Value*, LatticeVal>::iterator I = ValueState.find(V);
+    DenseMap<Value*, LatticeVal>::iterator I = ValueState.find(V);
     if (I != ValueState.end()) return I->second;  // Common case, in the map
 
     if (Constant *C = dyn_cast<Constant>(V)) {
@@ -1555,7 +1555,7 @@
   //
   SmallSet<BasicBlock*, 16> &ExecutableBBs = Solver.getExecutableBlocks();
   SmallVector<Instruction*, 32> Insts;
-  std::map<Value*, LatticeVal> &Values = Solver.getValueMapping();
+  DenseMap<Value*, LatticeVal> &Values = Solver.getValueMapping();
 
   for (Function::iterator BB = F.begin(), E = F.end(); BB != E; ++BB)
     if (!ExecutableBBs.count(BB)) {
@@ -1701,7 +1701,7 @@
   SmallSet<BasicBlock*, 16> &ExecutableBBs = Solver.getExecutableBlocks();
   SmallVector<Instruction*, 32> Insts;
   SmallVector<BasicBlock*, 32> BlocksToErase;
-  std::map<Value*, LatticeVal> &Values = Solver.getValueMapping();
+  DenseMap<Value*, LatticeVal> &Values = Solver.getValueMapping();
 
   for (Module::iterator F = M.begin(), E = M.end(); F != E; ++F) {
     for (Function::arg_iterator AI = F->arg_begin(), E = F->arg_end();





More information about the llvm-commits mailing list