[Polly] Complete switch to new pass manager

Description of the Project:
While the standard Polly-enabled -O1/-O2/-O3 optimization pass pipelines work fine with the New Pass Manager (NPM), some parts of Polly still only works with the legacy pass manager. This includes some passes such as -polly-export-jscop/-polly-export-jscop, regression testing, Polly-ACC, command line options such as -polly-show, the PassInstrumentation mechanism used by e.g. -print-after-all. LLVM (and Clang) have moved to NPM being the default and support for the legacy pass manager is deprecated, slowly degenerates and features getting removed.

That is, all of Polly’s functionality should eventually work with the NPM as well, and be prepared for the complete removal of the legacy pass manager. More details about the two pass managers found here.

Expected results:
The goal is to make Polly more usable with using only the NPM. Milestones, not necessarily all to be reached in this GSoC, are:

  1. Make all of Polly’s functionality available in the NPM (or decide to deprecate/remove it)
  2. Better integration into the NPM (such as supporting PassInstrumentation); If the NPM turns out to be inadequate, use only a monolothic function pass.
  3. Replace the legacy pass manager in regression tests.
  4. Be ready for complete removal of the legacy pass manager in LLVM.

Confirmed mentors: @Meinersbur

Desirable skills: Understanding of the C++ template pattern used by the new pass manager (CRTP, Mixins, etc). Familarity with how LLVM can be linked (static, BUILD_SHARED_LIBS, and SHLIB/DYLIB) and its plugin loading machanisms (static, -load and -load-pass-plugin). Ideally, already worked with LLVM’s new pass manager.

Project size: Medium

Difficulty: Medium/Hard

I have submitted several patches about this project in ⚙ D123677 [PassManager] Implement DOTGraphTraitsViewer under NPM ⚙ D123678 [polly] migrate -polly-show to the new pass manager , but I’m not eligible for GSoC 2022. (Actually, I’m not a beginner to the open source :stuck_out_tongue_winking_eye:. There are others who deserve this chance). If nobody submits for this project, I’d like to continue on this as a start of my exploration of polyhedral compilation.

If there are, feel free to close or modify my diffs.

There was noone else mentioning interest in the project yet. Even if, you are free to help as a co-mentor :slight_smile:

Thanks for the patches, I will look at them as soon as possible.

Is this project still eligible for GSOC '23? I would love to (co-)mentor if that is the case.