<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">
<br class="">
<div>
<blockquote type="cite" class="">
<div class="">On 31 May 2017, at 17:07, Quentin Colombet <<a href="mailto:qcolombet@apple.com" class="">qcolombet@apple.com</a>> wrote:</div>
<div class="">
<div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">
<div class="">
<div class="">
<blockquote type="cite" class="">
<div class="">
<div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">
<br class="">
</div>
<div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">
Latest comparisons on my side, after picking up r304244, i.e. the correct Localizer pass.</div>
<div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">
* CTMark compile time, comparing "-O0 -g" vs '-O0 -g -mllvm -global-isel=true -mllvm -global-isel-abort=0': about 6% increase with globalisel. This was about 3.5% before the Localizer pass landed.</div>
</div>
</blockquote>
<div class=""><br class="">
</div>
<div class="">That one is surprising too. I wouldn’t have expected this pass to show up in the compile time profile. At least not to this extend.</div>
<div class="">What is the biggest offender?</div>
</div>
</div>
</div>
</div>
</blockquote>
<div><br class="">
</div>
<div>Hmmm. So I took the 3.5% compile time overhead from my last measurement before the localizer landed, from around 24th of May.</div>
<div>When using -ftime-report, I see the Localizer pass typically taking very roughly about 1% of compile time.</div>
<div>Maybe another part of GlobalISel became a bit slower since I did that 3.5% measurement?</div>
<div>Or maybe the Localizer pass changes the structure of the program so that another later pass gets a different compile time profile?</div>
<div>Basically, I'd have to do more experiments to figure that one out.</div>
<div><br class="">
</div>
<div>As far as where time is spent in the gisel-passes itself, on average, I saw the following on the latest CTMark experiment I ran:</div>
<div>
<div><font face="Menlo" class="">Avg compile time spent in IRTranslator: 4.61%</font></div>
<div><font face="Menlo" class="">Avg compile time spent in InstructionSelect: 7.51%</font></div>
<div><font face="Menlo" class="">Avg compile time spent in Legalizer: 1.06%</font></div>
<div><font face="Menlo" class="">Avg compile time spent in Localizer: 0.76%</font></div>
<div><font face="Menlo" class="">Avg compile time spent in RegBankSelect: 2.12%</font></div>
</div>
<br class="">
<blockquote type="cite" class="">
<div class="">
<div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">
<div class="">
<div class=""><br class="">
<blockquote type="cite" class="">
<div class="">
<div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">
* My usual performance benchmarking run: 8.5% slow-down. This was about 9.5% before the Localizer pass landed, so a slight improvement.</div>
<div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">
* Code size: 3.14% larger. This was about 2.8% before the Localizer pass landed, so a slight regression.</div>
</div>
</blockquote>
<div class=""><br class="">
</div>
<div class="">That one is surprising. Do you have an idea of what is happening?</div>
<div class="">Alternatively if you can point me to the biggest offender, I can have a look.</div>
</div>
</div>
</div>
</div>
</blockquote>
<div><br class="">
</div>
<div>So the biggest offenders on the mem_bytes metric in LNT are:</div>
<div>
<table border="0" cellpadding="0" cellspacing="0" width="641" style="border-collapse:
 collapse;width:641pt" class="">
<!--StartFragment--><colgroup class=""><col width="381" style="mso-width-source:userset;mso-width-alt:16256;width:381pt" class=""><col width="65" span="4" style="width:65pt" class=""></colgroup>
<tbody class="">
<tr height="15" style="height:15.0pt" class="">
<td height="15" width="381" style="height:15.0pt;width:381pt" class=""></td>
<td width="65" style="width:65pt" class=""><font size="2" class="">O0 -g</font></td>
<td class="xl68" width="65" style="width:65pt;box-sizing: content-box"><font size="2" class="">O0 -g gisel-with-localizer</font></td>
<td class="xl68" colspan="2" width="130" style="mso-ignore:colspan;width:130pt;
  box-sizing: content-box">
<font size="2" class="">O0 -g gisel-without-localizer</font></td>
</tr>
<tr height="17" style="height:17.0pt" class="">
<td height="17" class="xl66" style="height:17.0pt;box-sizing: content-box"><font size="2" class="">SingleSource/Benchmarks/Misc/perlin</font></td>
<td class="xl65" align="right" style="box-sizing: content-box"><font size="2" class="">14272</font></td>
<td class="xl65" align="right" style="box-sizing: content-box"><font size="2" class="">14640</font></td>
<td class="xl65" align="right" style="box-sizing: content-box"><font size="2" class="">18344</font></td>
<td class="xl67" align="right"><font size="2" class="">25.95%</font></td>
</tr>
<tr height="17" style="height:17.0pt" class="">
<td height="17" class="xl66" style="height:17.0pt;box-sizing: content-box"><font size="2" class="">SingleSource/Benchmarks/Dhrystone/dry</font></td>
<td class="xl65" align="right" style="box-sizing: content-box"><font size="2" class="">16560</font></td>
<td class="xl65" align="right" style="box-sizing: content-box"><font size="2" class="">17144</font></td>
<td class="xl65" align="right" style="box-sizing: content-box"><font size="2" class="">20160</font></td>
<td class="xl67" align="right"><font size="2" class="">18.21%</font></td>
</tr>
<tr height="17" style="height:17.0pt" class="">
<td height="17" class="xl66" style="height:17.0pt;box-sizing: content-box"><font size="2" class="">SingleSource/Benchmarks/Stanford/Queens<font class="font5">Profile</font></font></td>
<td class="xl65" align="right" style="box-sizing: content-box"><font size="2" class="">13912</font></td>
<td class="xl65" align="right" style="box-sizing: content-box"><font size="2" class="">14192</font></td>
<td class="xl65" align="right" style="box-sizing: content-box"><font size="2" class="">15136</font></td>
<td class="xl67" align="right"><font size="2" class="">6.79%</font></td>
</tr>
<tr height="17" style="height:17.0pt" class="">
<td height="17" class="xl66" style="height:17.0pt;box-sizing: content-box"><font size="2" class="">MultiSource/Benchmarks/Trimaran/netbench-url/netbench-url</font></td>
<td class="xl65" align="right" style="box-sizing: content-box"><font size="2" class="">71400</font></td>
<td class="xl65" align="right" style="box-sizing: content-box"><font size="2" class="">72272</font></td>
<td class="xl65" align="right" style="box-sizing: content-box"><font size="2" class="">75504</font></td>
<td class="xl67" align="right"><font size="2" class="">4.53%</font></td>
</tr>
<!--EndFragment-->
</tbody>
</table>
</div>
<div><br class="">
</div>
I haven't had time to investigate what exact changes make the code size go up that much with the localizer pass in those cases...</div>
<div><br class="">
<blockquote type="cite" class="">
<div class="">
<div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">
<div class="">
<div class="">
<div class=""><br class="">
</div>
<div class="">The only thing I can think of is that we duplicate constants that are expensive to materialize. If that’s the case, we were discussing with Ahmed an alternative to the localizer pass that would operate during InstructionSelect so may be worth
 pursuing.</div>
</div>
</div>
</div>
</div>
</blockquote>
</div>
<br class="">
</body>
</html>