[LLVMdev] How to translate library functions into LLVM IR bitcode?

Liwei Yang yangliwei.uestc at gmail.com
Mon Sep 15 05:56:43 PDT 2014


Good tips. Although I have used llvm-link to merge .bc files together, I
guess -flto could optimize the resultant .bc file further.

As for the assembly, yes it is an issue. Anyway, I'll try to address those
sources which are available for being translated into .bc first.

Thanks for your advice, Tim.

On Mon, Sep 15, 2014 at 2:55 PM, Tim Northover <t.p.northover at gmail.com>
wrote:

> > If there's any automated way to infer about all the subroutines that one
> > function needs, clang them into .bc file and link them into a stand-alone
> > .bc library, that will be more than appreciated:-)
>
> If manually compiling the files is working for you, you could try
> building the entire library with "-flto" for Link-time optimisation.
> The output of that will be LLVM IR (if you can convince the build
> system to do it for you).
>
> The issue is that parts of the standard library are
> performance-critical and often written in assembly. If the entire file
> is assembly you won't be able to produce IR very easily at all.
>
> Cheers.
>
> Tim.
>



-- 
Best Regards
Liwei
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20140915/785580e2/attachment.html>


More information about the llvm-dev mailing list