BypassSlowDivision: Assign to reference, don't copy the object.
authorJakub Staszak <kubastaszak@gmail.com>
Tue, 4 Sep 2012 23:11:11 +0000 (23:11 +0000)
committerJakub Staszak <kubastaszak@gmail.com>
Tue, 4 Sep 2012 23:11:11 +0000 (23:11 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163179 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Utils/BypassSlowDivision.cpp

index 4130def1cb865fe83cd1963282d6edac534b94d7..b694779a5323721943c333d1ed6ed61f3d39d390 100644 (file)
@@ -189,7 +189,7 @@ static bool reuseOrInsertFastDiv(Function &F,
   // Get instruction operands
   Instruction *Instr = J;
   DivOpInfo Key(UseSignedOp, Instr->getOperand(0), Instr->getOperand(1));
-  DivCacheTy::const_iterator CacheI = PerBBDivCache.find(Key);
+  DivCacheTy::iterator CacheI = PerBBDivCache.find(Key);
 
   if (CacheI == PerBBDivCache.end()) {
     // If previous instance does not exist, insert fast div
@@ -198,7 +198,7 @@ static bool reuseOrInsertFastDiv(Function &F,
   }
 
   // Replace operation value with previously generated phi node
-  DivPhiNodes Value = CacheI->second;
+  DivPhiNodes &Value = CacheI->second;
   if (UseDivOp) {
     // Replace all uses of div instruction with quotient phi node
     J->replaceAllUsesWith(Value.Quotient);