<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><blockquote type="cite" class=""><div class="">On 31 May 2017, at 22:52, Vitaly Buka <<a href="mailto:vitalybuka@google.com" class="">vitalybuka@google.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">Is <a href="https://reviews.llvm.org/differential/diff/100829/" target="_blank" class="gmail-cremed cremed" style="font-size:12.8px">https://reviews.llvm.org/<wbr class="">differential/diff/100829/</a><span style="font-size:12.8px" class="">  replacement for </span><span style="font-size:12.8px" class="">r303341?</span><div class=""><span style="font-size:12.8px" class=""><br class=""></span></div><div class=""><span style="font-size:12.8px" class="">If so LGTM.</span></div></div></div></blockquote><div><br class=""></div><div>It's a few commits from my local git repo squashed into a single diff:</div><div>* D33590 and D33596 since I'd otherwise have to rewrite them.</div><div>* <span style="font-size: 12.8px;" class="">r303341</span></div><div><span style="font-size: 12.8px;" class="">* Three patches to convert the generated code to a state machine.</span></div><div>I'm currently finishing off the test updates to the state machine patches and posting them on llvm-commits.</div><br class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><div class=""><div class=""><span style="font-size:12.8px" class="">r303542 </span>msan  AArch64InstructionSelector.cpp: <span style="font-size:12.8px" class="">1m17.209s</span><span style="font-size:12.8px" class=""><br class=""></span></div><div class=""><div class=""><span style="font-size:12.8px" class="">r303542+</span><a href="https://reviews.llvm.org/differential/diff/100829/" target="_blank" class="gmail-cremed cremed" style="font-size:12.8px">diff/100829/</a>  msan  AArch64InstructionSelector.cpp:  1m24.724s</div></div></div></div></div></blockquote><div><br class=""></div><div>That's much better :-). Thanks for trying the patch.</div><br class=""><blockquote type="cite" class=""><div class=""><div class="gmail_extra"><div class="gmail_quote">On Wed, May 31, 2017 at 6:13 AM, Daniel Sanders <span dir="ltr" class=""><<a href="mailto:daniel_l_sanders@apple.com" target="_blank" class="">daniel_l_sanders@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="">Great! I expect I'll be able to cut it down further once I start fusing these smaller state-machines together. Before that, I'll re-order the patches that went into that diff so that I don't have to re-commit the regression before fixing it.<div class=""><div class="h5"><div class=""><div class=""><div class=""><br class=""><div class=""><blockquote type="cite" class=""><div class="">On 31 May 2017, at 13:48, Diana Picus <<a href="mailto:diana.picus@linaro.org" target="_blank" class="">diana.picus@linaro.org</a>> wrote:</div><br class="m_-5817535166028216979Apple-interchange-newline"><div class=""><div dir="ltr" class=""><div class="">Hi,</div><div class=""><br class=""></div>This runs in:<div class=""><div class="">real    13m6.296s</div><div class="">user    42m45.191s</div><div class="">sys     1m2.030s</div></div><div class=""><br class=""></div><div class="">(on top of a fully built r303542). It should be fine for the ARM bots.</div><div class=""><br class=""></div><div class="">However, you need to 'return std::move(M)' at line 1884.</div><div class=""><br class=""></div><div class="">@Vitaly, is it ok for your bots as well?</div><div class=""><br class=""></div><div class="">Cheers,</div><div class="">Diana</div></div><div class="gmail_extra"><br class=""><div class="gmail_quote">On 31 May 2017 at 10:21, Daniel Sanders <span dir="ltr" class=""><<a href="mailto:daniel_l_sanders@apple.com" target="_blank" class="">daniel_l_sanders@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="">Hi Diana and Vitaly,<div class=""><br class=""></div><div class="">Could you give <a href="https://reviews.llvm.org/differential/diff/100829/" target="_blank" class="">https://reviews.llvm.org/<wbr class="">differential/diff/100829/</a> a try? When measuring the compile of AArch64InstructionSelector.cpp<wbr class="">.o with asan enabled and running under instruments's Allocation profiler, my machine reports that the cumulative memory allocations is down to ~3.5GB (was ~10GB), the number of allocations down to ~4 million (was ~23 million), and the compile time down to ~15s (was ~60s).</div><div class=""><br class=""></div><div class="">The patch is based on r303542 and the main change is that most of the generated C++ has been replaced with a state-machine based implementation. It's not fully converted to a state-machine yet since it generates lots of smaller machines (one matcher and one emitter per rule) instead of a single machine but it's hopefully sufficient to unblock my patch series.</div><div class=""><div class="m_-5817535166028216979h5"><div class=""><br class=""></div><div class=""><div class=""><blockquote type="cite" class=""><div class="">On 26 May 2017, at 09:10, Diana Picus <<a href="mailto:diana.picus@linaro.org" target="_blank" class="">diana.picus@linaro.org</a>> wrote:</div><br class="m_-5817535166028216979m_-1218326532135719949Apple-interchange-newline"><div class=""><div class="">Ok, that sounds reasonable. I'm happy to test more patches for you<br class="">when they're ready.<br class=""><br class="">On 25 May 2017 at 17:39, Daniel Sanders <<a href="mailto:daniel_l_sanders@apple.com" target="_blank" class="">daniel_l_sanders@apple.com</a>> wrote:<br class=""><blockquote type="cite" class="">Thanks for trying that patch. I agree that 34 mins still isn't good enough but we're heading in the right direction.<br class=""><br class="">Changing the partitioning predicate to the instruction opcode rather than the number of operands in the top-level instruction will hopefully cut it down further. I also have a patch that shaves a small amount off of the compile-time by replacing the various LLT::scalar()/LLT::vector() calls with references to LLT objects that were created in advance. I tried something similar with the getRegBankForRegClass() but I haven't written that as a patch yet since that one requires some refactors to get access to a mapping that RegisterBankEmitter.cpp knows. In my experiment I edited this information into AArchGenGlobalISel.inc by hand.<br class=""><br class="">I think the real solution is to convert the generated C++ to the state-machine that we intended to end up with. I don't think we'll be able to put it off much longer given that we're hitting compile-time problems when we can only import 25% of the rules. That said, I have a couple more nearly-finished patches I'd like to get in before we introduce the state machine. Hopefully, the above tricks will be enough to save me a re-write.<br class=""><br class=""><blockquote type="cite" class="">On 25 May 2017, at 16:11, Diana Picus <<a href="mailto:diana.picus@linaro.org" target="_blank" class="">diana.picus@linaro.org</a>> wrote:<br class=""><br class="">Hi Daniel,<br class=""><br class="">I built r303542, then applied your patch and built again and it still takes<br class="">real    34m30.279s<br class="">user    84m36.553s<br class="">sys     0m58.372s<br class=""><br class="">This is better than the 50m I saw before, but I think we should try to<br class="">make it a bit faster. Do you have any other ideas to make it work?<br class=""><br class="">Thanks,<br class="">Diana<br class=""><br class=""><br class="">On 22 May 2017 at 11:22, Diana Picus <<a href="mailto:diana.picus@linaro.org" target="_blank" class="">diana.picus@linaro.org</a>> wrote:<br class=""><blockquote type="cite" class="">Hi Daniel,<br class=""><br class="">I did your experiment on a TK1 machine (same as the bots) and for r303258 I get:<br class="">real    18m28.882s<br class="">user    35m37.091s<br class="">sys     0m44.726s<br class=""><br class="">and for r303259:<br class="">real    50m52.048s<br class="">user    88m25.473s<br class="">sys     0m46.548s<br class=""><br class="">If I can help investigate, please let me know, otherwise we can just<br class="">try your fixes and see how they affect compilation time.<br class=""><br class="">Thanks,<br class="">Diana<br class=""><br class="">On 22 May 2017 at 10:49, Daniel Sanders <<a href="mailto:daniel_l_sanders@apple.com" target="_blank" class="">daniel_l_sanders@apple.com</a>> wrote:<br class=""><blockquote type="cite" class="">r303341 is the re-commit of the r303259 which tripled the number of rules<br class="">that can be imported into GlobalISel from SelectionDAG. A compile time<br class="">regression is to be expected but when I looked into it I found it was ~25s<br class="">on my machine for the whole incremental build rather than the ~12mins you<br class="">are seeing. I'll take another look.<br class=""><br class="">I'm aware of a couple easy improvements we could make to the way the<br class="">importer works. I was leaving them until we change it over to a state<br class="">machine but the most obvious is to group rules by their top-level gMIR<br class="">instruction. This would reduce the cost of the std::sort that handles the<br class="">rule priorities in generating the source file and will also make it simpler<br class="">for the compiler to compile it.<br class=""><br class=""><br class="">On 21 May 2017, at 11:16, Vitaly Buka <<a href="mailto:vitalybuka@google.com" target="_blank" class="">vitalybuka@google.com</a>> wrote:<br class=""><br class="">It must be r303341, I commented on corresponding llvm-commits thread.<br class=""><br class="">On Fri, May 19, 2017 at 7:34 AM, Diana Picus via llvm-dev<br class=""><<a href="mailto:llvm-dev@lists.llvm.org" target="_blank" class="">llvm-dev@lists.llvm.org</a>> wrote:<br class=""><blockquote type="cite" class=""><br class="">Ok, thanks. I'll try to do a bisect next week to see if I can find it.<br class=""><br class="">Cheers,<br class="">Diana<br class=""><br class="">On 19 May 2017 at 16:29, Daniel Sanders <<a href="mailto:daniel_l_sanders@apple.com" target="_blank" class="">daniel_l_sanders@apple.com</a>><br class="">wrote:<br class=""><blockquote type="cite" class=""><br class=""><blockquote type="cite" class="">On 19 May 2017, at 14:54, Daniel Sanders via llvm-dev<br class=""><<a href="mailto:llvm-dev@lists.llvm.org" target="_blank" class="">llvm-dev@lists.llvm.org</a>> wrote:<br class=""><br class="">r303259 will have increased compile-time since it tripled the number of<br class="">importable<br class="">SelectionDAG rules but a quick measurement building the affected file:<br class="">  ninja<br class="">lib/Target/<Target>/CMakeFiles<wbr class="">/LLVM<Target>CodeGen.dir/<<wbr class="">Target>InstructionSelector.<wbr class="">cpp.o<br class="">for both ARM and AArch64 didn't show a significant increase. I'll check<br class="">whether<br class="">it made a different to linking.<br class=""></blockquote><br class="">I don't think it's r303259. Starting with a fully built r303259, then<br class="">updating to r303258 and running 'ninja' gives me:<br class="">       real    2m28.273s<br class="">       user    13m23.171s<br class="">       sys     0m47.725s<br class="">then updating to r303259 and running 'ninja' again gives me:<br class="">       real    2m19.052s<br class="">       user    13m38.802s<br class="">       sys     0m44.551s<br class=""><br class=""><blockquote type="cite" class="">sanitizer-x86_64-linux-fast also timed out after one of my commits this<br class="">morning.<br class=""><br class=""><blockquote type="cite" class="">On 19 May 2017, at 14:14, Diana Picus <<a href="mailto:diana.picus@linaro.org" target="_blank" class="">diana.picus@linaro.org</a>> wrote:<br class=""><br class="">Hi,<br class=""><br class="">We've noticed that recently some of our bots (mostly<br class="">clang-cmake-armv7-a15 and clang-cmake-thumbv7-a15) started timing out<br class="">whenever someone commits a change to TableGen:<br class=""><br class="">r303418:<br class=""><a href="http://lab.llvm.org:8011/builders/clang-cmake-armv7-a15/builds/7268" target="_blank" class="">http://lab.llvm.org:8011/build<wbr class="">ers/clang-cmake-armv7-a15/<wbr class="">builds/7268</a><br class="">r303346:<br class=""><a href="http://lab.llvm.org:8011/builders/clang-cmake-armv7-a15/builds/7242" target="_blank" class="">http://lab.llvm.org:8011/build<wbr class="">ers/clang-cmake-armv7-a15/<wbr class="">builds/7242</a><br class="">r303341:<br class=""><a href="http://lab.llvm.org:8011/builders/clang-cmake-armv7-a15/builds/7239" target="_blank" class="">http://lab.llvm.org:8011/build<wbr class="">ers/clang-cmake-armv7-a15/<wbr class="">builds/7239</a><br class="">r303259:<br class=""><a href="http://lab.llvm.org:8011/builders/clang-cmake-armv7-a15/builds/7198" target="_blank" class="">http://lab.llvm.org:8011/build<wbr class="">ers/clang-cmake-armv7-a15/<wbr class="">builds/7198</a><br class=""><br class="">TableGen changes before that (I checked about 3-4 of them) don't have<br class="">this problem:<br class="">r303253:<br class=""><a href="http://lab.llvm.org:8011/builders/clang-cmake-armv7-a15/builds/7197" target="_blank" class="">http://lab.llvm.org:8011/build<wbr class="">ers/clang-cmake-armv7-a15/<wbr class="">builds/7197</a><br class=""><br class="">That one in particular actually finishes the whole build in 635s,<br class="">which is only a bit over 50% of the timeout limit (1200s). So, between<br class="">r303253 and now, something happened that made full builds<br class="">significantly slower. Does anyone have any idea what that might have<br class="">been? Also, has anyone noticed this on other bots?<br class=""><br class="">Thanks,<br class="">Diana<br class=""></blockquote><br class="">______________________________<wbr class="">_________________<br class="">LLVM Developers mailing list<br class=""><a href="mailto:llvm-dev@lists.llvm.org" target="_blank" class="">llvm-dev@lists.llvm.org</a><br class=""><a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" target="_blank" class="">http://lists.llvm.org/cgi-bin/<wbr class="">mailman/listinfo/llvm-dev</a><br class=""></blockquote><br class=""></blockquote>______________________________<wbr class="">_________________<br class="">LLVM Developers mailing list<br class=""><a href="mailto:llvm-dev@lists.llvm.org" target="_blank" class="">llvm-dev@lists.llvm.org</a><br class=""><a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" target="_blank" class="">http://lists.llvm.org/cgi-bin/<wbr class="">mailman/listinfo/llvm-dev</a><br class=""></blockquote><br class=""><br class=""><br class=""></blockquote></blockquote></blockquote><br class=""></blockquote></div></div></blockquote></div><br class=""></div></div></div></div></blockquote></div><br class=""></div>
</div></blockquote></div><br class=""></div></div></div></div></div></div></blockquote></div><br class=""></div>
</div></blockquote></div><br class=""></body></html>