[PATCH] D28031: Allow target to specify early module passes
Stanislav Mekhanoshin via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Jan 3 10:37:04 PST 2017
rampitec added a comment.
In https://reviews.llvm.org/D28031#631812, @jlebar wrote:
> Could we instead just make the `addEarlyAsPossiblePasses` API take a module pass manager? It would be the responsibility of the target to instantiate a function pass manager and add it to the MPM. This way our solution is fully general -- if we decide we want (say) early-as-possible CGSCC passes, we don't have to do anything special to make that work.
Isn't it too heavy? We would need to create a new FPM, when we already have one, and it is more code for target. FunctionPassManager requires Module as an argument to ctor, so target will need to create a module pass, which will then instantiate an FPM and run it. As far as I understand that would also happen not exactly at the same point of time as now, i.e. later than possible.
How about changing API to pass a bulder object into addEarlyAsPossiblePasses instead of PassManagerBase? In this case target could just call Builder.addExtension() itself with any extension type it needs and as much times it needs.
Repository:
rL LLVM
https://reviews.llvm.org/D28031
More information about the llvm-commits
mailing list