[SCCP] Pass the Solver by reference, copies are expensive ...

.. enough to cause LTO compile time to regress insanely.
Thanks *a lot* to Rafael for reporting the problem and testing
the fix!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275468 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Davide Italiano 2016-07-14 20:25:54 +00:00
parent a43274d789
commit f3702b696c

View File

@ -1510,7 +1510,7 @@ bool SCCPSolver::ResolvedUndefsIn(Function &F) {
return false;
}
static bool tryToReplaceWithConstant(SCCPSolver Solver, Value *V) {
static bool tryToReplaceWithConstant(SCCPSolver &Solver, Value *V) {
Constant *Const = nullptr;
if (V->getType()->isStructTy()) {
std::vector<LatticeVal> IVs = Solver.getStructLatticeValueFor(V);
@ -1540,7 +1540,7 @@ static bool tryToReplaceWithConstant(SCCPSolver Solver, Value *V) {
return true;
}
static bool tryToReplaceInstWithConstant(SCCPSolver Solver, Instruction *Inst,
static bool tryToReplaceInstWithConstant(SCCPSolver &Solver, Instruction *Inst,
bool shouldEraseFromParent) {
if (!tryToReplaceWithConstant(Solver, Inst))
return false;