[PATCH] Extend store ccp

Revital1 Eres ERES@il.ibm.com
Fri Mar 23 12:10:00 GMT 2007


>
> You confused me a lot in that you use a name for get_def_of_stmt_rhs ()
> that doesn't look like it checks for a single constant value ;)   Maybe
> just make it return true or false and call it stmt_rhs_constant_val_p
> (stmt, val).
>
> Or even fold it into it's only use,
all_vdef_have_same_lattice_const_value.

Sorry about that... I think I will do the latter - insert
get_def_of_stmt_rhs into all_vdef_have_same_lattice_const_value to
simplify things.

> Did you check compile-time and runtime effects of this patch like on
SPEC?  I
> suppose we can eliminate array zero initialization if there follows
> different initialzation
> with this patch.

I do not have the effect of this patch on SPEC yet, but I certainly
intend to measure it and post the results.

Thanks,
Revital

>
> Thanks,
> Richard.
>
> > :ADDPATCH tree-ssa optimization:
> >
> > Thanks,
> > Revital
> >
> > 2007-03-22  Revital Eres  <eres@il.ibm.com>
> >
> >         * tree-ssa-propagate.c
(all_vdef_have_same_lattice_const_value):
> >           New function to get the defining stmt.
> >           (get_def_of_stmt_rhs): New helper function
> >           which walks on the virtual use-def chain to get the defining
> > stmt.
> >           (replace_vuses_in): Call
all_vdef_have_same_lattice_const_value
> >           to perform the final replacement and add new parameter which
> >           indicates whether store cpp analysis should be extended to
> >           analyze memory references based on the virtual use-def chain.
> >           (do_store_ccp): New function.
> >           (substitute_and_fold): Add new parameter.
> >         * tree-ssa-propagate.h
(all_vdef_have_same_lattice_const_value):
> >            Declare.
> >            (substitute_and_fold): Change declaration.
> >         * tree-vrp.c (vrp_finalize): Call substitute_and_fold with new
> > argument .
> >         * tree-ssa-ccp.c (ccp_finalize): Likewise.
> >           (visit_assignment): Call
all_vdef_have_same_lattice_const_value
> > while
> >            performing the propogation.
> >        * tree-ssa-copy.c (fini_copy_prop): Call substitute_and_fold
with
> > new
> >           argument.
> >         * testsuite/gcc.dg/store_ccp_test.c: New test.
> >
> > (See attached file: patch_ccp_22_3.txt)(See attached file:
> > store_ccp_test.txt)
> >



More information about the Gcc-patches mailing list