This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]