[LLVMdev] Build Attributes Proposal

Duncan Sands baldrick at free.fr
Fri Nov 12 08:20:54 PST 2010


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:

* 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.



More information about the llvm-dev mailing list