This is an archive of the discontinued LLVM Phabricator instance.

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

Authored by andreadb on Apr 13 2017, 5:02 AM.

Details

Summary

Intrinsic calls like llvm.dbg.value() should not be considered as viable candidates for inlining.

Before this patch, we always called method 'findCalleeFunctionSamples()' on intrinsic calls.

However, an intrinsic call (for example: a @llvm.dbg.value()) can have the same debug location of another function F which, according to the sample profile, was originally inlined.

In that scenario, method 'findCalleeFunctionSamples()' would return a non-null pointer, and the algorithm would end up adding the intrinsic call to the 'Candidates' set.

As a side note: I noticed that Dehao created D31950. With that patch, intrinsic calls would not be added to the Candidates set, because that patch would introduce a check on the function name.

That said, in the case of intrinsic calls, we shouldn't even call 'findCalleeFunctionSamples()', since intrinsic calls cannot be considered as viable inlining candidates fof obvious reasons.

Please let me know if okay to commit.

Thanks,
Andrea

Diff Detail

Repository
rL LLVM

Event Timeline

andreadb created this revision.Apr 13 2017, 5:02 AM
danielcdh accepted this revision.Apr 14 2017, 7:47 PM
This revision is now accepted and ready to land.Apr 14 2017, 7:47 PM
This revision was automatically updated to reflect the committed changes.