Commit a044f0e7 by Richard Biener Committed by Richard Biener

tree-ssa-pre.c (get_representative_for): Adjust dumping.

2012-12-13  Richard Biener  <rguenther@suse.de>

	* tree-ssa-pre.c (get_representative_for): Adjust dumping.
	Mark created SSA names for release.
	(eliminate_bb): Insert only when expr is not NULL.

From-SVN: r194468
parent 653787d7
2012-12-13 Richard Biener <rguenther@suse.de>
* tree-ssa-pre.c (get_representative_for): Adjust dumping.
Mark created SSA names for release.
(eliminate_bb): Insert only when expr is not NULL.
2012-12-12 Jakub Jelinek <jakub@redhat.com>
PR debug/55665
......@@ -1395,31 +1395,26 @@ get_representative_for (const pre_expr e)
pre_expr rep = expression_for_id (i);
if (rep->kind == NAME)
return PRE_EXPR_NAME (rep);
else if (rep->kind == CONSTANT)
return PRE_EXPR_CONSTANT (rep);
}
}
break;
}
/* If we reached here we couldn't find an SSA_NAME. This can
happen when we've discovered a value that has never appeared in
the program as set to an SSA_NAME, most likely as the result of
phi translation. */
if (dump_file)
{
fprintf (dump_file,
"Could not find SSA_NAME representative for expression:");
print_pre_expr (dump_file, e);
fprintf (dump_file, "\n");
}
/* Build and insert the assignment of the end result to the temporary
that we will return. */
the program as set to an SSA_NAME, as the result of phi translation.
Create one here.
??? We should be able to re-use this when we insert the statement
to compute it. */
name = make_temp_ssa_name (get_expr_type (e), gimple_build_nop (), "pretmp");
VN_INFO_GET (name)->value_id = value_id;
VN_INFO (name)->valnum = sccvn_valnum_from_value_id (value_id);
if (VN_INFO (name)->valnum == NULL_TREE)
VN_INFO (name)->valnum = name;
VN_INFO (name)->valnum = name;
/* ??? For now mark this SSA name for release by SCCVN. */
VN_INFO (name)->needs_insertion = true;
add_to_value (value_id, get_or_alloc_expr_for_name (name));
if (dump_file)
if (dump_file && (dump_flags & TDF_DETAILS))
{
fprintf (dump_file, "Created SSA_NAME representative ");
print_generic_expr (dump_file, name, 0);
......@@ -4170,6 +4165,7 @@ eliminate_bb (dom_walk_data *, basic_block b)
if (val != VN_TOP
&& TREE_CODE (val) == SSA_NAME
&& VN_INFO (val)->needs_insertion
&& VN_INFO (val)->expr != NULL_TREE
&& (sprime = eliminate_insert (&gsi, val)) != NULL_TREE)
eliminate_push_avail (sprime);
}
......
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