<div dir="ltr"><div><div><div>Dear Will,<br></div>Thank you,<br></div>--plugin-opt does not seem to work on my linux system. I have installed gold and configured and made LLVM under gold.<br></div><div><div><div><br></div>
</div></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Sun, Mar 30, 2014 at 9:55 PM, Will Dietz <span dir="ltr"><<a href="mailto:willdtz@gmail.com" target="_blank">willdtz@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">FWIW you can pass flags to LTO by escaping it with the following when<br>
invoking clang:<br>
<br>
-Wl,--plugin-opt,-my-pass-option<br>
<br>
Or at least you used to be able to. That said, environment variables<br>
can be a good fallback<br>
for stubborn build systems that do things like strip unrecognized linker flags.<br>
<span class="HOEnZb"><font color="#888888"><br>
~Will<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
On Sun, Mar 30, 2014 at 12:47 PM, Rahman Lavaee<br>
<<a href="mailto:rlavaee@cs.rochester.edu">rlavaee@cs.rochester.edu</a>> wrote:<br>
> Thank you very much John.<br>
> With an environment variable I need to take some special care, but it looks<br>
> like the only way to go.<br>
><br>
><br>
> On Sun, Mar 30, 2014 at 11:07 AM, John Criswell <<a href="mailto:criswell@illinois.edu">criswell@illinois.edu</a>><br>
> wrote:<br>
>><br>
>> Dear Rahman,<br>
>><br>
>> I think your best option is to modify the code in libLTO so that it runs<br>
>> your pass when you want it to run. I believe the file you want to modify is<br>
>> LTOCodeGenerator.cpp.<br>
>><br>
>> This does mean that passing options to your pass will be difficult or<br>
>> impossible. However, you can either hard-code the options you need or read<br>
>> them from an environment variable if there is no easy way to pass options to<br>
>> the libLTO.<br>
>><br>
>> If you want to go the llc route, then you'll need to modify the llc code<br>
>> so that it runs your pass instead of opt; sadly, I don't know off-hand where<br>
>> the code is that you would need to modify (it is either in llc or in some<br>
>> LLVM library somewhere). The only reason I discourage the llc route is<br>
>> because it is difficult to get whole-program bitcode files for large<br>
>> programs (e.g., Apache).<br>
>><br>
>> Regards,<br>
>><br>
>> John Criswell<br>
>><br>
>><br>
>> On 3/29/14, 12:47 AM, Rahman Lavaee wrote:<br>
>><br>
>> Hi,<br>
>> I am finding it difficult to see how I can run an IR instrumentation pass<br>
>> after "all" IR passes.<br>
>> I previously used opt to run my pass after linking all the llvm bitcode<br>
>> files and then ran llc.<br>
>> I found out that llc runs some other Function passes which depend on the<br>
>> target.<br>
>> For example, tail calls are only supported in x86 under some<br>
>> circumstances.<br>
>><br>
>> Then I tried lto and link time optimization. But I found it difficult to<br>
>> specify a flag option for my instrumentation pass.<br>
>><br>
>> Is there any way in llvm to run an IR pass after all IR passes?<br>
>><br>
>><br>
>> _______________________________________________<br>
>> LLVM Developers mailing list<br>
>> <a href="mailto:LLVMdev@cs.uiuc.edu">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>
>><br>
><br>
><br>
> _______________________________________________<br>
> LLVM Developers mailing list<br>
> <a href="mailto:LLVMdev@cs.uiuc.edu">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></div><br></div>