<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Dec 4, 2015, at 4:12 PM, David Callahan <<a href="mailto:dcallahan@fb.com" class="">dcallahan@fb.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class="">
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252" class="">
<div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; font-size: 14px; font-family: Calibri, sans-serif;" class="">
<div class="">Thanks for the response.</div>
<div class="">To clarify in your suggestion, llvm-link will combine the modules but not run the optimization pass, that is still delayed until the final binary is built, correct?</div></div></div></blockquote><div><br class=""></div><div>Yes.</div><div>You can use clang to generate a .o (as a real binary), that you can then wrap in an archive library.</div><div><br class=""></div><br class=""><blockquote type="cite" class=""><div class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; font-size: 14px; font-family: Calibri, sans-serif;" class="">
<div class=""><br class="">
</div>
<div class="">My use case is apply LTO to roughly program subsets; sacrificing effectiveness to avoid scaling problems and to allow the artifacts to be reused like archives and cached like .o’s.</div></div></div></blockquote><div><br class=""></div><div>You’re probably be interested in ThinLTO that is currently being implemented: scalability and incrementally are scheduled.</div><br class=""><blockquote type="cite" class=""><div class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; font-size: 14px; font-family: Calibri, sans-serif;" class="">
<div class="">I need to trigger the optimizer on the intermediate rather than defer to final link for these goals.</div></div></div></blockquote><div><br class=""></div><div>Just run clang on the output of llvm-link :)</div><div><br class=""></div><div>Note: you’re not having the same linker semantic with an archive containing one .o compared to an archive with multiple .o. So you need to be careful.</div><div><br class=""></div><div>— </div><div>Mehdi</div><div><br class=""></div><br class=""><blockquote type="cite" class=""><div class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; font-size: 14px; font-family: Calibri, sans-serif;" class="">
<div class=""><br class="">
</div>
<div class="">—david</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
<span id="OLK_SRC_BODY_SECTION" class="">
<div style="font-family: Calibri; font-size: 11pt; text-align: left; border-width: 1pt medium medium; border-style: solid none none; padding: 3pt 0in 0in; border-top-color: rgb(181, 196, 223);" class="">
<span style="font-weight:bold" class="">From: </span><<a href="mailto:mehdi.amini@apple.com" class="">mehdi.amini@apple.com</a>> on behalf of Mehdi Amini <<a href="mailto:mehdi.amini@apple.com" class="">mehdi.amini@apple.com</a>><br class="">
<span style="font-weight:bold" class="">Date: </span>Friday, December 4, 2015 at 4:02 PM<br class="">
<span style="font-weight:bold" class="">To: </span>David Callahan <<a href="mailto:dcallahan@fb.com" class="">dcallahan@fb.com</a>><br class="">
<span style="font-weight:bold" class="">Cc: </span>LLVM Dev Mailing list <<a href="mailto:llvm-dev@lists.llvm.org" class="">llvm-dev@lists.llvm.org</a>><br class="">
<span style="font-weight:bold" class="">Subject: </span>Re: [llvm-dev] LTO on libraries<br class="">
</div>
<div class=""><br class="">
</div>
<div class="">
<div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">
<br class="">
<div class="">
<blockquote type="cite" class="">
<div class="">On Dec 4, 2015, at 3:54 PM, David Callahan via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" class="">llvm-dev@lists.llvm.org</a>> wrote:</div>
<br class="Apple-interchange-newline">
<div class="">
<div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; font-size: 14px; font-family: Calibri, sans-serif;" class="">
<div class="">Hello,</div>
<div class=""><br class="">
</div>
<div class="">Is there a combination of the current tools would would allow me to apply LTO to a set of object files where are less than an entire application? Similar to “ld –r” for doing a partial link.</div>
<div class="">I assume it would start with “clang –flto –c {a,b,c}.c” but the a subsequent link step fails do to unresolved references of course.</div>
<div class="">Using llvm-link will linke the bitcode files but does not trigger compilation.</div>
</div>
</div>
</blockquote>
<div class=""><br class="">
</div>
<div class="">You can llvm-link and then run clang. Note that the result of LTO in this case is not as powerful as when it is linker driver, since you can’t internalize.</div>
<div class="">You may also want to look at llvm-lto, but it can be annoying because it requires (AFAIK) an export list.</div>
<div class=""><br class="">
</div>
<div class="">What is your use-case?</div>
<div class=""><br class="">
</div>
<div class="">— </div>
<div class="">Mehdi</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
<br class="">
<blockquote type="cite" class="">
<div class="">
<div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; font-size: 14px; font-family: Calibri, sans-serif;" class="">
<div class=""><br class="">
</div>
<div class="">Thanks</div>
<div class="">david</div>
</div>
_______________________________________________<br class="">
LLVM Developers mailing list<br class="">
<a href="mailto:llvm-dev@lists.llvm.org" class="">llvm-dev@lists.llvm.org</a><br class="">
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" class="">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br class="">
</div>
</blockquote>
</div>
<br class="">
</div>
</div>
</span>
</div>
</div></blockquote></div><br class=""></body></html>