[llvm-dev] Exposing the New Pass Manager in the LLVM C API

Andres Freund via llvm-dev llvm-dev at lists.llvm.org
Thu Oct 10 16:12:45 PDT 2019


Hi,

On 2019-10-04 08:58:14 +0200, Robin Kruppe via llvm-dev wrote:
> I agree that increasing coverage of the stable C API (especially for such
> essentials as the new PM) is a worthwhile goal that will benefit various
> projects using LLVM.

Same. For projects that need to compile against various versions of
LLVM, and that don't have very devoted resources, it's otherwise quite
hard to keep up.


> It also seems unlikely Rust's use cases can be fully served by a C API
> in the near term, we already have substantial amounts of custom C++
> code interacting with the legacy PM to do things not available in the
> C API (e.g. driving ThinLTO) and this customization need won't go away
> with the PM switch.

It'd kinda be good to encapsule this logic better. There's quite a few
copies of thinlink like logic out there. I e.g. wrote my own crappy
version for postgres' JIT, Rust has a copy, etc.  And it's really hard
to understand from the outside what one even iss supposed to use.



> > 2) Add a new interface that exposes the new PM while still keeping the
> > current one.
> >
> > The interface would probably be similar to the current one but just not
> > have the corresponding Initialize/FinalizeFunctionPassManager functions. I
> > think with this method we could also slowly roll out usage of the new PM
> > through the C API and eventually deprecate the legacy PM interface in favor
> > of the new one.
> >
> 
> +1 for this option.

Same.

Greetings,

Andres Freund


More information about the llvm-dev mailing list