I am writing a ModulePass
and invoke it using opt -load
. I would require that alloca
has been promoted to registers when my pass runs, using the -mem2reg switch for opt.
There is a link which indicates that the PromoteMemoryToRegsiter pass is a transform pass and as such should not be required by my pass. That's a statement from 2010. Does that still hold?
One of the posts I found suggested something like
AU.addRequiredID(PromoteMemoryToRegister::MemoryToRegisterID);
but that contradicted the post I linked above.
So my question is, how to I express this dependency for my pass, if possible? How do I express, in general, such pass dependencies? And what's the difference between a transform pass and, well, another pass?