[llvm-dev] Guidelines for pass initialization?
Owen Anderson via llvm-dev
llvm-dev at lists.llvm.org
Fri Aug 21 11:13:23 PDT 2015
> On Aug 21, 2015, at 10:40 AM, Philip Reames <listmail at philipreames.com> wrote:
>> INITIALIZE_PASS is used for a pass that is a leaf in the dependency graph, whereas INITIALIZE_PASS_BEGIN is used for interior nodes.
> Almost all transform passes - with the exception of LoopSimplify and the like - do not have passes which require them. As a result, most transform passes are leaves in the dependency graph and should use the INITIALIZE_PASS mechanism. All Analysis passes are expected to have consumers, so they are obvious not leaf and should use the INITIALIZE_PASS_BEGIN mechanism. Is that a reasonable summary?
No, you have the edge directions backwards. A pass that depends on something else (a Transform that depends on an Analysis) needs to specify that dependency. The Analysis pass itself does not need to specify the reverse dependency.
More information about the llvm-dev