<html><head><meta http-equiv="Content-Type" content="text/html charset=iso-8859-1"></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 Mar 11, 2016, at 7:24 PM, Yuxi Chen 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="font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); direction: ltr; font-family: Tahoma; font-size: 10pt;" class="">Hi John,<br class=""><br class="">One more question, I try to use libLTO,  and try example ON<span class="Apple-converted-space"> </span><a href="http://llvm.org/docs/GoldPlugin.html." target="_blank" class="">http://llvm.org/docs/GoldPlugin.html.</a><br class="">For the example, it directly generates executable, what I want is a .o file(which I can use llvm-dis to see the bitcode). Maybe I misinterpret your solution.<span class="Apple-converted-space"> </span><br class=""></div></div></blockquote><div><br class=""></div><div>It depends what you want to do on the bitcode. I think the idea is to generate your own libLTO that includes your pass(es) as part of the LTO pipeline.</div><div><br class=""></div><div>-- </div><div>Mehdi</div><div><br class=""></div><div><br class=""></div><br class=""><blockquote type="cite" class=""><div class=""><div style="font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); direction: ltr; font-family: Tahoma; font-size: 10pt;" class=""><br class="">Or you want to say if I follow the instruction like<span class="Apple-converted-space"> </span><a href="http://llvm.org/docs/GoldPlugin.html." target="_blank" class="">http://llvm.org/docs/GoldPlugin.html.</a><span class="Apple-converted-space"> </span>After ./configure&&make&&make ckeck, I can get one module, containing as many functions as possible.<br class=""><br class="">Best,<br class="">Yuxi<br class=""><div style="font-family: 'Times New Roman'; font-size: 16px;" class=""><hr tabindex="-1" class=""><div id="divRpF125995" style="direction: ltr;" class=""><font face="Tahoma" size="2" class=""><b class="">From:</b><span class="Apple-converted-space"> </span>John Criswell [<a href="mailto:jtcriswel@gmail.com" class="">jtcriswel@gmail.com</a>]<br class=""><b class="">Sent:</b><span class="Apple-converted-space"> </span>Friday, March 11, 2016 11:26 AM<br class=""><b class="">To:</b><span class="Apple-converted-space"> </span>Yuxi Chen; <a href="mailto:llvm-dev@lists.llvm.org" class="">llvm-dev@lists.llvm.org</a><br class=""><b class="">Cc:</b><span class="Apple-converted-space"> </span><a href="mailto:llvmdev-bounces@cs.uiuc.edu" class="">llvmdev-bounces@cs.uiuc.edu</a>; <a href="mailto:llvmdev@cs.uiuc.edu" class="">llvmdev@cs.uiuc.edu</a><br class=""><b class="">Subject:</b><span class="Apple-converted-space"> </span>Re: [llvm-dev] big module for a project<br class=""></font><br class=""></div><div class=""></div><div class=""><div class="moz-cite-prefix">Dear Yuxi,<br class=""><br class="">There are three general ways to do this (two of which have already been mentioned).<br class=""><br class="">First, you can change the Makefiles to emit bitcode and then use llvm-link to link all the bitcode files together into a big bitcode file.  You can then run the opt program on this large bitcode file.<br class=""><br class="">Second, you can use some third-party tools (for lack of a better term) that will get you a single bitcode file with fewer changes to the Makefiles.  I'm not very familiar with these, but I think others have commented on them.<br class=""><br class="">Third, you can add your analysis pass to the libLTO library and use LLVM's link-time optimization framework to run your analysis.  Documentation libLTO can be found at<a class="moz-txt-link-freetext" href="http://llvm.org/docs/LinkTimeOptimization.html" target="_blank">http://llvm.org/docs/LinkTimeOptimization.html</a><span class="Apple-converted-space"> </span>and<span class="Apple-converted-space"> </span><a class="moz-txt-link-freetext" href="http://llvm.org/docs/GoldPlugin.html" target="_blank">http://llvm.org/docs/GoldPlugin.html</a>.  LLVM's LTO infrastructure is designed to be transparent (i.e., you shouldn't have to modify Makefiles to use it), though some programs' Makefiles are more...complaint than others.<br class=""><br class="">I've used the libLTO approach for large programs with reasonable success.  However, some of the other third-party approaches have been reported to work well, so you might try looking at those.<br class=""><br class="">Regards,<br class=""><br class="">John Criswell<br class=""><br class="">On 3/10/16 9:54 PM, Yuxi Chen via llvm-dev wrote:<br class=""></div><blockquote type="cite" class=""><div style="direction: ltr; font-family: Tahoma; font-size: 10pt;" class="">Hi All,<br class=""><br class="">I am using clang to compile Mysql source code. Because I want to do some inter-procedural analysis, hopefully, I want to get a .o(bitcode) file(a module) containing all possible function declarations and definitions. Is it possible to do that ? Or you guys have some suggestions?<br class=""><br class="">To be clear, like Mysql, there is a mysqld routine, which is a major routine. I want to mysqld.o(which is generated by clang) to contain all possible function declarations and definitions. So when I do some analysis, I just need load one module, which is mysqld.o, instead of all .o files.<span class="Apple-converted-space"> </span><br class=""><br class=""><br class="">Best,<br class="">Yuxi<br class=""></div><br class=""><fieldset class="mimeAttachmentHeader" target="_blank"></fieldset><br class=""><pre class="">_______________________________________________
LLVM Developers mailing list
<a class="moz-txt-link-abbreviated" href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>
<a class="moz-txt-link-freetext" href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a>
</pre></blockquote><br class=""><br class=""><pre class="moz-signature" cols="72">-- 
John Criswell
Assistant Professor
Department of Computer Science, University of Rochester
<a class="moz-txt-link-freetext" href="http://www.cs.rochester.edu/u/criswell" target="_blank">http://www.cs.rochester.edu/u/criswell</a></pre></div></div></div><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); float: none; display: inline !important;" class="">_______________________________________________</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255);" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); float: none; display: inline !important;" class="">LLVM Developers mailing list</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255);" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); float: none; display: inline !important;" class=""><a href="mailto:llvm-dev@lists.llvm.org" class="">llvm-dev@lists.llvm.org</a></span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255);" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); float: none; display: inline !important;" 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></span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255);" class=""></div></blockquote></div><br class=""></body></html>