[LLVMdev] What are the optimizations that gold uses during the final link stage?

Devang Patel dpatel at apple.com
Tue Aug 31 10:48:43 PDT 2010

On Aug 31, 2010, at 10:43 AM, Rafael Espindola wrote:

>> I am not sure why "before it is optimized?". May be this is gold specific ?
>> One of the use of this utility is a debugging aid. The linker can select to do this when -save-temps is used on the command line.
> I think an example will explain. Lets say we have a function foo that
> is unused. The output of lto_codegen_write_merged_modules will have
> foo in it, but it will be marked as an internal function. The .o
> produced by libLTO will not have foo anymore.

Would not it be useful to debug LLVM optimizer bugs ?

BTW, if you call lto_codegen_write_merged_modules() from linker after optimization but before generating machine code and you'll get a .bc file without function foo.

In other words, when to use this hook is up to libLTO user. It is not required to use this hook all the time. 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20100831/f4cc4ea0/attachment.html>

More information about the llvm-dev mailing list