[PATCH] Add -disable-opt option to LTO

Nick Lewycky nicholas at mxc.ca
Sun Mar 3 15:24:09 PST 2013


Cristiano Giuffrida wrote:
> Hi,
> the attached patch adds the -disable-opt option to LTO. The effect is
> self-explanatory. I think this should be considered for merging
> (hopefully for the upcoming 3.3 release) for the following reasons:

I appreciate these goals, but I don't like the approach. libLTO 
shouldn't have these command-line flags at all, both of those are bugs. 
It should be entirely controllable through a proper C API.

 > - Debugging gold plugin-based linking without optimizations getting 
in the way.

If you want to add a flag to the gold plugin, please add it to the gold 
plugin. I don't know offhand whether this necessitates extending the 
libLTO interface, but it wouldn't surprise me.

 > - Debugging programs linked with the gold plugin while preserving the
 > original debug info.

Ditto.

> - Consistency with opt (which supports the same option with the same
> meaning and description).

How would this work? The C API is intended to be high-level and ABI 
stable across many llvm revisions. This means that llvm should be able 
to create and delete LTO passes without the need to recompile any libLTO 
clients.

> - Fine-grained control over LTO passes using the gold plugin in
> combination with opt (or clang/dragonegg).

Ditto.

Nick



More information about the llvm-commits mailing list