[SampleProfile] Skip intrinsic calls when visiting callsites in InlineHotFunctions.

Before this patch, we always called method 'findCalleeFunctionSamples()' on
intrinsic calls. However, intrinsic calls like llvm.dbg.value() are not viable
candidates for obvious reasons.

No functional change intended.

Differential Revision: https://reviews.llvm.org/D32008

llvm-svn: 300541
This commit is contained in:
Andrea Di Biagio 2017-04-18 10:08:53 +00:00
parent d9ff1cd213
commit e3edef0977
1 changed files with 1 additions and 1 deletions

View File

@ -677,7 +677,7 @@ bool SampleProfileLoader::inlineHotFunctions(
for (auto &I : BB.getInstList()) {
const FunctionSamples *FS = nullptr;
if ((isa<CallInst>(I) || isa<InvokeInst>(I)) &&
(FS = findCalleeFunctionSamples(I))) {
!isa<IntrinsicInst>(I) && (FS = findCalleeFunctionSamples(I))) {
Candidates.push_back(&I);
if (callsiteIsHot(Samples, FS))
Hot = true;