<div dir="ltr"><div>Hi Han,</div><div><br></div>What is your ultimate goal here?<div><br></div><div>Cheers,</div><div>Philip</div></div><br><div class="gmail_quote"><div dir="ltr">On Fri, Oct 19, 2018 at 9:17 PM Han Cui via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div lang="EN-GB" link="#0563C1" vlink="#954F72">
<div class="m_-4633289030068696578WordSection1">
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Calibri Light",sans-serif">Hi,<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Calibri Light",sans-serif"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Calibri Light",sans-serif">I’m having a very similar question to
<a href="http://lists.llvm.org/pipermail/llvm-dev/2018-August/125416.html" target="_blank">this thread</a>, about replicating the O3 optimization processing manually using opt.
<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Calibri Light",sans-serif"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Calibri Light",sans-serif">This is my setup:<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Calibri Light",sans-serif"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Calibri Light",sans-serif">Process A:<u></u><u></u></span></p>
<ol style="margin-top:0cm" start="1" type="1">
<li class="m_-4633289030068696578MsoListParagraph" style="color:black;margin-left:0cm">
<span style="font-size:10.0pt;font-family:"Calibri Light",sans-serif">clang -O1 -S -emit-llvm main.c -o main.ll<u></u><u></u></span></li><li class="m_-4633289030068696578MsoListParagraph" style="color:black;margin-left:0cm">
<span style="font-size:10.0pt;font-family:"Calibri Light",sans-serif">opt -O3 main.ll -o main-opt1.ll<u></u><u></u></span></li><li class="m_-4633289030068696578MsoListParagraph" style="color:black;margin-left:0cm">
<span style="font-size:10.0pt;font-family:"Calibri Light",sans-serif">clang -O1 main-opt1.ll -o main-opt1<u></u><u></u></span></li></ol>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Calibri Light",sans-serif;color:black"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Calibri Light",sans-serif">Process B:<u></u><u></u></span></p>
<ol style="margin-top:0cm" start="1" type="1">
<li class="m_-4633289030068696578MsoListParagraph" style="color:black;margin-left:0cm">
<span style="font-size:10.0pt;font-family:"Calibri Light",sans-serif">clang -O1 -S -emit-llvm main.c -o main.ll<u></u><u></u></span></li></ol>
<pre style="margin-left:36.0pt"><u></u><span style="color:black"><span>2.<span style="font:7.0pt "Times New Roman""> </span></span></span><u></u><span style="font-family:"Calibri Light",sans-serif;color:black">opt [opt flags given by command ‘opt -O3 -disable-output -debug-pass=Arguments main.ll’] main.ll -o main-opt2.ll<u></u><u></u></span></pre>
<ol style="margin-top:0cm" start="3" type="1">
<li class="m_-4633289030068696578MsoListParagraph" style="color:black;margin-left:0cm">
<span style="font-size:10.0pt;font-family:"Calibri Light",sans-serif">clang -O1 main-opt2.ll -o main-opt2<u></u><u></u></span></li></ol>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Calibri Light",sans-serif;color:black"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Calibri Light",sans-serif;color:black">I tried this with a set of programs and I noticed the execution time of main-opt2 is often much slower than main-opt1. While ‘main.ll’
is the same, ‘main-opt1.ll’ is different to ‘main-opt2.ll’. May I get some suggestions what I should put for opt (to replace the command in the brackets), so that the two process would have identical effects? Any help would be much appreciated.
<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Calibri Light",sans-serif;color:black"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Calibri Light",sans-serif;color:black">Thanks,<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Calibri Light",sans-serif;color:black">Han<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Calibri Light",sans-serif;color:black"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Calibri Light",sans-serif;color:black"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Calibri Light",sans-serif"><u></u> <u></u></span></p>
</div>
</div>
_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
</blockquote></div>