llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
27.92k stars 11.52k forks source link

[polly] Remove legacy pass manager usage #82046

Open aeubanks opened 6 months ago

aeubanks commented 6 months ago

There is still a lot of legacy pass manager usage in polly which is deprecated (since polly pertains to the optimization pipeline) and makes it hard to do cleanups. Could all references to the legacy pass manager in polly be removed?

@Meinersbur

llvmbot commented 6 months ago

@llvm/issue-subscribers-polly

Author: Arthur Eubanks (aeubanks)

There is still a lot of legacy pass manager usage in polly which is deprecated (since polly pertains to the optimization pipeline) and makes it hard to do cleanups. Could all references to the legacy pass manager in polly be removed? @Meinersbur
efriedma-quic commented 6 months ago

I'll discuss with my team about assigning someone to help. It would be helpful if you could point out the specific code in question; is it just the passes themselves, or something else?

rahulana-quic commented 5 months ago

I have been working on this and have been able to remove almost all references to the LPM. However, majority of the tests in Polly still use the legacy passes and they need to be ported before the code is removed. I am currently working on that.

Meinersbur commented 5 months ago

The passes needed to run Polly as a user are all using the NPM, but some developer support (tests, pass printers, debug utils) are still depending on LPM. Here is the overview:

CodeGeneration (NewPM: CodeGenerationPass) CodePreparation (NewPM: CodePreparationPass) DeadCodeElimWrapperPass (NewPM: DeadCodeElimPass) DependenceInfo (NewPM: DependenceAnalysis) DependenceInfoPrinterLegacyPass (NewPM: DependenceInfoPrinterPass) DependenceInfoWrapperPass DependenceInfoPrinterLegacyFunctionPass JSONExporter (NewPM: JSONExportPass) JSONImporter (NewPM: JSONImportPass) JSONImporterPrinterLegacyPass MaximalStaticExpanderWrapperPass (NewPM: MaximalStaticExpansionPass/MaximalStaticExpansionPrinterPass) IslAstInfoWrapperPass (NewPM: IslAstAnalysis) IslAstInfoPrinterLegacyPass (NewPM: IslAstPrinterPass) IslScheduleOptimizerWrapperPass (NewPM: IslScheduleOptimizerPass) IslScheduleOptimizerPrinterLegacyPass (NewPM: IslScheduleOptimizerPrinterPass) PollyCanonicalize (NewPM: buildCanonicalicationPassesForNPM) PolyhedralInfo (deprecated) PolyhedralInfoPrinterLegacyPass (deprecated) ScopDetectionWrapperPass (NewPM: ScopAnalysisPrinterPass) ScopDetectionPrinterLegacyPass (NewPM: ScopAnalysisPrinterPass) ScopInliner (deprecated) ScopInfoRegionPass (NewPM: n/a) ScopInfoPrinterLegacyRegionPass (NewPM: n/a) ScopInfoWrapperPass (NewPM: ScopInfoAnalysis) ScopInfoPrinterLegacyFunctionPass (NewPM: ScopInfoPrinterPass) FlattenSchedule FlattenSchedulePrinterLegacyPass ForwardOpTreeWrapperPass (NewPM: ForwardOpTreePass) ForwardOpTreePrinterLegacyPass (NewPM: ForwardOpTreePrinterPass) DeLICMWrapperPass (NewPM: DeLICMPass) DeLICMPrinterLegacyPass (NewPM: DeLICMPrinterPass) SimplifyWrapperPass (NewPM: SimplifyPass) SimplifyPrinterLegacyPass (NewPM: SimplifyPrinterPass) DumpModuleWrapperPass (NewPM: DumpModulePass) PruneUnprofitableWrapperPass (NewPM: PruneUnprofitablePass)

@efriedma-quic How much did you progress? Any work left over for me?

efriedma-quic commented 5 months ago

@rahulana-quic is continuing work on this. I'll let him give a status update.

rahulana-quic commented 5 months ago

Thanks @Meinersbur, what you have summarised tracks with the changes I made locally to remove the legacy passes. But like I mentioned above, the tests need to be ported before we can merge those changes and I am working on that.

nikic commented 4 weeks ago

Is there any update on this? It looks like polly is still using the legacy pass manager.

efriedma-quic commented 3 weeks ago

Most of the polly tests were switched to newpm. There are a few tests that depend on debug print passes that haven't yet been ported to newpm (grep for "%loadPolly" in tests). I don't think @rahulana-quic made any progress on porting the legacypm passes.