[PATCH] New attribute to create target clones

Bernd Schmidt bschmidt@redhat.com
Tue Sep 22 21:09:00 GMT 2015


On 09/22/2015 09:41 PM, Jeff Law wrote:
> Essentially it allows us to more easily support
> per-microarchitecture-optimized versions of functions.   You list just
> have to list the microarchitectures and the compiler handles the rest.
> Very simple, very easy.  I'd think it'd be particularly helpful for
> vectorization.
>
> You could emulate this with compiling the same source multiple times
> with different flags/defines and wire up on ifunc by hand.  But Evgeny's
> approach is vastly simpler.

As far as I can tell the ifunc is generated automatically (and the 
functionality is documented as such), so the new target_clone doesn't 
buy much. But one thing I didn't was that the existing support is only 
available in C++, while Evgeny's patch works for C. That is probably an 
argument that could be made for its inclusion.

Or at least, it's supposed to work. As I said, I get verify_ssa failures 
on the included testcases, and for a simpler one I just tried I get the 
clones of the function, but not the resolver that ought to be generated.


Bernd



More information about the Gcc-patches mailing list