From 6f73588fb9d1d9f555abd9ef3b44e92ff2d2a1b1 Mon Sep 17 00:00:00 2001 From: Davide Italiano Date: Thu, 14 Jul 2016 20:25:54 +0000 Subject: [PATCH] [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 --- llvm/lib/Transforms/Scalar/SCCP.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/llvm/lib/Transforms/Scalar/SCCP.cpp b/llvm/lib/Transforms/Scalar/SCCP.cpp index 6ef7a20..d7a541d 100644 --- a/llvm/lib/Transforms/Scalar/SCCP.cpp +++ b/llvm/lib/Transforms/Scalar/SCCP.cpp @@ -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 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; -- 2.7.4