<div dir="ltr"><div>Hi David,</div><div><br></div><div>Thanks a lot for the clarification.</div><div><br></div><div>Defaulting to fixed vectorization and having a qualifier that restricts to fixed/scalable vectorization seems very reasonable to me in this context. I can see how a `vectorize_style(any)` would be unnecessary.<br></div><div><br></div><div>Kind regards,<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Missatge de David Sherwood <<a href="mailto:David.Sherwood@arm.com">David.Sherwood@arm.com</a>> del dia dc., 9 de des. 2020 a les 13:49:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">





<div style="overflow-wrap: break-word;" lang="EN-GB">
<div class="gmail-m_-4095296795362494428WordSection1">
<p class="MsoNormal">Hi Roger,<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Thanks for the suggestion. With regards to possible use cases of a vectorize_style(any)<u></u><u></u></p>
<p class="MsoNormal">pragma my thoughts are:<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">1. Any existing tests that currently use vectorize_width(#number) were presumably<u></u><u></u></p>
<p class="MsoNormal">written with fixed width vectorisation in mind. So it makes sense in those cases<u></u><u></u></p>
<p class="MsoNormal">for the default to be fixed width. If the user wants to go back and fix them to explicitly<u></u><u></u></p>
<p class="MsoNormal">use scalable vectorisation they can just add vectorize_width(#number, scalable). We<u></u><u></u></p>
<p class="MsoNormal">feel that specifying the numeric part of the vectorisation factor without also considering<u></u><u></u></p>
<p class="MsoNormal">if the factor is fixed-length or scalable is not a realistic/real world use case. I imagine<u></u><u></u></p>
<p class="MsoNormal">that best results will be obtained by letting the vectoriser choose the best pair, i.e.<u></u><u></u></p>
<p class="MsoNormal">vectorize_width(4, fixed) or vectorize_width(8, scalable).<u></u><u></u></p>
<p class="MsoNormal">2. However, if the user wants the compiler to choose the best option (fixed or scalable)<u></u><u></u></p>
<p class="MsoNormal">then we already have a route for that with vectorize(enable). Similarly when compiling<u></u><u></u></p>
<p class="MsoNormal">at -O2 or above the compiler will choose the most profitable option.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Kind Regards,<u></u><u></u></p>
<p class="MsoNormal">David.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<div style="border-color:rgb(225,225,225) currentcolor currentcolor;border-style:solid none none;border-width:1pt medium medium;padding:3pt 0cm 0cm">
<p class="MsoNormal"><b><span lang="EN-US">From:</span></b><span lang="EN-US"> Roger Ferrer Ibáñez <<a href="mailto:rofirrim@gmail.com" target="_blank">rofirrim@gmail.com</a>>
<br>
<b>Sent:</b> 30 November 2020 13:34<br>
<b>To:</b> David Sherwood <<a href="mailto:David.Sherwood@arm.com" target="_blank">David.Sherwood@arm.com</a>><br>
<b>Cc:</b> <a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a><br>
<b>Subject:</b> Re: [cfe-dev] Proposed changes to vectorize_width #pragma<u></u><u></u></span></p>
</div>
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<div>
<div>
<p class="MsoNormal">Hi David,<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">Your proposal looks sensible to me. I understand that for reasons of evolution of the pragma, you chose to give it `fixed` semantics if no explicit mark of vectorisation style appears, right?<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">Is this something in the future we'd want to relax? This way the target could also pick the best vectorization style (borrowing Sjoerd's terminology here).
<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">Perhaps we could define a `vectorize_style(any)` as well. That would be the one used if no explicit `vectorize_style` is specified.<u></u><u></u></p>
</div>
</div>
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<blockquote style="border-color:currentcolor currentcolor currentcolor rgb(204,204,204);border-style:none none none solid;border-width:medium medium medium 1pt;padding:0cm 0cm 0cm 6pt;margin:5pt 0cm 5pt 4.8pt">
<div>
<div>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal">As a further extension I’d also like to permit vectorize_width(fixed|scalable) to<u></u><u></u></p>
<p class="MsoNormal">allow users to hint at the type of vector used without specifying the<u></u><u></u></p>
<p class="MsoNormal">vectorisation factor. Examples of this would be:<u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="gmail-m_-4095296795362494428gmail-m-5052617891530397558msoplaintext">  // Vectorize the loop with <N x eltty> for a profitable N<u></u><u></u></p>
<p class="gmail-m_-4095296795362494428gmail-m-5052617891530397558msoplaintext">  #pragma clang loop vectorize_width(fixed)<u></u><u></u></p>
<p class="gmail-m_-4095296795362494428gmail-m-5052617891530397558msoplaintext">  // Vectorize the loop with <vscale x N x eltty> for a profitable N<u></u><u></u></p>
<p class="gmail-m_-4095296795362494428gmail-m-5052617891530397558msoplaintext">  #pragma clang loop vectorize_width(scalable)<u></u><u></u></p>
</div>
</div>
</blockquote>
<div>
<p class="MsoNormal">In those cases, I imagine `vectorize_style` could be enough and we avoid having a `vectorize_width` that doesn't actually tell us the width (or the factor of the actual width, for scalables). But this falls in the "aesthetics" category,
 I think.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">Kind regards,<u></u><u></u></p>
</div>
</div>
</div>
</div>
</div>

</blockquote></div><br clear="all"><br>-- <br><div dir="ltr" class="gmail_signature">Roger Ferrer Ibáñez<br></div>