<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:Helvetica;
panose-1:2 11 6 4 2 2 2 2 2 4;}
@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;}
/* 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.msonormal0, li.msonormal0, div.msonormal0
{mso-style-name:msonormal;
mso-margin-top-alt:auto;
margin-right:0in;
mso-margin-bottom-alt:auto;
margin-left:0in;
font-size:12.0pt;
font-family:"Times New Roman",serif;}
span.EmailStyle19
{mso-style-type:personal-reply;
font-family:"Calibri",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@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'>Hi Michael,<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif'>I will take a look.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif'>My patch tries to make getUserCost() more accurate by finding more ext IRs that are free. As a result, I expect to see more loops get unrolled and more functions get inlined. I will look into these benchmarks to see what happened.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif'>As to compilation time, I think the unroller counts the loop size for the whole loop no matter how large the loop is. Shall we exit early if we realize the loop is hopeless for unrolling?<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif'><o:p> </o:p></span></p><div><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif'>Haicheng Wu<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif'>Employee of Qualcomm Datacenter Technologies, Inc.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif'>Qualcomm Datacenter Technologies, Inc. as an affiliate of Qualcomm Technologies, Inc. Qualcomm Technologies, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project.<o:p></o:p></span></p></div><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif'><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><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'> mzolotukhin@apple.com [mailto:mzolotukhin@apple.com] <br><b>Sent:</b> Monday, July 24, 2017 5:18 AM<br><b>To:</b> Haicheng Wu <haicheng@codeaurora.org><br><b>Cc:</b> llvm-commits <llvm-commits@lists.llvm.org>; Gerolf Hoflehner <ghoflehner@apple.com><br><b>Subject:</b> Re: [llvm] r308076 - [TTI] Refine the cost of EXT in getUserCost()<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><div><p class=MsoNormal><o:p> </o:p></p></div><p class=MsoNormal>This commit caused a number of code-size and compile-time degradations. Any chance to recover them?<o:p></o:p></p><div><p class=MsoNormal><o:p> </o:p></p><div><table class=MsoNormalTable border=0 cellspacing=0 cellpadding=0 style='border-collapse:collapse;max-width:100%;border-spacing: 0px'><thead><tr><td width=500 valign=bottom style='width:375.0pt;padding:3.0pt 3.75pt 3.0pt 3.75pt'><p class=MsoNormal align=center style='margin-bottom:15.0pt;text-align:center;line-height:15.0pt'><b><span style='font-size:9.0pt;font-family:"Helvetica",sans-serif;color:#333333'>Performance Regressions - code_size<o:p></o:p></span></b></p></td><td valign=bottom style='padding:3.0pt 3.75pt 3.0pt 3.75pt'><p class=MsoNormal align=center style='margin-bottom:15.0pt;text-align:center;line-height:15.0pt'><b><span style='font-size:9.0pt;font-family:"Helvetica",sans-serif;color:#333333'>Δ <o:p></o:p></span></b></p></td><td valign=bottom style='padding:3.0pt 3.75pt 3.0pt 3.75pt'><p class=MsoNormal align=center style='margin-bottom:15.0pt;text-align:center;line-height:15.0pt'><b><span style='font-size:9.0pt;font-family:"Helvetica",sans-serif;color:#333333'>Previous<o:p></o:p></span></b></p></td><td valign=bottom style='padding:3.0pt 3.75pt 3.0pt 3.75pt'><p class=MsoNormal align=center style='margin-bottom:15.0pt;text-align:center;line-height:15.0pt'><b><span style='font-size:9.0pt;font-family:"Helvetica",sans-serif;color:#333333'>Current<o:p></o:p></span></b></p></td><td valign=bottom style='padding:3.0pt 3.75pt 3.0pt 3.75pt'><p class=MsoNormal align=center style='margin-bottom:15.0pt;text-align:center;line-height:15.0pt'><b><span style='font-size:9.0pt;font-family:"Helvetica",sans-serif;color:#333333'>σ <o:p></o:p></span></b></p></td><td valign=bottom style='padding:3.0pt 3.75pt 3.0pt 3.75pt'><p class=MsoNormal align=center style='margin-bottom:15.0pt;text-align:center;line-height:15.0pt'><b><span style='font-size:9.0pt;font-family:"Helvetica",sans-serif;color:#333333'>Δ (B)<o:p></o:p></span></b></p></td><td valign=bottom style='padding:3.0pt 3.75pt 3.0pt 3.75pt'><p class=MsoNormal align=center style='margin-bottom:15.0pt;text-align:center;line-height:15.0pt'><b><span style='font-size:9.0pt;font-family:"Helvetica",sans-serif;color:#333333'>σ (B)<o:p></o:p></span></b></p></td></tr></thead><tr><td valign=top style='border:none;border-top:solid #DDDDDD 1.0pt;background:#F9F9F9;padding:3.0pt 3.75pt 3.0pt 3.75pt'><p class=MsoNormal style='margin-bottom:15.0pt;line-height:15.0pt'><span style='font-size:9.0pt;font-family:"Helvetica",sans-serif;color:#333333'><a href="http://104.154.54.203/db_default/v4/nts/59530/graph?test.1605737=8"><span style='color:#0088CC;text-decoration:none'>CTMark/sqlite3/sqlite3</span></a><o:p></o:p></span></p></td><td valign=top style='border:none;border-top:solid #DDDDDD 1.0pt;background:#FF6565;padding:3.0pt 3.75pt 3.0pt 3.75pt'><p class=MsoNormal style='margin-bottom:15.0pt;line-height:15.0pt'><span style='font-size:9.0pt;font-family:"Helvetica",sans-serif;color:#333333'>15.43%<o:p></o:p></span></p></td><td valign=top style='border:none;border-top:solid #DDDDDD 1.0pt;background:#F9F9F9;padding:3.0pt 3.75pt 3.0pt 3.75pt'><p class=MsoNormal style='margin-bottom:15.0pt;line-height:15.0pt'><span style='font-size:9.0pt;font-family:"Helvetica",sans-serif;color:#333333'>503892.0000<o:p></o:p></span></p></td><td valign=top style='border:none;border-top:solid #DDDDDD 1.0pt;background:#F9F9F9;padding:3.0pt 3.75pt 3.0pt 3.75pt'><p class=MsoNormal style='margin-bottom:15.0pt;line-height:15.0pt'><span style='font-size:9.0pt;font-family:"Helvetica",sans-serif;color:#333333'>581656.0000<o:p></o:p></span></p></td><td valign=top style='border:none;border-top:solid #DDDDDD 1.0pt;background:#F9F9F9;padding:3.0pt 3.75pt 3.0pt 3.75pt'><p class=MsoNormal style='margin-bottom:15.0pt;line-height:15.0pt'><span style='font-size:9.0pt;font-family:"Helvetica",sans-serif;color:#333333'>-<o:p></o:p></span></p></td><td valign=top style='border:none;border-top:solid #DDDDDD 1.0pt;background:#FF7070;padding:3.0pt 3.75pt 3.0pt 3.75pt'><p class=MsoNormal style='margin-bottom:15.0pt;line-height:15.0pt'><span style='font-size:9.0pt;font-family:"Helvetica",sans-serif;color:#333333'>12.92%<o:p></o:p></span></p></td><td valign=top style='border:none;border-top:solid #DDDDDD 1.0pt;background:#F9F9F9;padding:3.0pt 3.75pt 3.0pt 3.75pt'><p class=MsoNormal style='margin-bottom:15.0pt;line-height:15.0pt'><span style='font-size:9.0pt;font-family:"Helvetica",sans-serif;color:#333333'>-<o:p></o:p></span></p></td></tr><tr><td valign=top style='border:none;border-top:solid #DDDDDD 1.0pt;padding:3.0pt 3.75pt 3.0pt 3.75pt'><p class=MsoNormal style='margin-bottom:15.0pt;line-height:15.0pt'><span style='font-size:9.0pt;font-family:"Helvetica",sans-serif;color:#333333'><a href="http://104.154.54.203/db_default/v4/nts/59530/graph?test.1605732=8"><span style='color:#0088CC;text-decoration:none'>CTMark/lencod/lencod</span></a><o:p></o:p></span></p></td><td valign=top style='border:none;border-top:solid #DDDDDD 1.0pt;background:#FFABAB;padding:3.0pt 3.75pt 3.0pt 3.75pt'><p class=MsoNormal style='margin-bottom:15.0pt;line-height:15.0pt'><span style='font-size:9.0pt;font-family:"Helvetica",sans-serif;color:#333333'>3.92%<o:p></o:p></span></p></td><td valign=top style='border:none;border-top:solid #DDDDDD 1.0pt;padding:3.0pt 3.75pt 3.0pt 3.75pt'><p class=MsoNormal style='margin-bottom:15.0pt;line-height:15.0pt'><span style='font-size:9.0pt;font-family:"Helvetica",sans-serif;color:#333333'>636696.0000<o:p></o:p></span></p></td><td valign=top style='border:none;border-top:solid #DDDDDD 1.0pt;padding:3.0pt 3.75pt 3.0pt 3.75pt'><p class=MsoNormal style='margin-bottom:15.0pt;line-height:15.0pt'><span style='font-size:9.0pt;font-family:"Helvetica",sans-serif;color:#333333'>661652.0000<o:p></o:p></span></p></td><td valign=top style='border:none;border-top:solid #DDDDDD 1.0pt;padding:3.0pt 3.75pt 3.0pt 3.75pt'><p class=MsoNormal style='margin-bottom:15.0pt;line-height:15.0pt'><span style='font-size:9.0pt;font-family:"Helvetica",sans-serif;color:#333333'>-<o:p></o:p></span></p></td><td valign=top style='border:none;border-top:solid #DDDDDD 1.0pt;background:#FF4141;padding:3.0pt 3.75pt 3.0pt 3.75pt'><p class=MsoNormal style='margin-bottom:15.0pt;line-height:15.0pt'><span style='font-size:9.0pt;font-family:"Helvetica",sans-serif;color:#333333'>26.59%<o:p></o:p></span></p></td><td valign=top style='border:none;border-top:solid #DDDDDD 1.0pt;padding:3.0pt 3.75pt 3.0pt 3.75pt'><p class=MsoNormal style='margin-bottom:15.0pt;line-height:15.0pt'><span style='font-size:9.0pt;font-family:"Helvetica",sans-serif;color:#333333'>-<o:p></o:p></span></p></td></tr><tr><td valign=top style='border:none;border-top:solid #DDDDDD 1.0pt;background:#F9F9F9;padding:3.0pt 3.75pt 3.0pt 3.75pt'><p class=MsoNormal style='margin-bottom:15.0pt;line-height:15.0pt'><span style='font-size:9.0pt;font-family:"Helvetica",sans-serif;color:#333333'><a href="http://104.154.54.203/db_default/v4/nts/59530/graph?test.1605723=8"><span style='color:#0088CC;text-decoration:none'>CTMark/mafft/pairlocalalign</span></a><o:p></o:p></span></p></td><td valign=top style='border:none;border-top:solid #DDDDDD 1.0pt;background:#FFB1B1;padding:3.0pt 3.75pt 3.0pt 3.75pt'><p class=MsoNormal style='margin-bottom:15.0pt;line-height:15.0pt'><span style='font-size:9.0pt;font-family:"Helvetica",sans-serif;color:#333333'>3.34%<o:p></o:p></span></p></td><td valign=top style='border:none;border-top:solid #DDDDDD 1.0pt;background:#F9F9F9;padding:3.0pt 3.75pt 3.0pt 3.75pt'><p class=MsoNormal style='margin-bottom:15.0pt;line-height:15.0pt'><span style='font-size:9.0pt;font-family:"Helvetica",sans-serif;color:#333333'>151352.0000<o:p></o:p></span></p></td><td valign=top style='border:none;border-top:solid #DDDDDD 1.0pt;background:#F9F9F9;padding:3.0pt 3.75pt 3.0pt 3.75pt'><p class=MsoNormal style='margin-bottom:15.0pt;line-height:15.0pt'><span style='font-size:9.0pt;font-family:"Helvetica",sans-serif;color:#333333'>156404.0000<o:p></o:p></span></p></td><td valign=top style='border:none;border-top:solid #DDDDDD 1.0pt;background:#F9F9F9;padding:3.0pt 3.75pt 3.0pt 3.75pt'><p class=MsoNormal style='margin-bottom:15.0pt;line-height:15.0pt'><span style='font-size:9.0pt;font-family:"Helvetica",sans-serif;color:#333333'>-<o:p></o:p></span></p></td><td valign=top style='border:none;border-top:solid #DDDDDD 1.0pt;background:#FF6F6F;padding:3.0pt 3.75pt 3.0pt 3.75pt'><p class=MsoNormal style='margin-bottom:15.0pt;line-height:15.0pt'><span style='font-size:9.0pt;font-family:"Helvetica",sans-serif;color:#333333'>13.15%<o:p></o:p></span></p></td><td valign=top style='border:none;border-top:solid #DDDDDD 1.0pt;background:#F9F9F9;padding:3.0pt 3.75pt 3.0pt 3.75pt'><p class=MsoNormal style='margin-bottom:15.0pt;line-height:15.0pt'><span style='font-size:9.0pt;font-family:"Helvetica",sans-serif;color:#333333'>-<o:p></o:p></span></p></td></tr></table><div style='margin-bottom:7.5pt'><p class=MsoNormal><span style='font-size:10.5pt;font-family:"Helvetica",sans-serif;color:#333333'><o:p> </o:p></span></p></div><table class=MsoNormalTable border=0 cellspacing=0 cellpadding=0 style='border-collapse:collapse;max-width:100%;border-spacing: 0px'><thead><tr><td width=500 valign=bottom style='width:375.0pt;padding:3.0pt 3.75pt 3.0pt 3.75pt'><p class=MsoNormal align=center style='margin-bottom:15.0pt;text-align:center;line-height:15.0pt'><b><span style='font-size:9.0pt;font-family:"Helvetica",sans-serif;color:#333333'>Performance Regressions - Compile Time<o:p></o:p></span></b></p></td><td valign=bottom style='padding:3.0pt 3.75pt 3.0pt 3.75pt'><p class=MsoNormal align=center style='margin-bottom:15.0pt;text-align:center;line-height:15.0pt'><b><span style='font-size:9.0pt;font-family:"Helvetica",sans-serif;color:#333333'>Δ <o:p></o:p></span></b></p></td><td valign=bottom style='padding:3.0pt 3.75pt 3.0pt 3.75pt'><p class=MsoNormal align=center style='margin-bottom:15.0pt;text-align:center;line-height:15.0pt'><b><span style='font-size:9.0pt;font-family:"Helvetica",sans-serif;color:#333333'>Previous<o:p></o:p></span></b></p></td><td valign=bottom style='padding:3.0pt 3.75pt 3.0pt 3.75pt'><p class=MsoNormal align=center style='margin-bottom:15.0pt;text-align:center;line-height:15.0pt'><b><span style='font-size:9.0pt;font-family:"Helvetica",sans-serif;color:#333333'>Current<o:p></o:p></span></b></p></td><td valign=bottom style='padding:3.0pt 3.75pt 3.0pt 3.75pt'><p class=MsoNormal align=center style='margin-bottom:15.0pt;text-align:center;line-height:15.0pt'><b><span style='font-size:9.0pt;font-family:"Helvetica",sans-serif;color:#333333'>σ <o:p></o:p></span></b></p></td><td valign=bottom style='padding:3.0pt 3.75pt 3.0pt 3.75pt'><p class=MsoNormal align=center style='margin-bottom:15.0pt;text-align:center;line-height:15.0pt'><b><span style='font-size:9.0pt;font-family:"Helvetica",sans-serif;color:#333333'>Δ (B)<o:p></o:p></span></b></p></td><td valign=bottom style='padding:3.0pt 3.75pt 3.0pt 3.75pt'><p class=MsoNormal align=center style='margin-bottom:15.0pt;text-align:center;line-height:15.0pt'><b><span style='font-size:9.0pt;font-family:"Helvetica",sans-serif;color:#333333'>σ (B)<o:p></o:p></span></b></p></td></tr></thead><tr><td valign=top style='border:none;border-top:solid #DDDDDD 1.0pt;background:#F9F9F9;padding:3.0pt 3.75pt 3.0pt 3.75pt'><p class=MsoNormal style='margin-bottom:15.0pt;line-height:15.0pt'><span style='font-size:9.0pt;font-family:"Helvetica",sans-serif;color:#333333'><a href="http://104.154.54.203/db_default/v4/nts/59530/graph?test.1605736=2"><span style='color:#0088CC;text-decoration:none'>CTMark/sqlite3/sqlite3-link</span></a><o:p></o:p></span></p></td><td valign=top style='border:none;border-top:solid #DDDDDD 1.0pt;background:#FF5D5D;padding:3.0pt 3.75pt 3.0pt 3.75pt'><p class=MsoNormal style='margin-bottom:15.0pt;line-height:15.0pt'><span style='font-size:9.0pt;font-family:"Helvetica",sans-serif;color:#333333'>17.62%<o:p></o:p></span></p></td><td valign=top style='border:none;border-top:solid #DDDDDD 1.0pt;background:#F9F9F9;padding:3.0pt 3.75pt 3.0pt 3.75pt'><p class=MsoNormal style='margin-bottom:15.0pt;line-height:15.0pt'><span style='font-size:9.0pt;font-family:"Helvetica",sans-serif;color:#333333'>7.1298<o:p></o:p></span></p></td><td valign=top style='border:none;border-top:solid #DDDDDD 1.0pt;background:#F9F9F9;padding:3.0pt 3.75pt 3.0pt 3.75pt'><p class=MsoNormal style='margin-bottom:15.0pt;line-height:15.0pt'><span style='font-size:9.0pt;font-family:"Helvetica",sans-serif;color:#333333'>8.3859<o:p></o:p></span></p></td><td valign=top style='border:none;border-top:solid #DDDDDD 1.0pt;background:#F9F9F9;padding:3.0pt 3.75pt 3.0pt 3.75pt'><p class=MsoNormal style='margin-bottom:15.0pt;line-height:15.0pt'><span style='font-size:9.0pt;font-family:"Helvetica",sans-serif;color:#333333'>-<o:p></o:p></span></p></td><td valign=top style='border:none;border-top:solid #DDDDDD 1.0pt;background:#FFABAB;padding:3.0pt 3.75pt 3.0pt 3.75pt'><p class=MsoNormal style='margin-bottom:15.0pt;line-height:15.0pt'><span style='font-size:9.0pt;font-family:"Helvetica",sans-serif;color:#333333'>3.90%<o:p></o:p></span></p></td><td valign=top style='border:none;border-top:solid #DDDDDD 1.0pt;background:#F9F9F9;padding:3.0pt 3.75pt 3.0pt 3.75pt'><p class=MsoNormal style='margin-bottom:15.0pt;line-height:15.0pt'><span style='font-size:9.0pt;font-family:"Helvetica",sans-serif;color:#333333'>-<o:p></o:p></span></p></td></tr><tr><td valign=top style='border:none;border-top:solid #DDDDDD 1.0pt;padding:3.0pt 3.75pt 3.0pt 3.75pt'><p class=MsoNormal style='margin-bottom:15.0pt;line-height:15.0pt'><span style='font-size:9.0pt;font-family:"Helvetica",sans-serif;color:#333333'><a href="http://104.154.54.203/db_default/v4/nts/59530/graph?test.1605737=2"><span style='color:#0088CC;text-decoration:none'>CTMark/sqlite3/sqlite3</span></a><o:p></o:p></span></p></td><td valign=top style='border:none;border-top:solid #DDDDDD 1.0pt;background:#FF7171;padding:3.0pt 3.75pt 3.0pt 3.75pt'><p class=MsoNormal style='margin-bottom:15.0pt;line-height:15.0pt'><span style='font-size:9.0pt;font-family:"Helvetica",sans-serif;color:#333333'>12.75%<o:p></o:p></span></p></td><td valign=top style='border:none;border-top:solid #DDDDDD 1.0pt;padding:3.0pt 3.75pt 3.0pt 3.75pt'><p class=MsoNormal style='margin-bottom:15.0pt;line-height:15.0pt'><span style='font-size:9.0pt;font-family:"Helvetica",sans-serif;color:#333333'>7.5996<o:p></o:p></span></p></td><td valign=top style='border:none;border-top:solid #DDDDDD 1.0pt;padding:3.0pt 3.75pt 3.0pt 3.75pt'><p class=MsoNormal style='margin-bottom:15.0pt;line-height:15.0pt'><span style='font-size:9.0pt;font-family:"Helvetica",sans-serif;color:#333333'>8.5685<o:p></o:p></span></p></td><td valign=top style='border:none;border-top:solid #DDDDDD 1.0pt;padding:3.0pt 3.75pt 3.0pt 3.75pt'><p class=MsoNormal style='margin-bottom:15.0pt;line-height:15.0pt'><span style='font-size:9.0pt;font-family:"Helvetica",sans-serif;color:#333333'>-<o:p></o:p></span></p></td><td valign=top style='border:none;border-top:solid #DDDDDD 1.0pt;background:#FFB1B1;padding:3.0pt 3.75pt 3.0pt 3.75pt'><p class=MsoNormal style='margin-bottom:15.0pt;line-height:15.0pt'><span style='font-size:9.0pt;font-family:"Helvetica",sans-serif;color:#333333'>3.34%<o:p></o:p></span></p></td><td valign=top style='border:none;border-top:solid #DDDDDD 1.0pt;padding:3.0pt 3.75pt 3.0pt 3.75pt'><p class=MsoNormal style='margin-bottom:15.0pt;line-height:15.0pt'><span style='font-size:9.0pt;font-family:"Helvetica",sans-serif;color:#333333'>-<o:p></o:p></span></p></td></tr><tr><td valign=top style='border:none;border-top:solid #DDDDDD 1.0pt;background:#F9F9F9;padding:3.0pt 3.75pt 3.0pt 3.75pt'><p class=MsoNormal style='margin-bottom:15.0pt;line-height:15.0pt'><span style='font-size:9.0pt;font-family:"Helvetica",sans-serif;color:#333333'><a href="http://104.154.54.203/db_default/v4/nts/59530/graph?test.1605740=2"><span style='color:#0088CC;text-decoration:none'>CTMark/mafft/pairlocalalign-link</span></a><o:p></o:p></span></p></td><td valign=top style='border:none;border-top:solid #DDDDDD 1.0pt;background:#FF8F8F;padding:3.0pt 3.75pt 3.0pt 3.75pt'><p class=MsoNormal style='margin-bottom:15.0pt;line-height:15.0pt'><span style='font-size:9.0pt;font-family:"Helvetica",sans-serif;color:#333333'>7.33%<o:p></o:p></span></p></td><td valign=top style='border:none;border-top:solid #DDDDDD 1.0pt;background:#F9F9F9;padding:3.0pt 3.75pt 3.0pt 3.75pt'><p class=MsoNormal style='margin-bottom:15.0pt;line-height:15.0pt'><span style='font-size:9.0pt;font-family:"Helvetica",sans-serif;color:#333333'>2.7199<o:p></o:p></span></p></td><td valign=top style='border:none;border-top:solid #DDDDDD 1.0pt;background:#F9F9F9;padding:3.0pt 3.75pt 3.0pt 3.75pt'><p class=MsoNormal style='margin-bottom:15.0pt;line-height:15.0pt'><span style='font-size:9.0pt;font-family:"Helvetica",sans-serif;color:#333333'>2.9194<o:p></o:p></span></p></td><td valign=top style='border:none;border-top:solid #DDDDDD 1.0pt;background:#F9F9F9;padding:3.0pt 3.75pt 3.0pt 3.75pt'><p class=MsoNormal style='margin-bottom:15.0pt;line-height:15.0pt'><span style='font-size:9.0pt;font-family:"Helvetica",sans-serif;color:#333333'>-<o:p></o:p></span></p></td><td valign=top style='border:none;border-top:solid #DDDDDD 1.0pt;background:#6BFF6B;padding:3.0pt 3.75pt 3.0pt 3.75pt'><p class=MsoNormal style='margin-bottom:15.0pt;line-height:15.0pt'><span style='font-size:9.0pt;font-family:"Helvetica",sans-serif;color:#333333'>-14.12%<o:p></o:p></span></p></td><td valign=top style='border:none;border-top:solid #DDDDDD 1.0pt;background:#F9F9F9;padding:3.0pt 3.75pt 3.0pt 3.75pt'><p class=MsoNormal style='margin-bottom:15.0pt;line-height:15.0pt'><span style='font-size:9.0pt;font-family:"Helvetica",sans-serif;color:#333333'>-<o:p></o:p></span></p></td></tr><tr><td valign=top style='border:none;border-top:solid #DDDDDD 1.0pt;padding:3.0pt 3.75pt 3.0pt 3.75pt'><p class=MsoNormal style='margin-bottom:15.0pt;line-height:15.0pt'><span style='font-size:9.0pt;font-family:"Helvetica",sans-serif;color:#333333'><a href="http://104.154.54.203/db_default/v4/nts/59530/graph?test.1605738=2"><span style='color:#0088CC;text-decoration:none'>CTMark/lencod/lencod-link</span></a><o:p></o:p></span></p></td><td valign=top style='border:none;border-top:solid #DDDDDD 1.0pt;background:#FFA6A6;padding:3.0pt 3.75pt 3.0pt 3.75pt'><p class=MsoNormal style='margin-bottom:15.0pt;line-height:15.0pt'><span style='font-size:9.0pt;font-family:"Helvetica",sans-serif;color:#333333'>4.42%<o:p></o:p></span></p></td><td valign=top style='border:none;border-top:solid #DDDDDD 1.0pt;padding:3.0pt 3.75pt 3.0pt 3.75pt'><p class=MsoNormal style='margin-bottom:15.0pt;line-height:15.0pt'><span style='font-size:9.0pt;font-family:"Helvetica",sans-serif;color:#333333'>11.9191<o:p></o:p></span></p></td><td valign=top style='border:none;border-top:solid #DDDDDD 1.0pt;padding:3.0pt 3.75pt 3.0pt 3.75pt'><p class=MsoNormal style='margin-bottom:15.0pt;line-height:15.0pt'><span style='font-size:9.0pt;font-family:"Helvetica",sans-serif;color:#333333'>12.4459<o:p></o:p></span></p></td><td valign=top style='border:none;border-top:solid #DDDDDD 1.0pt;padding:3.0pt 3.75pt 3.0pt 3.75pt'><p class=MsoNormal style='margin-bottom:15.0pt;line-height:15.0pt'><span style='font-size:9.0pt;font-family:"Helvetica",sans-serif;color:#333333'>-<o:p></o:p></span></p></td><td valign=top style='border:none;border-top:solid #DDDDDD 1.0pt;background:#FFB4B4;padding:3.0pt 3.75pt 3.0pt 3.75pt'><p class=MsoNormal style='margin-bottom:15.0pt;line-height:15.0pt'><span style='font-size:9.0pt;font-family:"Helvetica",sans-serif;color:#333333'>3.07%<o:p></o:p></span></p></td><td valign=top style='border:none;border-top:solid #DDDDDD 1.0pt;padding:3.0pt 3.75pt 3.0pt 3.75pt'><p class=MsoNormal style='margin-bottom:15.0pt;line-height:15.0pt'><span style='font-size:9.0pt;font-family:"Helvetica",sans-serif;color:#333333'>-<o:p></o:p></span></p></td></tr><tr><td valign=top style='border:none;border-top:solid #DDDDDD 1.0pt;background:#F9F9F9;padding:3.0pt 3.75pt 3.0pt 3.75pt'><p class=MsoNormal style='margin-bottom:15.0pt;line-height:15.0pt'><span style='font-size:9.0pt;font-family:"Helvetica",sans-serif;color:#333333'><a href="http://104.154.54.203/db_default/v4/nts/59530/graph?test.1605723=2"><span style='color:#0088CC;text-decoration:none'>CTMark/mafft/pairlocalalign</span></a><o:p></o:p></span></p></td><td valign=top style='border:none;border-top:solid #DDDDDD 1.0pt;background:#FFB3B3;padding:3.0pt 3.75pt 3.0pt 3.75pt'><p class=MsoNormal style='margin-bottom:15.0pt;line-height:15.0pt'><span style='font-size:9.0pt;font-family:"Helvetica",sans-serif;color:#333333'>3.15%<o:p></o:p></span></p></td><td valign=top style='border:none;border-top:solid #DDDDDD 1.0pt;background:#F9F9F9;padding:3.0pt 3.75pt 3.0pt 3.75pt'><p class=MsoNormal style='margin-bottom:15.0pt;line-height:15.0pt'><span style='font-size:9.0pt;font-family:"Helvetica",sans-serif;color:#333333'>5.1741<o:p></o:p></span></p></td><td valign=top style='border:none;border-top:solid #DDDDDD 1.0pt;background:#F9F9F9;padding:3.0pt 3.75pt 3.0pt 3.75pt'><p class=MsoNormal style='margin-bottom:15.0pt;line-height:15.0pt'><span style='font-size:9.0pt;font-family:"Helvetica",sans-serif;color:#333333'>5.3370<o:p></o:p></span></p></td><td valign=top style='border:none;border-top:solid #DDDDDD 1.0pt;background:#F9F9F9;padding:3.0pt 3.75pt 3.0pt 3.75pt'><p class=MsoNormal style='margin-bottom:15.0pt;line-height:15.0pt'><span style='font-size:9.0pt;font-family:"Helvetica",sans-serif;color:#333333'>-<o:p></o:p></span></p></td><td valign=top style='border:none;border-top:solid #DDDDDD 1.0pt;background:#5FFF5F;padding:3.0pt 3.75pt 3.0pt 3.75pt'><p class=MsoNormal style='margin-bottom:15.0pt;line-height:15.0pt'><span style='font-size:9.0pt;font-family:"Helvetica",sans-serif;color:#333333'>-16.96%<o:p></o:p></span></p></td><td valign=top style='border:none;border-top:solid #DDDDDD 1.0pt;background:#F9F9F9;padding:3.0pt 3.75pt 3.0pt 3.75pt'><p class=MsoNormal style='margin-bottom:15.0pt;line-height:15.0pt'><span style='font-size:9.0pt;font-family:"Helvetica",sans-serif;color:#333333'>-<o:p></o:p></span></p></td></tr><tr><td valign=top style='border:none;border-top:solid #DDDDDD 1.0pt;padding:3.0pt 3.75pt 3.0pt 3.75pt'><p class=MsoNormal style='margin-bottom:15.0pt;line-height:15.0pt'><span style='font-size:9.0pt;font-family:"Helvetica",sans-serif;color:#333333'><a href="http://104.154.54.203/db_default/v4/nts/59530/graph?test.1605732=2"><span style='color:#0088CC;text-decoration:none'>CTMark/lencod/lencod</span></a><o:p></o:p></span></p></td><td valign=top style='border:none;border-top:solid #DDDDDD 1.0pt;background:#FFBEBE;padding:3.0pt 3.75pt 3.0pt 3.75pt'><p class=MsoNormal style='margin-bottom:15.0pt;line-height:15.0pt'><span style='font-size:9.0pt;font-family:"Helvetica",sans-serif;color:#333333'>2.25%<o:p></o:p></span></p></td><td valign=top style='border:none;border-top:solid #DDDDDD 1.0pt;padding:3.0pt 3.75pt 3.0pt 3.75pt'><p class=MsoNormal style='margin-bottom:15.0pt;line-height:15.0pt'><span style='font-size:9.0pt;font-family:"Helvetica",sans-serif;color:#333333'>10.6467<o:p></o:p></span></p></td><td valign=top style='border:none;border-top:solid #DDDDDD 1.0pt;padding:3.0pt 3.75pt 3.0pt 3.75pt'><p class=MsoNormal style='margin-bottom:15.0pt;line-height:15.0pt'><span style='font-size:9.0pt;font-family:"Helvetica",sans-serif;color:#333333'>10.8867<o:p></o:p></span></p></td><td valign=top style='border:none;border-top:solid #DDDDDD 1.0pt;padding:3.0pt 3.75pt 3.0pt 3.75pt'><p class=MsoNormal style='margin-bottom:15.0pt;line-height:15.0pt'><span style='font-size:9.0pt;font-family:"Helvetica",sans-serif;color:#333333'>-<o:p></o:p></span></p></td><td valign=top style='border:none;border-top:solid #DDDDDD 1.0pt;background:#EBFFEB;padding:3.0pt 3.75pt 3.0pt 3.75pt'><p class=MsoNormal style='margin-bottom:15.0pt;line-height:15.0pt'><span style='font-size:9.0pt;font-family:"Helvetica",sans-serif;color:#333333'>-0.17%<o:p></o:p></span></p></td><td valign=top style='border:none;border-top:solid #DDDDDD 1.0pt;padding:3.0pt 3.75pt 3.0pt 3.75pt'><p class=MsoNormal style='margin-bottom:15.0pt;line-height:15.0pt'><span style='font-size:9.0pt;font-family:"Helvetica",sans-serif;color:#333333'>-<o:p></o:p></span></p></td></tr><tr><td valign=top style='border:none;border-top:solid #DDDDDD 1.0pt;background:#F9F9F9;padding:3.0pt 3.75pt 3.0pt 3.75pt'><p class=MsoNormal style='margin-bottom:15.0pt;line-height:15.0pt'><span style='font-size:9.0pt;font-family:"Helvetica",sans-serif;color:#333333'><a href="http://104.154.54.203/db_default/v4/nts/59530/graph?test.1605724=2"><span style='color:#0088CC;text-decoration:none'>CTMark/7zip/7zip-benchmark</span></a><o:p></o:p></span></p></td><td valign=top style='border:none;border-top:solid #DDDDDD 1.0pt;background:#FFCFCF;padding:3.0pt 3.75pt 3.0pt 3.75pt'><p class=MsoNormal style='margin-bottom:15.0pt;line-height:15.0pt'><span style='font-size:9.0pt;font-family:"Helvetica",sans-serif;color:#333333'>1.18%<o:p></o:p></span></p></td><td valign=top style='border:none;border-top:solid #DDDDDD 1.0pt;background:#F9F9F9;padding:3.0pt 3.75pt 3.0pt 3.75pt'><p class=MsoNormal style='margin-bottom:15.0pt;line-height:15.0pt'><span style='font-size:9.0pt;font-family:"Helvetica",sans-serif;color:#333333'>35.7458<o:p></o:p></span></p></td><td valign=top style='border:none;border-top:solid #DDDDDD 1.0pt;background:#F9F9F9;padding:3.0pt 3.75pt 3.0pt 3.75pt'><p class=MsoNormal style='margin-bottom:15.0pt;line-height:15.0pt'><span style='font-size:9.0pt;font-family:"Helvetica",sans-serif;color:#333333'>36.1689<o:p></o:p></span></p></td><td valign=top style='border:none;border-top:solid #DDDDDD 1.0pt;background:#F9F9F9;padding:3.0pt 3.75pt 3.0pt 3.75pt'><p class=MsoNormal style='margin-bottom:15.0pt;line-height:15.0pt'><span style='font-size:9.0pt;font-family:"Helvetica",sans-serif;color:#333333'>-<o:p></o:p></span></p></td><td valign=top style='border:none;border-top:solid #DDDDDD 1.0pt;background:#FFA7A7;padding:3.0pt 3.75pt 3.0pt 3.75pt'><p class=MsoNormal style='margin-bottom:15.0pt;line-height:15.0pt'><span style='font-size:9.0pt;font-family:"Helvetica",sans-serif;color:#333333'>4.27%<o:p></o:p></span></p></td><td valign=top style='border:none;border-top:solid #DDDDDD 1.0pt;background:#F9F9F9;padding:3.0pt 3.75pt 3.0pt 3.75pt'><p class=MsoNormal style='margin-bottom:12.0pt;line-height:15.0pt'><span style='font-size:9.0pt;font-family:"Helvetica",sans-serif;color:#333333'>-<o:p></o:p></span></p></td></tr></table></div><div><p class=MsoNormal>Details on green dragon:<o:p></o:p></p></div><div><p class=MsoNormal><a href="http://104.154.54.203/db_default/v4/nts/59530">http://104.154.54.203/db_default/v4/nts/59530</a><o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>Thanks,<o:p></o:p></p></div><div><p class=MsoNormal>Michael<o:p></o:p></p></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 Jul 15, 2017, at 6:12 AM, Haicheng Wu via llvm-commits <<a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a>> wrote:<o:p></o:p></p></div><p class=MsoNormal><o:p> </o:p></p><div><div><p class=MsoNormal>Author: haicheng<br>Date: Fri Jul 14 19:12:16 2017<br>New Revision: 308076<br><br>URL: <a href="http://llvm.org/viewvc/llvm-project?rev=308076&view=rev">http://llvm.org/viewvc/llvm-project?rev=308076&view=rev</a><br>Log:<br>[TTI] Refine the cost of EXT in getUserCost()<br><br>Now, getUserCost() only checks the src and dst types of EXT to decide it is free<br>or not. This change first checks the types, then calls isExtFreeImpl(), and<br>check if EXT can form ExtLoad at last. Currently, only AArch64 has customized<br>implementation of isExtFreeImpl() to check if EXT can be folded into its use.<br><br>Differential Revision: <a href="https://reviews.llvm.org/D34458">https://reviews.llvm.org/D34458</a><br><br>Added:<br> llvm/trunk/test/Transforms/Inline/AArch64/ext.ll<br> llvm/trunk/test/Transforms/Inline/PowerPC/<br> llvm/trunk/test/Transforms/Inline/PowerPC/ext.ll<br> llvm/trunk/test/Transforms/Inline/PowerPC/lit.local.cfg<br> llvm/trunk/test/Transforms/Inline/X86/ext.ll<br>Modified:<br> llvm/trunk/include/llvm/Analysis/TargetTransformInfo.h<br> llvm/trunk/include/llvm/Analysis/TargetTransformInfoImpl.h<br> llvm/trunk/include/llvm/CodeGen/BasicTTIImpl.h<br> llvm/trunk/include/llvm/Target/TargetLowering.h<br> llvm/trunk/lib/Analysis/TargetTransformInfo.cpp<br> llvm/trunk/lib/CodeGen/CodeGenPrepare.cpp<br><br>Modified: llvm/trunk/include/llvm/Analysis/TargetTransformInfo.h<br>URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/TargetTransformInfo.h?rev=308076&r1=308075&r2=308076&view=diff">http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/TargetTransformInfo.h?rev=308076&r1=308075&r2=308076&view=diff</a><br>==============================================================================<br>--- llvm/trunk/include/llvm/Analysis/TargetTransformInfo.h (original)<br>+++ llvm/trunk/include/llvm/Analysis/TargetTransformInfo.h Fri Jul 14 19:12:16 2017<br>@@ -155,6 +155,13 @@ public:<br> int getGEPCost(Type *PointeeType, const Value *Ptr,<br> ArrayRef<const Value *> Operands) const;<br><br>+ /// \brief Estimate the cost of a EXT operation when lowered.<br>+ ///<br>+ /// The contract for this function is the same as \c getOperationCost except<br>+ /// that it supports an interface that provides extra information specific to<br>+ /// the EXT operation.<br>+ int getExtCost(const Instruction *I, const Value *Src) const;<br>+<br> /// \brief Estimate the cost of a function call when lowered.<br> ///<br> /// The contract for this is the same as \c getOperationCost except that it<br>@@ -849,6 +856,7 @@ public:<br> virtual int getOperationCost(unsigned Opcode, Type *Ty, Type *OpTy) = 0;<br> virtual int getGEPCost(Type *PointeeType, const Value *Ptr,<br> ArrayRef<const Value *> Operands) = 0;<br>+ virtual int getExtCost(const Instruction *I, const Value *Src) = 0;<br> virtual int getCallCost(FunctionType *FTy, int NumArgs) = 0;<br> virtual int getCallCost(const Function *F, int NumArgs) = 0;<br> virtual int getCallCost(const Function *F,<br>@@ -1022,6 +1030,9 @@ public:<br> ArrayRef<const Value *> Operands) override {<br> return Impl.getGEPCost(PointeeType, Ptr, Operands);<br> }<br>+ int getExtCost(const Instruction *I, const Value *Src) override {<br>+ return Impl.getExtCost(I, Src);<br>+ }<br> int getCallCost(FunctionType *FTy, int NumArgs) override {<br> return Impl.getCallCost(FTy, NumArgs);<br> }<br><br>Modified: llvm/trunk/include/llvm/Analysis/TargetTransformInfoImpl.h<br>URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/TargetTransformInfoImpl.h?rev=308076&r1=308075&r2=308076&view=diff">http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/TargetTransformInfoImpl.h?rev=308076&r1=308075&r2=308076&view=diff</a><br>==============================================================================<br>--- llvm/trunk/include/llvm/Analysis/TargetTransformInfoImpl.h (original)<br>+++ llvm/trunk/include/llvm/Analysis/TargetTransformInfoImpl.h Fri Jul 14 19:12:16 2017<br>@@ -120,6 +120,10 @@ public:<br> return SI.getNumCases();<br> }<br><br>+ int getExtCost(const Instruction *I, const Value *Src) {<br>+ return TTI::TCC_Basic;<br>+ }<br>+<br> unsigned getCallCost(FunctionType *FTy, int NumArgs) {<br> assert(FTy && "FunctionType must be provided to this routine.");<br><br>@@ -728,6 +732,8 @@ public:<br> // nop on most sane targets.<br> if (isa<CmpInst>(CI->getOperand(0)))<br> return TTI::TCC_Free;<br>+ if (isa<SExtInst>(CI) || isa<ZExtInst>(CI) || isa<FPExtInst>(CI))<br>+ return static_cast<T *>(this)->getExtCost(CI, Operands.back());<br> }<br><br> return static_cast<T *>(this)->getOperationCost(<br><br>Modified: llvm/trunk/include/llvm/CodeGen/BasicTTIImpl.h<br>URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/BasicTTIImpl.h?rev=308076&r1=308075&r2=308076&view=diff">http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/BasicTTIImpl.h?rev=308076&r1=308075&r2=308076&view=diff</a><br>==============================================================================<br>--- llvm/trunk/include/llvm/CodeGen/BasicTTIImpl.h (original)<br>+++ llvm/trunk/include/llvm/CodeGen/BasicTTIImpl.h Fri Jul 14 19:12:16 2017<br>@@ -155,6 +155,18 @@ public:<br> return BaseT::getGEPCost(PointeeType, Ptr, Operands);<br> }<br><br>+ int getExtCost(const Instruction *I, const Value *Src) {<br>+ if (getTLI()->isExtFree(I))<br>+ return TargetTransformInfo::TCC_Free;<br>+<br>+ if (isa<ZExtInst>(I) || isa<SExtInst>(I))<br>+ if (const LoadInst *LI = dyn_cast<LoadInst>(Src))<br>+ if (getTLI()->isExtLoad(LI, I, DL))<br>+ return TargetTransformInfo::TCC_Free;<br>+<br>+ return TargetTransformInfo::TCC_Basic;<br>+ }<br>+<br> unsigned getIntrinsicCost(Intrinsic::ID IID, Type *RetTy,<br> ArrayRef<const Value *> Arguments) {<br> return BaseT::getIntrinsicCost(IID, RetTy, Arguments);<br><br>Modified: llvm/trunk/include/llvm/Target/TargetLowering.h<br>URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/TargetLowering.h?rev=308076&r1=308075&r2=308076&view=diff">http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/TargetLowering.h?rev=308076&r1=308075&r2=308076&view=diff</a><br>==============================================================================<br>--- llvm/trunk/include/llvm/Target/TargetLowering.h (original)<br>+++ llvm/trunk/include/llvm/Target/TargetLowering.h Fri Jul 14 19:12:16 2017<br>@@ -2012,6 +2012,35 @@ public:<br> return isExtFreeImpl(I);<br> }<br><br>+ /// Return true if \p Load and \p Ext can form an ExtLoad.<br>+ /// For example, in AArch64<br>+ /// %L = load i8, i8* %ptr<br>+ /// %E = zext i8 %L to i32<br>+ /// can be lowered into one load instruction<br>+ /// ldrb w0, [x0]<br>+ bool isExtLoad(const LoadInst *Load, const Instruction *Ext,<br>+ const DataLayout &DL) const {<br>+ EVT VT = getValueType(DL, Ext->getType());<br>+ EVT LoadVT = getValueType(DL, Load->getType());<br>+<br>+ // If the load has other users and the truncate is not free, the ext<br>+ // probably isn't free.<br>+ if (!Load->hasOneUse() && (isTypeLegal(LoadVT) || !isTypeLegal(VT)) &&<br>+ !isTruncateFree(Ext->getType(), Load->getType()))<br>+ return false;<br>+<br>+ // Check whether the target supports casts folded into loads.<br>+ unsigned LType;<br>+ if (isa<ZExtInst>(Ext))<br>+ LType = ISD::ZEXTLOAD;<br>+ else {<br>+ assert(isa<SExtInst>(Ext) && "Unexpected ext type!");<br>+ LType = ISD::SEXTLOAD;<br>+ }<br>+<br>+ return isLoadExtLegal(LType, VT, LoadVT);<br>+ }<br>+<br> /// Return true if any actual instruction that defines a value of type FromTy<br> /// implicitly zero-extends the value to ToTy in the result register.<br> ///<br><br>Modified: llvm/trunk/lib/Analysis/TargetTransformInfo.cpp<br>URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/TargetTransformInfo.cpp?rev=308076&r1=308075&r2=308076&view=diff">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/TargetTransformInfo.cpp?rev=308076&r1=308075&r2=308076&view=diff</a><br>==============================================================================<br>--- llvm/trunk/lib/Analysis/TargetTransformInfo.cpp (original)<br>+++ llvm/trunk/lib/Analysis/TargetTransformInfo.cpp Fri Jul 14 19:12:16 2017<br>@@ -82,6 +82,11 @@ int TargetTransformInfo::getGEPCost(Type<br> return TTIImpl->getGEPCost(PointeeType, Ptr, Operands);<br>}<br><br>+int TargetTransformInfo::getExtCost(const Instruction *I,<br>+ const Value *Src) const {<br>+ return TTIImpl->getExtCost(I, Src);<br>+}<br>+<br>int TargetTransformInfo::getIntrinsicCost(<br> Intrinsic::ID IID, Type *RetTy, ArrayRef<const Value *> Arguments) const {<br> int Cost = TTIImpl->getIntrinsicCost(IID, RetTy, Arguments);<br><br>Modified: llvm/trunk/lib/CodeGen/CodeGenPrepare.cpp<br>URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/CodeGenPrepare.cpp?rev=308076&r1=308075&r2=308076&view=diff">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/CodeGenPrepare.cpp?rev=308076&r1=308075&r2=308076&view=diff</a><br>==============================================================================<br>--- llvm/trunk/lib/CodeGen/CodeGenPrepare.cpp (original)<br>+++ llvm/trunk/lib/CodeGen/CodeGenPrepare.cpp Fri Jul 14 19:12:16 2017<br>@@ -4847,25 +4847,7 @@ bool CodeGenPrepare::canFormExtLd(<br> if (!HasPromoted && LI->getParent() == Inst->getParent())<br> return false;<br><br>- EVT VT = TLI->getValueType(*DL, Inst->getType());<br>- EVT LoadVT = TLI->getValueType(*DL, LI->getType());<br>-<br>- // If the load has other users and the truncate is not free, this probably<br>- // isn't worthwhile.<br>- if (!LI->hasOneUse() && (TLI->isTypeLegal(LoadVT) || !TLI->isTypeLegal(VT)) &&<br>- !TLI->isTruncateFree(Inst->getType(), LI->getType()))<br>- return false;<br>-<br>- // Check whether the target supports casts folded into loads.<br>- unsigned LType;<br>- if (isa<ZExtInst>(Inst))<br>- LType = ISD::ZEXTLOAD;<br>- else {<br>- assert(isa<SExtInst>(Inst) && "Unexpected ext type!");<br>- LType = ISD::SEXTLOAD;<br>- }<br>-<br>- return TLI->isLoadExtLegal(LType, VT, LoadVT);<br>+ return TLI->isExtLoad(LI, Inst, *DL);<br>}<br><br>/// Move a zext or sext fed by a load into the same basic block as the load,<br><br>Added: llvm/trunk/test/Transforms/Inline/AArch64/ext.ll<br>URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/Inline/AArch64/ext.ll?rev=308076&view=auto">http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/Inline/AArch64/ext.ll?rev=308076&view=auto</a><br>==============================================================================<br>--- llvm/trunk/test/Transforms/Inline/AArch64/ext.ll (added)<br>+++ llvm/trunk/test/Transforms/Inline/AArch64/ext.ll Fri Jul 14 19:12:16 2017<br>@@ -0,0 +1,249 @@<br>+; REQUIRES: asserts<br>+; RUN: opt -inline -mtriple=aarch64--linux-gnu -S -debug-only=inline-cost < %s 2>&1 | FileCheck %s<br>+<br>+target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128"<br>+target triple = "aarch64--linux-gnu"<br>+<br>+define i32 @outer1(i32* %ptr, i32 %i) {<br>+ %C = call i32 @inner1(i32* %ptr, i32 %i)<br>+ ret i32 %C<br>+}<br>+<br>+; sext can be folded into gep.<br>+; CHECK: Analyzing call of inner1<br>+; CHECK: NumInstructionsSimplified: 3<br>+; CHECK: NumInstructions: 4<br>+define i32 @inner1(i32* %ptr, i32 %i) {<br>+ %E = sext i32 %i to i64<br>+ %G = getelementptr inbounds i32, i32* %ptr, i64 %E<br>+ %L = load i32, i32* %G<br>+ ret i32 %L<br>+}<br>+<br>+define i32 @outer2(i32* %ptr, i32 %i) {<br>+ %C = call i32 @inner2(i32* %ptr, i32 %i)<br>+ ret i32 %C<br>+}<br>+<br>+; zext from i32 to i64 is free.<br>+; CHECK: Analyzing call of inner2<br>+; CHECK: NumInstructionsSimplified: 3<br>+; CHECK: NumInstructions: 4<br>+define i32 @inner2(i32* %ptr, i32 %i) {<br>+ %E = zext i32 %i to i64<br>+ %G = getelementptr inbounds i32, i32* %ptr, i64 %E<br>+ %L = load i32, i32* %G<br>+ ret i32 %L<br>+}<br>+<br>+define i32 @outer3(i32* %ptr, i16 %i) {<br>+ %C = call i32 @inner3(i32* %ptr, i16 %i)<br>+ ret i32 %C<br>+}<br>+<br>+; zext can be folded into gep.<br>+; CHECK: Analyzing call of inner3<br>+; CHECK: NumInstructionsSimplified: 3<br>+; CHECK: NumInstructions: 4<br>+define i32 @inner3(i32* %ptr, i16 %i) {<br>+ %E = zext i16 %i to i64<br>+ %G = getelementptr inbounds i32, i32* %ptr, i64 %E<br>+ %L = load i32, i32* %G<br>+ ret i32 %L<br>+}<br>+<br>+define i16 @outer4(i8* %ptr) {<br>+ %C = call i16 @inner4(i8* %ptr)<br>+ ret i16 %C<br>+}<br>+<br>+; It is an ExtLoad.<br>+; CHECK: Analyzing call of inner4<br>+; CHECK: NumInstructionsSimplified: 2<br>+; CHECK: NumInstructions: 3<br>+define i16 @inner4(i8* %ptr) {<br>+ %L = load i8, i8* %ptr<br>+ %E = zext i8 %L to i16<br>+ ret i16 %E<br>+}<br>+<br>+define i16 @outer5(i8* %ptr) {<br>+ %C = call i16 @inner5(i8* %ptr)<br>+ ret i16 %C<br>+}<br>+<br>+; It is an ExtLoad.<br>+; CHECK: Analyzing call of inner5<br>+; CHECK: NumInstructionsSimplified: 2<br>+; CHECK: NumInstructions: 3<br>+define i16 @inner5(i8* %ptr) {<br>+ %L = load i8, i8* %ptr<br>+ %E = sext i8 %L to i16<br>+ ret i16 %E<br>+}<br>+<br>+define i32 @outer6(i8* %ptr) {<br>+ %C = call i32 @inner6(i8* %ptr)<br>+ ret i32 %C<br>+}<br>+<br>+; It is an ExtLoad.<br>+; CHECK: Analyzing call of inner6<br>+; CHECK: NumInstructionsSimplified: 2<br>+; CHECK: NumInstructions: 3<br>+define i32 @inner6(i8* %ptr) {<br>+ %L = load i8, i8* %ptr<br>+ %E = zext i8 %L to i32<br>+ ret i32 %E<br>+}<br>+<br>+define i32 @outer7(i8* %ptr) {<br>+ %C = call i32 @inner7(i8* %ptr)<br>+ ret i32 %C<br>+}<br>+<br>+; It is an ExtLoad.<br>+; CHECK: Analyzing call of inner7<br>+; CHECK: NumInstructionsSimplified: 2<br>+; CHECK: NumInstructions: 3<br>+define i32 @inner7(i8* %ptr) {<br>+ %L = load i8, i8* %ptr<br>+ %E = sext i8 %L to i32<br>+ ret i32 %E<br>+}<br>+<br>+define i32 @outer8(i16* %ptr) {<br>+ %C = call i32 @inner8(i16* %ptr)<br>+ ret i32 %C<br>+}<br>+<br>+; It is an ExtLoad.<br>+; CHECK: Analyzing call of inner8<br>+; CHECK: NumInstructionsSimplified: 2<br>+; CHECK: NumInstructions: 3<br>+define i32 @inner8(i16* %ptr) {<br>+ %L = load i16, i16* %ptr<br>+ %E = zext i16 %L to i32<br>+ ret i32 %E<br>+}<br>+<br>+define i32 @outer9(i16* %ptr) {<br>+ %C = call i32 @inner9(i16* %ptr)<br>+ ret i32 %C<br>+}<br>+<br>+; It is an ExtLoad.<br>+; CHECK: Analyzing call of inner9<br>+; CHECK: NumInstructionsSimplified: 2<br>+; CHECK: NumInstructions: 3<br>+define i32 @inner9(i16* %ptr) {<br>+ %L = load i16, i16* %ptr<br>+ %E = sext i16 %L to i32<br>+ ret i32 %E<br>+}<br>+<br>+define i64 @outer10(i8* %ptr) {<br>+ %C = call i64 @inner10(i8* %ptr)<br>+ ret i64 %C<br>+}<br>+<br>+; It is an ExtLoad.<br>+; CHECK: Analyzing call of inner10<br>+; CHECK: NumInstructionsSimplified: 2<br>+; CHECK: NumInstructions: 3<br>+define i64 @inner10(i8* %ptr) {<br>+ %L = load i8, i8* %ptr<br>+ %E = zext i8 %L to i64<br>+ ret i64 %E<br>+}<br>+<br>+define i64 @outer11(i8* %ptr) {<br>+ %C = call i64 @inner11(i8* %ptr)<br>+ ret i64 %C<br>+}<br>+<br>+; It is an ExtLoad.<br>+; CHECK: Analyzing call of inner11<br>+; CHECK: NumInstructionsSimplified: 2<br>+; CHECK: NumInstructions: 3<br>+define i64 @inner11(i8* %ptr) {<br>+ %L = load i8, i8* %ptr<br>+ %E = sext i8 %L to i64<br>+ ret i64 %E<br>+}<br>+<br>+define i64 @outer12(i16* %ptr) {<br>+ %C = call i64 @inner12(i16* %ptr)<br>+ ret i64 %C<br>+}<br>+<br>+; It is an ExtLoad.<br>+; CHECK: Analyzing call of inner12<br>+; CHECK: NumInstructionsSimplified: 2<br>+; CHECK: NumInstructions: 3<br>+define i64 @inner12(i16* %ptr) {<br>+ %L = load i16, i16* %ptr<br>+ %E = zext i16 %L to i64<br>+ ret i64 %E<br>+}<br>+<br>+define i64 @outer13(i16* %ptr) {<br>+ %C = call i64 @inner13(i16* %ptr)<br>+ ret i64 %C<br>+}<br>+<br>+; It is an ExtLoad.<br>+; CHECK: Analyzing call of inner13<br>+; CHECK: NumInstructionsSimplified: 2<br>+; CHECK: NumInstructions: 3<br>+define i64 @inner13(i16* %ptr) {<br>+ %L = load i16, i16* %ptr<br>+ %E = sext i16 %L to i64<br>+ ret i64 %E<br>+}<br>+<br>+define i64 @outer14(i32* %ptr) {<br>+ %C = call i64 @inner14(i32* %ptr)<br>+ ret i64 %C<br>+}<br>+<br>+; It is an ExtLoad.<br>+; CHECK: Analyzing call of inner14<br>+; CHECK: NumInstructionsSimplified: 2<br>+; CHECK: NumInstructions: 3<br>+define i64 @inner14(i32* %ptr) {<br>+ %L = load i32, i32* %ptr<br>+ %E = zext i32 %L to i64<br>+ ret i64 %E<br>+}<br>+<br>+define i64 @outer15(i32* %ptr) {<br>+ %C = call i64 @inner15(i32* %ptr)<br>+ ret i64 %C<br>+}<br>+<br>+; It is an ExtLoad.<br>+; CHECK: Analyzing call of inner15<br>+; CHECK: NumInstructionsSimplified: 2<br>+; CHECK: NumInstructions: 3<br>+define i64 @inner15(i32* %ptr) {<br>+ %L = load i32, i32* %ptr<br>+ %E = sext i32 %L to i64<br>+ ret i64 %E<br>+}<br>+<br>+define i64 @outer16(i32 %V1, i64 %V2) {<br>+ %C = call i64 @inner16(i32 %V1, i64 %V2)<br>+ ret i64 %C<br>+}<br>+<br>+; sext can be folded into shl.<br>+; CHECK: Analyzing call of inner16<br>+; CHECK: NumInstructionsSimplified: 2<br>+; CHECK: NumInstructions: 4<br>+define i64 @inner16(i32 %V1, i64 %V2) {<br>+ %E = sext i32 %V1 to i64<br>+ %S = shl i64 %E, 3<br>+ %A = add i64 %V2, %S<br>+ ret i64 %A<br>+}<br><br>Added: llvm/trunk/test/Transforms/Inline/PowerPC/ext.ll<br>URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/Inline/PowerPC/ext.ll?rev=308076&view=auto">http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/Inline/PowerPC/ext.ll?rev=308076&view=auto</a><br>==============================================================================<br>--- llvm/trunk/test/Transforms/Inline/PowerPC/ext.ll (added)<br>+++ llvm/trunk/test/Transforms/Inline/PowerPC/ext.ll Fri Jul 14 19:12:16 2017<br>@@ -0,0 +1,140 @@<br>+; REQUIRES: asserts<br>+; RUN: opt -inline -S -debug-only=inline-cost < %s 2>&1 | FileCheck %s<br>+<br>+target datalayout = "E-m:e-i64:64-n32:64"<br>+target triple = "powerpc64le-ibm-linux-gnu"<br>+<br>+define i16 @outer1(i8* %ptr) {<br>+ %C = call i16 @inner1(i8* %ptr)<br>+ ret i16 %C<br>+}<br>+<br>+; It is an ExtLoad.<br>+; CHECK: Analyzing call of inner1<br>+; CHECK: NumInstructionsSimplified: 2<br>+; CHECK: NumInstructions: 3<br>+define i16 @inner1(i8* %ptr) {<br>+ %L = load i8, i8* %ptr<br>+ %E = zext i8 %L to i16<br>+ ret i16 %E<br>+}<br>+<br>+define i32 @outer2(i8* %ptr) {<br>+ %C = call i32 @inner2(i8* %ptr)<br>+ ret i32 %C<br>+}<br>+<br>+; It is an ExtLoad.<br>+; CHECK: Analyzing call of inner2<br>+; CHECK: NumInstructionsSimplified: 2<br>+; CHECK: NumInstructions: 3<br>+define i32 @inner2(i8* %ptr) {<br>+ %L = load i8, i8* %ptr<br>+ %E = zext i8 %L to i32<br>+ ret i32 %E<br>+}<br>+<br>+define i32 @outer3(i16* %ptr) {<br>+ %C = call i32 @inner3(i16* %ptr)<br>+ ret i32 %C<br>+}<br>+<br>+; It is an ExtLoad.<br>+; CHECK: Analyzing call of inner3<br>+; CHECK: NumInstructionsSimplified: 2<br>+; CHECK: NumInstructions: 3<br>+define i32 @inner3(i16* %ptr) {<br>+ %L = load i16, i16* %ptr<br>+ %E = zext i16 %L to i32<br>+ ret i32 %E<br>+}<br>+<br>+define i32 @outer4(i16* %ptr) {<br>+ %C = call i32 @inner4(i16* %ptr)<br>+ ret i32 %C<br>+}<br>+<br>+; It is an ExtLoad.<br>+; CHECK: Analyzing call of inner4<br>+; CHECK: NumInstructionsSimplified: 2<br>+; CHECK: NumInstructions: 3<br>+define i32 @inner4(i16* %ptr) {<br>+ %L = load i16, i16* %ptr<br>+ %E = sext i16 %L to i32<br>+ ret i32 %E<br>+}<br>+<br>+define i64 @outer5(i8* %ptr) {<br>+ %C = call i64 @inner5(i8* %ptr)<br>+ ret i64 %C<br>+}<br>+<br>+; It is an ExtLoad.<br>+; CHECK: Analyzing call of inner5<br>+; CHECK: NumInstructionsSimplified: 2<br>+; CHECK: NumInstructions: 3<br>+define i64 @inner5(i8* %ptr) {<br>+ %L = load i8, i8* %ptr<br>+ %E = zext i8 %L to i64<br>+ ret i64 %E<br>+}<br>+<br>+define i64 @outer6(i16* %ptr) {<br>+ %C = call i64 @inner6(i16* %ptr)<br>+ ret i64 %C<br>+}<br>+<br>+; It is an ExtLoad.<br>+; CHECK: Analyzing call of inner6<br>+; CHECK: NumInstructionsSimplified: 2<br>+; CHECK: NumInstructions: 3<br>+define i64 @inner6(i16* %ptr) {<br>+ %L = load i16, i16* %ptr<br>+ %E = zext i16 %L to i64<br>+ ret i64 %E<br>+}<br>+<br>+define i64 @outer7(i16* %ptr) {<br>+ %C = call i64 @inner7(i16* %ptr)<br>+ ret i64 %C<br>+}<br>+<br>+; It is an ExtLoad.<br>+; CHECK: Analyzing call of inner7<br>+; CHECK: NumInstructionsSimplified: 2<br>+; CHECK: NumInstructions: 3<br>+define i64 @inner7(i16* %ptr) {<br>+ %L = load i16, i16* %ptr<br>+ %E = sext i16 %L to i64<br>+ ret i64 %E<br>+}<br>+<br>+define i64 @outer8(i32* %ptr) {<br>+ %C = call i64 @inner8(i32* %ptr)<br>+ ret i64 %C<br>+}<br>+<br>+; It is an ExtLoad.<br>+; CHECK: Analyzing call of inner8<br>+; CHECK: NumInstructionsSimplified: 2<br>+; CHECK: NumInstructions: 3<br>+define i64 @inner8(i32* %ptr) {<br>+ %L = load i32, i32* %ptr<br>+ %E = zext i32 %L to i64<br>+ ret i64 %E<br>+}<br>+<br>+define i64 @outer9(i32* %ptr) {<br>+ %C = call i64 @inner9(i32* %ptr)<br>+ ret i64 %C<br>+}<br>+<br>+; It is an ExtLoad.<br>+; CHECK: Analyzing call of inner9<br>+; CHECK: NumInstructionsSimplified: 2<br>+; CHECK: NumInstructions: 3<br>+define i64 @inner9(i32* %ptr) {<br>+ %L = load i32, i32* %ptr<br>+ %E = sext i32 %L to i64<br>+ ret i64 %E<br>+}<br><br>Added: llvm/trunk/test/Transforms/Inline/PowerPC/lit.local.cfg<br>URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/Inline/PowerPC/lit.local.cfg?rev=308076&view=auto">http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/Inline/PowerPC/lit.local.cfg?rev=308076&view=auto</a><br>==============================================================================<br>--- llvm/trunk/test/Transforms/Inline/PowerPC/lit.local.cfg (added)<br>+++ llvm/trunk/test/Transforms/Inline/PowerPC/lit.local.cfg Fri Jul 14 19:12:16 2017<br>@@ -0,0 +1,3 @@<br>+if not 'PowerPC' in config.root.targets:<br>+ config.unsupported = True<br>+<br><br>Added: llvm/trunk/test/Transforms/Inline/X86/ext.ll<br>URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/Inline/X86/ext.ll?rev=308076&view=auto">http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/Inline/X86/ext.ll?rev=308076&view=auto</a><br>==============================================================================<br>--- llvm/trunk/test/Transforms/Inline/X86/ext.ll (added)<br>+++ llvm/trunk/test/Transforms/Inline/X86/ext.ll Fri Jul 14 19:12:16 2017<br>@@ -0,0 +1,201 @@<br>+; REQUIRES: asserts<br>+; RUN: opt -inline -mtriple=x86_64-unknown-unknown -S -debug-only=inline-cost < %s 2>&1 | FileCheck %s<br>+<br>+target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"<br>+target triple = "x86_64-unknown-unknown"<br>+<br>+define i32 @outer1(i32* %ptr, i32 %i) {<br>+ %C = call i32 @inner1(i32* %ptr, i32 %i)<br>+ ret i32 %C<br>+}<br>+<br>+; zext from i32 to i64 is free.<br>+; CHECK: Analyzing call of inner1<br>+; CHECK: NumInstructionsSimplified: 3<br>+; CHECK: NumInstructions: 4<br>+define i32 @inner1(i32* %ptr, i32 %i) {<br>+ %E = zext i32 %i to i64<br>+ %G = getelementptr inbounds i32, i32* %ptr, i64 %E<br>+ %L = load i32, i32* %G<br>+ ret i32 %L<br>+}<br>+<br>+define i16 @outer2(i8* %ptr) {<br>+ %C = call i16 @inner2(i8* %ptr)<br>+ ret i16 %C<br>+}<br>+<br>+; It is an ExtLoad.<br>+; CHECK: Analyzing call of inner2<br>+; CHECK: NumInstructionsSimplified: 2<br>+; CHECK: NumInstructions: 3<br>+define i16 @inner2(i8* %ptr) {<br>+ %L = load i8, i8* %ptr<br>+ %E = zext i8 %L to i16<br>+ ret i16 %E<br>+}<br>+<br>+define i16 @outer3(i8* %ptr) {<br>+ %C = call i16 @inner3(i8* %ptr)<br>+ ret i16 %C<br>+}<br>+<br>+; It is an ExtLoad.<br>+; CHECK: Analyzing call of inner3<br>+; CHECK: NumInstructionsSimplified: 2<br>+; CHECK: NumInstructions: 3<br>+define i16 @inner3(i8* %ptr) {<br>+ %L = load i8, i8* %ptr<br>+ %E = sext i8 %L to i16<br>+ ret i16 %E<br>+}<br>+<br>+define i32 @outer4(i8* %ptr) {<br>+ %C = call i32 @inner4(i8* %ptr)<br>+ ret i32 %C<br>+}<br>+<br>+; It is an ExtLoad.<br>+; CHECK: Analyzing call of inner4<br>+; CHECK: NumInstructionsSimplified: 2<br>+; CHECK: NumInstructions: 3<br>+define i32 @inner4(i8* %ptr) {<br>+ %L = load i8, i8* %ptr<br>+ %E = zext i8 %L to i32<br>+ ret i32 %E<br>+}<br>+<br>+define i32 @outer5(i8* %ptr) {<br>+ %C = call i32 @inner5(i8* %ptr)<br>+ ret i32 %C<br>+}<br>+<br>+; It is an ExtLoad.<br>+; CHECK: Analyzing call of inner5<br>+; CHECK: NumInstructionsSimplified: 2<br>+; CHECK: NumInstructions: 3<br>+define i32 @inner5(i8* %ptr) {<br>+ %L = load i8, i8* %ptr<br>+ %E = sext i8 %L to i32<br>+ ret i32 %E<br>+}<br>+<br>+define i32 @outer6(i16* %ptr) {<br>+ %C = call i32 @inner6(i16* %ptr)<br>+ ret i32 %C<br>+}<br>+<br>+; It is an ExtLoad.<br>+; CHECK: Analyzing call of inner6<br>+; CHECK: NumInstructionsSimplified: 2<br>+; CHECK: NumInstructions: 3<br>+define i32 @inner6(i16* %ptr) {<br>+ %L = load i16, i16* %ptr<br>+ %E = zext i16 %L to i32<br>+ ret i32 %E<br>+}<br>+<br>+define i32 @outer7(i16* %ptr) {<br>+ %C = call i32 @inner7(i16* %ptr)<br>+ ret i32 %C<br>+}<br>+<br>+; It is an ExtLoad.<br>+; CHECK: Analyzing call of inner7<br>+; CHECK: NumInstructionsSimplified: 2<br>+; CHECK: NumInstructions: 3<br>+define i32 @inner7(i16* %ptr) {<br>+ %L = load i16, i16* %ptr<br>+ %E = sext i16 %L to i32<br>+ ret i32 %E<br>+}<br>+<br>+define i64 @outer8(i8* %ptr) {<br>+ %C = call i64 @inner8(i8* %ptr)<br>+ ret i64 %C<br>+}<br>+<br>+; It is an ExtLoad.<br>+; CHECK: Analyzing call of inner8<br>+; CHECK: NumInstructionsSimplified: 2<br>+; CHECK: NumInstructions: 3<br>+define i64 @inner8(i8* %ptr) {<br>+ %L = load i8, i8* %ptr<br>+ %E = zext i8 %L to i64<br>+ ret i64 %E<br>+}<br>+<br>+define i64 @outer9(i8* %ptr) {<br>+ %C = call i64 @inner9(i8* %ptr)<br>+ ret i64 %C<br>+}<br>+<br>+; It is an ExtLoad.<br>+; CHECK: Analyzing call of inner9<br>+; CHECK: NumInstructionsSimplified: 2<br>+; CHECK: NumInstructions: 3<br>+define i64 @inner9(i8* %ptr) {<br>+ %L = load i8, i8* %ptr<br>+ %E = sext i8 %L to i64<br>+ ret i64 %E<br>+}<br>+<br>+define i64 @outer10(i16* %ptr) {<br>+ %C = call i64 @inner10(i16* %ptr)<br>+ ret i64 %C<br>+}<br>+<br>+; It is an ExtLoad.<br>+; CHECK: Analyzing call of inner10<br>+; CHECK: NumInstructionsSimplified: 2<br>+; CHECK: NumInstructions: 3<br>+define i64 @inner10(i16* %ptr) {<br>+ %L = load i16, i16* %ptr<br>+ %E = zext i16 %L to i64<br>+ ret i64 %E<br>+}<br>+<br>+define i64 @outer11(i16* %ptr) {<br>+ %C = call i64 @inner11(i16* %ptr)<br>+ ret i64 %C<br>+}<br>+<br>+; It is an ExtLoad.<br>+; CHECK: Analyzing call of inner11<br>+; CHECK: NumInstructionsSimplified: 2<br>+; CHECK: NumInstructions: 3<br>+define i64 @inner11(i16* %ptr) {<br>+ %L = load i16, i16* %ptr<br>+ %E = sext i16 %L to i64<br>+ ret i64 %E<br>+}<br>+<br>+define i64 @outer12(i32* %ptr) {<br>+ %C = call i64 @inner12(i32* %ptr)<br>+ ret i64 %C<br>+}<br>+<br>+; It is an ExtLoad.<br>+; CHECK: Analyzing call of inner12<br>+; CHECK: NumInstructionsSimplified: 2<br>+; CHECK: NumInstructions: 3<br>+define i64 @inner12(i32* %ptr) {<br>+ %L = load i32, i32* %ptr<br>+ %E = zext i32 %L to i64<br>+ ret i64 %E<br>+}<br>+<br>+define i64 @outer13(i32* %ptr) {<br>+ %C = call i64 @inner13(i32* %ptr)<br>+ ret i64 %C<br>+}<br>+<br>+; It is an ExtLoad.<br>+; CHECK: Analyzing call of inner13<br>+; CHECK: NumInstructionsSimplified: 2<br>+; CHECK: NumInstructions: 3<br>+define i64 @inner13(i32* %ptr) {<br>+ %L = load i32, i32* %ptr<br>+ %E = sext i32 %L to i64<br>+ ret i64 %E<br>+}<br><br><br>_______________________________________________<br>llvm-commits mailing list<br><a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a><br><a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><o:p></o:p></p></div></div></blockquote></div><p class=MsoNormal><o:p> </o:p></p></div></div></div></body></html>