[LLVMdev] library functions

Duncan Sands baldrick at free.fr
Fri Oct 5 01:38:41 PDT 2012


> I doubt LLVM has the infrastructure  in place to do so ,One way to accomplish
> this  by implementing decompiler to convert library functions to LLVM IR and
>   run the LLVM analyze pass over  converted LLVM IR ,Then revert back from LLVM
> IR to your library format.

LLVM knows the semantics of many library functions, see SimplifyLibCalls.cpp.
However if you mean that you want LLVM to see the actual body of library
functions etc, then you are basically trying to do link-time optimization,
and the steps are something like this: build your library with -flto, build
your program with -flto, link them together using an LLVM aware linker.

Ciao, Duncan.

> Thanks
> ~Umesh
> On Thu, Oct 4, 2012 at 9:47 PM, apala guha <aguha at uchicago.edu
> <mailto:aguha at uchicago.edu>> wrote:
>     Hi,
>     Is there any way to analyze library functions using LLVM, in the same manner
>     as source code functions?
>     Thanks.
>     -Apala
>     _________________________________________________
>     LLVM Developers mailing list
>     LLVMdev at cs.uiuc.edu <mailto:LLVMdev at cs.uiuc.edu> http://llvm.cs.uiuc.edu
>     http://lists.cs.uiuc.edu/__mailman/listinfo/llvmdev
>     <http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev>
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev

More information about the llvm-dev mailing list