<div dir="ltr">Hi Ayal, Elena,<div><br></div><div>I'd really like to enable this by default.</div><div><br></div><div>As I wrote above, I didn't see any regressions in internal benchmarks, and there doesn't seem to be anything in SPEC2006 either. I do see a performance improvement in an internal benchmark (that is, a real workload). <br></div><div><br></div><div>Would you be able to provide an example that gets pessimized? I have no doubt you've seen regressions related to this, but the fact they exist doesn't help me analyze them as long as I can't see them. :-) I'd really rather look at regressions before making the change - and either try to make the necessary improvements to the cost model, or abandon this as unfeasible for now (pending Ashutosh's work). </div><div><br></div><div>If you can't, an alternative is to turn this on, and then, if regressions show up on anyone's radar (where we can actually get a reproducer), turn it off again and go back to analysis. But I'd strongly prefer to "prefetch" the problem.</div><div><br></div><div>Thanks,</div><div> Michael</div><div><br></div><div><br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Aug 10, 2016 at 4:32 PM, Michael Kuperstein <span dir="ltr"><<a href="mailto:mkuper@google.com" target="_blank">mkuper@google.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">So, unfortunately, it turns out I don't have access to DENBench.<div><br></div><div>Do you happen to have a reduced example that gets pessimized by this?</div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Aug 9, 2016 at 11:25 AM, Michael Kuperstein <span dir="ltr"><<a href="mailto:mkuper@google.com" target="_blank">mkuper@google.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Thanks Ayal!<div><br></div><div>I'll take a look at DENBench.</div><div><br></div><div>As another data point - I tried enabling this on our internal benchmarks. I'm seeing one regression, and it seems to be a regression of the "good" kind - without interleaving we don't vectorize the innermost loop, and with interleaving we do. The vectorized loop is actually significantly faster when benchmarked in isolation, but in this specific instance, the static loop count is unknown, and the dynamic loop count happens to almost always be 1 - and this lives inside a hot outer loop.</div><div>That's something we ought to be handling through PGO (or, conceivably, outer loop vectorization :-) ).</div><span class="m_7447484640176171171HOEnZb"><font color="#888888"><div><br></div><div>Michael</div></font></span></div><div class="m_7447484640176171171HOEnZb"><div class="m_7447484640176171171h5"><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Aug 8, 2016 at 3:21 PM, Zaks, Ayal <span dir="ltr"><<a href="mailto:ayal.zaks@intel.com" target="_blank">ayal.zaks@intel.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div lang="EN-US" link="blue" vlink="purple">
<div class="m_7447484640176171171m_-5114204913764254463m_-1520058666220918778WordSection1"><span>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">></span><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"> We also need to understand what to do with edge elements in the vector
if their loading is not required. We, probably, should issue a masked load in this case.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"><u></u> <u></u></span></p>
</span><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">The existing code solves such edge cases where the last element of an InterleaveGroup is absent by making sure the last iteration (and up to last VF iterations)
are peeled and executed scalarly; see requiresScalarEpilogue.</span><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"><u></u><u></u></span></p><span>
<p class="MsoNormal"><a name="m_7447484640176171171_m_-5114204913764254463_m_-1520058666220918778__MailEndCompose"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"><u></u> <u></u></span></a></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">></span><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"> All regressions that we see are in 32-bit mode.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"><u></u> <u></u></span></p>
</span><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">One place to find them, using the default BaseT::getInterleavedMemoryOpC<wbr>ost(), is DENBench’s RGB conversions.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">Ayal.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"><u></u> <u></u></span></p>
<div>
<div style="border:none;border-top:solid #e1e1e1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><a name="m_7447484640176171171_m_-5114204913764254463_m_-1520058666220918778______replyseparator"></a><b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">From:</span></b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"> Demikhovsky, Elena
<br>
<b>Sent:</b> Monday, August 08, 2016 00:09<br>
<b>To:</b> Michael Kuperstein <<a href="mailto:mkuper@google.com" target="_blank">mkuper@google.com</a>>; Renato Golin <<a href="mailto:renato.golin@linaro.org" target="_blank">renato.golin@linaro.org</a>><br>
<b>Cc:</b> Matthew Simpson <<a href="mailto:mssimpso@codeaurora.org" target="_blank">mssimpso@codeaurora.org</a>>; Nema, Ashutosh <<a href="mailto:Ashutosh.Nema@amd.com" target="_blank">Ashutosh.Nema@amd.com</a>>; Sanjay Patel <<a href="mailto:spatel@rotateright.com" target="_blank">spatel@rotateright.com</a>>; llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>>; Zaks, Ayal <<a href="mailto:ayal.zaks@intel.com" target="_blank">ayal.zaks@intel.com</a>><br>
<b>Subject:</b> RE: [llvm-dev] enabling interleaved access loop vectorization<u></u><u></u></span></p>
</div>
</div><div><div class="m_7447484640176171171m_-5114204913764254463h5">
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">We checked the gathered data again. All regressions that we see are in 32-bit mode. The 64-bit mode looks good overall.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal" style="margin-left:36.0pt">
<u></u><span style="font-family:"Calibri",sans-serif;color:#2f5496"><span>-<span style="font:7.0pt "Times New Roman"">
</span></span></span><u></u><span dir="LTR"></span><b><i><span style="color:#2f5496"> Elena<u></u><u></u></span></i></b></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"><u></u> <u></u></span></p>
<div style="border:none;border-left:solid blue 1.5pt;padding:0cm 0cm 0cm 4.0pt">
<div>
<div style="border:none;border-top:solid #e1e1e1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">From:</span></b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"> Michael Kuperstein [</span><a href="mailto:mkuper@google.com" target="_blank"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">mailto:mkuper@google.com</span></a><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">]
<br>
<b>Sent:</b> Saturday, August 06, 2016 02:56<br>
<b>To:</b> Renato Golin <</span><a href="mailto:renato.golin@linaro.org" target="_blank"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">renato.golin@linaro.org</span></a><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">><br>
<b>Cc:</b> Demikhovsky, Elena <</span><a href="mailto:elena.demikhovsky@intel.com" target="_blank"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">elena.demikhovsky@intel.com</span></a><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">>; Matthew
Simpson <</span><a href="mailto:mssimpso@codeaurora.org" target="_blank"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">mssimpso@codeaurora.org</span></a><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">>; Nema, Ashutosh <</span><a href="mailto:Ashutosh.Nema@amd.com" target="_blank"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">Ashutosh.Nema@amd.com</span></a><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">>;
Sanjay Patel <</span><a href="mailto:spatel@rotateright.com" target="_blank"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">spatel@rotateright.com</span></a><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">>; llvm-dev <</span><a href="mailto:llvm-dev@lists.llvm.org" target="_blank"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">llvm-dev@lists.llvm.org</span></a><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">>;
Zaks, Ayal <</span><a href="mailto:ayal.zaks@intel.com" target="_blank"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">ayal.zaks@intel.com</span></a><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">><br>
<b>Subject:</b> Re: [llvm-dev] enabling interleaved access loop vectorization<u></u><u></u></span></p>
</div>
</div>
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<p class="MsoNormal" style="margin-left:46.2pt"><u></u> <u></u></p>
<div>
<p class="MsoNormal" style="margin-left:46.2pt"><u></u> <u></u></p>
<div>
<p class="MsoNormal" style="margin-left:46.2pt">On Fri, Aug 5, 2016 at 4:37 PM, Renato Golin <<a href="mailto:renato.golin@linaro.org" target="_blank">renato.golin@linaro.org</a>> wrote:<u></u><u></u></p>
<blockquote style="border:none;border-left:solid #cccccc 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-top:5.0pt;margin-right:0cm;margin-bottom:5.0pt">
<p class="MsoNormal" style="margin-right:0cm;margin-bottom:12.0pt;margin-left:46.2pt">
On 6 August 2016 at 00:18, Michael Kuperstein <<a href="mailto:mkuper@google.com" target="_blank">mkuper@google.com</a>> wrote:<br>
> I agree that we can get *more* improvement with better cost modeling, but<br>
> I'd expect to be able to get *some* improvement the way things are right<br>
> now.<br>
<br>
Elena said she saw "some" improvements. :)<u></u><u></u></p>
</blockquote>
<div>
<p class="MsoNormal" style="margin-left:46.2pt"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:46.2pt">I didn't mean "some improvements, some regressions", I meant "some of the improvement we'd expect from the full solution". :-)<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:46.2pt"> <u></u><u></u></p>
</div>
<blockquote style="border:none;border-left:solid #cccccc 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-top:5.0pt;margin-right:0cm;margin-bottom:5.0pt">
<p class="MsoNormal" style="margin-right:0cm;margin-bottom:12.0pt;margin-left:46.2pt">
<br>
> That's why I'm curious about where we saw regressions - I'm wondering<br>
> whether there's really a significant cost modeling issue I'm missing, or<br>
> it's something that's easy to fix so that we can make forward progress,<br>
> while Ashutosh is working on the longer-term solution.<br>
<br>
Sounds like a task to try a few patterns and fiddle with the cost model.<br>
<br>
Arnold did a lot of those during the first months of the vectorizer,<br>
so it might be just a matter of finding the right heuristics, at least<br>
for the low hanging fruits.<br>
<br>
Of course, that'd also involve benchmarking everything else, to make<br>
sure the new heuristics doesn't introduce regressions on<br>
non-interleaved vectorisation.<u></u><u></u></p>
</blockquote>
<div>
<p class="MsoNormal" style="margin-left:46.2pt"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:46.2pt">I don't disagree with you.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:46.2pt"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:46.2pt">All I'm saying is that before fiddling with the heuristics, it'd be good to understand what exactly breaks if we simply flip the flag. If the answer happens to be "nothing" - well, problem
solved. Unfortunately, according to Elena, that's not the answer. <u></u><u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:46.2pt">I'm going to play with it with our internal benchmarks, but it's my understanding that Elena/Ayal already have some idea of what the problems are.<u></u><u></u></p>
</div>
</div>
<p class="MsoNormal" style="margin-left:46.2pt"><u></u> <u></u></p>
</div>
</div>
</div>
</div></div></div><div><div class="m_7447484640176171171m_-5114204913764254463h5">
<p>------------------------------<wbr>------------------------------<wbr>---------<br>
Intel Israel (74) Limited</p>
<p>This e-mail and any attachments may contain confidential material for<br>
the sole use of the intended recipient(s). Any review or distribution<br>
by others is strictly prohibited. If you are not the intended<br>
recipient, please contact the sender and delete all copies.</p></div></div></div>
</blockquote></div><br></div>
</div></div></blockquote></div><br></div>
</div></div></blockquote></div><br></div>