Hello,
I am used to specifying dependence on other LLVM passes in the getAnalysisUsage(AnalysisUsage &)
method of my pass. However, it doesn’t seem that there is a header file that exposes the mem2reg
pass - it is implemented in Mem2Reg.cpp
as a wrapper.
Is there an easy way to reuse this pass, or should I, in essence, duplicate Mem2Reg.cpp
in my project?
Cheers,
Usually dependencies are expressed toward *analyses* and not toward other transformations.
It is the responsibility of the pass pipeline building to order transformations.
(hope I haven't misunderstood your question)
Oh, I see, that makes a lot of sense.
How do I build the pass pipeline?
It depends how you interact with LLVM, one the command line with opt
it is the order of the arguments.
Otherwise at the C++ API level it involves creating a PassManager and adding passes to it in order.
Your pass is surely added to the PassManager at some point, you just have to figure out by which component (again I don’t know your project).
Okay, so I have to create my own PassManager. I think that answers my question.
Thanks for the help! When I have something useful implemented I’ll be happy to share the details.