This is an archive of the discontinued LLVM Phabricator instance.

[MLInliner] Don't inline call sites in unreachable basic blocks
ClosedPublic

Authored by mtrofin on Jun 15 2022, 12:42 PM.

Details

Summary

This requires DominatorTree be updated, which we do in the ml inliner
case, but not in the default case, and the cost of doing so is
noticeable to compile time for the latter[1]. So the patch only affects
the ML inliner.

[1] https://llvm-compile-time-tracker.com/compare.php?from=9fc0aa45e3312944431ba7e1ca0cec99c613992b&to=7af461b1ce0d9138211ef5f883f35d5b9ddf47be&stat=wall-time

Diff Detail

Event Timeline

mtrofin created this revision.Jun 15 2022, 12:42 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 15 2022, 12:42 PM
Herald added a subscriber: hiraditya. · View Herald Transcript
mtrofin requested review of this revision.Jun 15 2022, 12:42 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 15 2022, 12:42 PM
xbolva00 retitled this revision from [inline] Don't inline call sites in unreachable basic blocks to [MLInliner] Don't inline call sites in unreachable basic blocks.Jun 15 2022, 3:22 PM
kazu accepted this revision.Jun 16 2022, 8:59 AM

LGTM modulo minor cosmetic changes. Thanks!

llvm/lib/Analysis/MLInlineAdvisor.cpp
279–282

Remove the trailing space.

292–293

Could you move this up to the beginning of the function if all you need is CB?

This revision is now accepted and ready to land.Jun 16 2022, 8:59 AM
mtrofin updated this revision to Diff 437563.Jun 16 2022, 9:04 AM
mtrofin marked 2 inline comments as done.

feedback

This revision was landed with ongoing or failed builds.Jun 16 2022, 9:14 AM
This revision was automatically updated to reflect the committed changes.