Make Solve check its own post-condition, to reduce clutter in the
authorDan Gohman <gohman@apple.com>
Thu, 20 May 2010 20:59:23 +0000 (20:59 +0000)
committerDan Gohman <gohman@apple.com>
Thu, 20 May 2010 20:59:23 +0000 (20:59 +0000)
top-level LSRInstance logic.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@104278 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Scalar/LoopStrengthReduce.cpp

index f1dbbf95292abd68f6461a7d68152ceb66009113..2454a4e01fd40e59d54e218f27794d3c0972b769 100644 (file)
@@ -3109,6 +3109,8 @@ void LSRInstance::Solve(SmallVectorImpl<const Formula *> &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<const Formula *, 8> Solution;
   Solve(Solution);
-  assert(Solution.size() == Uses.size() && "Malformed solution!");
 
   // Release memory that is no longer needed.
   Factors.clear();