]> granicus.if.org Git - llvm/commitdiff
Fix debug build test failure
authorXinliang David Li <davidxl@google.com>
Fri, 2 Jun 2017 22:38:48 +0000 (22:38 +0000)
committerXinliang David Li <davidxl@google.com>
Fri, 2 Jun 2017 22:38:48 +0000 (22:38 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304600 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/IPO/PartialInlining.cpp

index eee250c4d54c623249605d56753199f1f5f6d242..ea805efc66b79f9538cc5290c11ee90382dded6c 100644 (file)
@@ -581,13 +581,14 @@ std::tuple<int, int, int> PartialInlinerImpl::computeOutliningCosts(
   for (BasicBlock &BB : *OutlinedFunction) {
     OutlinedFunctionCost += computeBBInlineCost(&BB);
   }
+
+  assert(OutlinedFunctionCost >= OutlinedRegionCost &&
+         "Outlined function cost should be no less than the outlined region");
   // The code extractor introduces a new root and exit stub blocks with
   // additional unconditional branches. Those branches will be eliminated
   // later with bb layout. The cost should be adjusted accordingly:
   OutlinedFunctionCost -= 2 * InlineConstants::InstrCost;
 
-  assert(OutlinedFunctionCost >= OutlinedRegionCost &&
-         "Outlined function cost should be no less than the outlined region");
   int OutliningRuntimeOverhead = OutliningFuncCallCost +
                                  (OutlinedFunctionCost - OutlinedRegionCost) +
                                  ExtraOutliningPenalty;