Using options for passes in the new Pass Manager

Hello everyone!

I have been recently looking at porting a pass from the legacy LLVM Pass Manager to the new one.
My main issue is that this pass has options, and I don’t see how to use them with the new PM.
Is there a prefered way to do this?

With the legacy PM, I could do opt --enable-new-pm=0 -load [...] --<pass-name> -<option-name>=<option-value> <bitcode-file>.
I can imagine using environment variables or configuration files to keep the option feature in the new PM, but I am wondering if there is a better way.

A similar issue is mentioned in llvm-tutor, e.g. on the MBAAdd example.
This is also discussed in this 2019 post.
Has the option feature disappeared in the new PM? What would you advise?

Thanks in advance,
Louis Rustenholz

1 Like

Hi,

I recently moved to the new PM in my project and encountered the same problem.
In case you’re still looking for a solution, I’m using the workaround shown here.

It’s not very elegant but there seems to be no “right” solution at the moment.