<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">Dear Rahman,<br>
<br>
I think your best option is to modify the code in libLTO so that
it runs your pass when you want it to run. I believe the file you
want to modify is LTOCodeGenerator.cpp.<br>
<br>
This does mean that passing options to your pass will be difficult
or impossible. However, you can either hard-code the options you
need or read them from an environment variable if there is no easy
way to pass options to the libLTO.<br>
<br>
If you want to go the llc route, then you'll need to modify the
llc code so that it runs your pass instead of opt; sadly, I don't
know off-hand where the code is that you would need to modify (it
is either in llc or in some LLVM library somewhere). The only
reason I discourage the llc route is because it is difficult to
get whole-program bitcode files for large programs (e.g., Apache).<br>
<br>
Regards,<br>
<br>
John Criswell<br>
<br>
On 3/29/14, 12:47 AM, Rahman Lavaee wrote:<br>
</div>
<blockquote
cite="mid:CAERV3kOum-D_gV7YDcJ0pVr1D-_kN5CvmJ8_Xw99NUz9d0iJgg@mail.gmail.com"
type="cite">
<meta http-equiv="Content-Type" content="text/html;
charset=ISO-8859-1">
<div dir="ltr">
<div>
<div>
<div>
<div>Hi,<br>
</div>
I am finding it difficult to see how I can run an IR
instrumentation pass after "all" IR passes.<br>
</div>
I previously used opt to run my pass after linking all the
llvm bitcode files and then ran llc. <br>
I found out that llc runs some other Function passes which
depend on the target.<br>
</div>
For example, tail calls are only supported in x86 under some
circumstances.<br>
<br>
</div>
<div>Then I tried lto and link time optimization. But I found it
difficult to specify a flag option for my instrumentation
pass.<br>
<br>
</div>
<div>Is there any way in llvm to run an IR pass after all IR
passes?<br>
</div>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
LLVM Developers mailing list
<a class="moz-txt-link-abbreviated" href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a> <a class="moz-txt-link-freetext" href="http://llvm.cs.uiuc.edu">http://llvm.cs.uiuc.edu</a>
<a class="moz-txt-link-freetext" href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a>
</pre>
</blockquote>
<br>
</body>
</html>