<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:DengXian;
        panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:"\@DengXian";
        panose-1:2 1 6 0 3 1 1 1 1 1;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
p.gmail-m-5052617891530397558msoplaintext, li.gmail-m-5052617891530397558msoplaintext, div.gmail-m-5052617891530397558msoplaintext
        {mso-style-name:gmail-m_-5052617891530397558msoplaintext;
        mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
span.EmailStyle19
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;
        font-family:"Calibri",sans-serif;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-GB" link="#0563C1" vlink="#954F72" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoNormal">Hi Roger,<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Thanks for the suggestion. With regards to possible use cases of a vectorize_style(any)<o:p></o:p></p>
<p class="MsoNormal">pragma my thoughts are:<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">1. Any existing tests that currently use vectorize_width(#number) were presumably<o:p></o:p></p>
<p class="MsoNormal">written with fixed width vectorisation in mind. So it makes sense in those cases<o:p></o:p></p>
<p class="MsoNormal">for the default to be fixed width. If the user wants to go back and fix them to explicitly<o:p></o:p></p>
<p class="MsoNormal">use scalable vectorisation they can just add vectorize_width(#number, scalable). We<o:p></o:p></p>
<p class="MsoNormal">feel that specifying the numeric part of the vectorisation factor without also considering<o:p></o:p></p>
<p class="MsoNormal">if the factor is fixed-length or scalable is not a realistic/real world use case. I imagine<o:p></o:p></p>
<p class="MsoNormal">that best results will be obtained by letting the vectoriser choose the best pair, i.e.<o:p></o:p></p>
<p class="MsoNormal">vectorize_width(4, fixed) or vectorize_width(8, scalable).<o:p></o:p></p>
<p class="MsoNormal">2. However, if the user wants the compiler to choose the best option (fixed or scalable)<o:p></o:p></p>
<p class="MsoNormal">then we already have a route for that with vectorize(enable). Similarly when compiling<o:p></o:p></p>
<p class="MsoNormal">at -O2 or above the compiler will choose the most profitable option.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Kind Regards,<o:p></o:p></p>
<p class="MsoNormal">David.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span lang="EN-US">From:</span></b><span lang="EN-US"> Roger Ferrer Ibáñez <rofirrim@gmail.com>
<br>
<b>Sent:</b> 30 November 2020 13:34<br>
<b>To:</b> David Sherwood <David.Sherwood@arm.com><br>
<b>Cc:</b> cfe-dev@lists.llvm.org<br>
<b>Subject:</b> Re: [cfe-dev] Proposed changes to vectorize_width #pragma<o:p></o:p></span></p>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div>
<div>
<p class="MsoNormal">Hi David,<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></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?<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></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).
<o:p></o:p></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.<o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></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">
<div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">As a further extension I’d also like to permit vectorize_width(fixed|scalable) to<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">allow users to hint at the type of vector used without specifying the<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">vectorisation factor. Examples of this would be:<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
<p class="gmail-m-5052617891530397558msoplaintext">  // Vectorize the loop with <N x eltty> for a profitable N<o:p></o:p></p>
<p class="gmail-m-5052617891530397558msoplaintext">  #pragma clang loop vectorize_width(fixed)<o:p></o:p></p>
<p class="gmail-m-5052617891530397558msoplaintext">  // Vectorize the loop with <vscale x N x eltty> for a profitable N<o:p></o:p></p>
<p class="gmail-m-5052617891530397558msoplaintext">  #pragma clang loop vectorize_width(scalable)<o:p></o:p></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.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Kind regards,<o:p></o:p></p>
</div>
</div>
</div>
</div>
</body>
</html>