Skip to content

Commit

Permalink
Fix debug build test failure
Browse files Browse the repository at this point in the history
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304600 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
david-xl committed Jun 2, 2017
1 parent 118cef0 commit 13596b2
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/Transforms/IPO/PartialInlining.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 13596b2

Please sign in to comment.