[LLVMdev] Build Attributes Proposal

Renato Golin rengolin at systemcall.org
Fri Nov 12 11:22:16 PST 2010


Hi Devang,

On 12 November 2010 18:13, Devang Patel <dpatel at apple.com> wrote:
>> 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.

Well, if it's a compilation parameter (rather than a function
attribute), applying to all functions in a module doesn't make all
that sense, but I guess one could do that.

I was trying to avoid pollution of the LangRef and moving it to a
target specific namespace. You don't have to implement it in your
front-end if you don't want. In that case, the back-end will assume
all the defaults are to be selected and act as it would today. But if
the compiler want's to pass those options any time, they should be
allowed to and that should be carried throughout the compilation life
time (front to back end) and honoured by every pass.


> I think missing a point here. Are you proposing that linker selects libraries based on attributes encoded in IR ?

That was just a top-of-my-head example but, yes. The behaviour of the
compiler and linker could change in face of the build attributes.

But, as I said, you're free to ignore it completely if you want. You
could have an ARM compatibility mode that only regards build
attributes when in this mode. That would make it much easier to
compile using ARM+LLVM tools.

We originally thought we could use metadata, but it would have to be
linked to a global variable, and there's no point of having a global
variable just for that.

cheers,
--renato



More information about the llvm-dev mailing list