[LLVMdev] Build Attributes Proposal

Sandeep Patel deeppatel1987 at gmail.com
Thu Nov 18 10:53:10 PST 2010


On Thu, Nov 18, 2010 at 6:55 AM, Duncan Sands <baldrick at free.fr> wrote:
>
>> 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?

I wasn't so much worried about -O level, but processor tuning
selection, float ABI, etc. For example, one might build most code with
Thumb and then build some hot code as ARM. Or perhaps one builds code
with and without NEON and conditionally decides which code to run at a
higher level.

deep




More information about the llvm-dev mailing list