mirror of
https://github.com/RPCSX/llvm.git
synced 2024-11-30 15:10:33 +00:00
Use CallSite to simplify code
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288192 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
a55fccbc47
commit
375d719e55
@ -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 '") +
|
||||
|
Loading…
Reference in New Issue
Block a user