Re: [PATCH 33/89] Use more concrete types for various gimple statements

2014-05-12 Thread Jeff Law

On 04/21/14 10:57, David Malcolm wrote:

gcc/
* cgraphunit.c (thunk_adjust): Strengthen local stmt from gimple
to gimple_assign.

* gimple-ssa-isolate-paths.c
(insert_trap_and_remove_trailing_statements): Strengthen local
new_stmt from gimple to gimple_call.

* gimple-ssa-strength-reduction.c (replace_mult_candidate):
Strengthen local copy_stmt from gimple to gimple_assign.
(create_add_on_incoming_edge): Likewise, for new_stmt.
(insert_initializers): Likewise, for init_stmt.
(introduce_cast_before_cand): Likewise, for cast_stmt.
(replace_one_candidate): Likewise, for copy_stmt and
cast_stmt.

* gimplify.c (build_stack_save_restore): Require gimple_calls
rather than plain gimples.
(gimplify_bind_expr): Strengthen locals stack_save and
stack_restore from gimple to gimple_call.  Strengthen gs
to gimple_try.
(gimplify_switch_expr): Strengthen local gimple_switch from
gimple to gimple_switch, and new_default to gimple_label.
(gimplify_cond_expr): Strengthen local gimple_cond from gimple
to gimple_cond.
(gimplify_init_constructor): Strengthen local init from gimple
to gimple_assign.
(gimplify_cleanup_point_expr): Strengthen local gtry from gimple
to gimple_try.
(gimple_push_cleanup): Strengthen locals ffalse and ftrue from
gimple to gimple_assign.

* tree-eh.c (do_goto_redirection): Strengthen local to gimple_goto.
(emit_post_landing_pad): Strengthen local to gimple_label.

* tree-outof-ssa.c (insert_backedge_copies): Strengthen local
stmt from gimple to gimple_assign.

* tree-parloops.c (take_address_of): Likewise.

* tree-predcom.c (replace_ref_with): Likewise, for new_stmt.
(initialize_root_vars_lm): Likewise, for init_stmt.
(reassociate_to_the_same_stmt): Likewise, for new_stmt and tmp_stmt.

* tree-profile.c (gimple_gen_edge_profiler): Likewise, for stmt1,
stmt2, stmt3.
(gimple_gen_ic_profiler): Likewise.
(gimple_gen_ic_func_profiler): Strengthen local stmt1 from
gimple to gimple_call, and stmt2 to gimple_assign.

* tree-scalar-evolution.c (scev_const_prop): Strengthen local
ass from gimple to gimple_assign.

* tree-sra.c (build_ref_for_offset): Likewise for stmt.
(generate_subtree_copies): Likewise; also strengthen ds to
gimple_debug.
(init_subtree_with_zero): Likewise.
(sra_modify_expr): Likewise.
(load_assign_lhs_subreplacements): Likewise.
(sra_modify_assign): Strengthen ds to gimple_debug.
(sra_ipa_reset_debug_stmts): Likewise for def_temp.

* tree-ssa-ccp.c (insert_clobber_before_stack_restore):
Strengthen local clobber_stmt from gimple to gimple_assign.

* tree-ssa-dce.c (remove_dead_stmt): Strengthen note to
gimple_debug.

* tree-ssa-dom.c (record_equivalences_from_stmt): Strengthen
local new_stmt from gimple to gimple_assign.
(optimize_stmt): Likewise.

* tree-ssa-forwprop.c (simplify_bitwise_binary): Likewise for
4 declarations of newop.
(simplify_rotate): Likewise for g.

* tree-ssa-loop-im.c (rewrite_reciprocal): Likewise for 3 locals.
(rewrite_bittest): Likewise for stmt and stmt2.
(move_computations_dom_walker::before_dom_children): Likewise for
new_stmt.
(execute_sm): Likewise for load and store.

* tree-ssa-loop-ivcanon.c (remove_exits_and_undefined_stmts):
Strengthen local stmt from gimple to gimple_call.
(unloop_loops): Likewise.

* tree-ssa-loop-ivopts.c (rewrite_use_nonlinear_expr): Strengthen
local ass from gimple to gimple_assign.
(remove_unused_ivs): Strengthen def_temp to gimple_debug.

* tree-ssa-loop-manip.c (rewrite_phi_with_iv): Strengthen local stmt
from gimple to gimple_assign.

* tree-ssa-loop-prefetch.c (issue_prefetch_ref): Strengthen local
prefetch from gimple to gimple_call.

* tree-ssa-math-opts.c (insert_reciprocals): Strengthen local
new_stmt from gimple to gimple_assign.
(powi_as_mults_1): Likewise for mult_stmt.
(powi_as_mults): Likewise for div_stmt.
(build_and_insert_binop): Likewise for stmt.
(build_and_insert_cast): Likewise.
(execute_cse_sincos): Likewise for stmt and various decls of
new_stmt.
(execute_optimize_bswap): Likewise for two decls of convert_stmt.
(convert_mult_to_fma): Likewise for fma_stmt.

* tree-ssa-phiopt.c (conditional_replacement): Likewise for new_stmt.
(abs_replacement): Likewise.

* tree-ssa-phiprop.c (phiprop_insert_phi): Likewise for tmp.

* tree-ssa-pre.c (create_expression_by_pieces): Likewise for newstmt.
(eliminate_insert): 

[PATCH 33/89] Use more concrete types for various gimple statements

2014-04-21 Thread David Malcolm
gcc/
* cgraphunit.c (thunk_adjust): Strengthen local stmt from gimple
to gimple_assign.

* gimple-ssa-isolate-paths.c
(insert_trap_and_remove_trailing_statements): Strengthen local
new_stmt from gimple to gimple_call.

* gimple-ssa-strength-reduction.c (replace_mult_candidate):
Strengthen local copy_stmt from gimple to gimple_assign.
(create_add_on_incoming_edge): Likewise, for new_stmt.
(insert_initializers): Likewise, for init_stmt.
(introduce_cast_before_cand): Likewise, for cast_stmt.
(replace_one_candidate): Likewise, for copy_stmt and
cast_stmt.

* gimplify.c (build_stack_save_restore): Require gimple_calls
rather than plain gimples.
(gimplify_bind_expr): Strengthen locals stack_save and
stack_restore from gimple to gimple_call.  Strengthen gs
to gimple_try.
(gimplify_switch_expr): Strengthen local gimple_switch from
gimple to gimple_switch, and new_default to gimple_label.
(gimplify_cond_expr): Strengthen local gimple_cond from gimple
to gimple_cond.
(gimplify_init_constructor): Strengthen local init from gimple
to gimple_assign.
(gimplify_cleanup_point_expr): Strengthen local gtry from gimple
to gimple_try.
(gimple_push_cleanup): Strengthen locals ffalse and ftrue from
gimple to gimple_assign.

* tree-eh.c (do_goto_redirection): Strengthen local to gimple_goto.
(emit_post_landing_pad): Strengthen local to gimple_label.

* tree-outof-ssa.c (insert_backedge_copies): Strengthen local
stmt from gimple to gimple_assign.

* tree-parloops.c (take_address_of): Likewise.

* tree-predcom.c (replace_ref_with): Likewise, for new_stmt.
(initialize_root_vars_lm): Likewise, for init_stmt.
(reassociate_to_the_same_stmt): Likewise, for new_stmt and tmp_stmt.

* tree-profile.c (gimple_gen_edge_profiler): Likewise, for stmt1,
stmt2, stmt3.
(gimple_gen_ic_profiler): Likewise.
(gimple_gen_ic_func_profiler): Strengthen local stmt1 from
gimple to gimple_call, and stmt2 to gimple_assign.

* tree-scalar-evolution.c (scev_const_prop): Strengthen local
ass from gimple to gimple_assign.

* tree-sra.c (build_ref_for_offset): Likewise for stmt.
(generate_subtree_copies): Likewise; also strengthen ds to
gimple_debug.
(init_subtree_with_zero): Likewise.
(sra_modify_expr): Likewise.
(load_assign_lhs_subreplacements): Likewise.
(sra_modify_assign): Strengthen ds to gimple_debug.
(sra_ipa_reset_debug_stmts): Likewise for def_temp.

* tree-ssa-ccp.c (insert_clobber_before_stack_restore):
Strengthen local clobber_stmt from gimple to gimple_assign.

* tree-ssa-dce.c (remove_dead_stmt): Strengthen note to
gimple_debug.

* tree-ssa-dom.c (record_equivalences_from_stmt): Strengthen
local new_stmt from gimple to gimple_assign.
(optimize_stmt): Likewise.

* tree-ssa-forwprop.c (simplify_bitwise_binary): Likewise for
4 declarations of newop.
(simplify_rotate): Likewise for g.

* tree-ssa-loop-im.c (rewrite_reciprocal): Likewise for 3 locals.
(rewrite_bittest): Likewise for stmt and stmt2.
(move_computations_dom_walker::before_dom_children): Likewise for
new_stmt.
(execute_sm): Likewise for load and store.

* tree-ssa-loop-ivcanon.c (remove_exits_and_undefined_stmts):
Strengthen local stmt from gimple to gimple_call.
(unloop_loops): Likewise.

* tree-ssa-loop-ivopts.c (rewrite_use_nonlinear_expr): Strengthen
local ass from gimple to gimple_assign.
(remove_unused_ivs): Strengthen def_temp to gimple_debug.

* tree-ssa-loop-manip.c (rewrite_phi_with_iv): Strengthen local stmt
from gimple to gimple_assign.

* tree-ssa-loop-prefetch.c (issue_prefetch_ref): Strengthen local
prefetch from gimple to gimple_call.

* tree-ssa-math-opts.c (insert_reciprocals): Strengthen local
new_stmt from gimple to gimple_assign.
(powi_as_mults_1): Likewise for mult_stmt.
(powi_as_mults): Likewise for div_stmt.
(build_and_insert_binop): Likewise for stmt.
(build_and_insert_cast): Likewise.
(execute_cse_sincos): Likewise for stmt and various decls of
new_stmt.
(execute_optimize_bswap): Likewise for two decls of convert_stmt.
(convert_mult_to_fma): Likewise for fma_stmt.

* tree-ssa-phiopt.c (conditional_replacement): Likewise for new_stmt.
(abs_replacement): Likewise.

* tree-ssa-phiprop.c (phiprop_insert_phi): Likewise for tmp.

* tree-ssa-pre.c (create_expression_by_pieces): Likewise for newstmt.
(eliminate_insert): Likewise for tem.

* 

Re: [PATCH 33/89] Use more concrete types for various gimple statements

2014-04-21 Thread Bill Schmidt
Hi David,

Just a quick review of the gimple-ssa-strength-reduction.c changes.  I
have one stylistic comment:

On Mon, 2014-04-21 at 12:57 -0400, David Malcolm wrote:

 diff --git a/gcc/gimple-ssa-strength-reduction.c 
 b/gcc/gimple-ssa-strength-reduction.c
 index 9320b51..35e15e0 100644
 --- a/gcc/gimple-ssa-strength-reduction.c
 +++ b/gcc/gimple-ssa-strength-reduction.c
 @@ -2058,7 +2058,7 @@ replace_mult_candidate (slsr_cand_t c, tree basis_name, 
 double_int bump)
if (bump.is_zero ())
   {
 tree lhs = gimple_assign_lhs (c-cand_stmt);
 -   gimple copy_stmt = gimple_build_assign (lhs, basis_name);
 +   gimple_assign copy_stmt = gimple_build_assign (lhs, basis_name);
 gimple_stmt_iterator gsi = gsi_for_stmt (c-cand_stmt);
 gimple_set_location (copy_stmt, gimple_location (c-cand_stmt));
 gsi_replace (gsi, copy_stmt, false);
 @@ -2159,7 +2159,7 @@ create_add_on_incoming_edge (slsr_cand_t c, tree 
 basis_name,
basic_block insert_bb;
gimple_stmt_iterator gsi;
tree lhs, basis_type;
 -  gimple new_stmt;
 +  gimple_assign new_stmt;
 
/* If the add candidate along this incoming edge has the same
   index as C's hidden basis, the hidden basis represents this
 @@ -3118,7 +3118,7 @@ insert_initializers (slsr_cand_t c)
  {
basic_block bb;
slsr_cand_t where = NULL;
 -  gimple init_stmt;
 +  gimple_assign init_stmt;
tree stride_type, new_name, incr_tree;
double_int incr = incr_vec[i].incr;
 
 @@ -3256,7 +3256,7 @@ static tree
  introduce_cast_before_cand (slsr_cand_t c, tree to_type, tree from_expr)
  {
tree cast_lhs;
 -  gimple cast_stmt;
 +  gimple_assign cast_stmt;
gimple_stmt_iterator gsi = gsi_for_stmt (c-cand_stmt);
 
cast_lhs = make_temp_ssa_name (to_type, NULL, slsr);
 @@ -3418,7 +3418,7 @@ replace_one_candidate (slsr_cand_t c, unsigned i, tree 
 basis_name)

if (types_compatible_p (lhs_type, basis_type))
   {
 -   gimple copy_stmt = gimple_build_assign (lhs, basis_name);
 +   gimple_assign copy_stmt = gimple_build_assign (lhs, basis_name);
 gimple_stmt_iterator gsi = gsi_for_stmt (c-cand_stmt);
 gimple_set_location (copy_stmt, gimple_location (c-cand_stmt));
 gsi_replace (gsi, copy_stmt, false);
 @@ -3430,9 +3430,10 @@ replace_one_candidate (slsr_cand_t c, unsigned i, tree 
 basis_name)
else
   {
 gimple_stmt_iterator gsi = gsi_for_stmt (c-cand_stmt);
 -   gimple cast_stmt = gimple_build_assign_with_ops (NOP_EXPR, lhs,
 -basis_name,
 -NULL_TREE);
 +   gimple_assign cast_stmt =
 + gimple_build_assign_with_ops (NOP_EXPR, lhs,
 +   basis_name,
 +   NULL_TREE);

Please collapse the last three lines onto one line, now that it will
fit.

Thanks,
Bill

 gimple_set_location (cast_stmt, gimple_location (c-cand_stmt));
 gsi_replace (gsi, cast_stmt, false);
 c-cand_stmt = cast_stmt;