This is an archive of the discontinued LLVM Phabricator instance.

[PartialInliner] Skip call sites where inlining fails.
ClosedPublic

Authored by fhahn on Nov 2 2017, 5:03 PM.

Details

Summary

InlineFunction can fail, for example when trying to inline vararg
fuctions. In those cases, we do not want to bump partial inlining
counters or set AnyInlined to true, because this could leave an unused
function hanging around.

Diff Detail

Event Timeline

fhahn created this revision.Nov 2 2017, 5:03 PM
davidxl added inline comments.Nov 2 2017, 5:07 PM
lib/Transforms/IPO/PartialInlining.cpp
933–934

Move the opt remark down.

davide accepted this revision.Nov 2 2017, 6:39 PM

LGTM with David's suggestion of moving the remark down. Thanks!

This revision is now accepted and ready to land.Nov 2 2017, 6:39 PM
fhahn updated this revision to Diff 121455.Nov 3 2017, 3:32 AM

I've updated the patch to construct the remark before inlining, as the callsite gets erased by InlineFunction, but moved emission of the remark after the InlineFunction.

fhahn added inline comments.Nov 3 2017, 4:28 AM
lib/Transforms/IPO/PartialInlining.cpp
933–934

Done, thanks!

fhahn closed this revision.Nov 3 2017, 4:29 AM