This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [tuples][patch] Convert pass_ccp and pass_store_ccp to tuples (revised patch)
- From: "Diego Novillo" <dnovillo at google dot com>
- To: "Bill Maddox" <maddox at google dot com>
- Cc: gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Wed, 5 Mar 2008 15:20:01 -0500
- Subject: Re: [tuples][patch] Convert pass_ccp and pass_store_ccp to tuples (revised patch)
- References: <8a0e66f0803042324s3085e6bo8751323eae0f3f44@mail.gmail.com>
On Wed, Mar 5, 2008 at 02:24, Bill Maddox <maddox@google.com> wrote:
> Here is a revised patch. It takes into account all of your feedback,
> except that I left in the assert on an unexpected statement type in
> gimple_set_lhs, as I thought it would mask bugs to do otherwise.
> gimple_get_lhs simply returns NULL_TREE in those cases.
Sure. That's fine.
> * tree-ssa-ccp.c (dump_lattice_value, debug_lattice_value):
> Re-enable functions #if'd out.
> (test_default_value, likely_value, surely_varying_stmt_p,
> ccp_initialize, ccp_visit_phi_node, ccp_fold, evaluate_stmt,
> visit_assignment, visit_cond_stmt, ccp_visit_stmt):
> Convert to tuples.
> (fold_gimple_call): Don't trip over call that simplifies to
> another call, not a constant.
> * tree-ssa-propagate.c (ssa_prop_init): Initialize in-worklist
> flag for phi nodes as well as statements.
> (valid_gimple_expression_p): Add fixme comment to remove this.
> function. It currently has static uses, but asserts when called.
> (stmt_makes_single_load, stmt_makes_single_store):
> Convert to tuples
> (replace_phi_args_in): Convert to tuples. Fix typo in comment.
> * gimple.c (gimple_copy_no_def_use, gimple_get_lhs,
> gimple_set_lhs): New function.
> * gimple.h (gimple_copy_no_def_use, gimple_get_lhs,
> gimple_set_lhs): Declare new function.
> * tree-cfg.c (replace_uses_by): Add comment regarding empty
> operands.
> * passes.c (init_optimization_passes): Enable pass_ccp and
> pass_store_ccp.
OK with a couple of minor cosmetic changes I didn't see the first time:
> - if (IS_EMPTY_STMT (stmt))
> + if (gimple_code (stmt) == GIMPLE_NOP)
You can also use the shorthand gimple_nop_p (stmt) here, but it's not
terribly important.
> /* A CALL_EXPR is assumed to be varying. NOTE: This may be overly
s/CALL_EXPR/GIMPLE_CALL/
Thanks. Diego.