<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jun 30, 2016 at 4:26 PM, Xinliang David Li <span dir="ltr"><<a href="mailto:davidxl@google.com" target="_blank">davidxl@google.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><span class=""><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_quote"><div><br></div><div>I would still really love to talk about any concerns or problems you see with the design. Currently the one I'm thinking about the most is quadratic behaviors, but if there are other concerns I'd like to discuss them.</div></div></div></blockquote><div><br></div><div><br></div></span><div>I may be repeating myself, but I would like to summarize my concerns and position here:</div><div><br></div><div>1. We have a goal to make the pass manager to use the new PM. There are many known/concrete performance improvements depending on that (there is possible short term solution that does not depend on new PM, but we've decided to make them depend on new PM switch anyway).  Note the PM switch is already a very large task with potential risks, coupling that task with another huge change is not the right plan going forward.  The right way is to make *minimal* changes enable new PM as soon as possible and make incremental improvement of other parts later.  The longer we delay, the longer the community suffers.</div><div><br></div><div>2. Changes with this scale needs to be justified with concrete benefit. If there are anything real missing, we should have known them already. </div><div>  </div><div>3. With changes in core infrastructure like this, subtle bugs are likely to be very hard to debug. When a bug is introduced, there will no way for user to workaround it (such as by disabling a pass). This is reason why core piece like this needs to kept simple</div><div><br></div><div>4. The patch introduces a new SCC formation algorithm (double layer with support for CG mutation on the fly), however design document on how this works is missing.  It needs to document </div><div>    * What exactly is expected (in terms of vistation order) when a) an edge is added; b) an edge is deleted; c) when a new node is introduced and connected. </div><div>    * How ref-edges are formed, how indirect callsites are handled etc.</div><div>    * If it is a modification of the classic SCC formation algorithm, describe the change and prove that the algorithm works as expected.</div><div><br></div><div>Having a document like this also helps reviewers of the code (for reasoning of the correctness).  Without this, I suspect very few people can help with maintaining the code in the future.</div><div><br></div><div>5.  Another added complexity is that the SCC passes are now required to do the updates -- it seems pretty obscure to the pass writers.</div><div><br></div><div>6. What is the plan to address the quadratic behavior?</div><div><br></div><div>7. Is this tested on large programs (e.g, in LTO mode)?  How large is the RefSCC graph? How much memory overhead is expected? What is the compile time impact?</div><div><br></div><div>8. This change makes new PM transition not NFC.  It can potentially affect a lot of other people, e.g., introduced performance regression, correctness issue etc.</div><div><br></div><div>So in short, my proposal is that we do minimal work in CGSCC pass manager to enable/unblock porting of inliner to the the new PM, and we can revisit/re-examine this patch in depth later when new PM is in place.  Does it make sense?</div></div></div></div></blockquote><div><br></div><div>I have posted the proof of concept port of the old PM visitation to the new PM. <a href="http://reviews.llvm.org/D21921">http://reviews.llvm.org/D21921</a></div><div>The proof of concept also ports all the remaining CGSCC passes as a quick sanity check.</div><div><br></div><div>Please take a look, everybody.</div><div><br></div><div>-- Sean Silva</div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div><br></div><div>thanks,</div><div><br></div><div>David</div><span class=""><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_quote"><span><div><span style="line-height:1.5"> </span><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_quote"><span><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div> Regardless, if/when the evidence appears for those cases being important to optimize, we can add them; porting to the new PM is orthogonal.</div><div><br></div><div>[*] Hopefully I will start an RFC and send out a proof of concept patch tomorrow; I just need to test out a proof of concept port of the inliner on something bigger to make sure everything works.<br></div></div></div></div></blockquote><div><br></div></span><div>As I have said in this thread, several other threads when LazyCallGraph was first designed, and in several other discussions, I continue to think this is the wrong approach.</div></div></div></blockquote><div><br></div></div></div></div><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div>Can you provide links to those discussions? I can't find anything in my email.</div></div></div></div></blockquote><div><br></div></span><div>I have tried very hard to find them, and haven't succeeded. Really sorry about this. I know some of them took place outside of email sadly, but my memory is that some did take place in the discussion threads around the pass manager and the need for having a cache key for SCCs.</div><div><br></div><div>That said, my only real goal in mentioning this is that I don't want you or others to think that this is something that was never discussed. I even clearly remember Hal having reservations about this. ;] I know I myself would have preferred to maintain precise similarity to the current pass manager, but I don't see a way that results in a robust interaction with cache based management of analyses.</div><div><br></div><div>Anyways, I'm happy to try to explain this freshly if useful, but I'm not sure what the remaining points of contention or confusion are.</div></div></div>
</blockquote></span></div><br></div></div>
</blockquote></div><br></div></div>