This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PING] Function versioning and IPCP extension
- From: Razya Ladelsky <RAZYA at il dot ibm dot com>
- To: Diego Novillo <dnovillo at redhat dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Wed, 27 Jul 2005 14:58:12 +0300
- Subject: Re: [PING] Function versioning and IPCP extension
>
> > + struct cgraph_node *cgraph_function_versioning (struct cgraph_node
*,
> > + /* Create a new function name with PREFIX. Returns an identifier.
*/
> > + tree
> > + create_function_name (const char *prefix)
> >
> Why not use create_tmp_var_name directly?
>
The functionality of create_tmp_var_name is not enough.
We need to add code that replaces non-alphanumeric characters
with the character '_'.
For instance operator<< should be replaced with operator__.
> > ! /* Return true if the function is allowed to be versioned.
> > ! This is a guard for the versioning functionality. */
> > ! static bool
> > ! function_versionable_p (tree fndecl)
> > ! {
> > ! if (fndecl == NULL_TREE)
> > ! return false;
> > ! /* ??? There are cases where a function is
> > ! uninlinable but can be versioned. */
> > ! if (!tree_inlinable_function_p (fndecl))
> > ! return false;
> > !
> Example of one or the other? What would be the additional tests
> that an uninlinable function needs to pass so that it can be
> versioned?
>
For the moment versioning code uses inlining code and shares the same
restrictions.
This is due to the way in which versioning is currently implemented.
Basically almost every function could be versioned, and versioning should
have its
own criteria.