From: Dan Gohman Date: Thu, 20 May 2010 20:59:23 +0000 (+0000) Subject: Make Solve check its own post-condition, to reduce clutter in the X-Git-Url: http://plrg.eecs.uci.edu/git/?p=oota-llvm.git;a=commitdiff_plain;h=a5528785089bfd093a36cbc2eddcc35980c5340e Make Solve check its own post-condition, to reduce clutter in the top-level LSRInstance logic. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@104278 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Transforms/Scalar/LoopStrengthReduce.cpp b/lib/Transforms/Scalar/LoopStrengthReduce.cpp index f1dbbf95292..2454a4e01fd 100644 --- a/lib/Transforms/Scalar/LoopStrengthReduce.cpp +++ b/lib/Transforms/Scalar/LoopStrengthReduce.cpp @@ -3109,6 +3109,8 @@ void LSRInstance::Solve(SmallVectorImpl &Solution) const { Solution[i]->print(dbgs()); dbgs() << '\n'; }); + + assert(Solution.size() == Uses.size() && "Malformed solution!"); } /// HoistInsertPosition - Helper for AdjustInsertPositionForExpand. Climb up @@ -3547,7 +3549,6 @@ LSRInstance::LSRInstance(const TargetLowering *tli, Loop *l, Pass *P) SmallVector Solution; Solve(Solution); - assert(Solution.size() == Uses.size() && "Malformed solution!"); // Release memory that is no longer needed. Factors.clear();