[PATCH] Add an -mattr option to the gold plugin to support subtarget features in LTO
Nick Lewycky
nicholas at mxc.ca
Tue Mar 25 00:06:24 PDT 2014
Nick Kledzik wrote:
>
> On Mar 24, 2014, at 4:27 PM, Tom Roeder<tmroeder at google.com> wrote:
>> The small patch attached here adds support for an -mattr option to the
>> gold plugin and to llvm-lto. This allows the caller to specify details
>> of the subtarget architecture, like +aes, or +ssse3 on x86. Note that
>> this required a change to the include/llvm-c/lto.h interface: it adds
>> a function lto_codegen_set_attr and it increments the version of the
>> interface.
>>
>> Please let me know what you think.
>
> The LTO API already has:
> lto_codegen_debug_option(lto_codegen_t, const char *);
>
> Could you support -mattr options using the existing API like?:
> lto_codegen_debug_option(cg, “-mattr=+sse3”);
Absolutely not. That API has the word "debug" in its name because it is
strictly reserved for debugging libLTO. That means that it is not part
of libLTO's public interface.
The reason is that libLTO has a strong ABI requirement. Once we have a
user using libLTO, we can never ever break them at the ABI level. The
intention is that this exposed interface is something small that we can
audit, and that we can change LLVM's innards without disturbing libLTO.
Once you allow passing arbitrary flags across, every single flag
everywhere in every llvm library becomes part of the permanent ABI that
can never be changed.
Nick
More information about the llvm-commits
mailing list