<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On May 17, 2016, at 6:39 PM, Chandler Carruth <<a href="mailto:chandlerc@gmail.com" class="">chandlerc@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><div class="gmail_quote"><div dir="ltr" class="">On Mon, May 16, 2016 at 6:36 PM Quentin Colombet via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" class="">llvm-dev@lists.llvm.org</a>> wrote:<br class=""></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word" class=""><div class="">Hi,</div><div class=""><br class=""></div>DAG combiner does indeed optimizations but also canonicalization.<div class="">The latter, we probably need to keep, the former, we should be able to disable.</div><div class=""><br class=""></div><div class="">When I asked Marianne to do a RFC about this, I was hoping we could get new ideas on how to tackle this problem.</div><div class=""><br class=""></div><div class="">I am fine with the approach of disabling the optimizations one by one when we know it is indeed an optimization. However, I am not a fan of having "if (OptLevel == <...>)" scattered all around the place.</div><div class="">Instead, I would like to have a sort of list of optimizations that differ between the opt level == none and the other opt level, then we run just that list.</div><div class=""><br class=""></div><div class="">In other words, I was thinking we could have some kind of registration mechanism for each optimization and this is a matter of classifying them.</div><div class=""><br class=""></div><div class="">Anyhow, what are other people thoughts?</div></div></blockquote><div class=""><br class=""></div><div class="">I think the hard part here is that we're really, really bad at registration systems. ;]</div><div class=""><span style="line-height:1.5" class=""><br class=""></span></div><div class=""><span style="line-height:1.5" class="">I think switching DAGCombine to use a registration system so that we can use that registration system to also declare a classification between optimizations and canonicalizations that are necessary for lowering would be a *huge* change, if a really good one.</span></div><div class=""><span style="line-height:1.5" class=""><br class=""></span></div><div class=""><span style="line-height:1.5" class="">My question is: is it worth that in the face of progress towards global isel? I'm not sure it is, but I'm also not sure it isn't. =/ this seems to be a hard tradeoff question.</span><br class=""></div></div></div></div></blockquote><div><br class=""></div><div>Agree, I don’t think it makes sense to do that in SDISel. Though I was curious to have ideas to see how we would tackle that when we eventually do combines in GISel.</div><div><br class=""></div><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><div class="gmail_quote"><div class=""><span style="line-height:1.5" class=""><br class=""></span></div><div class=""><span style="line-height:1.5" class="">I wonder, is the sprinkling of conditions in dag combining code for this going to be significantly worse than the existing sprinkling of conditions to select whether a combine is pre- or post-legalization (for each of the different phases of legalization)? If it is going to be significantly less intrusive, then it might make more sense to just hack the DAG combines with conditions to address the immediate problem rather than taking on the whole task of moving to a mechanical dispatching system for combines. If it would make the situation 2x worse though (that is, it has the same level of overhead), then perhaps it does make sense to do the big refactoring first.</span></div></div></div></div></blockquote><div><br class=""></div><div>Agreed.</div><div><br class=""></div><div>Q.</div><br class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><div class="gmail_quote"><div class=""><span style="line-height:1.5" class=""><br class=""></span></div><div class=""><span style="line-height:1.5" class="">-Chandler</span></div></div></div>
</div></blockquote></div><br class=""></body></html>