I'd like to write an inter-modular analysis pass. My understanding is that this should take the form of an LTO pass. However, I have been unable to find any resources on the mechanics of writing and running a custom LTO pass. Does anyone have any pointers? Thanks, Steve -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20150518/b07ba533/attachment.html>
On 5/18/15 2:16 PM, Stephen Thomas wrote:> I'd like to write an inter-modular analysis pass. My understanding is > that this should take the form of an LTO pass. However, I have been > unable to find any resources on the mechanics of writing and running a > custom LTO pass. Does anyone have any pointers?All you need to do is to write a ModulePass and modify the libLTO plugin to run it. Writing a ModulePass is described in the "How to Write an LLVM Pass" document in the LLVM documentation. To modify libLTO, you'll need to read the documents on how to install it, and you'll need to modify the plugin (in llvm/tools/LTO, I think). Alternatively, you can modify the LLVM library that defines which passes get run when you use -O2 and -flto optimization, but the result is the same: you'll need to install a new libLTO plugin. Regards, John Criswell> > Thanks, > Steve > > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev-- John Criswell Assistant Professor Department of Computer Science, University of Rochester http://www.cs.rochester.edu/u/criswell -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20150518/0fec0ba6/attachment.html>
It works in debug mode. I left the std::cout statements in and compiled in sim mode. ir2v aborted. A similar abort happened with more than 8 memcpy's to cpu_ptrs. I don't know if there are other limits we should be diagnosing or documenting. -jon On May 18, 2015, at 2:34 PM, John Criswell wrote:> On 5/18/15 2:16 PM, Stephen Thomas wrote: >> I'd like to write an inter-modular analysis pass. My understanding is that this should take the form of an LTO pass. However, I have been unable to find any resources on the mechanics of writing and running a custom LTO pass. Does anyone have any pointers? > > All you need to do is to write a ModulePass and modify the libLTO plugin to run it. Writing a ModulePass is described in the "How to Write an LLVM Pass" document in the LLVM documentation. To modify libLTO, you'll need to read the documents on how to install it, and you'll need to modify the plugin (in llvm/tools/LTO, I think). Alternatively, you can modify the LLVM library that defines which passes get run when you use -O2 and -flto optimization, but the result is the same: you'll need to install a new libLTO plugin. > > Regards, > > John Criswell > >> >> Thanks, >> Steve >> >> >> _______________________________________________ >> LLVM Developers mailing list >> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu >> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev > > > -- > John Criswell > Assistant Professor > Department of Computer Science, University of Rochester > http://www.cs.rochester.edu/u/criswell > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20150518/c702e974/attachment.html>
On Mon, May 18, 2015 at 3:34 PM, John Criswell <jtcriswel at gmail.com> wrote:> On 5/18/15 2:16 PM, Stephen Thomas wrote: > > I'd like to write an inter-modular analysis pass. My understanding is that > this should take the form of an LTO pass. However, I have been unable to > find any resources on the mechanics of writing and running a custom LTO > pass. Does anyone have any pointers? > > > All you need to do is to write a ModulePass and modify the libLTO plugin > to run it. Writing a ModulePass is described in the "How to Write an LLVM > Pass" document in the LLVM documentation. >Great, that makes sense.> To modify libLTO, you'll need to read the documents on how to install it, > and you'll need to modify the plugin (in llvm/tools/LTO, I think). >Alternatively, you can modify the LLVM library that defines which passes> get run when you use -O2 and -flto optimization, but the result is the > same: you'll need to install a new libLTO plugin. >Just to check my understanding: I will have to change LLVM source code (probably to some .cpp file in llvm/tools/LTO or in llvm/lib/LTO) and recompile in order to run my custom LTO pass? I'm double checking because for custom intra-modular analysis passes, it is not a requirement to change LLVM source code. Instead, one just adds the name of the .so to the opt invocation. ( http://llvm.org/docs/WritingAnLLVMPass.html#running-a-pass-with-opt). Thanks, Steve> > Regards, > > John Criswell > > > Thanks, > Steve > > > _______________________________________________ > LLVM Developers mailing listLLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.eduhttp://lists.cs.uiuc.edu/mailman/listinfo/llvmdev > > > > -- > John Criswell > Assistant Professor > Department of Computer Science, University of Rochesterhttp://www.cs.rochester.edu/u/criswell > >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20150518/17590e77/attachment.html>