Thanks Michael. These reports are great for both me personally and the llvm community. It's very appreciated. <div><br></div><div>-eric<br><br><div class="gmail_quote"><div dir="ltr">On Tue, Apr 11, 2017, 7:49 PM Mikhail Zolotukhin via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>> wrote:<br></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="gmail_msg">Hi,<div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">It's been a while since I sent the last compile time report [1], where it was shown that LLVM was getting slower over time. But now I'm happy to bring some good news: finally, LLVM is getting faster, not slower :)</div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">*** Current status ***</div><div class="gmail_msg">Many areas of LLVM have been examined and improved since then: InstCombine, SCEV, APInt implementation, and that resulted in almost 10% improvement compared to January compiler. I remeasured compile time data for CTMark tests and annotated the biggest changes, the graphs for Os and O0-g are attached below. Thick black line represents geomean, colored thin lines represent individual tests. The data is normalized on the first revision in the range (which is ~Jun, 2015).</div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">*** Future work ***</div><div class="gmail_msg">There are still plenty of opportunities to make LLVM faster. Here is a list of some ideas that can further help compile-time:</div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">- KnownBits Cache. InstCombine and other passes use known bits, which often happens to be pretty expensive. Hal posted a patch [2] that implements a cache for known bits, but there are still some issues to fix there.</div><div class="gmail_msg">- SCEV. Some parts of SCEV still need to be improved. For instance, createAddRecFromPHI function seems to be very inefficient: it can perform many expensive traversals over entire function/loop nest, and most of them are probably redundant.</div><div class="gmail_msg">- Forming LCSSA. PR31851 reports that the current implementation of LCSSA forming can be expensive. A WIP patch [3] should address the problem, but probably there are more to be improved here.</div><div class="gmail_msg">- InstCombine vs InstSimplify. Currently we run InstCombine 6 times in our O3 pipeline. Probably, we don't need full InstCombine all 6 times, and some of its invocations can be replaced with a cheaper clean-up pass.</div><div class="gmail_msg">- Unnecessary pass dependencies. There are cases in which computing pass dependencies is much more expensive than running the pass itself (especially at O0). It might make sense to find such passes and try replacing their dependencies with lazy computations of required analyses (see e.g. [4]).</div><div class="gmail_msg">- libcxx. r249742 split a bunch of headers and resulted in noticeable compile time slowdowns. While the change itself seems to be necessary, it would be nice to find a way to mitigate the induced slowdowns.</div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">Of course, the list is far from complete, so if you happen to know other problematic areas, please let me know. Some of these ideas are already worked on, but there is always a room for volunteers here! So, if you'd like to work on LLVM compile time, please, let me know and let's join our efforts.</div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">Thanks for your time,</div><div class="gmail_msg">Michael</div><div class="gmail_msg"><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">[1] <a href="http://lists.llvm.org/pipermail/llvm-dev/2017-January/109188.html" class="gmail_msg" target="_blank">http://lists.llvm.org/pipermail/llvm-dev/2017-January/109188.html</a></div></div><div class="gmail_msg">[2] <a class="m_-6346665513826632624m_-3075486418410273754gmail-m_-1855108276665198409moz-txt-link-freetext gmail_msg" href="https://reviews.llvm.org/D31239" target="_blank">https://reviews.llvm.org/D31239</a></div><div class="gmail_msg">[3] <a href="https://reviews.llvm.org/D31843" class="gmail_msg" target="_blank">https://reviews.llvm.org/D31843</a></div><div class="gmail_msg">[4] <a href="https://reviews.llvm.org/D31302" class="gmail_msg" target="_blank">https://reviews.llvm.org/D31302</a></div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">CTMark -Os:</div><div class="gmail_msg"></div></div><div style="word-wrap:break-word" class="gmail_msg"><div class="gmail_msg"></div><div class="gmail_msg">CTMark -O0-g:</div><div class="gmail_msg"></div></div>
<div style="word-wrap:break-word" class="gmail_msg"><div class="gmail_msg"></div><div class="gmail_msg"><br class="gmail_msg"></div></div>
_______________________________________________<br class="gmail_msg">
LLVM Developers mailing list<br class="gmail_msg">
<a href="mailto:llvm-dev@lists.llvm.org" class="gmail_msg" target="_blank">llvm-dev@lists.llvm.org</a><br class="gmail_msg">
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" class="gmail_msg" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br class="gmail_msg">
</blockquote></div></div>