<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jan 28, 2014 at 7:57 PM, Arnold Schwaighofer <span dir="ltr"><<a href="mailto:aschwaighofer@apple.com" target="_blank">aschwaighofer@apple.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im"><br>
> This look OK? I just wanted to double check that there wasn't a specific reason to keep these two things separate. Hoping to get some good benchmarks on the new stuff you added soon.<br>
><br>
<br>
</div>I am a little concerned about this part:<br>
<br>
+  if (!Legal->getRuntimePointerCheck()->Need &&<br>
       LoopCost < SmallLoopCost) {<br>
<br>
This now guards all unrolling. We won’t unroll vectorized code if we need a runtime check where we did before. For example code that looks like the following snippet does not get unrolled.<br>
<br>
int foo_func(float *A, float *B, int N) {<br>
  for (i in 0..N)<br>
    A[i] *= B[i];<br>
}<br>
<br>
For optimal throughput we might want to unroll and vectorized this and we don’t mind the runtime check.<br>
<br>
I wanted unrolling for load/stores ports to not create an extra runtime check if there wasn’t already one and so I had the "!Legal->getRuntimePointerCheck()->Need” guard. Initially this code was in the if (VF == 1) section. When I ported the patch this got lost.</blockquote>
<div><br></div><div>Sure, makes sense. I didn't think of this only because I didn't see the VF==1, but the load/store heuristic I agree really only makes sense when we're unrolling unvectorized code.</div><div>
<br></div><div>Good to commit with that change? Do you want to add a test case for unrolling in the case of small vector code such as you describe? I suspect we're missing one.</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">
<br>
> Also, unrelated, but can you commit the register pressure tweak yet? Still need more benchmarking?<br>
<br>
</div>Yes, this still needs benchmarking. If you want I can commit it behind a flag.<br></blockquote></div><div class="gmail_extra"><br></div>Flags are actually the easiest way for me to benchmark things -- it lets me just pick up an automated build of our toolchain and run it through with different flags.</div>
<div class="gmail_extra"><br></div><div class="gmail_extra">-Chandler<br><br></div></div>