We might also need a LNPMUpdater (LoopNestPassManagerUpdater) which disallows adding inner-loops back into the pipeline, and LoopNestPassManager will simply be PassManager<Loop, LoopAnalysisManager, LoopStandardAnalysisResult &, LNPMUpdater &>.
LNPMUpdater should have some functionalities of LPMUpdater, e.g. adding sibling loop nest, revisit the current loop nest, etc.
One question I have is whether the IRUnit LoopNestPass operates on should be Loop or LoopNest, since I’m not quite sure about the usage of LoopNest and why it should be constructed with a ScalarEvolution.
That’s a good point, we can make ScalarEvolution optional for LoopNest. Currently, the only use case is to check if the loop nest is perfect, which can provide a more conservative result if ScalarEvolution is not given.
Having said that, ScalarEvolution is one of the analyses in LoopStandardAnalysisResults, so all LoopPasses already have access to ScalarEvolution.
LoopNest provides some useful utilities, although it is still not at a manual phrase.
My personal opinion is all the mechanism of the LoopNest, e.g. LoopNestPassManager, LPMUpdater, etc, should operates on Loop. While IRUnitT which is used by loop nest transformations/analyses should operates on LoopNest.
@etiotto What’s your opinion on that?
Also, it is stated that “we want to create a LoopNestPass, where transformations intended for loop nest can inherit from it” in the original GSoC project description, but I believe that inheriting from a Pass subclass is no longer required in the New Pass Manager. So should we also implement a LoopNestPass subclass that allows implementing loop-nest-passes for the Legacy Pass Manager?
Right, the wording should be corrected. Given that the New Pass Manager will soon be the default Pass Manager, we should not spend extra effort to create LoopNestPass in Legacy Pass Manager.
Finally, I have some questions that might not be very relevant to the project. But currently, how does the LegacyPassManager and the NewPassManager interact? Also, is it possible to add passes designed for LegacyPassManager into the NewPassManager and vice versa?
Most transformations have both for LegacyPassManager and NewPassManager, and have the actual implementation of the transformations in a separate class, or a static function that can be call by both.
e.g. LoopFuseLegacy is for LegacyPassManager , LoopFusePass is for NewPassManager, and both create LoopFuser and do the transformation there.
Looking forward to your first patch!
Ta-Wei Tu —2020/07/18 07:38:44 AM—Hi, Thanks for your help! I’ve checked the sources that you mentioned.