For an optimization pipeline built from the following code, what’s the correct that passes get unnested and scheduled?
ModulePassManager MPM;
CGSCCPassManager CGPM;
FunctionPassManager FPM;
LoopPassManager LPM;
LPM.addPass(foo-loop-pass);
LPM.addPass(bar-loop-pass);
FPM.addPass(foo-func-pass);
FPM.addPass(createFunctionToLoopPassAdaptor(LPM));
FPM.addPass(bar-func-pass);
CGPM.addPass(foo-cgscc-pass);
CGPM.addPass(createCGSCCToFunctionPassAdaptor(FPM));
CGPM.addPass(bar-cgscc-pass);
MPM.addPass(foo-module-pass);
MPM.addPass(createModuleToPostOrderCGSCCPassAdaptor(CGPM));
MPM.addPass(bar-module-pass);
Does each adapted PM (consisting a list of passes for a smaller data structure) get scheduled as a PM after adaption? To elaborate, is this the correct order for the above pipeline? Thanks!
foo-module-pass over the entire module
for each cgscc in the module
run foo-cgscc-pass over cgscc
for each func in cgscc
run foo-func-pass over func
for each loop in func
run foo-loop-pass over loop
run bar-loop-pass over loop
run bar-func-pass over func
run bar-cgscc-pass over cgscc
bar-module-pass over the entire module