BypassSlowDivision: Assign to reference, don't copy the object.
llvm-svn: 163179
This commit is contained in:
parent
eb31ef0577
commit
e535c1a12e
|
@ -189,7 +189,7 @@ static bool reuseOrInsertFastDiv(Function &F,
|
||||||
// Get instruction operands
|
// Get instruction operands
|
||||||
Instruction *Instr = J;
|
Instruction *Instr = J;
|
||||||
DivOpInfo Key(UseSignedOp, Instr->getOperand(0), Instr->getOperand(1));
|
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 (CacheI == PerBBDivCache.end()) {
|
||||||
// If previous instance does not exist, insert fast div
|
// 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
|
// Replace operation value with previously generated phi node
|
||||||
DivPhiNodes Value = CacheI->second;
|
DivPhiNodes &Value = CacheI->second;
|
||||||
if (UseDivOp) {
|
if (UseDivOp) {
|
||||||
// Replace all uses of div instruction with quotient phi node
|
// Replace all uses of div instruction with quotient phi node
|
||||||
J->replaceAllUsesWith(Value.Quotient);
|
J->replaceAllUsesWith(Value.Quotient);
|
||||||
|
|
Loading…
Reference in New Issue