Hi all,<br><br>I am trying to compare the performance of gcc , llvm-gcc , clang and lli(with JIT) on x86. i have attached the performance comparision spreadsheet as well as the source which i used for performing these test. i ran this code for 10000 iterations and the time of execution is as follows<br>
<br>for -O3 results refer attachment.<br><b>clang (-O0) </b><br>
<meta http-equiv="CONTENT-TYPE" content="text/html; charset=utf-8"><title></title><meta name="GENERATOR" content="OpenOffice.org 2.4 (Linux)">
<style>
<!--
BODY,DIV,TABLE,THEAD,TBODY,TFOOT,TR,TH,TD,P { font-family:"Arial"; font-size:x-small }
-->
</style>
<table border="0" cellspacing="0" cols="2" frame="void" rules="none">
<colgroup><col width="96"><col width="86"></colgroup>
<tbody>
<tr>
<td align="left" height="16" width="96">real</td>
<td align="left" width="86">0m10.247s</td>
</tr>
<tr>
<td align="left" height="16">user</td>
<td align="left">0m2.644s</td>
</tr>
<tr>
<td align="left" height="16">sys</td>
<td align="left">0m5.949s</td>
</tr>
</tbody>
</table>
<br><b>llvm-gcc(-O0)</b><br>
<meta http-equiv="CONTENT-TYPE" content="text/html; charset=utf-8"><title></title><meta name="GENERATOR" content="OpenOffice.org 2.4 (Linux)">
<style>
<!--
BODY,DIV,TABLE,THEAD,TBODY,TFOOT,TR,TH,TD,P { font-family:"Arial"; font-size:x-small }
-->
</style>
<table border="0" cellspacing="0" cols="2" frame="void" rules="none">
<colgroup><col width="86"><col width="86"></colgroup>
<tbody>
<tr>
<td align="left" height="16" width="86">real</td>
<td align="left" width="86">0m11.324s</td>
</tr>
<tr>
<td align="left" height="16">user</td>
<td align="left">0m2.478s</td>
</tr>
<tr>
<td align="left" height="16">sys</td>
<td align="left">0m6.000s</td>
</tr>
</tbody>
</table>
<b><br>gcc(-O0)</b><br>
<meta http-equiv="CONTENT-TYPE" content="text/html; charset=utf-8"><title></title><meta name="GENERATOR" content="OpenOffice.org 2.4 (Linux)">
<style>
<!--
BODY,DIV,TABLE,THEAD,TBODY,TFOOT,TR,TH,TD,P { font-family:"Arial"; font-size:x-small }
-->
</style>
<table border="0" cellspacing="0" cols="2" frame="void" rules="none">
<colgroup><col width="86"><col width="86"></colgroup>
<tbody>
<tr>
<td align="left" height="16" width="86">real</td>
<td align="left" width="86">0m10.963s</td>
</tr>
<tr>
<td align="left" height="16">user</td>
<td align="left">0m2.365s</td>
</tr>
<tr>
<td align="left" height="16">sys</td>
<td align="left">0m5.953s</td>
</tr>
</tbody>
</table>
<br><b>llvm-jit </b><br>i used clang-cc -O0 -emit-llvm-bc to emit llvm bytecode and then passed it to opt tool and then linked all bytecode files to single bytecode using llvm-ld, i used lli tool to run this single bytecode file and noticed the following output<br>
<meta http-equiv="CONTENT-TYPE" content="text/html; charset=utf-8"><title></title><meta name="GENERATOR" content="OpenOffice.org 2.4 (Linux)">
<style>
<!--
BODY,DIV,TABLE,THEAD,TBODY,TFOOT,TR,TH,TD,P { font-family:"Arial"; font-size:x-small }
-->
</style>
<table border="0" cellspacing="0" cols="2" frame="void" rules="none">
<colgroup><col width="86"><col width="86"></colgroup>
<tbody>
<tr>
<td align="left" height="16" width="86">real</td>
<td align="left" width="86">6m33.786s</td>
</tr>
<tr>
<td align="left" height="16">user</td>
<td align="left">5m12.612s</td>
</tr>
<tr>
<td align="left" height="17">sys</td>
<td align="left">1m1.205s</td>
</tr>
</tbody>
</table>
<br>why is lli taking such a loooong time to execute this particular piece of code.?? <br><br clear="all"><br>Thanks and Regards,<br>Prasanth J<br><br><br><br>