2013-02-20 Richard Biener <rguenther@suse.de>
+ * tree-call-cdce.c (tree_call_cdce): Do not remove unused locals.
+ * tree-ssa-forwprop.c (ssa_forward_propagate_and_combine): Likewise.
+ * tree-ssa-dce.c (perform_tree_ssa_dce): Likewise.
+ * tree-ssa-copyrename.c (copy_rename_partition_coalesce): Do
+ not return anything.
+ (rename_ssa_copies): Do not remove unused locals.
+ * tree-ssa-ccp.c (do_ssa_ccp): Likewise.
+ * tree-ssanames.c (pass_release_ssa_names): Remove unused
+ locals first.
+ * passes.c (execute_function_todo): Do not schedule unused locals
+ removal if cleanup_tree_cfg did something.
+ * tree-ssa-live.c (remove_unused_locals): Dump statistics
+ about the number of removed locals.
+
+2013-02-20 Richard Biener <rguenther@suse.de>
+
PR tree-optimization/56398
* tree-vect-loop-manip.c (adjust_debug_stmts): Skip
SSA default defs.
/* Coalesce the partitions in MAP representing VAR1 and VAR2 if it is valid.
Choose a representative for the partition, and send debug info to DEBUG. */
-static bool
+static void
copy_rename_partition_coalesce (var_map map, tree var1, tree var2, FILE *debug)
{
int p1, p2, p3;
{
if (debug)
fprintf (debug, " : Already coalesced.\n");
- return false;
+ return;
}
rep1 = partition_to_var (map, p1);
root1 = SSA_NAME_VAR (rep1);
root2 = SSA_NAME_VAR (rep2);
if (!root1 && !root2)
- return false;
+ return;
/* Don't coalesce if one of the variables occurs in an abnormal PHI. */
abnorm = (SSA_NAME_OCCURS_IN_ABNORMAL_PHI (rep1)
{
if (debug)
fprintf (debug, " : Abnormal PHI barrier. No coalesce.\n");
- return false;
+ return;
}
/* Partitions already have the same root, simply merge them. */
p1 = partition_union (map->var_partition, p1, p2);
if (debug)
fprintf (debug, " : Same root, coalesced --> P%d.\n", p1);
- return false;
+ return;
}
/* Never attempt to coalesce 2 different parameters. */
{
if (debug)
fprintf (debug, " : 2 different PARM_DECLS. No coalesce.\n");
- return false;
+ return;
}
if ((root1 && TREE_CODE (root1) == RESULT_DECL)
{
if (debug)
fprintf (debug, " : One root a RESULT_DECL. No coalesce.\n");
- return false;
+ return;
}
ign1 = !root1 || (TREE_CODE (root1) == VAR_DECL && DECL_IGNORED_P (root1));
{
if (debug)
fprintf (debug, " : 2 different USER vars. No coalesce.\n");
- return false;
+ return;
}
else
ign2 = true;
{
if (debug)
fprintf (debug, " : 2 default defs. No coalesce.\n");
- return false;
+ return;
}
else
{
{
if (debug)
fprintf (debug, " : Choosen variable has no root. No coalesce.\n");
- return false;
+ return;
}
/* Don't coalesce if the new chosen root variable would be read-only.
{
if (debug)
fprintf (debug, " : Readonly variable. No coalesce.\n");
- return false;
+ return;
}
/* Don't coalesce if the two variables aren't type compatible . */
{
if (debug)
fprintf (debug, " : Incompatible types. No coalesce.\n");
- return false;
+ return;
}
/* Merge the two partitions. */
TDF_SLIM);
fprintf (debug, "\n");
}
- return true;
}
gimple stmt, phi;
unsigned x;
FILE *debug;
- bool updated = false;
memset (&stats, 0, sizeof (stats));
tree lhs = gimple_assign_lhs (stmt);
tree rhs = gimple_assign_rhs1 (stmt);
- updated |= copy_rename_partition_coalesce (map, lhs, rhs, debug);
+ copy_rename_partition_coalesce (map, lhs, rhs, debug);
}
}
}
{
tree arg = PHI_ARG_DEF (phi, i);
if (TREE_CODE (arg) == SSA_NAME)
- updated |= copy_rename_partition_coalesce (map, res, arg,
- debug);
+ copy_rename_partition_coalesce (map, res, arg,
+ debug);
}
/* Else if all arguments are in the same partition try to merge
it with the result. */
}
}
if (all_p_same == 1)
- updated |= copy_rename_partition_coalesce (map, res,
- PHI_ARG_DEF (phi, 0),
- debug);
+ copy_rename_partition_coalesce (map, res,
+ PHI_ARG_DEF (phi, 0),
+ debug);
}
}
}
statistics_counter_event (cfun, "copies coalesced",
stats.coalesced);
delete_var_map (map);
- return updated ? TODO_remove_unused_locals : 0;
+ return 0;
}
/* Return true if copy rename is to be performed. */