<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 14 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
{mso-style-priority:99;
mso-style-link:"Balloon Text Char";
margin:0in;
margin-bottom:.0001pt;
font-size:8.0pt;
font-family:"Tahoma","sans-serif";}
span.gmail-m-7387267872061111849apple-converted-space
{mso-style-name:gmail-m_-7387267872061111849apple-converted-space;}
span.gmail-m-7387267872061111849m8648527886154158176hoenzb
{mso-style-name:gmail-m_-7387267872061111849m8648527886154158176hoenzb;}
span.BalloonTextChar
{mso-style-name:"Balloon Text Char";
mso-style-priority:99;
mso-style-link:"Balloon Text";
font-family:"Tahoma","sans-serif";}
span.EmailStyle21
{mso-style-type:personal-reply;
font-family:"Calibri","sans-serif";
color:#1F497D;}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri","sans-serif";}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
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-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">(resend with llvm-dev back in the cc list)<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><a name="_MailEndCompose"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">We have policy for what we support; we don't have a policy for when do we change what we support. The policy was clear in the early
3.x era, but circumstances changed as we got to 4.0, and the only point of agreement was to stay with "back to 3.0."<o:p></o:p></span></a></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">LLVM 3.0 was released 6 years ago; it might be time to drop some of the older versions?<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">--paulr<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<div style="border:none;border-left:solid blue 1.5pt;padding:0in 0in 0in 4.0pt">
<div>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> llvm-dev [mailto:llvm-dev-bounces@lists.llvm.org]
<b>On Behalf Of </b>Mehdi AMINI via llvm-dev<br>
<b>Sent:</b> Thursday, September 21, 2017 10:06 PM<br>
<b>To:</b> Simon Pilgrim<br>
<b>Cc:</b> llvm-dev@lists.llvm.org<br>
<b>Subject:</b> Re: [llvm-dev] RFC: [X86] Can we begin removing AutoUpgrade support for x86 instrinsics added in early 3.X versions<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal">Hi,<o:p></o:p></p>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">I believe we have a formal policy: we support every bitcode produced since LLVM 3.0: <a href="https://llvm.org/docs/DeveloperPolicy.html#ir-backwards-compatibility">https://llvm.org/docs/DeveloperPolicy.html#ir-backwards-compatibility</a><o:p></o:p></p>
<div>
<p class="MsoNormal">(until we decide to uprev the version we support).<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Unfortunately, the testing was only added around 3.6 or 3.7? And support is only as good as the testing we have...<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<div>
<p class="MsoNormal">-- <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">Mehdi<o:p></o:p></p>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal">2017-09-21 0:23 GMT-07:00 Simon Pilgrim via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>>:<o:p></o:p></p>
<div>
<div>
<p class="MsoNormal">I agree with Paul that we need to formalise the compatibility policy before we start removing support for old intrinsics. Do we want a deprecation warning of some kind for the use of any intrinsic used in auto-upgrade, would that actually
be useful or just a nuisance?<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">In the meantime I’m happy to help fix any missing test coverage.<o:p></o:p></p>
</div>
<div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<div>
<p class="MsoNormal">On 20 Sep 2017, at 22:16, Robinson, Paul via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>> wrote:<o:p></o:p></p>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">I think the general backward-compatibility story has been kind of vague for a while. There was some talk about it at the time of the version-numbering change,
but I don't remember if it came to any kind of solid conclusion.</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"> </span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">I think the handling of the old X86 intrinsics would want to follow the general compatibility policy, assuming we can all agree on one. There shouldn't be
a special case for those IMO. So, starting a new non-X86-specific thread about backward compatibility would be appropriate.</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">--paulr</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><a name="m_-7387267872061111849__MailEndCompose"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"> </span></a><o:p></o:p></p>
</div>
<div style="border:none;border-left:solid blue 1.5pt;padding:0in 0in 0in 4.0pt">
<div>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in">
<div>
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span class="gmail-m-7387267872061111849apple-converted-space"><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> </span></span><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">llvm-dev
[<a href="mailto:llvm-dev-bounces@lists.llvm.org" target="_blank"><span style="color:purple">mailto:llvm-dev-bounces@lists.llvm.org</span></a>]<span class="gmail-m-7387267872061111849apple-converted-space"> </span><b>On Behalf Of<span class="gmail-m-7387267872061111849apple-converted-space"> </span></b>Craig
Topper via llvm-dev<br>
<b>Sent:</b><span class="gmail-m-7387267872061111849apple-converted-space"> </span>Wednesday, September 20, 2017 1:01 PM<br>
<b>To:</b><span class="gmail-m-7387267872061111849apple-converted-space"> </span>Daniel Berlin<br>
<b>Cc:</b><span class="gmail-m-7387267872061111849apple-converted-space"> </span>llvm-dev<br>
<b>Subject:</b><span class="gmail-m-7387267872061111849apple-converted-space"> </span>Re: [llvm-dev] RFC: [X86] Can we begin removing AutoUpgrade support for x86 instrinsics added in early 3.X versions</span><o:p></o:p></p>
</div>
</div>
</div>
<div>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
<div>
<div>
<div>
<p class="MsoNormal">Many of the older autoupgrades have no test cases because I think when we upgraded them we just replace all the code in the tests with native IR. So for some of the code we don't even know if it works.<o:p></o:p></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
</div>
<div>
<p class="MsoNormal">I don't really want to watch the amount of code here continue to grow indefinitely. It's pretty poorly structured and has been up against the MSVC cascaded if/else limit a couple times. I think they allow about 128. Of course this is fixable
by better structuring, but we'd probably want to fix the lack of tests to be more confident about not breaking it.<o:p></o:p></p>
</div>
<div>
<div>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal">The ridiculous number of string compares in the code might be slow, but I'm not sure. I've never tried to profile it. We don't divide up the string compares based on first letters or anything so I think we run through a lot of memcmps.<o:p></o:p></p>
</div>
<div>
<div>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
</div>
<div>
<div>
<div>
<p class="MsoNormal">Unfortunately, the bulk of the upgrade code was added in the 3.7, 3.9, 4.0 timeframe so the big reduction in code probably requires several more years. But I wanted to start a conversation about what our compability story looks like going
forward.<o:p></o:p></p>
</div>
</div>
</div>
</div>
</div>
<div>
<div>
<p class="MsoNormal"><br clear="all">
<o:p></o:p></p>
</div>
<div>
<div>
<div>
<p class="MsoNormal">~Craig<o:p></o:p></p>
</div>
</div>
</div>
<div>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
<div>
<div>
<p class="MsoNormal">On Wed, Sep 20, 2017 at 12:31 PM, Daniel Berlin <<a href="mailto:dberlin@dberlin.org" target="_blank"><span style="color:purple">dberlin@dberlin.org</span></a>> wrote:<o:p></o:p></p>
</div>
<div>
<div>
<p class="MsoNormal">Is there a reason why?<br>
IE is it hard to maintain, slow, or are you just worried it will break? or something else?<o:p></o:p></p>
</div>
<div>
<div>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal">(I'm not opposed in any way, literally just want to understand the motivation)<o:p></o:p></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
<div>
<div>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
</div>
</div>
</div>
<div>
<div>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
<div>
<div>
<div>
<div>
<p class="MsoNormal">On Wed, Sep 20, 2017 at 12:20 PM, Craig Topper via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank"><span style="color:purple">llvm-dev@lists.llvm.org</span></a>> wrote:<o:p></o:p></p>
</div>
</div>
</div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-top:5.0pt;margin-right:0in;margin-bottom:5.0pt">
<div>
<div>
<div>
<div>
<div>
<p class="MsoNormal">We have quite a lot of code in AutoUpgrade.cpp to upgrade X86 intrinsics that have been replaced with native IR over the years. Has enough time and/or versions passed that we can begin phasing out some of this code?<o:p></o:p></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal">As I'm writing these we don't seem to have tests for a lot of the older upgrades. We've done better at this in the last few years.<o:p></o:p></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal">3.1 added upgrade for:<o:p></o:p></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal">x86.sse2.pcmpeq.* - we have almost no test cases for this<o:p></o:p></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal">x86.sse2.pcmpgt.* - we no test cases for this<o:p></o:p></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal">x86.avx2.pcmpeq.* - we have no test cases<o:p></o:p></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal">x86.avx2.pcmpgt.* - we have no test cases for this<o:p></o:p></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal">x86.avx.vpermil.* - we do test this<o:p></o:p></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal">3.2 added upgrade for:<o:p></o:p></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal">x86.avx.movnt.* - we have tests for this<o:p></o:p></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal">x86.xop.vpcom* - we have tests for this<o:p></o:p></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal">x86.sse41.ptest.* had its signature chagned and we upgrade from the old signature. We don't have tests for the old signature.<o:p></o:p></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal">x86.xop.vfrcz.ss/sd had an argument dropped that we upgrade for. We don't have any tests for the old signature.<o:p></o:p></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal">3.3 had no upgrades<o:p></o:p></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal">3.4 removed:<o:p></o:p></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal">x86.sse42.crc32.64.8 we do have tests that use it<o:p></o:p></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal">For the complete list of intrinsic upgrade support, there's an annotated list in ShouldUpgradeX86Intrinsic in AutoUpgrade.cpp<o:p></o:p></p>
</div>
</div>
<div>
<p class="MsoNormal"><span style="color:#888888"><br clear="all">
</span><o:p></o:p></p>
</div>
<div>
<div>
<div>
<p class="MsoNormal"><span style="color:#888888">~Craig</span><o:p></o:p></p>
</div>
</div>
</div>
</div>
</div>
</div>
</blockquote>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</blockquote>
</div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><o:p> </o:p></p>
</div>
</div>
</div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><br>
_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><o:p></o:p></p>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>