[llvm-commits] [llvm] r40816 - /llvm/trunk/lib/Transforms/Utils/PromoteMemoryToRegister.cpp

Chris Lattner sabre at nondot.org
Sat Aug 4 12:52:21 PDT 2007


Author: lattner
Date: Sat Aug  4 14:52:20 2007
New Revision: 40816

URL: http://llvm.org/viewvc/llvm-project?rev=40816&view=rev
Log:
std::map -> DenseMap

Modified:
    llvm/trunk/lib/Transforms/Utils/PromoteMemoryToRegister.cpp

Modified: llvm/trunk/lib/Transforms/Utils/PromoteMemoryToRegister.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/PromoteMemoryToRegister.cpp?rev=40816&r1=40815&r2=40816&view=diff

==============================================================================
--- llvm/trunk/lib/Transforms/Utils/PromoteMemoryToRegister.cpp (original)
+++ llvm/trunk/lib/Transforms/Utils/PromoteMemoryToRegister.cpp Sat Aug  4 14:52:20 2007
@@ -702,7 +702,7 @@
 /// alloca which is locally used in it (which might be a lot).
 void PromoteMem2Reg::
 PromoteLocallyUsedAllocas(BasicBlock *BB, const std::vector<AllocaInst*> &AIs) {
-  std::map<AllocaInst*, Value*> CurValues;
+  DenseMap<AllocaInst*, Value*> CurValues;
   for (unsigned i = 0, e = AIs.size(); i != e; ++i)
     CurValues[AIs[i]] = 0; // Insert with null value
 
@@ -711,7 +711,7 @@
     if (LoadInst *LI = dyn_cast<LoadInst>(Inst)) {
       // Is this a load of an alloca we are tracking?
       if (AllocaInst *AI = dyn_cast<AllocaInst>(LI->getOperand(0))) {
-        std::map<AllocaInst*, Value*>::iterator AIt = CurValues.find(AI);
+        DenseMap<AllocaInst*, Value*>::iterator AIt = CurValues.find(AI);
         if (AIt != CurValues.end()) {
           // If loading an uninitialized value, allow the inter-block case to
           // handle it.  Due to control flow, this might actually be ok.
@@ -730,7 +730,7 @@
       }
     } else if (StoreInst *SI = dyn_cast<StoreInst>(Inst)) {
       if (AllocaInst *AI = dyn_cast<AllocaInst>(SI->getOperand(1))) {
-        std::map<AllocaInst*, Value*>::iterator AIt = CurValues.find(AI);
+        DenseMap<AllocaInst*, Value*>::iterator AIt = CurValues.find(AI);
         if (AIt != CurValues.end()) {
           // Store updates the "current value"...
           AIt->second = SI->getOperand(0);





More information about the llvm-commits mailing list