[LLVMdev] LTO ?

Devang Patel dpatel at apple.com
Thu Jan 24 12:55:11 PST 2008


On Jan 24, 2008, at 12:23 PM, Jeff Inman wrote:

> Hi folks,
>
> I've got an idea for something I may be able to do as a Link-Time-
> Optimization pass,
> but I can't seem to find how LTO gets used.  My crude approach has
> been to compile
> LLVM for debugging, and then run gdb on llvm-ld with -O5 and two .bc
> files, trying to
> catch LTO in action.

Then, you want to set up a break-point at tools/llvm-ld/Optimizer.cpp: 
109 Optimizer(Module *M)

>  I've also scanned the compiled tools, and none
> of them appear
> to use the symbol 'createLLVMOptimizer' (or anything with 'lto',
> etc).  The document at
> http://llvm.org/releases/2.1/docs/LinkTimeOptimization.html  doesn't
> seem to be of much
> help for getting started with this.

This document is intended for someone who wants to integrate LLVM  
optimizer in the system linker. If a system linker can optimizer LLVM  
bitcodes then that is one way to take advantage of LTO. Another  
approach is to use llvm-ld to join multiple .bc files together and  
optimize them using various interprocedural optimizations.

>   How do I provoke LTO?  Any
> suggestions?
>
> Thanks,
>
> Jeff

-
Devang






More information about the llvm-dev mailing list