<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=""><br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On Apr 20, 2018, at 1:46 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=""><div class="">Hi Vedant,<br class=""><br class=""></div>Thanks for your reply. More comments inline.<br class=""><div class="gmail_extra"><br clear="all" class=""><div class=""><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr" class="">Son Tuan Vu</div></div></div>
<br class=""><div class="gmail_quote">On Fri, Apr 20, 2018 at 10:19 PM, Vedant Kumar <span dir="ltr" class=""><<a href="mailto:vsk@apple.com" target="_blank" class="">vsk@apple.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 style="word-wrap:break-word;line-break:after-white-space" class=""><div class="">Hi,</div><div class=""><br class=""></div><div class="">+ Chandler, who has a lot more experience with our pass managers.</div><div class=""><span class=""><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" target="_blank" class="">sontuan.vu119@gmail.com</a>> wrote:</div><br class="m_-7496564123560258389Apple-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 class=""><br class=""></div></span><div class="">Could you clarify the question? I'm not sure what it is you'd like me to chime in about.</div><div class=""><br class=""></div></div></div></blockquote><div class="">I guess you now know what I wanted to ask?</div></div></div></div></div></blockquote><div><br class=""></div>I think there was a little confusion, as I thought the "last point" was something Philip had said. I suppose you just meant question #2 from your first email.</div><div><br class=""></div><div><br class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word;line-break:after-white-space" class=""><div class=""><div class=""></div><div class=""><br class=""></div><div class=""><span class=""><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 class=""><br class=""></div></span><div class="">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><span class=""><div class=""><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> <wbr class="">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=<wbr class="">PrintModulePassWrapper </b>for example?</div></blockquote><br class=""></span></div><div class="">Speaking for myself, I'd rather type "opt -foo-each" over "opt -apply-after-each=foo".</div></div></div></blockquote><div class=""><br class=""></div><div class="">I agree that "opt -foo-each" would be easier and more intuitive, but if someone ever wants to apply foo after each pass, she will have to hack into opt and write her own custom PassManager. Or maybe this situation is not likely to happen?  <br class=""></div></div></div></div></div></blockquote><div><br class=""></div><div>This doesn't seem like a common scenario to me.</div><div><br class=""></div><div>vedant</div><br class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word;line-break:after-white-space" class=""><div class=""><div class=""><br class=""></div><div class="">best,</div><div class="">vedant</div><span class=""><div class=""><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_-7496564123560258389m_-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_-7496564123560258389m_-4988062535238603916HOEnZb"><div class="m_-7496564123560258389m_-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_-7496564123560258389m_-4988062535238603916m_2100459851225606617HOEnZb"><font color="#888888" class=""><br clear="all" class=""><div class=""><div class="m_-7496564123560258389m_-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_-7496564123560258389m_-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></span></div><br class=""></div></blockquote></div><br class=""></div></div>
</div></blockquote></div><br class=""></body></html>