<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Jan 27, 2011, at 12:37 PM, <a href="mailto:Hendrix_@gmx.net">Hendrix_@gmx.net</a> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div><br>On 27.01.2011, at 21:12, Devang Patel wrote:<br><br><blockquote type="cite"><br></blockquote><blockquote type="cite">On Jan 27, 2011, at 12:02 PM, <a href="mailto:Hendrix_@gmx.net">Hendrix_@gmx.net</a> wrote:<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><blockquote type="cite">OK, I am looking for "LTO"/global optimization. So the function definition will remain "somewhere else" (externally), and the optimizer will find in some other module to possibly inline it later on.<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">I am planning to concat all the *.ll (eg "link" the files) and pass them to the "global" optimizer, as "size" is a very important optimization criterium to me. After that, the back-end will be invoked.<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">Is that a good approach?<br></blockquote></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">How about just add -O4 on clang (or llvm-gcc) command line to get LTO optimizations ?<br></blockquote><blockquote type="cite">See<span class="Apple-tab-span" style="white-space:pre"> </span><a href="http://llvm.org/docs/LinkTimeOptimization.html">http://llvm.org/docs/LinkTimeOptimization.html</a><br></blockquote><blockquote type="cite"><span class="Apple-tab-span" style="white-space:pre"> </span><a href="http://llvm.org/docs/GoldPlugin.html">http://llvm.org/docs/GoldPlugin.html</a><br></blockquote><blockquote type="cite"><span class="Apple-tab-span" style="white-space:pre"> </span>On Mac OS X, it is a checkbox in Xcode.<br></blockquote><blockquote type="cite">-<br></blockquote><blockquote type="cite">Devang<br></blockquote><br>My backend doesnt supply lto :( I am trying to emulate lto like this:<br></div></blockquote><div><br></div>The backend (or code generator) does not do LTO in this case also.</div><div><br><blockquote type="cite"><div><br>clang *.c -S -emit-llvm<br>cat *.ll > very_big.ll<br>opt -O3 -extra-things...<br>llc very_big.ll.optimized<font class="Apple-style-span" color="#000000"><font class="Apple-style-span" color="#144FAE"><br></font></font></div></blockquote><br></div><div>Try replacing "cat *.ll > very_big.ll" with "llvm-ld *.ll -o big.bc". 'llvm-ld' is another llvm tool, just like 'opt'</div><br><div>-</div><div>Devang</div></body></html>