This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [middle-end, patch 5/9] Rewritten jump functions computation
- From: Razya Ladelsky <RAZYA at il dot ibm dot com>
- To: Martin Jambor <mjambor at suse dot cz>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>, Jan Hubicka <jh at suse dot cz>, Kenneth Zadeck <zadeck at naturalbridge dot com>
- Date: Tue, 15 Jul 2008 13:14:12 +0300
- Subject: 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);
> + }
>