<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></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 Aug 19, 2014, at 1:47 PM, Sean Silva <<a href="mailto:chisophugis@gmail.com" class="">chisophugis@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><br class=""><div class="gmail_extra"><br class=""><br class=""><div class="gmail_quote">On Tue, Aug 19, 2014 at 11:47 AM, Chris Bieneman <span dir="ltr" class=""><<a href="mailto:cbieneman@apple.com" target="_blank" class="">cbieneman@apple.com</a>></span> wrote:<br class="">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word" class=""><br class=""><div class=""><div class=""><blockquote type="cite" class=""><div class="">On Aug 19, 2014, at 11:03 AM, Sean Silva <<a href="mailto:chisophugis@gmail.com" target="_blank" class="">chisophugis@gmail.com</a>> wrote:</div>
<br class=""><div class=""><div dir="ltr" class=""><br class=""><div class="gmail_extra"><br class=""><br class=""><div class="gmail_quote">On Tue, Aug 19, 2014 at 10:13 AM, Chris Bieneman <span dir="ltr" class=""><<a href="mailto:cbieneman@apple.com" target="_blank" class="">cbieneman@apple.com</a>></span> wrote:<br class="">

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Initially the biggest difference is the exported API, what parts of LLVM are linked into it, and the file size. The patch I’m proposing exports the full C API, pulls in a few parts of LLVM that aren’t in libLTO (like the JIT), and results in a dylib a little less than 10% bigger.<br class="">

</blockquote><div class=""><br class=""></div><div class="">Keep in mind though that due to virtual memory, it may be worthwhile to have everyone load a 10% bigger dylib (and have the kernel just not page in the unused parts) vs. having two separate dylibs that might have overlapping functionality resident.</div>
</div></div></div></div></blockquote><div class=""><br class=""></div></div><div class="">Agreed with the caveat that you don’t want to include content that isn’t used by any clients. This is actually the motivation for why I want to support using the command line to specify which LLVM libraries to include in the library and dynamically generating the export list.</div>
<span class="HOEnZb"><font color="#888888" class=""><div class=""><br class=""></div></font></span></div></div></blockquote><div class=""><br class=""></div><div class="">That's the opposite of what I was saying, which was that the kernel will only page in stuff that is used, so just doing this to reduce file size or memory footprint might not be worth it (and might actually be detrimental if there are multiple simultaneous LLVM users on the system).</div></div></div></div></div></blockquote><div><br class=""></div><div>On a desktop OS where you provide LLVM as an API that anyone can link to that might make sense (but I don’t think that doing that is a great idea  since you will quickly hit the issue that we don’t do an amazing job of maintaining API compatibility). On a system where LLVM is an implementation detail of other system libraries that the packager can audit the functionality it doesn’t make sense to include anything extra.</div><div><br class=""></div><div>Also that extra TEXT is not free. Larger library sizes result in larger downloads. No matter what you will actually be paging in more code unless you somehow manage to make sure that none of unused functionality is on the same pages as functionality you use, and in any event you are still using the virtual address space which has a non-trivial impact in some environments.</div><div><br class=""></div><div>Louis</div><br class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><div class="gmail_extra"><div class="gmail_quote"><div class="">-- Sean Silva</div><div class=""> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word" class=""><div class=""><span class="HOEnZb"><font color="#888888" class=""><div class="">
</div><div class="">-Chris</div></font></span><div class=""><br class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><div class="gmail_extra"><div class="gmail_quote">
<div class=""><br class=""></div><div class="">Having a single dylib might also net you some cache advantage since the last-level caches typically use real addresses, and so can be shared among processes across a context switch.</div><div class=""><br class=""></div>

<div class="">-- Sean Silva</div><div class=""> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br class="">
I’m also hoping to do some more work in the build configs to support users dynamically specifying which components to include in libLLVM, and having the build process automatically generate the export list.<br class="">
<span class=""><font color="#888888" class=""><br class="">
-Chris<br class="">
</font></span><div class=""><div class=""><br class="">
> On Aug 19, 2014, at 9:54 AM, Bob Wilson <<a href="mailto:bob.wilson@apple.com" target="_blank" class="">bob.wilson@apple.com</a>> wrote:<br class="">
><br class="">
><br class="">
>> On Aug 18, 2014, at 3:51 PM, Chris Bieneman <<a href="mailto:cbieneman@apple.com" target="_blank" class="">cbieneman@apple.com</a>> wrote:<br class="">
>><br class="">
>> This patch adds a new tool libLLVM.dylib which exports the full C API, and can be optionally built for clients who want to link LLVM dynamically.<br class="">
>><br class="">
>> I will be working on some more build system extensions to allow users to better fine-tune the dylib to their uses.<br class="">
><br class="">
> Chris, I haven’t yet looked at this is detail, but I’m wondering how it relates to libLTO.dylib. At least on Darwin, we have gradually been expanding the use of libLTO.dylib for things besides LTO, adding various other functions from the C API, with the intention that it would eventually become an alias for libLLVM.dylib. Would this be a good time to make that transition?<br class="">


> _______________________________________________<br class="">
> llvm-commits mailing list<br class="">
> <a href="mailto:llvm-commits@cs.uiuc.edu" target="_blank" class="">llvm-commits@cs.uiuc.edu</a><br class="">
> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank" class="">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br class="">
<br class="">
<br class="">
_______________________________________________<br class="">
llvm-commits mailing list<br class="">
<a href="mailto:llvm-commits@cs.uiuc.edu" target="_blank" class="">llvm-commits@cs.uiuc.edu</a><br class="">
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank" class="">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br class="">
</div></div></blockquote></div><br class=""></div></div>
_______________________________________________<br class="">llvm-commits mailing list<br class=""><a href="mailto:llvm-commits@cs.uiuc.edu" target="_blank" class="">llvm-commits@cs.uiuc.edu</a><br class=""><a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank" class="">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br class="">
</div></blockquote></div></div><br class=""></div></blockquote></div><br class=""></div></div>
_______________________________________________<br class="">llvm-commits mailing list<br class=""><a href="mailto:llvm-commits@cs.uiuc.edu" class="">llvm-commits@cs.uiuc.edu</a><br class="">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits<br class=""></div></blockquote></div><br class=""></body></html>