[llvm] 0205fab - [Inlining] Make shouldBeDeferred static (NFC)
Kazu Hirata via llvm-commits
llvm-commits at lists.llvm.org
Mon May 11 17:43:42 PDT 2020
Author: Kazu Hirata
Date: 2020-05-11T17:43:31-07:00
New Revision: 0205fabe5dfbc77a4a42b9961bcbbd6eccace93e
URL: https://github.com/llvm/llvm-project/commit/0205fabe5dfbc77a4a42b9961bcbbd6eccace93e
DIFF: https://github.com/llvm/llvm-project/commit/0205fabe5dfbc77a4a42b9961bcbbd6eccace93e.diff
LOG: [Inlining] Make shouldBeDeferred static (NFC)
Summary:
This patch makes shouldBeDeferred static because it is called only
from shouldInline in the same .cpp file.
Reviewers: davidxl, mtrofin
Reviewed By: mtrofin
Subscribers: hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D79750
Added:
Modified:
llvm/include/llvm/Analysis/InlineAdvisor.h
llvm/lib/Analysis/InlineAdvisor.cpp
Removed:
################################################################################
diff --git a/llvm/include/llvm/Analysis/InlineAdvisor.h b/llvm/include/llvm/Analysis/InlineAdvisor.h
index 8fc2ca2e35a0..3dab78223d0b 100644
--- a/llvm/include/llvm/Analysis/InlineAdvisor.h
+++ b/llvm/include/llvm/Analysis/InlineAdvisor.h
@@ -25,14 +25,6 @@ class OptimizationRemarkEmitter;
// Default (manual policy) decision making helper APIs. Shared with the legacy
// pass manager inliner.
-/// Return true if inlining of CB can block the caller from being
-/// inlined which is proved to be more beneficial. \p IC is the
-/// estimated inline cost associated with callsite \p CB.
-/// \p TotalSecondaryCost will be set to the estimated cost of inlining the
-/// caller if \p CB is suppressed for inlining.
-bool shouldBeDeferred(Function *Caller, InlineCost IC, int &TotalSecondaryCost,
- function_ref<InlineCost(CallBase &CB)> GetInlineCost);
-
/// Return the cost only if the inliner should attempt to inline at the given
/// CallSite. If we return the cost, we will emit an optimisation remark later
/// using that cost, so we won't do so from this function. Return None if
diff --git a/llvm/lib/Analysis/InlineAdvisor.cpp b/llvm/lib/Analysis/InlineAdvisor.cpp
index eae0d24984cf..e9d4f7e16ddc 100644
--- a/llvm/lib/Analysis/InlineAdvisor.cpp
+++ b/llvm/lib/Analysis/InlineAdvisor.cpp
@@ -51,9 +51,9 @@ static cl::opt<int>
/// estimated inline cost associated with callsite \p CB.
/// \p TotalSecondaryCost will be set to the estimated cost of inlining the
/// caller if \p CB is suppressed for inlining.
-bool llvm::shouldBeDeferred(
- Function *Caller, InlineCost IC, int &TotalSecondaryCost,
- function_ref<InlineCost(CallBase &CB)> GetInlineCost) {
+static bool
+shouldBeDeferred(Function *Caller, InlineCost IC, int &TotalSecondaryCost,
+ function_ref<InlineCost(CallBase &CB)> GetInlineCost) {
// For now we only handle local or inline functions.
if (!Caller->hasLocalLinkage() && !Caller->hasLinkOnceODRLinkage())
return false;
More information about the llvm-commits
mailing list