Page MenuHomePhabricator

[ArgPromotion] Remove all the getters and ReplaceCallSite
ClosedPublic

Authored by psamolysov on Jun 28 2022, 6:35 AM.

Details

Summary

AARGetter is an abstraction over a source of the AAResults introduced
to support the legacy pass manager as well as the modern one. Since the
Argument Promotion pass doesn't support the legacy pass manager anymore,
the abstraction is not required and AAResults may be used directly.

The instance of the FunctionAnalysisManager is passed through the
functions to get all the required analyses just wherever they are
required and do not use the awkward getter callbacks.

The ReplaceCallSite parameter was required for the legacy pass manager
only and isn't used anymore, so the parameter has been eliminated.

Diff Detail

Event Timeline

psamolysov created this revision.Jun 28 2022, 6:35 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 28 2022, 6:35 AM
psamolysov requested review of this revision.Jun 28 2022, 6:35 AM
nikic added a comment.Jun 28 2022, 7:28 AM

The disadvantage is that AAResult gets computed unconditionally, while previously it was only computed if the function was a viable promotion candidate.

Maybe we want to pass through FunctionAnalysisManager to avoid the awkward callbacks, while keeping the current positions of the lookup?

Good catch, thank you. I think the ReplicaCallSite parameter can be removed too because we pass only None for it.

psamolysov retitled this revision from [ArgPromotion] Remove AARGetter to [ArgPromotion] Remove all the getters and ReplaceCallSite.
psamolysov edited the summary of this revision. (Show Details)

Eliminate all the getters as well as the ReplaceCallSite parameter.

Remove #include of unused headers.

aeubanks accepted this revision.Jun 28 2022, 9:17 AM
aeubanks added inline comments.
llvm/lib/Transforms/IPO/ArgumentPromotion.cpp
44

some of these includes should still be here, like CGSCCPassManager, LazyCallGraph, and Module

This revision is now accepted and ready to land.Jun 28 2022, 9:17 AM
psamolysov added a comment.EditedJun 28 2022, 9:21 AM

CGSCCPassManager and LazyCallGraph are included in the class' header. About Module I'm not sure, CLion marks this header as unused, I also see no Module in the code.

This revision was landed with ongoing or failed builds.Jun 29 2022, 12:48 AM
This revision was automatically updated to reflect the committed changes.