[llvm] [Analysis] Remove global state from `PluginInline{Advisor,Order}Analysis`. (PR #114615)

Michele Scandale via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 8 12:40:58 PST 2024


michele-scandale wrote:

> I see some comments at
> 
> https://github.com/llvm/llvm-project/blob/5005f8d2486d6eec7b2b8ae04f49e8a87ebf4bf6/llvm/include/llvm/Analysis/InlineAdvisor.h#L241
> 
> about adding a pass to register an analysis. Is there any reason we can't just register the analysis directly with [`PassBuilder::registerAnalysisRegistrationCallback`](https://github.com/llvm/llvm-project/blob/5005f8d2486d6eec7b2b8ae04f49e8a87ebf4bf6/llvm/include/llvm/Passes/PassBuilder.h#L548) in `llvmGetPassPluginInfo`? that seems like it'd solve your issue IIUC?

In the context I'm working on there are multiple independent optimization pipelines in the same process for different purposes (each pipeline has its own analysis manager instances): for some of them this exact mechanism is being used (due to a static plugin being registered) to customize the inline advisor, and that end up breaking the other pipelines because of the shared global state.

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


More information about the llvm-commits mailing list