I've fixed the misprint and vertical spaces.
I'll ask to commit the patch when x86 bootstrap and make check finished.

Thanks,
Evgeny

Updated ChangeLog:

2015-10-30  Evgeny Stupachenko  <evstu...@gmail.com>

gcc/
        * Makefile.in (OBJS): Add multiple_target.o.
        * attrib.c (make_attribute): Moved from config/i386/i386.c
        * config/i386/i386.c (make_attribute): Deleted.
        * multiple_target.c (create_dispatcher_calls): New.
        (get_attr_len): Ditto.
        (get_attr_str): Ditto.
        (separate_attrs): Ditto.
        (is_valid_asm_symbol): Ditto.
        (create_new_asm_name): Ditto.
        (create_target_clone): Ditto.
        (expand_target_clones): Ditto.
        (ipa_target_clone): Ditto.
        (ipa_dispatcher_calls): Ditto.
        * passes.def (pass_target_clone): Two new ipa passes.
        * tree-pass.h (make_pass_target_clone): Ditto.

gcc/c-family
        * c-common.c (handle_target_clones_attribute): New.
        * (c_common_attribute_table): Add handle_target_clones_attribute.
        * (handle_always_inline_attribute): Add check on target_clones
        attribute.
        * (handle_target_attribute): Ditto.

gcc/testsuite
        * gcc.dg/mvc1.c: New test for multiple targets cloning.
        * gcc.dg/mvc2.c: Ditto.
        * gcc.dg/mvc3.c: Ditto.
        * gcc.dg/mvc4.c: Ditto.
        * gcc.dg/mvc5.c: Ditto.
        * gcc.dg/mvc6.c: Ditto.
        * gcc.dg/mvc7.c: Ditto.
        * g++.dg/ext/mvc1.C: Ditto.
        * g++.dg/ext/mvc2.C: Ditto.
        * g++.dg/ext/mvc3.C: Ditto.
        * g++.dg/ext/mvc4.C: Ditto.

gcc/doc
        * doc/extend.texi (target_clones): New attribute description.

On Fri, Oct 30, 2015 at 8:27 AM, Jeff Law <l...@redhat.com> wrote:
> On 10/29/2015 12:13 PM, Evgeny Stupachenko wrote:
>>
>> On Thu, Oct 29, 2015 at 8:02 PM, Jan Hubicka<hubi...@ucw.cz>  wrote:
>>>>
>>>> >>Yes. This is not necessary. However that way we'll have the following
>>>> >>code in dispatcher:
>>>> >>         cmpl    $6, __cpu_model+4(%rip)
>>>> >>         sete    %al
>>>> >>         movzbl  %al, %eax
>>>> >>         testl   %eax, %eax
>>>> >>         jle     .L16
>>>> >>         movl    $foo.target_clone.1, %eax
>>>> >>I think it is very hard to read and debug such...
>>>> >>
>>>> >>While now we have:
>>>> >>
>>>> >>         cmpl    $6, __cpu_model+4(%rip)
>>>> >>         sete    %al
>>>> >>         movzbl  %al, %eax
>>>> >>         testl   %eax, %eax
>>>> >>         jle     .L16
>>>> >>         movl    $foo.arch_slm, %eax
>>>> >>
>>>> >>and it is clear that we are jumping to SLM code here.
>>>> >>I'd like to keep target in names.
>>>
>>> >
>>> >I am not against more informative names, but why you don't pass the info
>>> > here:
>>> >
>>> >+create_target_clone (cgraph_node *node, bool definition)
>>> >+{
>>> >+  cgraph_node *new_node;
>>> >+  if (definition)
>>> >+    {
>>> >+      new_node = node->create_version_clone_with_body (vNULL, NULL,
>>> >+                                                      NULL, false,
>>> >+                                                      NULL, NULL,
>>> >+                                                      "target_clone");
>>> >+      new_node->force_output = true;
>>> >+    }
>>> >+  else
>>> >+    {
>>> >+      tree new_decl = copy_node (node->decl);
>>> >+      new_node = cgraph_node::get_create (new_decl);
>>> >+    }
>>> >+  return new_node;
>>> >+}
>>> >
>>> >passing "arch_slm" instead of target_clone will get you the name you
>>> > want
>>> >(plus the extra index that may be needed anyway to disambiguate).
>>> >
>>> >Note that in general those .suffixes should be machine parseable, so
>>> > cp-demangle.c
>>> >can expand them correctly.  We may want to have some consistent grammar
>>> > for them here
>>> >and update cp-demangle.c to output nice info like "target clone for..."
>>
>> Ok. I've modified the patch correspondingly.
>
> You'll need updated ChangeLog entries.  Don't forget to drop the omp-low
> spurious whitespace change.
>
> You should also fix the formatting nits Jan pointed out.
>
> With those changes, this patch is OK for the trunk.  I'll run the header
> file reordering & cleanup tool after the patch is committed to the trunk.
>
> jeff
>
>

Reply via email to