<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Jan 23, 2014 at 9:05 AM, Eric Christopher <span dir="ltr"><<a href="mailto:echristo@gmail.com" target="_blank">echristo@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><p dir="ltr">Adrian may have handled this recently?</p></blockquote><div>I believe so.</div><div><br></div><div>Manman</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">
<div class="gmail_quote">On Jan 13, 2014 3:34 PM, "Manman Ren" <<a href="mailto:manman.ren@gmail.com" target="_blank">manman.ren@gmail.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr"><div>I briefly looked at the bit code files and some types are not uniqued, here is one example:</div><div><div>!3903 = metadata !{i32 786454, metadata !3904, null, metadata !"int64_t", i32 198, i64 0, i64 0, i64 0, i32 0, metadata !2258} ; [ DW_TAG_typedef ] [int64_t] [line 198, size 0, align 0, offset 0] [from long int]</div>
<div><br></div><div>!4019 = metadata !{i32 786454, metadata !4020, null, metadata !"int64_t", i32 198, i64 0, i64 0, i64 0, i32 0, metadata !2258} ; [ DW_TAG_typedef ] [int64_t] [line 198, size 0, align 0, offset 0] [from long int]</div>
<div><br></div><div>!3904 = metadata !{metadata !"runtime/int.cpp", metadata !"/home/kmod/icbd/jit"}</div><div>!4020 = metadata !{metadata !"runtime/list.cpp", metadata !"/home/kmod/icbd/jit"}</div>
</div><div><br></div><div>The file names are different for the two typedefs.</div><div><br></div><div>Manman</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Jan 10, 2014 at 12:14 AM, Eric Christopher <span dir="ltr"><<a href="mailto:echristo@gmail.com" target="_blank">echristo@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">That was likely type information and should mostly be fixed up. It's still not lazily loaded, but is going to be ridiculously smaller now.<span><font color="#888888"><br>
<div><br></div><div>-eric</div></font></span><div><div><br><div>On Fri Jan 10 2014 at 12:11:52 AM, Sean Silva <<a href="mailto:chisophugis@gmail.com" target="_blank">chisophugis@gmail.com</a>> wrote:</div>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>This Summer I was working on LTO and Rafael mentioned to me that debug info is not lazy loaded, which was the cause for the insane resource usage I was seeing when doing LTO with debug info. This is likely the reason that the lazy loading was so ineffective for your debug build.</div>
<div><br></div>Rafael, am I remembering this right/can you give more information? I expect that this will have to get fixed before pitching LLD as a turnkey LTO solution (not sure where in the priority list it is).</div>
<div dir="ltr"><div><div>
<br></div><div>-- Sean Silva</div></div></div><div><div>On Thu, Jan 9, 2014 at 5:37 PM, Kevin Modzelewski <span dir="ltr"><<a href="mailto:kmod@dropbox.com" target="_blank">kmod@dropbox.com</a>></span> wrote:<br>
</div></div><blockquote style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div><div dir="ltr"><div><div>Hi all, I'm trying to reduce the startup time for my JIT, but I'm running into the problem that the majority of the time is spent loading the bitcode for my standard library, and I suspect it's due to debug info. My stdlib is currently about 2kloc in a number of C++ files; I compile them with clang -g -emit-llvm, then link them together with llvm-link, call opt -O3 on it, and arrive at a 1MB bitcode file. I then embed this as a binary blob into my executable, and call ParseBitcodeFile on it at startup.</div>
<div><br></div><div>Unfortunately, this parsing takes about 60ms right now, which is the main component of my ~100ms time to run on an empty source file (another ~20ms is loading the pre-jit'd image through an ObjectCache). I thought I'd save some time by using getLazyBitcodeModule, since the IR isn't actually needed right away, but this only reduced the parsing time (ie the time of the actual getLazyBitcodeModule() call) to 45ms, which I thought was surprising. I also tested computing the bytewise-xor of the bitcode file to make sure that it was fully read into memory, which took about 5ms, so the majority of the time does seem to be spent parsing.</div>
<div><br></div><div>Then I switched back to ParseBitcodeFile, but now I added the "-strip-debug" flag to my opt invocation, which reduced the bitcode file down to about 100KB, and reduced the parsing time to 20ms. What surprised me the most was that if I then switched to getLazyBitcodeModule, the parsing time was cut down to 3ms, which is what I was originally expecting. So when lazy loading, stripping out the debug info cuts down the initialization time from 45ms to 3ms, which is why I suspect that getLazyBitcodeModule is still parsing all of the debug info.</div>
<div><br></div><div><br></div><div>To work around it, I can generate separate builds, one with debug info and one without, but I'd like to avoid doing that. I did some simple profiling of what getLazyBitcodeModule was doing, and it wasn't terribly informative (spends most of its time in parsing-related functions); does anyone have any ideas if this is something that could be fixable or if I should just move on?</div>
<div><br></div><div>Thanks,</div><div>Kevin</div></div></div>
<br></div></div></blockquote><blockquote style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div>_______________________________________________<br>
LLVM Developers mailing list<br>
<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><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br>
<br></div></div></blockquote></blockquote>
</div></div><br>_______________________________________________<br>
LLVM Developers mailing list<br>
<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><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br>
<br></blockquote></div><br></div>
</blockquote></div>
</div></div></blockquote></div><br></div></div>