[llvm] Allow PTO to be modified in PassBuilder (PR #92821)

via llvm-commits llvm-commits at lists.llvm.org
Tue May 21 11:33:42 PDT 2024


modiking wrote:

> this seems like something that should be constant after creating the PassBuilder. what's wrong with creating a completely new PassBuilder if you want a different PTO? do you actually use this functionality?

I'm updating llvmlite (basically a python wrapper for LLVM) to use llvm-17 which is currently deleting and creating new PassBuilders: https://github.com/numba/llvmlite/pull/1042/files#diff-d8ebf43ad08696121c79ffa0fb08e76eb6ef6dca4a391ddd45fde8f6ea42e12cR140.

On a technical level creating new PassBuilders works but the manual memory management is fragile and IMO more expensive than necessary. That being said, the pipeline construction itself depends on PTO so changing it in PassBuilder after the fact requires rebuilding the pass pipeline at which point a new PassBuilder isn't very expensive.. Yeah it's probably better to create a new PassBuilder

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


More information about the llvm-commits mailing list