diff options
author | Taewook Oh <twoh@fb.com> | 2017-02-14 17:30:05 +0000 |
---|---|---|
committer | Taewook Oh <twoh@fb.com> | 2017-02-14 17:30:05 +0000 |
commit | f22fa72e4aa56ecbda42bc6eb1cd53a8421e9a57 (patch) | |
tree | 0aa5f0c316fa151a48cb5bdfc7a4c850ee7d31d8 /llvm/lib/Transforms/IPO/Inliner.cpp | |
parent | 4c98023724f3438f7d5ebc12cf7e384348a48d79 (diff) | |
download | bcm5719-llvm-f22fa72e4aa56ecbda42bc6eb1cd53a8421e9a57.tar.gz bcm5719-llvm-f22fa72e4aa56ecbda42bc6eb1cd53a8421e9a57.zip |
Do not apply redundant LastCallToStaticBonus
Summary:
As written in the comments above, LastCallToStaticBonus is already applied to
the cost if Caller has only one user, so it is redundant to reapply the bonus
here.
If the only user is not a caller, TotalSecondaryCost will not be adjusted
anyway because callerWillBeRemoved is false. If there's no caller at all, we
don't need to care about TotalSecondaryCost because
inliningPreventsSomeOuterInline is false.
Reviewers: chandlerc, eraman
Reviewed By: eraman
Subscribers: haicheng, davidxl, davide, llvm-commits, mehdi_amini
Differential Revision: https://reviews.llvm.org/D29169
llvm-svn: 295075
Diffstat (limited to 'llvm/lib/Transforms/IPO/Inliner.cpp')
-rw-r--r-- | llvm/lib/Transforms/IPO/Inliner.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/IPO/Inliner.cpp b/llvm/lib/Transforms/IPO/Inliner.cpp index 5547bb666d3..7049a6f501c 100644 --- a/llvm/lib/Transforms/IPO/Inliner.cpp +++ b/llvm/lib/Transforms/IPO/Inliner.cpp @@ -326,7 +326,7 @@ shouldBeDeferred(Function *Caller, CallSite CS, InlineCost IC, // one is set very low by getInlineCost, in anticipation that Caller will // be removed entirely. We did not account for this above unless there // is only one caller of Caller. - if (callerWillBeRemoved && !Caller->use_empty()) + if (callerWillBeRemoved && !Caller->hasOneUse()) TotalSecondaryCost -= InlineConstants::LastCallToStaticBonus; if (inliningPreventsSomeOuterInline && TotalSecondaryCost < IC.getCost()) |