[llvm] [LTO] Enable adding custom pass instrumentation callbacks (PR #71268)

Teresa Johnson via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 27 07:52:41 PST 2023


teresajohnson wrote:

> We are working on a downstream tool that pre-links bitcode files, runs optimization passes, and produces bitcode file output that can be used later for a final link with LTO, so we run LTO for input files but interrupt the process before codegen. Some passes in the default optimization pipeline, like EliminateAvailableExternallyPass, might be detrimental to this scheme and should be excluded. I suppose the easiest way to accomplish this is to provide a hook that enables adding corresponding filters. I do not think a more complex and general mechanism for customizing the pipeline is needed yet.

Interesting, essentially you are doing 2 rounds of LTO?

Is the EliminateAvailableExternallyPass the only one you want to disable? Another approach would be to add an internal option to enable or skip that pass, like many of the other -enable-* flags in PassBuilderPipelines.cpp.

There are existing options to register a custom opt pipeline completely, but I suppose you want something very close to an existing pass pipeline minus a handful of passes?

https://github.com/llvm/llvm-project/pull/71268


More information about the llvm-commits mailing list