<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
</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 24 May 2017, at 19:31, Quentin Colombet <<a href="mailto:qcolombet@apple.com" class="">qcolombet@apple.com</a>> wrote:</div>
<br class="Apple-interchange-newline">
<div class="">
<div class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word;">
Hi Kristof,
<div class=""><br class="">
</div>
<div class="">Thanks for the measurements.</div>
<div class=""><br class="">
<div class="">
<blockquote type="cite" class="">
<div class="">On May 24, 2017, at 6:00 AM, Kristof Beyls <<a href="mailto:kristof.beyls@arm.com" class="">kristof.beyls@arm.com</a>> wrote:</div>
<div class=""><br class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">
<blockquote type="cite" class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<div class="">
<div class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">
<div class=""><br class="">
<blockquote type="cite" class="">
<div class="">
<div class="">- Comparing against -O0 without globalisel but with the above regalloc options: 5.6% performance drop, 1% code size drop.<br class="">
<br class="">
In summary, the measurements indicate some good improvements.<br class="">
I also haven't measure the impact on compile time.<br class="">
</div>
</div>
</blockquote>
<div class=""><br class="">
</div>
<div class="">Do you have a mean to make this measurement?</div>
<div class="">Ahmed did a bunch of compile time measurements on our side and I wanted to see if I need to put him on the hook again :).</div>
</div>
</div>
</div>
</blockquote>
<div class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">
<br class="">
</div>
<div class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">
I did a quick setup with CTMark (part of the test-suite). I ran each of</div>
<div class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">
* '-O0 -g',</div>
<div class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">
* '-O0 -g -mllvm -global-isel=true -mllvm -global-isel-abort=0', and</div>
<div class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">
* '-O0 -g -mllvm -global-isel=true -mllvm -global-isel-abort=0 -mllvm -optimize-regalloc -mllvm -regalloc=greedy'</div>
<div class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">
5 times, cross-compiling from X86 to AArch64, and took the median measured compile times.</div>
<div class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">
In summary, I see GlobalISel having a compile time that's 3.5% higher than the current -O0 default.</div>
<div class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">
With enabling the greedy register allocator, this increases to 28%.</div>
<div class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">
28% is probably too high?</div>
</div>
</blockquote>
<div class=""><br class="">
</div>
<div class="">I think it is yes.</div>
<div class="">I have attached a quick hack to the greedy allocator to feature a fast mode.</div>
<div class="">Could you give it a try?</div>
<div class=""><br class="">
</div>
<div class="">To enable the fast mode, please use (-mllvm)<span class="Apple-converted-space"> </span><font face="Menlo" class="" style="font-size: 11px;">-regalloc-greedy-fast=true</font><span class="Apple-converted-space"> </span>(default is false).</div>
</div>
</div>
</div>
</div>
</blockquote>
<div><br class="">
</div>
<div>I'm afraid it doesn't seem to save much compile time. On geomean, I see about 26% compile time increase against the current -O0 default (compared to 28% increase for regalloc greedy without your patch).</div>
<br class="">
<blockquote type="cite" class="">
<div class="">
<div class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word;">
<div class="">
<div class=""><br class="">
<blockquote type="cite" class="">
<div class="">
<div class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">
At the moment I can't think of an alternative to having a "constant materialization localizer" pass at -O0 to hit all the metrics we thought of as necessary before enabling GISel by default.</div>
<div class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">
<br class="">
</div>
<div class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">
It would be good if someone else could also do a compilation time experiment - just to make sure I didn't make any silly mistakes in my experiment.</div>
<div class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">
<br class="">
</div>
<div class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">
Here are the details I see:</div>
<div class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">
<br class="">
</div>
<div class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">
<table border="0" cellpadding="0" cellspacing="0" width="424" class="" style="border-collapse: collapse; width: 424pt;">
<colgroup class=""><col width="304" class="" style="width: 304pt;"><col width="46" class="" style="width: 46pt;"><col width="74" class="" style="width: 74pt;"></colgroup>
<tbody class="">
<tr height="15" class="" style="height: 15pt;">
<td height="15" width="304" class="" style="text-align: right; height: 15pt; width: 304pt;">
</td>
<td class="x_xl66" width="46" style="text-align: right; width: 46pt;"><span class="" style="font-size: 12px;"><b class="">gisel</b></span></td>
<td class="x_xl66" width="74" style="text-align: right; width: 74pt;"><span class="" style="font-size: 12px;"><b class="">gisel+greedy</b></span></td>
</tr>
<tr height="17" class="" style="height: 17pt;">
<td height="17" class="" style="height: 17pt;"><span class="" style="font-size: 12px;">CTMark/7zip/7zip-benchmark</span></td>
<td class="x_xl64" align="right"><span class="" style="font-size: 12px;">102.8%</span></td>
<td class="x_xl64" align="right"><span class="" style="font-size: 12px;">106.5%</span></td>
</tr>
<tr height="17" class="" style="height: 17pt;">
<td height="17" class="" style="height: 17pt;"><span class="" style="font-size: 12px;">CTMark/Bullet/bullet</span></td>
<td class="x_xl64" align="right"><span class="" style="font-size: 12px;">100.5%</span></td>
<td class="x_xl64" align="right"><span class="" style="font-size: 12px;">105.1%</span></td>
</tr>
<tr height="17" class="" style="height: 17pt;">
<td height="17" class="" style="height: 17pt;"><span class="" style="font-size: 12px;">CTMark/ClamAV/clamscan</span></td>
<td class="x_xl64" align="right"><span class="" style="font-size: 12px;">101.6%</span></td>
<td class="x_xl64" align="right"><span class="" style="font-size: 12px;">130.8%</span></td>
</tr>
<tr height="17" class="" style="height: 17pt;">
<td height="17" class="" style="height: 17pt;"><span class="" style="font-size: 12px;">CTMark/SPASS/SPASS</span></td>
<td class="x_xl64" align="right"><span class="" style="font-size: 12px;">101.2%</span></td>
<td class="x_xl64" align="right"><span class="" style="font-size: 12px;">120.0%</span></td>
</tr>
<tr height="17" class="" style="height: 17pt;">
<td height="17" class="" style="height: 17pt;"><span class="" style="font-size: 12px;">CTMark/consumer-typeset/consumer-typeset</span></td>
<td class="x_xl64" align="right"><span class="" style="font-size: 12px;">105.7%</span></td>
<td class="x_xl64" align="right"><span class="" style="font-size: 12px;">138.2%</span></td>
</tr>
<tr height="17" class="" style="height: 17pt;">
<td height="17" class="" style="height: 17pt;"><span class="" style="font-size: 12px;">CTMark/kimwitu++/kc</span></td>
<td class="x_xl64" align="right"><span class="" style="font-size: 12px;">103.1%</span></td>
<td class="x_xl64" align="right"><span class="" style="font-size: 12px;">122.6%</span></td>
</tr>
<tr height="17" class="" style="height: 17pt;">
<td height="17" class="" style="height: 17pt;"><span class="" style="font-size: 12px;">CTMark/lencod/lencod</span></td>
<td class="x_xl64" align="right"><span class="" style="font-size: 12px;">106.2%</span></td>
<td class="x_xl64" align="right"><span class="" style="font-size: 12px;">143.4%</span></td>
</tr>
<tr height="17" class="" style="height: 17pt;">
<td height="17" class="" style="height: 17pt;"><span class="" style="font-size: 12px;">CTMark/mafft/pairlocalalign</span></td>
<td class="x_xl64" align="right"><span class="" style="font-size: 12px;">96.2%</span></td>
<td class="x_xl64" align="right"><span class="" style="font-size: 12px;">135.4%</span></td>
</tr>
<tr height="17" class="" style="height: 17pt;">
<td height="17" class="" style="height: 17pt;"><span class="" style="font-size: 12px;">CTMark/sqlite3/sqlite3</span></td>
<td class="x_xl64" align="right"><span class="" style="font-size: 12px;">109.1%</span></td>
<td class="x_xl64" align="right"><span class="" style="font-size: 12px;">155.1%</span></td>
</tr>
<tr height="17" class="" style="height: 17pt;">
<td height="17" class="" style="height: 17pt;"><span class="" style="font-size: 12px;">CTMark/tramp3d-v4/tramp3d-v4</span></td>
<td class="x_xl64" align="right"><span class="" style="font-size: 12px;">109.1%</span></td>
<td class="x_xl64" align="right"><span class="" style="font-size: 12px;">132.0%</span></td>
</tr>
<tr height="15" class="" style="height: 15pt;">
<td height="15" class="" style="height: 15pt;"><span class="" style="font-size: 12px;"><b class="">GEOMEAN</b></span></td>
<td class="x_xl65" align="right"><span class="" style="font-size: 12px;"><b class="">103.5%</b></span></td>
<td class="x_xl65" align="right"><span class="" style="font-size: 12px;"><b class="">128.0%</b></span></td>
</tr>
</tbody>
</table>
</div>
<div class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">
<br class="">
</div>
<div class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">
<br class="">
</div>
<div class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">
Thanks,</div>
<div class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">
<br class="">
</div>
<div class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">
Kristof</div>
</div>
</blockquote>
</div>
<br class="">
</div>
<div class="">Thanks,</div>
<div class="">-Quentin</div>
<div class=""></div>
</div>
<div class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word;">
<div class=""></div>
</div>
<span id="cid:1CB70C5C4A353643A2B70AC37E6DB4BA@eurprd08.prod.outlook.com"><regalloc-fastmode.diff></span></div>
</blockquote>
</div>
<br class="">
</body>
</html>