<html><head><meta http-equiv="Content-Type" content="text/html; charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div class="">Hi,</div><div><br class=""></div><div>+ Chandler, who has a lot more experience with our pass managers.</div><div><br class=""><blockquote type="cite" class=""><div class="">On Apr 20, 2018, at 12:56 PM, Son Tuan VU <<a href="mailto:sontuan.vu119@gmail.com" class="">sontuan.vu119@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">+ Vedant: what do you think about the last point, since Debugify is also related?<br class=""></div></div></blockquote><div><br class=""></div><div>Could you clarify the question? I'm not sure what it is you'd like me to chime in about.</div><div><br class=""></div><div><br class=""></div><div><div class=""></div><blockquote type="cite" class=""><div class="">2, I've asked this question once but have had no answer, so I'm gonna revive it here: in <b class="">opt</b>, the <b class="">verify-each</b> mode is only activated when we provide a pass name or a pipeline (list of pass names).  I guess this is intended, but I expect that <b class="">verify-each</b> to insert <b class="">Verifier</b> to the whole pipeline after each optimization pass, even when I pass -O1/2/3/s/z to <b class="">opt</b>.  And I assume others do expect the same thing.</div></blockquote><div><br class=""></div><div>I'd expect the same thing. I'm pretty sure it's a missing feature that -verify-each doesn't apply at opt -O1/etc.</div><div><br class=""></div><br class=""><blockquote type="cite" class=""><div class="">The 2nd question lead me to another idea: if we really want to make <b class="">verify-each</b> to work on any pipeline (not only user-provided ones), and we'll soon have a <b class="">debugify-each</b> option, should we refactor the code to have a <b class="">apply-after-each=pass-name</b> option that automatically inserts <b class="">pass-name </b>to the pipeline after each optimization pass?  We can even replace <b class="">print-after-all</b> option with <b class="">apply-after-each=PrintModulePassWrapper </b>for example?</div></blockquote><br class=""></div><div>Speaking for myself, I'd rather type "opt -foo-each" over "opt -apply-after-each=foo".</div><div><br class=""></div><div>best,</div><div>vedant</div><div><br class=""></div><br class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><div class=""><div class="gmail_extra"><br clear="all" class=""><div class=""><div class="m_-4988062535238603916gmail_signature" data-smartmail="gmail_signature"><div dir="ltr" class="">Son Tuan Vu</div></div></div>
<br class=""><div class="gmail_quote">On Thu, Apr 19, 2018 at 6:14 PM, Philip Pfaffe <span dir="ltr" class=""><<a href="mailto:philip.pfaffe@gmail.com" target="_blank" class="">philip.pfaffe@gmail.com</a>></span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr" class="">Hi Son,<div class=""><br class=""></div><div class="">PassManagerBuilder is used to populate legacy PassManagers.  That role is taken over by PassBuilder for new-PM passes.</div><div class=""><br class=""></div><div class="">Cheers,</div><div class="">Philip</div></div><div class="m_-4988062535238603916HOEnZb"><div class="m_-4988062535238603916h5"><div class="gmail_extra"><br class=""><div class="gmail_quote">2018-04-18 13:40 GMT+02:00 Son Tuan VU <span dir="ltr" class=""><<a href="mailto:sontuan.vu119@gmail.com" target="_blank" class="">sontuan.vu119@gmail.com</a>></span>:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr" class="">Hi Philip,<div class=""><br class=""></div><div class="">Thank you for your reply. So what would be the right way/API to write out-of-tree pass? I've been using <b class="">PassManagerBuilder</b>, which requires a callback refering to <b class="">legacy::PassManagerBase</b>, so I guess this will be no longer the good way to go?</div></div><div class="gmail_extra"><span class="m_-4988062535238603916m_2100459851225606617HOEnZb"><font color="#888888" class=""><br clear="all" class=""><div class=""><div class="m_-4988062535238603916m_2100459851225606617m_-4342999132220212639gmail_signature" data-smartmail="gmail_signature"><div dir="ltr" class="">Son Tuan Vu</div></div></div></font></span><div class=""><div class="m_-4988062535238603916m_2100459851225606617h5">
<br class=""><div class="gmail_quote">On Tue, Apr 17, 2018 at 6:06 PM, Philip Pfaffe <span dir="ltr" class=""><<a href="mailto:philip.pfaffe@gmail.com" target="_blank" class="">philip.pfaffe@gmail.com</a>></span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr" class="">Hi Son,<div class=""><br class=""></div><div class="">I have an answer to your first question:<br class=""><div class=""><br class=""><div class="gmail_extra"><div class="gmail_quote"><span class=""><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr" class=""><div class="">1, What are the differences between <b class="">LegacyPassManager</b> and <b class="">PassManager</b>?  I see that <b class="">opt</b> uses the former most of the times while the latter is used via <b class="">PassBuilder</b> API when an user wants to build her own pipeline, but I have no idea why so. What to use and when to use it is not clear to me.</div></div></blockquote></span><div class="">PassManager is the result of a long going effort to replace the default pass manager of opt and clang. Here's the original RFC containing the motivation: <a href="http://lists.llvm.org/pipermail/llvm-dev/2012-July/051643.html" target="_blank" class="">http://lists.llvm.org/pipermai<wbr class="">l/llvm-dev/2012-July/051643.ht<wbr class="">ml</a></div><div class=""><br class=""></div><div class="">LegacyPassManager is currently still the default, but we are really close to switching over the the new one. Both opt and clang have switches to enable the new one, by calling `opt -passes="...."` or `clang -fexperimental-new-pass-manage<wbr class="">r`. PassBuilder is essentially a big factory to produce PassManager and AnalysisManager objects for the passes and analyses included in core LLVM. If you develop analyses and passes, I'd suggest doing so against the new PM, especially if you plan on upstreaming your work.</div><div class=""><br class=""></div><div class="">Cheers,</div><div class="">Philip</div></div></div></div></div></div>
</blockquote></div><br class=""></div></div></div>
</blockquote></div><br class=""></div>
</div></div></blockquote></div><br class=""></div></div></div>
</div></blockquote></div><br class=""></body></html>