<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">One more thing. If you really want to find out what's going on at each pass of the optimization process. Place this code:<div><br></div><div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; color: rgb(0, 133, 24); ">// If this is set to 1 then the JIT engine will print out machine code</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; color: rgb(0, 133, 24); ">// between optimization passes.</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; color: rgb(115, 59, 167); "><span style="color: #4f8187">llvm</span><span style="color: #000000">::</span>PrintMachineCode<span style="color: #000000"> = </span><span style="color: #3527d4">0</span><span style="color: #000000">;</span></div></div><div><br></div><div>somewhere before running the pass manager, and it will print out the LLVM IR after every single optimization pass. It doesn't really print out machine code but it prints out an LLVM IR assembly language dump of the module.</div><div><br></div><div>- Curtis</div><div><br></div><div><br><div><div>On Jun 25, 2010, at 6:06 PM, Yuri wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div>I run large piece of code in JIT and it runs only marginallty faster <br>with optimization levels 1,2,3. I think differences are within the <br>margin or error.<br><br>level     user time<br>0           17339ms<br>1           16913ms<br>2           16891ms<br>3           16898ms<br><br>Level is set with builder->setOptLevel(olev);<br>Compilation time is excluded by taking the only top-level function <br>address before the run with getPointerToFunction. So I measure time <br>without getPointerToFunction.<br><br>Why optimization almost doesn't speed it up? What are the other than <br>setOptLevel ways to control optimization?<br><br>My mindset is defined by experience with gcc, when increasing inlining <br>levels speeds the code up significantly. Does JIT inline at all?<br>It's hard to believe that even only local (no inlining) optimization <br>wouldn't bring timing down by at least 10%.<br><br>i386 on i7<br>r106715<br><br>Yuri<br>_______________________________________________<br>LLVM Developers mailing list<br><a href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a>         <a href="http://llvm.cs.uiuc.edu">http://llvm.cs.uiuc.edu</a><br><a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br></div></blockquote></div><br></div></body></html>