Sorry for the non-answer, but AFAIK the pass registry can’t understand a non-default ctor. I personally don’t like non-default pass ctors anyway. You have at least three better options
- If you have different versions of a pass, just make them different passes that share implementation.
- If you have a pass that can be configured in different modes, get the mode from the current context within the pass. Maybe a Function attribute can be used, or ask TargetMachine/TargetOptions within backend passes.
- Get what you need from an existing ImmutablePass, like TargetTransformInfo, TargetPassConfig, or create your own Immutable pass.
thank you very much for your reply. And while it does not solve my immediate problem, it at least limits the solution space. So, it is a useful answer.
I will go back to the drawing board and explore your suggestions and try to map it to the problem at hand. I am trying to implement a scripting pass akin to Shang for the 3.4 release.
In any case, I was wondering if anyone is actively looking into such a scripting pass.