<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Thanks for your reply. This direction looked sensible, and I wanted to check if we weren't missing anything.</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);">
Cheers,</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Sjoerd.<br>
</div>
<div id="appendonsend"></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> Philip Reames <listmail@philipreames.com><br>
<b>Sent:</b> 09 August 2019 23:47<br>
<b>To:</b> Sjoerd Meijer <Sjoerd.Meijer@arm.com>; cfe-dev@lists.llvm.org <cfe-dev@lists.llvm.org><br>
<b>Cc:</b> nd <nd@arm.com><br>
<b>Subject:</b> Re: [cfe-dev] Behaviour of loop pragmas and transformation options</font>
<div> </div>
</div>
<div style="background-color:#FFFFFF">
<p><br>
</p>
<div class="x_moz-cite-prefix">On 8/7/19 12:25 AM, Sjoerd Meijer via cfe-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)">
<span>We have recently added support for a new loop pragma 'vectorize_predicate' [1].<br>
</span>
<div>During review of the LLVM part that does the actual transformation [2], the<br>
</div>
<div>question was raised if 'vectorize_predicate' should imply 'vectorize(enable)'.<br>
</div>
<div>I agree that this is indeed what users would most likely expect and so I<br>
</div>
<div>created a patch for that [3].<br>
</div>
<div><br>
</div>
<div>During review of [3], Florian mentioned bug report [4] supporting the case that<br>
</div>
<div>users indeed expect that more specific pragmas such as e.g. vectorize_width(4)<br>
</div>
<div>should imply vectorize(enable), but this is currently not the case.  But our<br>
</div>
<div>docs for example mention: "The following example implicitly enables<br>
</div>
<div>vectorization and interleaving by specifying a vector width and interleaving<br>
</div>
<div>count", and so we have an inconsistency in the docs and implementation. But as<br>
</div>
<div>I have e.g. no clue what the behaviour could be of "vectorize(disable)<br>
</div>
<div>vectorize_predicate(enable)", I would say the docs are right and the<br>
</div>
<div>implementation is wrong.<br>
</div>
<div><br>
</div>
<div>Michael mentioned that the situation with for example loop unroll pragmas<br>
</div>
<div>'unroll(enable) unroll_count(4)' is not very different. Pragma 'unroll_count'<br>
</div>
<div>also does not set 'llvm.loop.unroll.enable', but it is handled by the<br>
</div>
<div>LoopUnroll pass itself and so we end up with checks like this:<br>
</div>
<div><br>
</div>
<div>    bool ExplicitUnroll = PragmaCount > 0 || PragmaFullUnroll ||<br>
</div>
<div>                          PragmaEnableUnroll || UserUnrollCount;<br>
</div>
<div><br>
</div>
<div>And again, this is very similar to 'vectorize_width', and we have different<br>
</div>
<div>checks to see if vectorization is enabled.<br>
</div>
<div><br>
</div>
<div>Because of the many inconsistencies, we came to the conclusion in [3] that we<br>
</div>
<div>don't know how know how to (best) implement that setting an transformation<br>
</div>
<div>option implies setting the transformation.<br>
</div>
<div><br>
</div>
<div>My proposal would be that the transformation options imply the transformations<br>
</div>
<div>by setting the enable flag of that transformation. Thus, vectorize options<br>
</div>
<div>vectorize_width, vectorize_predicate, etc., set vectorize(enable), and unroll<br>
</div>
<div>option unroll count set unroll(enable).<br>
</div>
</div>
</blockquote>
I second this.  The complexities of which pragmas enable which transforms should be handled entirely in Clang, with Clang responsible for emitting a consistent set of metadata flags to LLVM. 
<br>
<blockquote type="cite">
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<div></div>
<div><br>
</div>
<div>Any thoughts on this welcome.<br>
</div>
<div><br>
</div>
<div><br>
</div>
<div>[1] <a class="x_moz-txt-link-freetext" href="https://reviews.llvm.org/rL366989">
https://reviews.llvm.org/rL366989</a><br>
</div>
<div>[2] <a class="x_moz-txt-link-freetext" href="https://reviews.llvm.org/D65197">
https://reviews.llvm.org/D65197</a><br>
</div>
<div>[3] <a class="x_moz-txt-link-freetext" href="https://reviews.llvm.org/D65776">
https://reviews.llvm.org/D65776</a><br>
</div>
<span>[4] <a href="https://bugs.llvm.org/show_bug.cgi?id=27643" id="LPlnk126071">
https://bugs.llvm.org/show_bug.cgi?id=27643</a></span><br>
</div>
<br>
<fieldset class="x_mimeAttachmentHeader"></fieldset>
<pre class="x_moz-quote-pre">_______________________________________________
cfe-dev mailing list
<a class="x_moz-txt-link-abbreviated" href="mailto:cfe-dev@lists.llvm.org">cfe-dev@lists.llvm.org</a>
<a class="x_moz-txt-link-freetext" href="https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev">https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev</a>
</pre>
</blockquote>
</div>
</body>
</html>