This is an archive of the discontinued LLVM Phabricator instance.

[NewPM] Add TargetMachine method to add alias analyses
ClosedPublic

Authored by aeubanks on Dec 14 2020, 6:16 PM.

Details

Summary

AMDGPUTargetMachine::adjustPassManager() adds some alias analyses to the
legacy PM. We need a way to do the same for the new PM in order to port
AMDGPUTargetMachine::adjustPassManager() to the new PM.

Currently the new PM adds alias analyses by creating an AAManager via
PassBuilder and overriding the AAManager a PassManager uses via
FunctionAnalysisManager::registerPass().

We will continue to respect a custom AA pipeline that specifies an exact
AA pipeline to use, but for "default" we will now add alias analyses
that backends specify. Most uses of PassManager use the "default"
AAManager created by PassBuilder::buildDefaultAAPipeline(). Backends can
override the newly added TargetMachine::registerAliasAnalyses() to add custom
alias analyses.

Diff Detail

Event Timeline

aeubanks created this revision.Dec 14 2020, 6:16 PM
aeubanks requested review of this revision.Dec 14 2020, 6:16 PM
Herald added a project: Restricted Project. · View Herald TranscriptDec 14 2020, 6:16 PM
ychen accepted this revision.Dec 21 2020, 9:54 AM

LGTM. The next step is to use this in AMDGPU and add tests?

This revision is now accepted and ready to land.Dec 21 2020, 9:54 AM

LGTM. The next step is to use this in AMDGPU and add tests?

Yup. Likely it'll just be porting the existing passes and making sure existing AMDGPU tests also pass under the NPM (assuming there are ones that test that custom AA passes run under something like -O2).

This revision was landed with ongoing or failed builds.Dec 21 2020, 1:46 PM
This revision was automatically updated to reflect the committed changes.