diff options
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/Transforms/IPO/SampleProfile.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/IPO/SampleProfile.cpp b/llvm/lib/Transforms/IPO/SampleProfile.cpp index 6e1818b2f58..cf0e02e8ecc 100644 --- a/llvm/lib/Transforms/IPO/SampleProfile.cpp +++ b/llvm/lib/Transforms/IPO/SampleProfile.cpp @@ -651,6 +651,8 @@ bool SampleProfileLoader::inlineHotFunctions(Function &F) { InvokeInst *II = dyn_cast<InvokeInst>(I); Function *CalledFunction = (CI == nullptr ? II->getCalledFunction() : CI->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))) { |