[llvm-dev] Guidelines for pass initialization?

Owen Anderson via llvm-dev llvm-dev at lists.llvm.org
Fri Aug 21 10:27:12 PDT 2015


The macro versions should be preferred, as they reduce static initializaters.

INITIALIZE_PASS is used for a pass that is a leaf in the dependency graph, whereas INITIALIZE_PASS_BEGIN is used for interior nodes.

—Owen

> On Aug 21, 2015, at 10:15 AM, Philip Reames via llvm-dev <llvm-dev at lists.llvm.org> wrote:
> 
> Does anyone know what the guidelines are supposed to be for properly initializing a pass?  Looking around, we seem to have three styles of pass registration in use.
> 
> INITIALIZE_PASS(...)
> 
> INITIALIZE_PASS_BEGIN(...)
> INITIALIZE_PASS_DEPENDENCY(...)
> ...
> INITIALIZE_PASS_END(...)
> 
> static RegisterPass<FooPass> X(...);
> (This is the one encouraged in the docs, but seemingly the least widely used in tree?)
> 
> As far as I can tell, these often appear to work interchangeably. (At least for passes with only "well known" dependencies.)  Can anyone expose a set of guidelines as to when one should use each?
> 
> Philip
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev



More information about the llvm-dev mailing list