<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 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:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        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;}
span.im
        {mso-style-name:im;}
span.EmailStyle18
        {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:612.0pt 792.0pt;
        margin:72.0pt 90.0pt 72.0pt 90.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-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">Hi,<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"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">Something was buggy with the test.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">Please try the new attached unified (contains both the infrastructure and the X86 code padding) patch.<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"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">Thanks,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">Omer<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"><o:p> </o:p></span></a></p>
<p class="MsoNormal"><a name="_____replyseparator"></a><b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">From:</span></b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"> Easwaran Raman [mailto:eraman@google.com]
<br>
<b>Sent:</b> Thursday, August 24, 2017 00:35<br>
<b>To:</b> Paparo Bivas, Omer <omer.paparo.bivas@intel.com><br>
<b>Cc:</b> reviews+D34393+public+21d556604f5de68f@reviews.llvm.org; Aboud, Amjad <amjad.aboud@intel.com>; Rackover, Zvi <zvi.rackover@intel.com>; Ansari, Zia <zia.ansari@intel.com>; craig.topper@gmail.com; rafael.espindola@gmail.com; Elovikov, Andrei <andrei.elovikov@intel.com>;
 gberry@codeaurora.org; wmi@google.com; kyle+llvm@iteratee.net; chandlerc@gmail.com; davidxl@google.com; llvm-dev@redking.me.uk; simon.dardis@imgtec.com; mgorny@gentoo.org; javed.absar@arm.com; llvm-commits@lists.llvm.org; Ben Simhon, Oren <oren.ben.simhon@intel.com>;
 Saba, Lama <lama.saba@intel.com><br>
<b>Subject:</b> Re: D34393: Adding code padding for performance stability - infrastructure<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal">I applies the two patches to llvm (synced at r311358). The attached perf_nops.mir test fails with the message:<o:p></o:p></p>
<div>
<p class="MsoNormal">LLVM ERROR: symbol '.L0$pb' can not be undefined in a subtraction expression<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Indeed if I generate the assembly, I don't see L0$pb defined. Am I missing something?<o:p></o:p></p>
</div>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal">On Sun, Aug 20, 2017 at 7:35 AM, Paparo Bivas, Omer <<a href="mailto:omer.paparo.bivas@intel.com" target="_blank">omer.paparo.bivas@intel.com</a>> wrote:<o:p></o:p></p>
<blockquote style="border:none;border-right:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm">
<p class="MsoNormal" style="margin-bottom:12.0pt">Hi,<br>
<br>
Attached is the said patch (CodePadding_x86.patch). I'm also attaching the infrastructure patch it relies on (CodePadding_inf.patch), which is identical to the one I've sent a few days ago.<br>
<br>
Thanks,<br>
Omer<br>
<br>
<span class="im">-----Original Message-----</span><br>
<span class="im">From: Omer Paparo Bivas via Phabricator [mailto:<a href="mailto:reviews@reviews.llvm.org">reviews@reviews.llvm.org</a>]</span><br>
<span class="im">Sent: Sunday, August 20, 2017 17:30</span><br>
<span class="im">To: Paparo Bivas, Omer <<a href="mailto:omer.paparo.bivas@intel.com">omer.paparo.bivas@intel.com</a>>; Aboud, Amjad <<a href="mailto:amjad.aboud@intel.com">amjad.aboud@intel.com</a>>; Rackover, Zvi <<a href="mailto:zvi.rackover@intel.com">zvi.rackover@intel.com</a>>;
 Ansari, Zia <<a href="mailto:zia.ansari@intel.com">zia.ansari@intel.com</a>>; <a href="mailto:craig.topper@gmail.com">
craig.topper@gmail.com</a>; <a href="mailto:rafael.espindola@gmail.com">rafael.espindola@gmail.com</a></span><br>
<span class="im">Cc: Elovikov, Andrei <<a href="mailto:andrei.elovikov@intel.com">andrei.elovikov@intel.com</a>>;
<a href="mailto:gberry@codeaurora.org">gberry@codeaurora.org</a>; <a href="mailto:wmi@google.com">
wmi@google.com</a>; <a href="mailto:eraman@google.com">eraman@google.com</a>; <a href="mailto:kyle%2Bllvm@iteratee.net">
kyle+llvm@iteratee.net</a>; <a href="mailto:chandlerc@gmail.com">chandlerc@gmail.com</a>;
<a href="mailto:davidxl@google.com">davidxl@google.com</a>; <a href="mailto:llvm-dev@redking.me.uk">
llvm-dev@redking.me.uk</a>; <a href="mailto:simon.dardis@imgtec.com">simon.dardis@imgtec.com</a>;
<a href="mailto:mgorny@gentoo.org">mgorny@gentoo.org</a>; <a href="mailto:javed.absar@arm.com">
javed.absar@arm.com</a>; <a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a>; Ben Simhon, Oren <<a href="mailto:oren.ben.simhon@intel.com">oren.ben.simhon@intel.com</a>>; Saba, Lama <<a href="mailto:lama.saba@intel.com">lama.saba@intel.com</a>></span><br>
<span class="im">Subject: [PATCH] D34393: Adding code padding for performance stability - infrastructure</span><o:p></o:p></p>
<div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt">opaparo added a comment.<br>
<br>
In <a href="https://reviews.llvm.org/D34393#844569" target="_blank">https://reviews.llvm.org/D34393#844569</a>, @davidxl wrote:<br>
<br>
> Tried the two patches with our internal benchmark -- the alignment related performance issue is still there.  The problem disappears with -mllvm -x86-experimental-pref-loop-alignment=5 is used.<br>
<br>
<br>
I can think of two reasons that might have caused the patch to fail to help you:<br>
<br>
1. This optimization is not enabled for all architectures. Use -target-cpu to specify the target (if you haven't already) to make sure you are compiling for the desired architecture, which will enable the optimization (if relevant). See the constructor of X86MCCodePadder
 for the list of architectures for which the optimization is enabled.<br>
2. You might have encountered a different alignment issue than the one handled by this patch. I will send you soon another patch (which was not yet uploaded for review) that addresses another alignment issue (in addition to the first one), which will hopefully
 handle your case. Regardless of the results you'll get, could you send a small reproducer for this problem? I would like to investigate it and see the kind of alignment issue we are facing here.<br>
<br>
<br>
<br>
<br>
<a href="https://reviews.llvm.org/D34393" target="_blank">https://reviews.llvm.org/D34393</a><br>
<br>
<br>
<o:p></o:p></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal">---------------------------------------------------------------------<br>
Intel Israel (74) Limited<br>
<br>
This e-mail and any attachments may contain confidential material for<br>
the sole use of the intended recipient(s). Any review or distribution<br>
by others is strictly prohibited. If you are not the intended<br>
recipient, please contact the sender and delete all copies.<o:p></o:p></p>
</div>
</div>
</blockquote>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</div>
<p>---------------------------------------------------------------------<br>
Intel Israel (74) Limited</p>

<p>This e-mail and any attachments may contain confidential material for<br>
the sole use of the intended recipient(s). Any review or distribution<br>
by others is strictly prohibited. If you are not the intended<br>
recipient, please contact the sender and delete all copies.</p></body>
</html>