<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 23 May 2017, at 21:48, Quentin Colombet <<a href="mailto:qcolombet@apple.com" class="">qcolombet@apple.com</a>> wrote:</div>
<br class="Apple-interchange-newline">
<div class=""><span 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; float: none; display: inline !important;" class="">Great!</span>
<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;">
I thought I had to look at our pipeline at O0 to make sure optimized regalloc was supported (<a href="https://bugs.llvm.org/show_bug.cgi?id=33022" class="">https://bugs.llvm.org/show_bug.cgi?id=33022</a> in mind). Glad I was wrong, it saves me some time.</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;">
<br class="">
<div class="">
<blockquote type="cite" class="">
<div class="">On May 22, 2017, at 12:51 AM, Kristof Beyls <<a href="mailto:kristof.beyls@arm.com" class="">kristof.beyls@arm.com</a>> wrote:</div>
<br class="Apple-interchange-newline">
<div class="">
<div class=""><br class="">
<blockquote type="cite" class="">On 22 May 2017, at 09:09, Diana Picus <<a href="mailto:diana.picus@linaro.org" class="">diana.picus@linaro.org</a>> wrote:<br class="">
<br class="">
Hi Quentin,<br class="">
<br class="">
I actually did a run with -mllvm -optimize-regalloc -mllvm<br class="">
-regalloc=greedy over the weekend and the test does pass with that.<br class="">
Haven't measured the compile time though.<br class="">
<br class="">
Cheers,<br class="">
Diana<br class="">
</blockquote>
<br class="">
I also did my usual benchmarking run with the same options as Diana did above:<br class="">
- Comparing against -O0 without globalisel: 2.5% performance drop, 0.8% code size improvement.<br class="">
</div>
</div>
</blockquote>
<div class=""><br class="">
</div>
<div class="">That’s compared to 9.5% performance drop and 2.8% code size regression, without that regalloc scheme, right?</div>
</div>
</div>
</div>
</blockquote>
<div><br class="">
</div>
<div>Indeed.</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;">
<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><br class="">
</div>
<div>I did a quick setup with CTMark (part of the test-suite). I ran each of</div>
<div>* '-O0 -g',</div>
<div>* '-O0 -g -mllvm -global-isel=true -mllvm -global-isel-abort=0', and</div>
<div>* '-O0 -g -mllvm -global-isel=true -mllvm -global-isel-abort=0 -mllvm -optimize-regalloc -mllvm -regalloc=greedy'</div>
<div>5 times, cross-compiling from X86 to AArch64, and took the median measured compile times.</div>
<div>In summary, I see GlobalISel having a compile time that's 3.5% higher than the current -O0 default.</div>
<div>With enabling the greedy register allocator, this increases to 28%.</div>
<div>28% is probably too high? 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><br class="">
</div>
<div>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><br class="">
</div>
<div>Here are the details I see:</div>
<div><br class="">
</div>
<div>
<table border="0" cellpadding="0" cellspacing="0" width="424" style="border-collapse:
 collapse;width:424pt" class="">
<!--StartFragment--><colgroup class=""><col width="304" style="mso-width-source:userset;mso-width-alt:12970;width:304pt" class=""><col width="46" style="mso-width-source:userset;mso-width-alt:1962;width:46pt" class=""><col width="74" style="mso-width-source:userset;mso-width-alt:3157;width:74pt" class=""></colgroup>
<tbody class="">
<tr height="15" style="height:15.0pt" class="">
<td height="15" width="304" style="text-align: right; height: 15pt; width: 304pt; box-sizing: content-box;" class="">
</td>
<td class="xl66" width="46" style="text-align: right; width: 46pt;"><span style="font-size: 12px;" class=""><b class="">gisel</b></span></td>
<td class="xl66" width="74" style="text-align: right; width: 74pt;"><span style="font-size: 12px;" class=""><b class="">gisel+greedy</b></span></td>
</tr>
<tr height="17" style="height:17.0pt" class="">
<td height="17" style="height:17.0pt;box-sizing: content-box" class=""><span style="font-size: 12px;" class="">CTMark/7zip/7zip-benchmark</span></td>
<td class="xl64" align="right"><span style="font-size: 12px;" class="">102.8%</span></td>
<td class="xl64" align="right"><span style="font-size: 12px;" class="">106.5%</span></td>
</tr>
<tr height="17" style="height:17.0pt" role="row" class="">
<td height="17" style="height:17.0pt;box-sizing: content-box" class=""><span style="font-size: 12px;" class="">CTMark/Bullet/bullet</span></td>
<td class="xl64" align="right"><span style="font-size: 12px;" class="">100.5%</span></td>
<td class="xl64" align="right"><span style="font-size: 12px;" class="">105.1%</span></td>
</tr>
<tr height="17" style="height:17.0pt" role="row" class="">
<td height="17" style="height:17.0pt;box-sizing: content-box" class=""><span style="font-size: 12px;" class="">CTMark/ClamAV/clamscan</span></td>
<td class="xl64" align="right"><span style="font-size: 12px;" class="">101.6%</span></td>
<td class="xl64" align="right"><span style="font-size: 12px;" class="">130.8%</span></td>
</tr>
<tr height="17" style="height:17.0pt" role="row" class="">
<td height="17" style="height:17.0pt;box-sizing: content-box" class=""><span style="font-size: 12px;" class="">CTMark/SPASS/SPASS</span></td>
<td class="xl64" align="right"><span style="font-size: 12px;" class="">101.2%</span></td>
<td class="xl64" align="right"><span style="font-size: 12px;" class="">120.0%</span></td>
</tr>
<tr height="17" style="height:17.0pt" role="row" class="">
<td height="17" style="height:17.0pt;box-sizing: content-box" class=""><span style="font-size: 12px;" class="">CTMark/consumer-typeset/consumer-typeset</span></td>
<td class="xl64" align="right"><span style="font-size: 12px;" class="">105.7%</span></td>
<td class="xl64" align="right"><span style="font-size: 12px;" class="">138.2%</span></td>
</tr>
<tr height="17" style="height:17.0pt" role="row" class="">
<td height="17" style="height:17.0pt;box-sizing: content-box" class=""><span style="font-size: 12px;" class="">CTMark/kimwitu++/kc</span></td>
<td class="xl64" align="right"><span style="font-size: 12px;" class="">103.1%</span></td>
<td class="xl64" align="right"><span style="font-size: 12px;" class="">122.6%</span></td>
</tr>
<tr height="17" style="height:17.0pt" role="row" class="">
<td height="17" style="height:17.0pt;box-sizing: content-box" class=""><span style="font-size: 12px;" class="">CTMark/lencod/lencod</span></td>
<td class="xl64" align="right"><span style="font-size: 12px;" class="">106.2%</span></td>
<td class="xl64" align="right"><span style="font-size: 12px;" class="">143.4%</span></td>
</tr>
<tr height="17" style="height:17.0pt" role="row" class="">
<td height="17" style="height:17.0pt;box-sizing: content-box" class=""><span style="font-size: 12px;" class="">CTMark/mafft/pairlocalalign</span></td>
<td class="xl64" align="right"><span style="font-size: 12px;" class="">96.2%</span></td>
<td class="xl64" align="right"><span style="font-size: 12px;" class="">135.4%</span></td>
</tr>
<tr height="17" style="height:17.0pt" role="row" class="">
<td height="17" style="height:17.0pt;box-sizing: content-box" class=""><span style="font-size: 12px;" class="">CTMark/sqlite3/sqlite3</span></td>
<td class="xl64" align="right"><span style="font-size: 12px;" class="">109.1%</span></td>
<td class="xl64" align="right"><span style="font-size: 12px;" class="">155.1%</span></td>
</tr>
<tr height="17" style="height:17.0pt" role="row" class="">
<td height="17" style="height:17.0pt;box-sizing: content-box" class=""><span style="font-size: 12px;" class="">CTMark/tramp3d-v4/tramp3d-v4</span></td>
<td class="xl64" align="right"><span style="font-size: 12px;" class="">109.1%</span></td>
<td class="xl64" align="right"><span style="font-size: 12px;" class="">132.0%</span></td>
</tr>
<tr height="15" style="height:15.0pt" class="">
<td height="15" style="height:15.0pt;box-sizing: content-box" class=""><span style="font-size: 12px;" class=""><b class="">GEOMEAN</b></span></td>
<td class="xl65" align="right"><span style="font-size: 12px;" class=""><b class="">103.5%</b></span></td>
<td class="xl65" align="right"><span style="font-size: 12px;" class=""><b class="">128.0%</b></span></td>
</tr>
</tbody>
</table>
</div>
<div><br class="">
</div>
<div><br class="">
</div>
<div>Thanks,</div>
<div><br class="">
</div>
<div>Kristof</div>
</div>
</body>
</html>