https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71990
Ivan Sorokin <vanyacpp at gmail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |vanyacpp at gmail dot com
--- Comment #5 from Ivan Sorokin <vanyacpp at gmail dot com> ---
I encountered the same issue as in this PR. GCC never inlines functions with
target_clone attribute. Therefore when the function is small and benefits from
inlining applying target_clone to it can pessimize it.
It would be great if GCC were able to inline functions with target_clone
attribute and propagate target_clone attribute as comment #3 suggests.
On this example:
__attribute__((target_clones("default", "arch=x86-64-v3")))
static int foo(int a, int b)
{
return a & ~b;
}
int bar(int a, int b)
{
return foo(a, b);
}
An ideal behavior would be foo to be inlined into bar (and bar becoming
multiversioned) and foo removed completely as none of its usages left.