<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<p><br>
</p>
<div class="moz-cite-prefix">On 9/10/19 3:52 PM, Sjoerd Meijer wrote:<br>
</div>
<blockquote type="cite" cite="mid:VI1PR08MB3341B18ECC0F9154480D3802FCB60@VI1PR08MB3341.eurprd08.prod.outlook.com">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif;
        font-size: 12pt; color: rgb(0, 0, 0);">
Hi Hal,</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif;
        font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif;
        font-size: 12pt; color: rgb(0, 0, 0);">
Many thanks for commenting and clarifying. I liked "pragmas should control transformations, not components" and it's difficult to disagree with that I think. :-)</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif;
        font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif;
        font-size: 12pt; color: rgb(0, 0, 0);">
I considered the interleaver an integral part of the vectorizer, a prep step or enabler for efficient vectorisation. With that assumption, my proposal made sense but if the interleaver is a separate optimisation then I don't think I have a case.</div>
</blockquote>
<p><br>
</p>
<p>Thanks! Interleaving is certainly an optimization that we've found to be useful even in the absence of vectorization (because it helps hide the latency of long, pipelined operations).<br>
</p>
<p><br>
</p>
<blockquote type="cite" cite="mid:VI1PR08MB3341B18ECC0F9154480D3802FCB60@VI1PR08MB3341.eurprd08.prod.outlook.com">
<div style="font-family: Calibri, Arial, Helvetica, sans-serif;
        font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif;
        font-size: 12pt; color: rgb(0, 0, 0);">
I will drop the "vectorize(disable) implies interleave(disable)" work, and finish
<span style="font-size:12pt;
          font-family:Calibri,Arial,Helvetica,sans-serif">
"vectorize_width() implies vectorize(enable)" to conclude my loop pragma adventure.</span></div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif;
        font-size: 12pt; color: rgb(0, 0, 0);">
<span style="font-size:12pt;
          font-family:Calibri,Arial,Helvetica,sans-serif"><br>
</span></div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif;
        font-size: 12pt; color: rgb(0, 0, 0);">
<span style="font-size:12pt;
          font-family:Calibri,Arial,Helvetica,sans-serif">Not relevant for this discussion, but I don't it is difficult to get a bit confused about the interleaver because of both the implementation and documentation. Clarifying
 things a bit more in the docs is probably low hanging fruit; I will review if that is true.
<br>
</span></div>
</blockquote>
<p><br>
</p>
<p>+1 for better documentation, of course. :-) -- Thanks again for helping to improve all of this.</p>
<p><br>
</p>
<p> -Hal<br>
</p>
<p><br>
</p>
<blockquote type="cite" cite="mid:VI1PR08MB3341B18ECC0F9154480D3802FCB60@VI1PR08MB3341.eurprd08.prod.outlook.com">
<div style="font-family: Calibri, Arial, Helvetica, sans-serif;
        font-size: 12pt; color: rgb(0, 0, 0);">
<span style="font-size:12pt;
          font-family:Calibri,Arial,Helvetica,sans-serif"></span></div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif;
        font-size: 12pt; color: rgb(0, 0, 0);">
<span style="font-size:12pt;
          font-family:Calibri,Arial,Helvetica,sans-serif"><br>
</span></div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif;
        font-size: 12pt; color: rgb(0, 0, 0);">
<span style="font-size:12pt;
          font-family:Calibri,Arial,Helvetica,sans-serif">Thanks,</span></div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif;
        font-size: 12pt; color: rgb(0, 0, 0);">
<span style="font-size:12pt;
          font-family:Calibri,Arial,Helvetica,sans-serif">Sjoerd.</span><br>
</div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font style="font-size:11pt" face="Calibri, sans-serif" color="#000000"><b>From:</b> Finkel, Hal J.
<a class="moz-txt-link-rfc2396E" href="mailto:hfinkel@anl.gov"><hfinkel@anl.gov></a><br>
<b>Sent:</b> 10 September 2019 18:49<br>
<b>To:</b> Sjoerd Meijer <a class="moz-txt-link-rfc2396E" href="mailto:Sjoerd.Meijer@arm.com">
<Sjoerd.Meijer@arm.com></a>; <a class="moz-txt-link-abbreviated" href="mailto:llvm-dev@lists.llvm.org">
llvm-dev@lists.llvm.org</a> <a class="moz-txt-link-rfc2396E" href="mailto:llvm-dev@lists.llvm.org">
<llvm-dev@lists.llvm.org></a><br>
<b>Subject:</b> Re: [llvm-dev] loop vectorizer disabling</font>
<div> </div>
</div>
<div style="background-color:#FFFFFF">
<p>Hi, Sjoerd,</p>
<p><br>
</p>
<p>Thanks for posting this RFC. I do, however, strongly disagree. From an implementation standpoint, it made sense to have a simple component, the loop vectorizer, perform not only loop vectorization but also related transformations - specifically, interleaving.
 However, the fact that a single component of the optimizer performs these different transformation is not something that we expose to users. Moreover, the optimizer is always free to use cost-model-based heuristics to perform any transformation unless specifically
 directed. Thus, disabling vectorization should not disable interleaving. Although often useful together, these are separate transformations, interleaving is often useful in the absence of vectorization, and we have a separate set of pragmas to control interleaving
 (interleave(enable/disable), interleave_count(N), etc.). Having vectorize(disable) imply interleave(disable) is unnecessary and confusing. I expect that my users will complain if we make this change (and, relatedly, we'll see performance regressions).</p>
<p><br>
</p>
<p>In short, our pragmas should control transformations, not components.</p>
<p><br>
</p>
<p>Thanks again,</p>
<p>Hal</p>
<p><br>
</p>
<div class="x_moz-cite-prefix">On 9/10/19 5:43 AM, Sjoerd Meijer via llvm-dev wrote:<br>
</div>
<blockquote type="cite"><style type="text/css" style="display:none">
<!--
p
        {margin-top:0;
        margin-bottom:0}
-->
</style>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;
            font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;
            font-size:12pt; color:rgb(0,0,0)">
I would like to propose that loop pragma `vectorize(disable)` actually means disabling the vectorizer for that loop. This perhaps sounds really obvious (I hope it does), but currently
<span style="font-family:Calibri,Arial,Helvetica,sans-serif;
              background-color:rgb(255,255,255);
              display:inline!important">
`vectorize(disable)`</span> sets the vectorization width to 1, and that means the vectorizer will run and could perform other tricks such as interleaving. The main reason to change the behaviour is that it will be more what (most) users would expect. <br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;
            font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;
            font-size:12pt; color:rgb(0,0,0)">
I think we reached consensus on changing the behaviour in [4], but since this is changing the behaviour of a user-facing pragma, we would like to know if there are any objections. <span style="color:rgb(0,0,0);
              font-family:Calibri,Arial,Helvetica,sans-serif;
              font-size:12pt">If
 people rely on the current behaviour that `vectorize(disable)` will do some other transformations performed by the vectorizer, which I hope is an edge case, I think this is a trivial rewrite, but still a change. </span><span style="color:rgb(0,0,0);
              font-family:Calibri,Arial,Helvetica,sans-serif;
              font-size:12pt">So,
 again, without objections we would like to go ahead with this.</span></div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;
            font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;
            font-size:12pt; color:rgb(0,0,0)">
<div style="margin:0px; font-size:12pt;
              font-family:Calibri,Arial,Helvetica,sans-serif">
For a little bit more context, this is a follow-up of a discussion on loop pragmas we had not so long ago. We added a new pragma [1], and enabling this new transformation option implies setting the transformation [2]. This is something that our docs promise
 for other transformation options too, except that this wasn't happening and s<span style="font-family:Calibri,Arial,Helvetica,sans-serif;
                font-size:12pt">o we started fixing that. I</span><span style="font-family:Calibri,Arial,Helvetica,sans-serif;
                font-size:12pt">n
 [3] for example, we implement that `vectorize_width()` implies `vectorize(enable)`. Related to this, we started discussing in [4] what `vectorize(disable)` should mean easier of [3], because it makes implementation easier but more importantly because that
 would probably match user expectations better.</span></div>
<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;
            font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;
            font-size:12pt; color:rgb(0,0,0)">
[1] <a href="https://reviews.llvm.org/D64744" id="LPNoLP994406" moz-do-not-send="true">
https://reviews.llvm.org/D64744</a><br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;
            font-size:12pt; color:rgb(0,0,0)">
[2] <a href="https://reviews.llvm.org/D65776" id="LPlnk655117" moz-do-not-send="true">
https://reviews.llvm.org/D65776</a></div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;
            font-size:12pt; color:rgb(0,0,0)">
[3] <a href="https://reviews.llvm.org/D66290" id="LPlnk733244" moz-do-not-send="true">
https://reviews.llvm.org/D66290</a><br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;
            font-size:12pt; color:rgb(0,0,0)">
[4] <a href="https://reviews.llvm.org/D66796" id="LPlnk560992" moz-do-not-send="true">
https://reviews.llvm.org/D66796</a><br>
</div>
<br>
<fieldset class="x_mimeAttachmentHeader"></fieldset>
<pre class="x_moz-quote-pre">_______________________________________________
LLVM Developers mailing list
<a class="x_moz-txt-link-abbreviated" href="mailto:llvm-dev@lists.llvm.org" moz-do-not-send="true">llvm-dev@lists.llvm.org</a>
<a class="x_moz-txt-link-freetext" href="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" moz-do-not-send="true">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a>
</pre>
</blockquote>
<pre class="x_moz-signature" cols="72">-- 
Hal Finkel
Lead, Compiler Technology and Programming Languages
Leadership Computing Facility
Argonne National Laboratory</pre>
</div>
IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose,
 or store or copy the information in any medium. Thank you. </blockquote>
<pre class="moz-signature" cols="72">-- 
Hal Finkel
Lead, Compiler Technology and Programming Languages
Leadership Computing Facility
Argonne National Laboratory</pre>
</body>
</html>