<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
</head>
<body>
<div class="moz-cite-prefix">Hi Neil,</div>
<div class="moz-cite-prefix"><br>
</div>
<div class="moz-cite-prefix">we want to make the representation more concise.</div>
<div class="moz-cite-prefix"><br>
</div>
<div class="moz-cite-prefix">One more thing i just realized is that we could use the tuple types to mask optimizations that do not expect them*.<br>
</div>
<div class="moz-cite-prefix">Eg standard fp optimizations could claim that they handle `llvm.fadd` unless there are any parameter tuples on it.</div>
<div class="moz-cite-prefix">Likewise, we can then implement a masked constrainedfp, SIMD fadd optimization pass that handles `llvm.fadd` with `fpenv` and/or `mask`.</div>
<div class="moz-cite-prefix"><br>
</div>
<div class="moz-cite-prefix">*: (this comes on the heels of a second to-be-published RFC on generalizing the pattern match logic in LLVM...)</div>
<div class="moz-cite-prefix"><br>
</div>
<div class="moz-cite-prefix">- Simon<br>
</div>
<div class="moz-cite-prefix"><br>
</div>
<div class="moz-cite-prefix">On 2/12/20 11:40 AM, Neil Henning wrote:<br>
</div>
<blockquote type="cite" cite="mid:CALRoqd0z3-2qCYfQMmHxrLNh=pmHM+YZqtp-_K685hiFM6FqcQ@mail.gmail.com">
<div dir="ltr">
<div>Hey Simon,</div>
<div><br>
</div>
<div>It wasn't clear from your RFC: why can't you just have these optional parameter tuples be normal function arguments to the intrinsics?</div>
<div><br>
</div>
<div>Cheers,</div>
<div>-Neil.<br>
</div>
</div>
<br>
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">On Wed, Feb 12, 2020 at 9:28 AM Simon Moll via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" moz-do-not-send="true">llvm-dev@lists.llvm.org</a>> wrote:<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>
<p>Hi,</p>
<p>this is an RFC for optional, named parameter tuples for intrinsics. The proposed syntax is:</p>
<p><tt>%z = call @llvm.some.intrinsic(%a, %b) optional_tuple(%x, %y, %z)</tt></p>
<p>where from the perspective of the call site %x, %y and %z are simply additional parameters.<br>
</p>
<p>Optional parameter tuples would be very useful for constrained fp intrinsics and vector predication. Some examples:</p>
<p><span></span></p>
<pre>; Default fpenv fadd (isomorphic to the fadd instruction)
%z = call double @llvm.fadd(%a, %b)
<span><pre>; Constrained fp add
%x = call double @llvm.fadd(%a, %b) fpenv(metadata !fpround.tonearest, metadata !fpexcept.strict)
</pre></span></pre>
<pre><span><pre>; Constrained fp add with vector predication (<a href="https://reviews.llvm.org/D57504" target="_blank" moz-do-not-send="true">https://reviews.llvm.org/D57504</a>)
%x = call <256 x double> @llvm.fadd(%a, %b) mask(<256 x i1> %mask), evl(i32 %evl), fpenv(metadata !fpround.tozero, metadata !fpexcept.strict)<span></span></pre></span></pre>
<p>For constrained fp and VP, we only require a very restricted form of this. That is:</p>
<p>- Tuples are only allowed on intrinsic function calls.<br>
</p>
<p>- There is a builtin list of allowed tuple types (eg tablegen file).<br>
</p>
<p>- Tuple types are opt in: Intrinsics define a list of permissible tuple types.<br>
</p>
<p>- Tuple parameters have default values when a tuple is absent at a call site. Eg, for `<tt>fpenv</tt>` the default fp environment `<tt>fpenv(fpround.tonearest, fpexcept.ignore)</tt>` is implied in the first example above.<br>
</p>
<p><br>
</p>
<p>Btw, different to operand bundles, optional parameter tuples are much more restricted and do not imply side effects of any kind. We might want to re-use the OpBundle logic for this though.<br>
</p>
<p>There are probably more use cases for this and i'd like to hear about them.<br>
</p>
<p>Looking forward to your feedback</p>
<p>- Simon<br>
</p>
</div>
_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org" target="_blank" moz-do-not-send="true">llvm-dev@lists.llvm.org</a><br>
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank" moz-do-not-send="true">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
</blockquote>
</div>
<br clear="all">
<br>
-- <br>
<div dir="ltr" class="gmail_signature">
<div dir="ltr">
<table style="border-collapse:collapse;border-spacing:0px;color:rgb(90,90,91);font-size:13px;margin:0px
            0px 20px;padding:0px" width="100%" cellspacing="0" cellpadding="0" border="0">
<tbody style="margin:0px;padding:0px">
<tr style="margin:0px;padding:0px">
<td style="border-collapse:collapse;font-size:0px;line-height:1.5em;padding:0px
                  0px 20px;vertical-align:top" align="left">
<table style="border-collapse:collapse;border-spacing:0px;margin:0px;padding:0px" cellspacing="0" cellpadding="0" border="0" align="left">
<tbody style="margin:0px;padding:0px">
<tr style="margin:0px;padding:0px">
<td style="border-collapse:collapse;font-size:1.12em;line-height:1.5em;padding:0px;vertical-align:top;width:64px">
<img style="border: medium none; border-radius:
                            0px; display: block; font-size: 13px;
                            height: auto; line-height: 100%; margin:
                            0px; max-width: 100%; outline-style: none;
                            outline-width: medium; padding: 20px 0px
                            0px; width: 100%;" alt="" src="https://unity3d.com/profiles/unity3d/themes/unity/images/ui/other/unity-logo-dark-email.png" moz-do-not-send="true" width="64" height="auto"></td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr style="margin:0px;padding:0px">
<td style="border-collapse:collapse;font-size:0px;line-height:1.5em;padding:0px;vertical-align:top" align="left">
<div style="color:rgb(0,0,0);font-family:Roboto,Arial;font-size:14px;font-weight:600;line-height:15px;margin:0px;padding:0px">
Neil Henning</div>
</td>
</tr>
<tr style="margin:0px;padding:0px">
<td style="border-collapse:collapse;font-size:0px;line-height:1.5em;padding:0px;vertical-align:top" align="left">
<div style="color:rgb(0,0,0);font-family:Roboto,Arial;font-size:14px;line-height:15px;margin:0px;padding:0px
                    0px 10px">
Senior Software Engineer Compiler</div>
</td>
</tr>
<tr style="margin:0px;padding:0px">
<td style="border-collapse:collapse;font-size:0px;line-height:1.5em;padding:0px;vertical-align:top" align="left">
<div style="color:rgb(0,0,0);font-family:Roboto,Arial;font-size:12px;line-height:15px;margin:0px;padding:0px">
<a href="http://unity.com" target="_blank" moz-do-not-send="true">unity.com</a></div>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<br>
<br>
<font style="BACKGROUND-COLOR: #ffffff">
<p align="center"><font style="BACKGROUND-COLOR: #ffffff">Click <a href="https://www.mailcontrol.com/sr/au0TF3_tWkTGX2PQPOmvUnR5FqKQsdnpC6XLzZrYB6UBu_M24t1kFgX-cQcSYUrQnWsWnXyX2xbIiTKH8SslWQ==" moz-do-not-send="true">
here</a> to report this email as spam.</font></p>
</font></blockquote>
<p><br>
</p>
</body>
</html>