Jinwook Shin (HOTWING)
2011-Jul-12 21:11 UTC
[LLVMdev] running a module pass via opt on multiple bitcode files
Hi, I'm trying to implement a module pass as a share object to process an entire program as a unit. The target program is built from multiple object files, hence multiple bitcode files. However, it seems that opt does not take the whole program, but just one bitcode file, "test.bc" in the example run shown below. $ opt -load mypass.dylib -mymodulepass < test.bc > /dev/null How do I run my module pass in a library on a whole program? Thanks. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20110712/c5b2bd6f/attachment.html>
John Criswell
2011-Jul-12 21:19 UTC
[LLVMdev] running a module pass via opt on multiple bitcode files
On 7/12/11 4:11 PM, Jinwook Shin (HOTWING) wrote:> > Hi, > > I'm trying to implement a module pass as a share object to process an > entire program as a unit. The target program is built from multiple > object files, hence multiple bitcode files. However, it seems that opt > does not take the whole program, but just one bitcode file, "test.bc" > in the example run shown below. > > $ opt -load mypass.dylib -mymodulepass < test.bc > /dev/null > > How do I run my module pass in a library on a whole program? >Link the bitcode files together into a single bitcode file with llvm-ld. You can then run the single bitcode file through opt. -- John T.> Thanks. > > > > _______________________________________________ > 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/20110712/e690424a/attachment.html>
Duncan Sands
2011-Jul-25 09:30 UTC
[LLVMdev] running a module pass via opt on multiple bitcode files
> Link the bitcode files together into a single bitcode file with llvm-ld. You can > then run the single bitcode file through opt.I think it would be better to link them with the (simpler) llvm-link. Ciao, Duncan.
Jinwook Shin (HOTWING)
2011-Aug-19 21:36 UTC
[LLVMdev] running a module pass via opt on multiple bitcode files
Thanks John. Your approach worked fine for my small toy program. Now, I would like to run my module pass on a huge project (still a single executable) consisting of a few thousand bit code files scattered in many different directories. And some of them are static libraries. Do you still think it's a good idea to manually gather and link them with llvm-ld? I've seen other module pass implementations where they directly patch a specific version of LLVM or clang, instead of running a shared object implementation with opt. Which would be the ideal approach to analyze a program with a module pass? Thanks. From: John Criswell <criswell at illinois.edu<mailto:criswell at illinois.edu>> Organization: University of Illinois Date: Tue, 12 Jul 2011 16:19:06 -0500 To: Jinwook Shin <Jinwook.Shin at microsoft.com<mailto:Jinwook.Shin at microsoft.com>> Cc: "llvmdev at cs.uiuc.edu<mailto:llvmdev at cs.uiuc.edu>" <llvmdev at cs.uiuc.edu<mailto:llvmdev at cs.uiuc.edu>> Subject: Re: [LLVMdev] running a module pass via opt on multiple bitcode files On 7/12/11 4:11 PM, Jinwook Shin (HOTWING) wrote: Hi, I'm trying to implement a module pass as a share object to process an entire program as a unit. The target program is built from multiple object files, hence multiple bitcode files. However, it seems that opt does not take the whole program, but just one bitcode file, "test.bc" in the example run shown below. $ opt -load mypass.dylib -mymodulepass < test.bc > /dev/null How do I run my module pass in a library on a whole program? Link the bitcode files together into a single bitcode file with llvm-ld. You can then run the single bitcode file through opt. -- John T. Thanks. _______________________________________________ LLVM Developers mailing list LLVMdev at cs.uiuc.edu<mailto:LLVMdev at cs.uiuc.edu> http://llvm.cs.uiuc.eduhttp://lists.cs.uiuc.edu/mailman/listinfo/llvmdev -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20110819/0b167c23/attachment.html>
Seemingly Similar Threads
- [LLVMdev] running a module pass via opt on multiple bitcode files
- [LLVMdev] running a module pass via opt on multiple bitcode files
- [LLVMdev] running a module pass via opt on multiple bitcode files
- [LLVMdev] running a module pass via opt on multiple bitcode files
- [LLVMdev] running a module pass via opt on multiple bitcode files