<div dir="ltr">Hi Philip,<br><div class="gmail_quote"><br></div><div class="gmail_quote">On Wed Feb 18 2015 at 10:11:32 PM Philip Reames <<a href="mailto:listmail@philipreames.com">listmail@philipreames.com</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div bgcolor="#FFFFFF" text="#000000">
You are mostly likely using a Release build. -stats only does
anything with Assertions enabled.</div></blockquote><div><br></div><div>So to use the -stats flag, I must compile LLVM and clang from source, with --enable-assertions ? That seems quite drastic just to see the printout of statistics for each pass applied on my IR.</div><div><br></div><div>--</div><div>Rob</div><div> <br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div bgcolor="#FFFFFF" text="#000000">
<br>
<div>On 02/18/2015 08:58 AM, Rob Stewart
wrote:<br>
</div>
</div><div bgcolor="#FFFFFF" text="#000000"><blockquote type="cite">
<div dir="ltr"><span style="font-size:13.1999998092651px;line-height:19.7999992370605px">Given
the program:</span>
<div style="font-size:13.1999998092651px;line-height:19.7999992370605px"><br>
</div>
<div style="font-size:13.1999998092651px;line-height:19.7999992370605px">
<div>int sum(int i,int j)</div>
<div>{ return i+j; }</div>
<div><br>
</div>
<div>int main()</div>
<div>{ sum(3,2); }</div>
</div>
<div style="font-size:13.1999998092651px;line-height:19.7999992370605px"><br>
</div>
<div style="font-size:13.1999998092651px;line-height:19.7999992370605px">$
clang -S -emit-llvm foo.c<br>
</div>
<div style="font-size:13.1999998092651px;line-height:19.7999992370605px"><br>
</div>
<div style="font-size:13.1999998092651px;line-height:19.7999992370605px">Now
I'd like to print all statistics. Unfortunately, the following
prints nothing:</div>
<div style="font-size:13.1999998092651px;line-height:19.7999992370605px"><br>
</div>
<div style="font-size:13.1999998092651px;line-height:19.7999992370605px">$
opt -S -O3 -stats < foo.ll > /dev/null<br>
</div>
<div style="font-size:13.1999998092651px;line-height:19.7999992370605px"><br>
</div>
<div style="font-size:13.1999998092651px;line-height:19.7999992370605px">However,
running the following prints an IR that is different to the
contents of foo.ll:</div>
<div style="font-size:13.1999998092651px;line-height:19.7999992370605px"><br>
</div>
<div style="font-size:13.1999998092651px;line-height:19.7999992370605px">$
opt -S -O3 foo.ll<br>
</div>
<div style="font-size:13.1999998092651px;line-height:19.7999992370605px"><br>
</div>
<div style="font-size:13.1999998092651px;line-height:19.7999992370605px">I'm
using LLVM 3.5. <span style="font-size:13.1999998092651px">I'm
doing something very obviously wrong. What is it?</span></div>
<div style="font-size:13.1999998092651px;line-height:19.7999992370605px"><br>
</div>
<div style="font-size:13.1999998092651px;line-height:19.7999992370605px">--</div>
<div style="font-size:13.1999998092651px;line-height:19.7999992370605px">Rob</div>
</div>
<br>
<fieldset></fieldset>
<br>
</blockquote></div><div bgcolor="#FFFFFF" text="#000000"><blockquote type="cite"><pre>_______________________________________________
LLVM Developers mailing list
<a href="mailto:LLVMdev@cs.uiuc.edu" target="_blank">LLVMdev@cs.uiuc.edu</a> <a href="http://llvm.cs.uiuc.edu" target="_blank">http://llvm.cs.uiuc.edu</a>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a>
</pre>
</blockquote>
<br>
</div>
</blockquote></div></div>