Hi, I'm writing a new loop pass, and has a need to call LICM(Loop Invariant Code Motion) 'PromoteAliasSet' on modified loop. For now I didn't found any why to call 'PromoteAliasSet' from my pass explicitly. The only way is to schedule LICM pass after my pass. For some reason my pass need more control and preferring to call LICM 'PromoteAliasSet' instead running full LICM as next pass. Can LICM be more modular by exposing wrapper functions for its core functionalities (i.e. SinkRegion, HoistRegion, PromoteAliasSet) ? These wrappers will check pre-requisite(i.e. AliasAnalysis, LoopInfo availability ) and call appropriate functions. Regards, Ashutosh -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20141215/85927695/attachment.html>
I've come across similar use cases recently. In particular, there are some cases where I'd like run HoistRegion on a particular basic block after loop unswitching. I would be open to reviewing patches if you wanted to send them. I may get around to doing so myself eventually, but it's fairly low on my priority list. Philip On 12/15/2014 04:16 AM, Nema, Ashutosh wrote:> > Hi, > > I’m writing a new loop pass, and has a need to call LICM(Loop > Invariant Code Motion) ‘PromoteAliasSet’ on modified loop. > > For now I didn’t found any why to call ‘PromoteAliasSet’ from my pass > explicitly. > > The only way is to schedule LICM pass after my pass. > > For some reason my pass need more control and preferring to call LICM > ‘PromoteAliasSet’ instead running full LICM as next pass. > > Can LICM be more modular by exposing wrapper functions for its core > functionalities (i.e. SinkRegion, HoistRegion, PromoteAliasSet) ? > > These wrappers will check pre-requisite(i.e. AliasAnalysis, LoopInfo > availability ) and call appropriate functions. > > Regards, > > Ashutosh > > > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20141219/68cc08f6/attachment.html>
One way you could go is to expose the interface in include/llvm/Transforms/Utils/LoopUtils.h. There's a similar approach in the LCSSA and LoopSimplify passes, both define functions used by other passes (e.g LoopUnroll and LICM). On Fri, Dec 19, 2014 at 10:58 PM, Philip Reames <listmail at philipreames.com> wrote:> I've come across similar use cases recently. In particular, there are some > cases where I'd like run HoistRegion on a particular basic block after loop > unswitching. > > I would be open to reviewing patches if you wanted to send them. I may get > around to doing so myself eventually, but it's fairly low on my priority > list. > > Philip > > > On 12/15/2014 04:16 AM, Nema, Ashutosh wrote: > > Hi, > > > > I’m writing a new loop pass, and has a need to call LICM(Loop Invariant Code > Motion) ‘PromoteAliasSet’ on modified loop. > > > > For now I didn’t found any why to call ‘PromoteAliasSet’ from my pass > explicitly. > > > > The only way is to schedule LICM pass after my pass. > > > > For some reason my pass need more control and preferring to call LICM > ‘PromoteAliasSet’ instead running full LICM as next pass. > > > > Can LICM be more modular by exposing wrapper functions for its core > functionalities (i.e. SinkRegion, HoistRegion, PromoteAliasSet) ? > > > > These wrappers will check pre-requisite(i.e. AliasAnalysis, LoopInfo > availability ) and call appropriate functions. > > > > Regards, > > Ashutosh > > > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev > > > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev >-- Bruno Cardoso Lopes http://www.brunocardoso.cc