diff options
author | Haicheng Wu <haicheng@codeaurora.org> | 2017-08-25 19:00:33 +0000 |
---|---|---|
committer | Haicheng Wu <haicheng@codeaurora.org> | 2017-08-25 19:00:33 +0000 |
commit | 61995364defde42d8dc472373d51f82c8bed90b7 (patch) | |
tree | 8e041a5edf62382894a71d0b6284e133ae396938 /llvm/lib/Analysis | |
parent | 524ae44dfa5ad1d39c885a412fce10f66041f8c5 (diff) | |
download | bcm5719-llvm-61995364defde42d8dc472373d51f82c8bed90b7.tar.gz bcm5719-llvm-61995364defde42d8dc472373d51f82c8bed90b7.zip |
[InlineCost] Small changes to early exit condition. NFC.
Change the early exit condition from Cost > Threshold to Cost >= Threshold
because the inline condition is Cost < Threshold.
Differential Revision: https://reviews.llvm.org/D37087
llvm-svn: 311791
Diffstat (limited to 'llvm/lib/Analysis')
-rw-r--r-- | llvm/lib/Analysis/InlineCost.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/Analysis/InlineCost.cpp b/llvm/lib/Analysis/InlineCost.cpp index c26388a19bc..8cdf2046702 100644 --- a/llvm/lib/Analysis/InlineCost.cpp +++ b/llvm/lib/Analysis/InlineCost.cpp @@ -1384,7 +1384,7 @@ bool CallAnalyzer::analyzeBlock(BasicBlock *BB, // Check if we've past the maximum possible threshold so we don't spin in // huge basic blocks that will never inline. - if (Cost > Threshold && !ComputeFullInlineCost) + if (Cost >= Threshold && !ComputeFullInlineCost) return false; } @@ -1470,7 +1470,7 @@ bool CallAnalyzer::analyzeCall(CallSite CS) { Cost += InlineConstants::ColdccPenalty; // Check if we're done. This can happen due to bonuses and penalties. - if (Cost > Threshold && !ComputeFullInlineCost) + if (Cost >= Threshold && !ComputeFullInlineCost) return false; if (F.empty()) @@ -1536,7 +1536,7 @@ bool CallAnalyzer::analyzeCall(CallSite CS) { for (unsigned Idx = 0; Idx != BBWorklist.size(); ++Idx) { // Bail out the moment we cross the threshold. This means we'll under-count // the cost, but only when undercounting doesn't matter. - if (Cost > Threshold && !ComputeFullInlineCost) + if (Cost >= Threshold && !ComputeFullInlineCost) break; BasicBlock *BB = BBWorklist[Idx]; |