Commit a7976089 by Richard Biener Committed by Richard Biener

passes.def (pass_split_crit_edges): Remove instance before PRE.

2017-09-07  Richard Biener  <rguenther@suse.de>

	* passes.def (pass_split_crit_edges): Remove instance before PRE.
	* tree-ssa-pre.c (pass_pre::execute): Instead manually split
	critical edges here, after loop init.
	(pass_data_pre): Remove PROP_no_crit_edges flags.
	* tree-ssa-sccvn.c (vn_reference_lookup_3): Use vn_valueize
	for valueization of call args to avoid leaking VN_TOP.
	(visit_use): Assert we do not visit default defs.
	(init_scc_vn): Use build_decl for VN_TOP to make name nicer.
	Use error_mark_node to more easily detect leaking VN_TOP.
	All default-defs are varying, not VN_TOP.  Mark them visited.
	(run_scc_vn): Make code match comment.

	* gcc.dg/tree-ssa/ssa-thread-12.c: XFAIL third FSM threading
	opportunity.

From-SVN: r251833
parent e76b2472
2017-09-07 Richard Biener <rguenther@suse.de>
* passes.def (pass_split_crit_edges): Remove instance before PRE.
* tree-ssa-pre.c (pass_pre::execute): Instead manually split
critical edges here, after loop init.
(pass_data_pre): Remove PROP_no_crit_edges flags.
* tree-ssa-sccvn.c (vn_reference_lookup_3): Use vn_valueize
for valueization of call args to avoid leaking VN_TOP.
(visit_use): Assert we do not visit default defs.
(init_scc_vn): Use build_decl for VN_TOP to make name nicer.
Use error_mark_node to more easily detect leaking VN_TOP.
All default-defs are varying, not VN_TOP. Mark them visited.
(run_scc_vn): Make code match comment.
2017-09-07 Michael Meissner <meissner@linux.vnet.ibm.com> 2017-09-07 Michael Meissner <meissner@linux.vnet.ibm.com>
* config/rs6000/rs6000-cpus.def (OTHER_VSX_VECTOR_MASKS): Delete * config/rs6000/rs6000-cpus.def (OTHER_VSX_VECTOR_MASKS): Delete
......
...@@ -255,7 +255,6 @@ along with GCC; see the file COPYING3. If not see ...@@ -255,7 +255,6 @@ along with GCC; see the file COPYING3. If not see
NEXT_PASS (pass_optimize_bswap); NEXT_PASS (pass_optimize_bswap);
NEXT_PASS (pass_laddress); NEXT_PASS (pass_laddress);
NEXT_PASS (pass_lim); NEXT_PASS (pass_lim);
NEXT_PASS (pass_split_crit_edges);
NEXT_PASS (pass_walloca, false); NEXT_PASS (pass_walloca, false);
NEXT_PASS (pass_pre); NEXT_PASS (pass_pre);
NEXT_PASS (pass_sink_code); NEXT_PASS (pass_sink_code);
......
2017-09-07 Richard Biener <rguenther@suse.de>
* gcc.dg/tree-ssa/ssa-thread-12.c: XFAIL third FSM threading
opportunity.
2017-09-07 Michael Meissner <meissner@linux.vnet.ibm.com> 2017-09-07 Michael Meissner <meissner@linux.vnet.ibm.com>
* gcc.target/powerpc/float128-1.c: Update options to know that * gcc.target/powerpc/float128-1.c: Update options to know that
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
/* { dg-options "-O2 -fdump-tree-thread2-details -fdump-tree-thread3-details -fdump-tree-thread4-details" } */ /* { dg-options "-O2 -fdump-tree-thread2-details -fdump-tree-thread3-details -fdump-tree-thread4-details" } */
/* { dg-final { scan-tree-dump "FSM" "thread2" } } */ /* { dg-final { scan-tree-dump "FSM" "thread2" } } */
/* { dg-final { scan-tree-dump "FSM" "thread3" } } */ /* { dg-final { scan-tree-dump "FSM" "thread3" } } */
/* { dg-final { scan-tree-dump "FSM" "thread4" } } */ /* { dg-final { scan-tree-dump "FSM" "thread4" { xfail *-*-* } } } */
typedef struct bitmap_head_def *bitmap; typedef struct bitmap_head_def *bitmap;
typedef const struct bitmap_head_def *const_bitmap; typedef const struct bitmap_head_def *const_bitmap;
......
...@@ -5006,11 +5006,9 @@ const pass_data pass_data_pre = ...@@ -5006,11 +5006,9 @@ const pass_data pass_data_pre =
"pre", /* name */ "pre", /* name */
OPTGROUP_NONE, /* optinfo_flags */ OPTGROUP_NONE, /* optinfo_flags */
TV_TREE_PRE, /* tv_id */ TV_TREE_PRE, /* tv_id */
/* PROP_no_crit_edges is ensured by placing pass_split_crit_edges before ( PROP_cfg | PROP_ssa ), /* properties_required */
pass_pre. */
( PROP_no_crit_edges | PROP_cfg | PROP_ssa ), /* properties_required */
0, /* properties_provided */ 0, /* properties_provided */
PROP_no_crit_edges, /* properties_destroyed */ 0, /* properties_destroyed */
TODO_rebuild_alias, /* todo_flags_start */ TODO_rebuild_alias, /* todo_flags_start */
0, /* todo_flags_finish */ 0, /* todo_flags_finish */
}; };
...@@ -5040,6 +5038,7 @@ pass_pre::execute (function *fun) ...@@ -5040,6 +5038,7 @@ pass_pre::execute (function *fun)
/* This has to happen before SCCVN runs because /* This has to happen before SCCVN runs because
loop_optimizer_init may create new phis, etc. */ loop_optimizer_init may create new phis, etc. */
loop_optimizer_init (LOOPS_NORMAL); loop_optimizer_init (LOOPS_NORMAL);
split_critical_edges ();
run_scc_vn (VN_WALK); run_scc_vn (VN_WALK);
......
...@@ -1874,10 +1874,10 @@ vn_reference_lookup_3 (ao_ref *ref, tree vuse, void *vr_, ...@@ -1874,10 +1874,10 @@ vn_reference_lookup_3 (ao_ref *ref, tree vuse, void *vr_,
for (unsigned i = 0; i < gimple_call_num_args (def_stmt); ++i) for (unsigned i = 0; i < gimple_call_num_args (def_stmt); ++i)
{ {
oldargs[i] = gimple_call_arg (def_stmt, i); oldargs[i] = gimple_call_arg (def_stmt, i);
if (TREE_CODE (oldargs[i]) == SSA_NAME tree val = vn_valueize (oldargs[i]);
&& VN_INFO (oldargs[i])->valnum != oldargs[i]) if (val != oldargs[i])
{ {
gimple_call_set_arg (def_stmt, i, VN_INFO (oldargs[i])->valnum); gimple_call_set_arg (def_stmt, i, val);
valueized_anything = true; valueized_anything = true;
} }
} }
...@@ -3956,9 +3956,10 @@ visit_use (tree use) ...@@ -3956,9 +3956,10 @@ visit_use (tree use)
mark_use_processed (use); mark_use_processed (use);
gcc_assert (!SSA_NAME_IN_FREE_LIST (use)); gcc_assert (!SSA_NAME_IN_FREE_LIST (use)
if (dump_file && (dump_flags & TDF_DETAILS) && !SSA_NAME_IS_DEFAULT_DEF (use));
&& !SSA_NAME_IS_DEFAULT_DEF (use))
if (dump_file && (dump_flags & TDF_DETAILS))
{ {
fprintf (dump_file, "Value numbering "); fprintf (dump_file, "Value numbering ");
print_generic_expr (dump_file, use); print_generic_expr (dump_file, use);
...@@ -3966,10 +3967,7 @@ visit_use (tree use) ...@@ -3966,10 +3967,7 @@ visit_use (tree use)
print_gimple_stmt (dump_file, stmt, 0); print_gimple_stmt (dump_file, stmt, 0);
} }
/* Handle uninitialized uses. */ if (gimple_code (stmt) == GIMPLE_PHI)
if (SSA_NAME_IS_DEFAULT_DEF (use))
changed = set_ssa_val_to (use, use);
else if (gimple_code (stmt) == GIMPLE_PHI)
changed = visit_phi (stmt); changed = visit_phi (stmt);
else if (gimple_has_volatile_ops (stmt)) else if (gimple_has_volatile_ops (stmt))
changed = defs_to_varying (stmt); changed = defs_to_varying (stmt);
...@@ -4554,7 +4552,8 @@ init_scc_vn (void) ...@@ -4554,7 +4552,8 @@ init_scc_vn (void)
XDELETE (rpo_numbers_temp); XDELETE (rpo_numbers_temp);
VN_TOP = create_tmp_var_raw (void_type_node, "vn_top"); VN_TOP = build_decl (UNKNOWN_LOCATION, VAR_DECL,
get_identifier ("VN_TOP"), error_mark_node);
renumber_gimple_stmt_uids (); renumber_gimple_stmt_uids ();
...@@ -4583,7 +4582,9 @@ init_scc_vn (void) ...@@ -4583,7 +4582,9 @@ init_scc_vn (void)
switch (TREE_CODE (SSA_NAME_VAR (name))) switch (TREE_CODE (SSA_NAME_VAR (name)))
{ {
case VAR_DECL: case VAR_DECL:
/* Undefined vars keep TOP. */ /* All undefined vars are VARYING. */
VN_INFO (name)->valnum = name;
VN_INFO (name)->visited = true;
break; break;
case PARM_DECL: case PARM_DECL:
...@@ -4610,12 +4611,10 @@ init_scc_vn (void) ...@@ -4610,12 +4611,10 @@ init_scc_vn (void)
case RESULT_DECL: case RESULT_DECL:
/* If the result is passed by invisible reference the default /* If the result is passed by invisible reference the default
def is initialized, otherwise it's uninitialized. */ def is initialized, otherwise it's uninitialized. Still
if (DECL_BY_REFERENCE (SSA_NAME_VAR (name))) undefined is varying. */
{ VN_INFO (name)->visited = true;
VN_INFO (name)->visited = true; VN_INFO (name)->valnum = name;
VN_INFO (name)->valnum = name;
}
break; break;
default: default:
...@@ -5008,14 +5007,13 @@ run_scc_vn (vn_lookup_kind default_vn_walk_kind_) ...@@ -5008,14 +5007,13 @@ run_scc_vn (vn_lookup_kind default_vn_walk_kind_)
/* Initialize the value ids and prune out remaining VN_TOPs /* Initialize the value ids and prune out remaining VN_TOPs
from dead code. */ from dead code. */
tree name; tree name;
FOR_EACH_SSA_NAME (i, name, cfun) FOR_EACH_SSA_NAME (i, name, cfun)
{ {
vn_ssa_aux_t info = VN_INFO (name); vn_ssa_aux_t info = VN_INFO (name);
if (!info->visited) if (!info->visited
info->valnum = name;
if (info->valnum == name
|| info->valnum == VN_TOP) || info->valnum == VN_TOP)
info->valnum = name;
if (info->valnum == name)
info->value_id = get_next_value_id (); info->value_id = get_next_value_id ();
else if (is_gimple_min_invariant (info->valnum)) else if (is_gimple_min_invariant (info->valnum))
info->value_id = get_or_alloc_constant_value_id (info->valnum); info->value_id = get_or_alloc_constant_value_id (info->valnum);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment