<div dir="ltr">Hi,<div><br></div><div>If your pass runs statically with `opt` (i.e. not loaded as a shared library), the only thing missing is adding it to the pass-manager so that it'll run during LTO.</div><div class="gmail_extra"><br></div><div class="gmail_extra">In LLVM 3.8 the entry point would be: `PassManagerBuilder::populateLTOPassManager()` in lib/Transforms/IPO/PassManagerBuilder.cpp </div><div class="gmail_extra"><br></div><div class="gmail_extra">Best,</div><div class="gmail_extra"><br></div><div class="gmail_extra">-- </div><div class="gmail_extra">Mehdi</div><div class="gmail_extra"><br></div><div class="gmail_extra"><br></div><div class="gmail_extra"><br><div class="gmail_quote">2017-08-04 5:40 GMT-07:00 Oliver Braunsdorf via llvm-dev <span dir="ltr"><<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>></span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">Hi there,<br>
<br>
Can someone please outline the steps to load a custom LTO pass at link time?<br>
<br>
I wrote a module pass which currently runs under opt to analyze bitcode<br>
files that have been manually linked using llvm-link.<br>
[Working with LLVM3.8.0]<br>
<br>
Now I want to integrate my custom pass into the a projects build chain.<br>
I installed gold linker and built LLVMgold.so so that I can use the<br>
"clang++ -flto" command to compile and link the project with LLVMs LTO<br>
Passes(at least I believe that the LLVMs LTO passes are executed). I am<br>
looking for some further command line option for clang to load the<br>
shared library of my custom module pass.<br>
Further I need to pass specific command line options to my module pass<br>
itself.<br>
<br>
As I read in the thread from 2015<br>
(<a href="http://lists.llvm.org/pipermail/llvm-dev/2015-May/085744.html" rel="noreferrer" target="_blank">http://lists.llvm.org/<wbr>pipermail/llvm-dev/2015-May/<wbr>085744.html</a>) I have<br>
to modify files in llvm/tools/LTO or in llvm/lib/LTO to accomplish this.<br>
Is that still true? Can someone please give me more detailed<br>
instructions? Because the old thread is missing a lot of details and I<br>
cannot find information in the LLVM documentation.<br>
<br>
Thanks,<br>
Oliver<br>
______________________________<wbr>_________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/llvm-dev</a><br>
</blockquote></div><br></div></div>