<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=us-ascii">
<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.MsoPlainText, li.MsoPlainText, div.MsoPlainText
        {mso-style-priority:99;
        mso-style-link:"Plain Text Char";
        margin:0cm;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
span.PlainTextChar
        {mso-style-name:"Plain Text Char";
        mso-style-priority:99;
        mso-style-link:"Plain Text";
        font-family:"Calibri",sans-serif;}
span.EmailStyle22
        {mso-style-type:personal-compose;
        font-family:"Calibri",sans-serif;
        color:windowtext;
        font-weight:normal;
        font-style:normal;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@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,<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">At the moment the vectorize_width(X) #pragma is used to provide hints to LLVM<o:p></o:p></p>
<p class="MsoNormal">about which vectorisation factor to use. The unsigned argument ‘X’ used to match<o:p></o:p></p>
<p class="MsoNormal">the NumElements property in the VectorType class, however VectorType is now<o:p></o:p></p>
<p class="MsoNormal">defined in terms of a ElementCount class.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I’d like to propose an extension to the vectorize_width #pragma that now takes<o:p></o:p></p>
<p class="MsoNormal">an optional second parameter of ‘fixed’ or ‘scalable’ that matches up with<o:p></o:p></p>
<p class="MsoNormal">ElementCount. When not specified the default value would be ‘fixed’. A few<o:p></o:p></p>
<p class="MsoNormal">examples of how this would look like are shown below:<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoPlainText">  // Vectorize the loop with <4 x eltty><o:p></o:p></p>
<p class="MsoPlainText">  #pragma clang loop vectorize_width(4)<o:p></o:p></p>
<p class="MsoPlainText">  #pragma clang loop vectorize_width(4, fixed)<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">  // Vectorize the loop with <vscale x 4 x eltty><o:p></o:p></p>
<p class="MsoPlainText">  #pragma clang loop vectorize_width(4, scalable)<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">As a further extension I’d also like to permit vectorize_width(fixed|scalable) to<o:p></o:p></p>
<p class="MsoNormal">allow users to hint at the type of vector used without specifying the<o:p></o:p></p>
<p class="MsoNormal">vectorisation factor. Examples of this would be:<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoPlainText">  // Vectorize the loop with <N x eltty> for a profitable N<o:p></o:p></p>
<p class="MsoPlainText">  #pragma clang loop vectorize_width(fixed)<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">  // Vectorize the loop with <vscale x N x eltty> for a profitable N<o:p></o:p></p>
<p class="MsoPlainText">  #pragma clang loop vectorize_width(scalable)<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Any thoughts you have would be much appreciated!<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 Sherwood.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</body>
</html>