This is an archive of the discontinued LLVM Phabricator instance.

[PassBuilder] Moved ProfileSummaryAnalysis in buildInlinerPipeline.
ClosedPublic

Authored by Whitney on May 10 2020, 4:23 PM.

Details

Summary

As commented in the code, ProfileSummaryAnalysis is required for inliner pass to query, so this patch moved RequireAnalysisPass<ProfileSummaryAnalysis> in the recently created buildInlinerPipeline.

Diff Detail

Event Timeline

Whitney created this revision.May 10 2020, 4:23 PM
jdoerfert added inline comments.May 10 2020, 5:05 PM
llvm/lib/Passes/PassBuilder.cpp
893

Doesn't this hold for GlobalsAA as well?

Whitney updated this revision to Diff 263094.May 10 2020, 6:12 PM
Whitney marked an inline comment as done.

Move GlobalsAA as well.

This revision is now accepted and ready to land.May 10 2020, 8:23 PM

What is the main purpose of the change?

What is the main purpose of the change?

The two requires of GlobalAA and ProfileSummaryAnalysis are explicitly commented for the CGSCC pipeline or the inliner.
Currently is not obvious that module passes (that doesn't preserve GlobalAA or ProfileSummaryAnalysis) should not be added before buildInlinerPipeline.
With this patch, buildInlinerPipeline can now use GlobalAA and ProfileSummaryAnalysis, without requiring them separately.
It also gives flexibility for passes to be added in buildInlinerPipeline in the future.

mtrofin accepted this revision.May 11 2020, 8:05 AM

lgtm!

davidxl accepted this revision.May 11 2020, 9:08 AM

thanks. LGTM

This revision was automatically updated to reflect the committed changes.