[llvm-dev] How can pass be used to optimize a project?

y liu via llvm-dev llvm-dev at lists.llvm.org
Wed Apr 15 06:02:58 PDT 2020

Hi, I have written a pass and get a psss.so file. My pass optimization
relies on some of my own target files.
This is how I use them when there is only one source file.

For example:

Pass: *Hello-pass.so*
The dependent object file:  *units.o* and *helper.o*

Target file: *simple.c*

I'm using the following command.

>>>  */usr/local/bin/clang  -emit-llvm -c  -o obj/simple.bc simple.c*
>>>  */usr/local/bin/llvm-link obj/simple.bc ./units.o ./helper.o >
obj/simple-link.bc *
>>>  */usr/local/bin/opt -load ../Hello-pass.so  -O3 < obj/simple-link.bc >
obj/simple-opt.bc *
>>>  */usr/local/bin/clang  -o obj/simple obj/simple-opt.bc -g -O3*

Now, I need to optimize a large project with my pass and object
file(Hello-pass.so units.o and helper.o),such as "md5sum" project.
It needs to be compiled and installed using the following command:


>>> * ./configure*

>>> * make*

>>>*  make install*

I need use LLVM to compile and optimize it.  How can I apply my pass to the
entire program?
What should I do? Please tell me an easy way.

Please help me!
Thank you!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20200415/91843627/attachment.html>

More information about the llvm-dev mailing list