<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=""><div class="">Hi Diana,</div><br class=""><div><blockquote type="cite" class=""><div class="">On May 19, 2017, at 1:33 AM, Diana Picus <<a href="mailto:diana.picus@linaro.org" class="">diana.picus@linaro.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">On 18 May 2017 at 19:09, Quentin Colombet <</span><a href="mailto:qcolombet@apple.com" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;" class="">qcolombet@apple.com</a><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">> wrote:</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><blockquote type="cite" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;" class="">Hi Diana,<br class=""><br class=""><blockquote type="cite" class="">On May 18, 2017, at 1:15 AM, Diana Picus <<a href="mailto:diana.picus@linaro.org" class="">diana.picus@linaro.org</a>> wrote:<br class=""><br class="">On 18 May 2017 at 09:06, Kristof Beyls <<a href="mailto:Kristof.Beyls@arm.com" class="">Kristof.Beyls@arm.com</a>> wrote:<br class=""><blockquote type="cite" class="">I think Diana found that when enabling r299283, the bootstrap failed with<br class="">llvm-tblgen segfaulting.<br class="">So there clearly is some work required there.<br class=""></blockquote><br class="">Indeed.<br class=""><br class="">@Quentin, what is the status of that patch?<br class=""></blockquote><br class="">Initially it was meant as a prototype to investigate how we could address those issues at O0. I didn’t mean to publish it.<br class=""><br class=""><blockquote type="cite" class="">Have you been working on<br class="">it since then?<br class=""></blockquote><br class="">No, I haven’t touched it and I honestly didn’t plan to do that.<br class=""><br class=""><blockquote type="cite" class="">Should I investigate the segfault more and send you a<br class="">reproducer?<br class=""></blockquote><br class="">Depends, do you guys want to pursue in that direction?<br class=""></blockquote><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">Not necessarily, if you think a better reg alloc scheme will do the</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">trick then I see no point in complicating the pass pipeline for now.</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><blockquote type="cite" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;" class="">My though was that it is probably best to rely on a better reg allocator (basic or greedy) scheme for O0. I believe the only concern may be compile time but it may  just fly (+ I have ideas how to make it better pretty easy).<br class=""><br class=""><blockquote type="cite" class="">Is this patch the way forward, or do you have other ideas<br class="">for reducing the stack usage?<br class=""></blockquote><br class="">Better reg alloc scheme for O0 :).<br class=""></blockquote><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">Ok, let's go with that then :)</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""></div></blockquote><div><br class=""></div><div>Sounds good, let me push a patch that would allow to use the greedy allocator at O0 and see if that’s sufficient. Then, we will look at the compile time that change will imply.</div><div><br class=""></div><div>Cheers,</div><div>-Quentin</div><br class=""><blockquote type="cite" class=""><div class=""><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><blockquote type="cite" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;" class=""><br class=""><blockquote type="cite" class=""><br class="">Thanks,<br class="">Diana<br class=""><br class=""><blockquote type="cite" class=""><br class="">Thanks,<br class=""><br class="">Kristof<br class=""><br class=""><br class="">On 16 May 2017, at 14:06, Diana Picus via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" class="">llvm-dev@lists.llvm.org</a>><br class="">wrote:<br class=""><br class="">Turns out it really is a GlobalISel issue - we eat up too much stack<br class="">space because all the constants used in the switches are stored on the<br class="">stack. We need to fix this somehow before changing the default. I'll<br class="">try to give it a run with Quentin's r299283 on top to see if it helps.<br class=""><br class="">Cheers,<br class="">Diana<br class=""><br class="">On 15 May 2017 at 09:38, Diana Picus <<a href="mailto:diana.picus@linaro.org" class="">diana.picus@linaro.org</a>> wrote:<br class=""><br class="">Got another one: <a href="https://bugs.llvm.org/show_bug.cgi?id=33036" class="">https://bugs.llvm.org/show_bug.cgi?id=33036</a><br class=""><br class="">I'm still investigating whether this is an actual GlobalISel issue or<br class="">something else (I'll also start a build on a more recent revision to<br class="">see how that behaves).<br class=""><br class="">On 12 May 2017 at 20:06, Eric Christopher <<a href="mailto:echristo@gmail.com" class="">echristo@gmail.com</a>> wrote:<br class=""><br class="">Agreed. That was probably just luck before :)<br class=""><br class="">-eric<br class=""><br class="">On Fri, May 12, 2017 at 5:22 AM Diana Picus via llvm-dev<br class=""><<a href="mailto:llvm-dev@lists.llvm.org" class="">llvm-dev@lists.llvm.org</a>> wrote:<br class=""><br class=""><br class="">It turns out that can be fixed by adding -lm to the link line, so I<br class="">will probably convert it into a test-suite bug.<br class=""><br class="">I don't suppose it's crucial to handle the fabs intrinsic nicely at -O0.<br class=""><br class="">On 12 May 2017 at 13:44, Diana Picus <<a href="mailto:diana.picus@linaro.org" class="">diana.picus@linaro.org</a>> wrote:<br class=""><br class="">Hi,<br class=""><br class="">I ran into a little snag on the test-suite:<br class=""><a href="https://bugs.llvm.org/show_bug.cgi?id=33021" class="">https://bugs.llvm.org/show_bug.cgi?id=33021</a><br class="">It boils down to GlobalISel generating calls to fabs instead of using<br class="">FABSDr (so we get undefined references).<br class=""><br class="">Cheers,<br class="">Diana<br class=""><br class="">On 11 May 2017 at 18:40, Quentin Colombet <qcolombet@apple.com> wrote:<br class=""><br class="">Hi Diana,<br class=""><br class="">Thanks for the summary.<br class=""><br class="">On May 11, 2017, at 4:01 AM, Diana Picus <diana.picus@linaro.org><br class="">wrote:<br class=""><br class="">Hi all,<br class=""><br class="">I'm still running some validation on this, I'll send an email when<br class="">it's done. If that goes well I don't have anything against making the<br class="">switch.<br class=""><br class="">For the record, here's a summary of issues that were deferred for<br class="">later on (some of which are optimization-ish and we might decide to<br class="">never do at -O0 at all):<br class="">* Crash in RegBankSelect for half fp types:<br class="">https://bugs.llvm.org/show_bug.cgi?id=32560<br class=""><br class=""><br class="">I’ll have a look.<br class=""><br class="">* Improving constant placement:<br class="">http://bugs.llvm.org/show_bug.cgi?id=32561<br class=""><br class=""><br class="">I’ve commented in the PR to mention the localizer technic I was playing<br class="">with, if someone wants to give it a try.<br class=""><br class="">* Fancy switch lowering<br class="">* Transforming division-by-constant-power-of-2 into right shift<br class=""><br class=""><br class="">AFAICT all the other issues that were brought up were fixed (yay!).<br class=""><br class="">Cheers,<br class="">Diana<br class=""><br class=""><br class="">Cheers,<br class="">-Quentin<br class=""><br class=""><br class=""><br class="">On 11 May 2017 at 08:44, Kristof Beyls via llvm-dev<br class=""><llvm-dev@lists.llvm.org> wrote:<br class=""><br class=""><br class="">On 10 May 2017, at 17:36, Quentin Colombet <qcolombet@apple.com> wrote:<br class=""><br class=""><br class="">MultiSource/Benchmarks/mediabench/mpeg2/mpeg2dec/mpeg2decode (46%):<br class="">Function<br class="">Reference_IDCT: Probably due to creating all constants in the entry BB<br class="">+<br class="">spilling floating point data through an X register:<br class=""><br class="">FastISel:<br class="">fadd d0, d1, d0<br class="">str d0, [sp,#528]<br class="">GlobalISel:<br class="">fadd d0, d1, d0<br class="">fmov x9, d0<br class="">stur x9, [x29,#-48]<br class=""><br class=""><br class="">Good finding, I forgot to do stores in my previous fix. I’ll do them<br class="">shortly.<br class=""><br class=""><br class="">Should be fixed by r302679<br class=""><br class=""><br class="">Thanks Quentin,<br class=""><br class="">That reduces the slow-down when enabling globalisel at -O0 from 13% (on<br class="">r302453)  to 9.5% (on r302679) in my experiments.<br class="">The code size increase also reduces from just over 3% to 2.8%.<br class=""><br class="">Kristof<br class=""><br class=""><br class="">_______________________________________________<br class="">LLVM Developers mailing list<br class="">llvm-dev@lists.llvm.org<br class="">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev<br class=""><br class=""><br class="">_______________________________________________<br class="">LLVM Developers mailing list<br class="">llvm-dev@lists.llvm.org<br class="">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev<br class=""><br class="">_______________________________________________<br class="">LLVM Developers mailing list<br class="">llvm-dev@lists.llvm.org<br class="">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</blockquote></blockquote></blockquote></div></blockquote></div><br class=""></body></html>