that will promote value of the attribute DECL_FUNCTION_SPECIFIC_TARGET
of the declaration.
+ If VERSION_DECL is set true, use clone_function_name_numbered for the
+ function clone. Otherwise, use clone_function_name.
+
Return the new version's cgraph node. */
cgraph_node *create_version_clone_with_body
(vec<cgraph_edge *> redirect_callers,
vec<ipa_replace_map *, va_gc> *tree_map,
ipa_param_adjustments *param_adjustments,
bitmap bbs_to_copy, basic_block new_entry_block, const char *clone_name,
- tree target_attributes = NULL_TREE);
+ tree target_attributes = NULL_TREE, bool version_decl = true);
/* Insert a new cgraph_function_version_info node into cgraph_fnver_htab
corresponding to cgraph_node. */
that will promote value of the attribute DECL_FUNCTION_SPECIFIC_TARGET
of the declaration.
+ If VERSION_DECL is set true, use clone_function_name_numbered for the
+ function clone. Otherwise, use clone_function_name.
+
Return the new version's cgraph node. */
cgraph_node *
vec<ipa_replace_map *, va_gc> *tree_map,
ipa_param_adjustments *param_adjustments,
bitmap bbs_to_copy, basic_block new_entry_block, const char *suffix,
- tree target_attributes)
+ tree target_attributes, bool version_decl)
{
tree old_decl = decl;
cgraph_node *new_version_node = NULL;
new_decl = copy_node (old_decl);
/* Generate a new name for the new version. */
- DECL_NAME (new_decl) = clone_function_name_numbered (old_decl, suffix);
- SET_DECL_ASSEMBLER_NAME (new_decl, DECL_NAME (new_decl));
+ tree fnname = (version_decl ? clone_function_name_numbered (old_decl, suffix)
+ : clone_function_name (old_decl, suffix));
+ DECL_NAME (new_decl) = fnname;
+ SET_DECL_ASSEMBLER_NAME (new_decl, fnname);
SET_DECL_RTL (new_decl, NULL);
DECL_VIRTUAL_P (new_decl) = 0;
}
}
- symtab->change_decl_assembler_name (node->decl,
- clone_function_name_numbered (
- node->decl, "default"));
+ tree fname = clone_function_name (node->decl, "default");
+ symtab->change_decl_assembler_name (node->decl, fname);
if (node->definition)
{
if (definition)
{
- new_node = node->create_version_clone_with_body (vNULL, NULL,
- NULL, NULL,
- NULL, name, attributes);
+ new_node
+ = node->create_version_clone_with_body (vNULL, NULL, NULL, NULL, NULL,
+ name, attributes, false);
if (new_node == NULL)
return NULL;
new_node->force_output = true;
new_node = cgraph_node::get_create (new_decl);
DECL_ATTRIBUTES (new_decl) = attributes;
/* Generate a new name for the new version. */
- symtab->change_decl_assembler_name (new_node->decl,
- clone_function_name_numbered (
- node->decl, name));
+ tree fname = clone_function_name (node->decl, name);
+ symtab->change_decl_assembler_name (new_node->decl, fname);
}
return new_node;
}
/* { dg-options "-fno-inline" } */
/* { dg-final { scan-assembler "foo,foo.resolver" } } */
+/* Verify that foo clones are not numbered. */
+/* { dg-final { scan-assembler "foo.default:" } } */
+/* { dg-final { scan-assembler "foo.avx:" } } */
+
__attribute__((target_clones("default","avx","avx2")))
int
foo ()
/* { dg-do compile } */
/* { dg-require-ifunc "" } */
-/* { dg-final { scan-assembler "foo.resolver" } } */
-/* { dg-final { scan-assembler "avx" } } */
+
+/* Verify that foo clones are not numbered. */
+/* { dg-final { scan-assembler "foo.resolver," } } */
+/* { dg-final { scan-assembler "foo.default," } } */
+/* { dg-final { scan-assembler "foo.avx," } } */
+
/* { dg-final { scan-assembler "slm" } } */
/* { dg-final { scan-assembler "foo,foo.resolver" } } */
return f2(p);
}
-/* { dg-final { scan-assembler "g2.default.1:\n\tjmp\tf2.default.1\n" } } */
-/* { dg-final { scan-assembler "g2.avx2.0:\n\tjmp\tf2.avx2.0\n" } } */
+/* { dg-final { scan-assembler "g2.default:\n\tjmp\tf2.default\n" } } */
+/* { dg-final { scan-assembler "g2.avx2:\n\tjmp\tf2.avx2\n" } } */
return f2(p);
}
-/* { dg-final { scan-assembler "g2.default.1:\n\tjmp\tf2.default.1\n" } } */
-/* { dg-final { scan-assembler "g2.avx2.0:\n\tjmp\tf2.avx2.0\n" } } */
+/* { dg-final { scan-assembler "g2.default:\n\tjmp\tf2.default\n" } } */
+/* { dg-final { scan-assembler "g2.avx2:\n\tjmp\tf2.avx2\n" } } */