<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=us-ascii"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:SimSun;
        panose-1:2 1 6 0 3 1 1 1 1 1;}
@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;}
@font-face
        {font-family:SimSun;
        panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
        {font-family:"Lucida Console";
        panose-1:2 11 6 9 4 5 4 2 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
p.MsoPlainText, li.MsoPlainText, div.MsoPlainText
        {mso-style-priority:99;
        mso-style-link:"Plain Text Char";
        margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
span.PlainTextChar
        {mso-style-name:"Plain Text Char";
        mso-style-priority:99;
        mso-style-link:"Plain Text";
        font-family:"Calibri",sans-serif;}
span.EmailStyle19
        {mso-style-type:personal;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
span.EmailStyle20
        {mso-style-type:personal;
        font-family:"Calibri",sans-serif;
        color:#1F497D;}
span.EmailStyle21
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.25in 1.0in 1.25in;}
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="#0563C1" vlink="#954F72"><div class=WordSection1><p class=MsoNormal><span style='color:#1F497D'>+llvmdev<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><div><div style='border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in'><p class=MsoNormal><b>From:</b> Lawrence [mailto:lawrence@codeaurora.org] <br><b>Sent:</b> Tuesday, July 14, 2015 5:42 PM<br><b>To:</b> 'dberlin@dberlin.org'<br><b>Cc:</b> 'Ana Pazos'; 'Sanjin Sijaric'; 'zinob@codeaurora.org'<br><b>Subject:</b> RE: Insight of 403050abcc091260be2e8f58484e7a39c0782b47?<o:p></o:p></p></div></div><p class=MsoNormal><o:p> </o:p></p><p class=MsoPlainText>Thanks Daniel for your prompt response.<o:p></o:p></p><p class=MsoPlainText><o:p> </o:p></p><p class=MsoPlainText>I understand the problem is a combination of multiple things, I have opened at least one RA bug for it.<o:p></o:p></p><p class=MsoPlainText><o:p> </o:p></p><p class=MsoPlainText>One thing I am not sure is should we add some register pressure mechanism to your patch (or even PRE) or fix later optimization such as rematerialization/split/spiller/coalescing(?) to handle that.<o:p></o:p></p><p class=MsoPlainText><o:p> </o:p></p><p class=MsoPlainText>+llvmdev for more discussion<o:p></o:p></p><p class=MsoPlainText><o:p> </o:p></p><p class=MsoPlainText>Will attached two log more detail to individual if anyone ask.<o:p></o:p></p><p class=MsoPlainText><o:p> </o:p></p><p class=MsoPlainText>Regards.<o:p></o:p></p><p class=MsoPlainText><o:p> </o:p></p><p class=MsoPlainText>Lawrence Hu<o:p></o:p></p><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><div><div style='border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in'><p class=MsoNormal><b>From:</b> Lawrence [<a href="mailto:lawrence@codeaurora.org">mailto:lawrence@codeaurora.org</a>] <br><b>Sent:</b> Tuesday, July 14, 2015 3:16 PM<br><b>To:</b> 'dberlin@dberlin.org'<br><b>Cc:</b> 'Ana Pazos'; 'Sanjin Sijaric'; 'zinob@codeaurora.org'<br><b>Subject:</b> Insight of 403050abcc091260be2e8f58484e7a39c0782b47?<o:p></o:p></p></div></div><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><span style='color:black'>Hi, </span><span style='font-size:9.0pt;font-family:"Lucida Console";color:black'>Daniel:<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:9.0pt;font-family:"Lucida Console";color:black'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:9.0pt;font-family:"Lucida Console";color:black'>I am investigating the performance of a version of open source bzip2/decompress, I found out that your patch <o:p></o:p></span></p><p class=MsoNormal><span style='font-size:9.0pt;font-family:"Lucida Console";color:black'><o:p> </o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.0pt;font-family:"Lucida Console";color:#4472C4'>commit 403050abcc091260be2e8f58484e7a39c0782b47<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.0pt;font-family:"Lucida Console";color:#4472C4'>Author: Daniel Berlin <<a href="mailto:dberlin@dberlin.org">dberlin@dberlin.org</a>><o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.0pt;font-family:"Lucida Console";color:#4472C4'>Date:   Tue Feb 3 20:37:08 2015 +0000<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.0pt;font-family:"Lucida Console";color:#4472C4'><o:p> </o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.0pt;font-family:"Lucida Console";color:#4472C4'>    Allow PRE to insert no-cost phi nodes<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.0pt;font-family:"Lucida Console";color:black'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:9.0pt;font-family:"Lucida Console";color:black'>changed some getelementptr to PHIs, which introduced a lot more long live ranges, that leaded to almost 3 times more Spill/Reloads from register allocation, as a result, it degraded the performance of bzip2/decompress by 16%.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:9.0pt;font-family:"Lucida Console";color:black'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:9.0pt;font-family:"Lucida Console";color:black'>Attached are two log files, log.good without your change, log.bad with your change.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:9.0pt;font-family:"Lucida Console";color:black'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:9.0pt;font-family:"Lucida Console";color:black'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:9.0pt;font-family:"Lucida Console";color:black'>I couldn’t understand your patch well just base on the description and comments, could you please give me some insight about the intention of the patch and possible way of limiting it to avoid that performance degradation?<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:9.0pt;font-family:"Lucida Console";color:black'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:9.0pt;font-family:"Lucida Console";color:black'>Your help is highly appreciated.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:9.0pt;font-family:"Lucida Console";color:black'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:9.0pt;font-family:"Lucida Console";color:black'>Regards<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:9.0pt;font-family:"Lucida Console";color:black'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:9.0pt;font-family:"Lucida Console";color:black'>Lawrence Hu.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:9.0pt;font-family:"Lucida Console";color:black'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:9.0pt;font-family:"Lucida Console";color:#BF0000'><o:p> </o:p></span></p><p class=MsoNormal><o:p> </o:p></p></div></body></html>