Hi, I know when a pass needs other passes, it will use something like this: "AU.addRequired<LoopInfo>();". But this is usually used for the analysis passes. When a pass needs another transform pass, can it call it automatically? For example: Some loop optimizations may need loop-simplify, I need add -loop-simplify before calling these passes manually, or they can call the pass -loop-simplify automatically? Thank you Regards, Hanbing LI -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20140612/de8b43cf/attachment.html>
On Thu, Jun 12, 2014 at 4:45 PM, Hanbing Li <hanbing.li at inria.fr> wrote:> Hi, > > I know when a pass needs other passes, it will use something like this: > "AU.addRequired<LoopInfo>();". But this is usually used for the analysis > passes. > When a pass needs another transform pass, can it call it automatically? > For example: > Some loop optimizations may need loop-simplify, I need add -loop-simplify > before calling these passes manually, or they can call the pass > -loop-simplify automatically? >Currently, the pass manager allows you (somewhat) to use the addRequired mechanism even with analyses. However, I strongly encourage you to not leverage it as it will eventually go away. Instead, your pass should gracefully degrade in the absence of loops being in simplified form (it is easy to test for this with LoopInfo). Then, you should ensure that the PassManagerBuilder (or whatever other system you use to build up a pipeline) puts the loops into simplified form prior to running your pass. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20140612/8d397b64/attachment.html>
Dear Hanbing Li, To the best of my knowledge, the pass dependency mechanism cannot be used to force one transform pass to be run before another pass. You must simply setup the PassManager to ensure that the transform pass runs before your pass. The reason for this is that adding a transform pass as a dependency can create a situation in which the PassManager cannot schedule the passes to be run (because the transform pass invalidates some analysis pass, creating a chicken-and-egg scheduling problem that PassManager cannot rectify). Regards, John Criswell On 6/12/14, 10:45 AM, Hanbing Li wrote:> Hi, > > I know when a pass needs other passes, it will use something like > this: "AU.addRequired<LoopInfo>();". But this is usually used for the > analysis passes. > When a pass needs another transform pass, can it call it automatically? > For example: > Some loop optimizations may need loop-simplify, I need add > -loop-simplify before calling these passes manually, or they can call > the pass -loop-simplify automatically? > > > Thank you > Regards, > > Hanbing LI > > > _______________________________________________ > 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/20140612/62295036/attachment.html>
On 6/12/14, 11:03 AM, Chandler Carruth wrote:> > On Thu, Jun 12, 2014 at 4:45 PM, Hanbing Li <hanbing.li at inria.fr > <mailto:hanbing.li at inria.fr>> wrote: > > Hi, > > I know when a pass needs other passes, it will use something like > this: "AU.addRequired<LoopInfo>();". But this is usually used for > the analysis passes. > When a pass needs another transform pass, can it call it > automatically? > For example: > Some loop optimizations may need loop-simplify, I need add > -loop-simplify before calling these passes manually, or they can > call the pass -loop-simplify automatically? > > > Currently, the pass manager allows you (somewhat) to use the > addRequired mechanism even with analyses. However, I strongly > encourage you to not leverage it as it will eventually go away.Just out of curiosity, why is this feature going away? Regards, John Criswell -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20140612/3c0914cb/attachment.html>