[LLVMdev] Build Attributes Proposal

Duncan Sands baldrick at free.fr
Wed Nov 17 22:55:00 PST 2010


Hi Sandeep,

> Another use for build attributes would be as a means to record the
> build flags selected for each translation unit so that LTO could know
> how to optimize/tune the result. This use seems more important to
> solve than the ARM attributes under discussion here.

why not have your build system just pass the appropriate flags directly to the
linker?  Also, suppose some files were compiled at -O1, others at -O3.  If you
do LTO then these files will all be linked together and optimized, but at what
-O level?  I think it would be wrong to have the linker make policy decisions
like "optimize at the highest -O level seen" or "optimize at the lowest -O level
seen".  Better to have the user explicitly say what they want.  But in that case
is there any need to record the -O level in some special way in the module in
the first place?

Ciao,

Duncan.



More information about the llvm-dev mailing list