[LLVMdev] Build Attributes Proposal

Devang Patel dpatel at apple.com
Fri Nov 12 10:13:37 PST 2010


On Nov 12, 2010, at 8:20 AM, Duncan Sands wrote:

> Hi Renato,
> 
>> So, after long rounds to define how the build attributes are going to
>> be represented in IR, and after Jason has implemented build attributes
>> in MC, I have a proposal on how to represent this in IR.
>> 
>> First, we need to distinguish between target dependent and independent
>> attributes. Generic things like optimization level, specific
>> optimizations, use of vector instructions, use of exceptions,
>> floating-point compatibility can all go in to the generic list of
>> attributes.
> 
> I don't see why you would want to put any of these things in the module
> at all:

In fact they are more suitable as function attributes. For example, we already have function attributes for -Os.
-
Devang

> 
> * optimization level: if you want the linker to optimize at -O3, I think
> you should just pass -O3 to the linker.  I don't see why the fact that
> the original files were optimized at -O3, -O0, -O0 and -O3 (for example)
> is relevant to link time optimization.
> 
> * specific optimizations: likewise.
> 
> * use of vector instructions: if you want the linker to codegen for SSE3,
> then pass -msse3 to the linker.
> 
> * use of exceptions: if a file is compiled with -fno-exceptions then
> all functions have the nounwind attribute and contain no invokes.
> This is all that is needed to automatically have the code generators
> not generate unwind info for them, so no special module level attribute
> is needed, everything is there already.
> 
> * floating point compatibility: not sure what you mean by this.
> 
> Ciao,
> 
> Duncan.
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev





More information about the llvm-dev mailing list