summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/IPO/PartialInlining.cpp
diff options
context:
space:
mode:
authorFedor Sergeev <fedor.sergeev@azul.com>2019-04-23 12:43:27 +0000
committerFedor Sergeev <fedor.sergeev@azul.com>2019-04-23 12:43:27 +0000
commit652168a99b5cdc1fb420b1224c8c2d42ad2b7465 (patch)
tree2cb15f62b733e35ca86dcb6c9158a59dde42ee3b /llvm/lib/Transforms/IPO/PartialInlining.cpp
parentccba42c7eb3cdfe7824cd4b473a9688e5738fa3a (diff)
downloadbcm5719-llvm-652168a99b5cdc1fb420b1224c8c2d42ad2b7465.tar.gz
bcm5719-llvm-652168a99b5cdc1fb420b1224c8c2d42ad2b7465.zip
[CallSite removal] move InlineCost to CallBase usage
Converting InlineCost interface and its internals into CallBase usage. Inliners themselves are still not converted. Reviewed By: reames Tags: #llvm Differential Revision: https://reviews.llvm.org/D60636 llvm-svn: 358982
Diffstat (limited to 'llvm/lib/Transforms/IPO/PartialInlining.cpp')
-rw-r--r--llvm/lib/Transforms/IPO/PartialInlining.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/llvm/lib/Transforms/IPO/PartialInlining.cpp b/llvm/lib/Transforms/IPO/PartialInlining.cpp
index a172aadaea0..733782e8764 100644
--- a/llvm/lib/Transforms/IPO/PartialInlining.cpp
+++ b/llvm/lib/Transforms/IPO/PartialInlining.cpp
@@ -775,9 +775,10 @@ bool PartialInlinerImpl::shouldPartialInline(
bool RemarksEnabled =
Callee->getContext().getDiagHandlerPtr()->isMissedOptRemarkEnabled(
DEBUG_TYPE);
- InlineCost IC =
- getInlineCost(CS, getInlineParams(), CalleeTTI, *GetAssumptionCache,
- GetBFI, PSI, RemarksEnabled ? &ORE : nullptr);
+ assert(Call && "invalid callsite for partial inline");
+ InlineCost IC = getInlineCost(cast<CallBase>(*Call), getInlineParams(),
+ CalleeTTI, *GetAssumptionCache, GetBFI, PSI,
+ RemarksEnabled ? &ORE : nullptr);
if (IC.isAlways()) {
ORE.emit([&]() {
@@ -811,7 +812,7 @@ bool PartialInlinerImpl::shouldPartialInline(
const DataLayout &DL = Caller->getParent()->getDataLayout();
// The savings of eliminating the call:
- int NonWeightedSavings = getCallsiteCost(CS, DL);
+ int NonWeightedSavings = getCallsiteCost(cast<CallBase>(*Call), DL);
BlockFrequency NormWeightedSavings(NonWeightedSavings);
// Weighted saving is smaller than weighted cost, return false
@@ -868,12 +869,12 @@ int PartialInlinerImpl::computeBBInlineCost(BasicBlock *BB) {
continue;
if (CallInst *CI = dyn_cast<CallInst>(&I)) {
- InlineCost += getCallsiteCost(CallSite(CI), DL);
+ InlineCost += getCallsiteCost(*CI, DL);
continue;
}
if (InvokeInst *II = dyn_cast<InvokeInst>(&I)) {
- InlineCost += getCallsiteCost(CallSite(II), DL);
+ InlineCost += getCallsiteCost(*II, DL);
continue;
}
OpenPOWER on IntegriCloud