summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/IPO/SampleProfile.cpp
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2016-11-29 19:42:27 +0000
committerDavid Blaikie <dblaikie@gmail.com>2016-11-29 19:42:27 +0000
commit831b65202053cd7e9d1994310ccf075201750a60 (patch)
tree39a2a377d5a7ffcd58fa404e735446d5aa4d9b5f /llvm/lib/Transforms/IPO/SampleProfile.cpp
parent640c44b8931cacab55995c7e5b07623e0a59f4a3 (diff)
downloadbcm5719-llvm-831b65202053cd7e9d1994310ccf075201750a60.tar.gz
bcm5719-llvm-831b65202053cd7e9d1994310ccf075201750a60.zip
Use CallSite to simplify code
llvm-svn: 288192
Diffstat (limited to 'llvm/lib/Transforms/IPO/SampleProfile.cpp')
-rw-r--r--llvm/lib/Transforms/IPO/SampleProfile.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/llvm/lib/Transforms/IPO/SampleProfile.cpp b/llvm/lib/Transforms/IPO/SampleProfile.cpp
index cf0e02e8ecc..560bc3ef491 100644
--- a/llvm/lib/Transforms/IPO/SampleProfile.cpp
+++ b/llvm/lib/Transforms/IPO/SampleProfile.cpp
@@ -647,15 +647,13 @@ bool SampleProfileLoader::inlineHotFunctions(Function &F) {
}
for (auto I : CIS) {
InlineFunctionInfo IFI(nullptr, ACT ? &GetAssumptionCache : nullptr);
- CallInst *CI = dyn_cast<CallInst>(I);
- InvokeInst *II = dyn_cast<InvokeInst>(I);
- Function *CalledFunction =
- (CI == nullptr ? II->getCalledFunction() : CI->getCalledFunction());
+ CallSite CS(I);
+ Function *CalledFunction = CS.getCalledFunction();
if (!CalledFunction || !CalledFunction->getSubprogram())
continue;
DebugLoc DLoc = I->getDebugLoc();
uint64_t NumSamples = findCalleeFunctionSamples(*I)->getTotalSamples();
- if ((CI && InlineFunction(CI, IFI)) || (II && InlineFunction(II, IFI))) {
+ if (InlineFunction(CS, IFI)) {
LocalChanged = true;
emitOptimizationRemark(Ctx, DEBUG_TYPE, F, DLoc,
Twine("inlined hot callee '") +
OpenPOWER on IntegriCloud