<div dir="ltr"><br><br><div class="gmail_quote">On Tue Feb 10 2015 at 1:39:50 PM Hal Finkel <<a href="mailto:hfinkel@anl.gov">hfinkel@anl.gov</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">----- Original Message -----<br>
> From: "Quentin Colombet" <<a href="mailto:qcolombet@apple.com" target="_blank">qcolombet@apple.com</a>><br>
> To: "Eric Christopher" <<a href="mailto:echristo@gmail.com" target="_blank">echristo@gmail.com</a>><br>
> Cc: <a href="mailto:reviews%2BD7128%2Bpublic%2B3a2510f20967c21a@reviews.llvm.org" target="_blank">reviews+D7128+public+<u></u>3a2510f20967c21a@reviews.llvm.<u></u>org</a>, <a href="mailto:ohsallen@us.ibm.com" target="_blank">ohsallen@us.ibm.com</a>, <a href="mailto:hfinkel@anl.gov" target="_blank">hfinkel@anl.gov</a>,<br>
> <a href="mailto:llvm-commits@cs.uiuc.edu" target="_blank">llvm-commits@cs.uiuc.edu</a><br>
> Sent: Tuesday, February 10, 2015 3:32:26 PM<br>
> Subject: Re: [PATCH] Optimize unrolled reductions in LoopStrengthReduce<br>
><br>
> On Feb 10, 2015, at 1:22 PM, Eric Christopher < <a href="mailto:echristo@gmail.com" target="_blank">echristo@gmail.com</a> ><br>
> wrote:<br>
><br>
> Cautious is fine, but adding more register pressure heuristics to the<br>
> middle end just gets us to a point where everything is poorly done<br>
> via heuristics.<br>
><br>
><br>
> What do you think would be the right metric to control this<br>
> optimization?<br>
> My inclination right now was to use the same, if possible, heuristic<br>
> as the vectorizer, which IIRC, uses some register pressure<br>
> heuristic.<br>
><br>
> I am not saying this is good, I am saying that like every unrolling<br>
> technic we need to find a good balance between code size explosion<br>
> and performance improvements. Exposing too much ILP is probably not<br>
> a good idea.<br>
><br>
<br>
It would be nice to be able to do these transformations in the backend where we can really measure register pressure and instruction latencies; unfortunately, right now, we lack the right infrastructure for that -- and I think it is not obvious how to add it either (it's like having ScalarEvolution that operates at the MI level, plus some version of the SEExpander that locally re-runs the instruction selector).<br>
<br></blockquote><div><br></div><div><br></div><div>This is what I'm talking about yes.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Our current register-pressure heuristic in the vectorizer is also not terrific (especially because it considers everything to belong to one big register class with not enough registers), but improving that seems much easier than the alternatives.<br>
<br></blockquote><div><br></div><div>Heh. And why I really don't like it. I'd prefer to optimize harder and then figure out a way to undo it later.</div><div><br></div><div>-eric</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
 -Hal<br>
<br>
><br>
> -Quentin<br>
><br>
><br>
><br>
><br>
><br>
><br>
> -eric<br>
><br>
> On Tue Feb 10 2015 at 11:02:04 AM Quentin Colombet <<br>
> <a href="mailto:qcolombet@apple.com" target="_blank">qcolombet@apple.com</a> > wrote:<br>
><br>
><br>
> > FWIW I'm not such a huge fan of using register pressure heuristics<br>
> > in the middle end<br>
><br>
><br>
> FWIW, I agree, but this is not what LSR currently does and since the<br>
> backends do not expect that yet, I would prefer moving with<br>
> cautious.<br>
><br>
> Q.<br>
><br>
><br>
> <a href="http://reviews.llvm.org/D7128" target="_blank">http://reviews.llvm.org/D7128</a><br>
><br>
> EMAIL PREFERENCES<br>
> <a href="http://reviews.llvm.org/" target="_blank">http://reviews.llvm.org/</a> settings/panel/ emailpreferences/<br>
><br>
><br>
><br>
><br>
<br>
--<br>
Hal Finkel<br>
Assistant Computational Scientist<br>
Leadership Computing Facility<br>
Argonne National Laboratory<br>
</blockquote></div></div>