forked from OSchip/llvm-project
[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! llvm-svn: 275468
This commit is contained in:
parent
40f993df25
commit
6f73588fb9
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue