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: [middle-end, patch 5/9] Rewritten jump functions computation


Martin Jambor <mjambor@suse.cz> wrote on 15/07/2008 12:56:43:

> Hi,
> 
> On Tue, Jul 15, 2008 at 12:44:37PM +0300, Razya Ladelsky wrote:
> > Jan Hubicka <jh@suse.cz> wrote on 15/07/2008 12:17:57:
> > > > Are you hadling only C++ member pointers? 
> > > > What about indirect C functions?
> > > 
> > > C function pointers are SSA registers and thus easier to analyze.
> > > 
> > 
> > But are not analyzed currently, right? 
> > Is it because they don't seem to have that much of performance impact? 

> > 
> 
> They are,  the last if in  the following excerpt from  the patch takes
> care of them  (and they are propagated like  anything else through the
> pass-through   jump  functions).    They  are   not  used   in  ipa-cp
> insertion/replacement stage, if that was what you were up to.  That is
> a future work item.
> 
> Martin
> 

Ah o.k.,
Analyzed, but not tranformed yet.

Thanks,
Razya

> +static void
> +compute_scalar_jump_functions (struct ipa_node_params *info,
> +                struct ipa_jump_func *functions,
> +                tree call)
> +{
> +  call_expr_arg_iterator iter;
> +  tree arg;
> +  int num = 0;
> +
> +  FOR_EACH_CALL_EXPR_ARG (arg, iter, call)
> +    {
> +      if (TREE_CODE (arg) == INTEGER_CST
> +     || TREE_CODE (arg) == REAL_CST
> +     || TREE_CODE (arg) == FIXED_CST)
> +   {
> +     functions[num].type = IPA_CONST;
> +     functions[num].value.constant = arg;
> +   }
> +      else if (TREE_CODE (arg) == ADDR_EXPR)
> +   {
> +     if (TREE_CODE (TREE_OPERAND (arg, 0)) == FUNCTION_DECL)
> +       {
> +         functions[num].type = IPA_CONST;
> +         functions[num].value.constant = TREE_OPERAND (arg, 0);
> +       }
> 


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