Commit 0b49d67b by Alan Lawrence Committed by Alan Lawrence

Tidy tree-ssa-dom.c: Use dom_valueize more.

	* tree-ssa-dom.c (record_equivalences_from_phis,
	record_equivalences_from_stmt, optimize_stmt): Use dom_valueize.
	(lookup_avail_expr): Likewise, and remove comment and unused temp.

From-SVN: r227366
parent 660adea4
2015-08-31 Alan Lawrence <alan.lawrence@arm.com>
* tree-ssa-dom.c (record_equivalences_from_phis,
record_equivalences_from_stmt, optimize_stmt): Use dom_valueize.
(lookup_avail_expr): Likewise, and remove comment and unused temp.
2015-09-01 Nick Clifton <nickc@redhat.com> 2015-09-01 Nick Clifton <nickc@redhat.com>
* config/msp430/msp430.opt (mcpu): Fix typo. * config/msp430/msp430.opt (mcpu): Fix typo.
......
...@@ -1577,12 +1577,7 @@ record_equivalences_from_phis (basic_block bb) ...@@ -1577,12 +1577,7 @@ record_equivalences_from_phis (basic_block bb)
if (lhs == t) if (lhs == t)
continue; continue;
/* Valueize t. */ t = dom_valueize (t);
if (TREE_CODE (t) == SSA_NAME)
{
tree tmp = SSA_NAME_VALUE (t);
t = tmp ? tmp : t;
}
/* If we have not processed an alternative yet, then set /* If we have not processed an alternative yet, then set
RHS to this alternative. */ RHS to this alternative. */
...@@ -2160,12 +2155,7 @@ record_equivalences_from_stmt (gimple stmt, int may_optimize_p) ...@@ -2160,12 +2155,7 @@ record_equivalences_from_stmt (gimple stmt, int may_optimize_p)
&& (TREE_CODE (rhs) == SSA_NAME && (TREE_CODE (rhs) == SSA_NAME
|| is_gimple_min_invariant (rhs))) || is_gimple_min_invariant (rhs)))
{ {
/* Valueize rhs. */ rhs = dom_valueize (rhs);
if (TREE_CODE (rhs) == SSA_NAME)
{
tree tmp = SSA_NAME_VALUE (rhs);
rhs = tmp ? tmp : rhs;
}
if (dump_file && (dump_flags & TDF_DETAILS)) if (dump_file && (dump_flags & TDF_DETAILS))
{ {
...@@ -2442,12 +2432,7 @@ optimize_stmt (basic_block bb, gimple_stmt_iterator si) ...@@ -2442,12 +2432,7 @@ optimize_stmt (basic_block bb, gimple_stmt_iterator si)
tree rhs = gimple_assign_rhs1 (stmt); tree rhs = gimple_assign_rhs1 (stmt);
tree cached_lhs; tree cached_lhs;
gassign *new_stmt; gassign *new_stmt;
if (TREE_CODE (rhs) == SSA_NAME) rhs = dom_valueize (rhs);
{
tree tem = SSA_NAME_VALUE (rhs);
if (tem)
rhs = tem;
}
/* Build a new statement with the RHS and LHS exchanged. */ /* Build a new statement with the RHS and LHS exchanged. */
if (TREE_CODE (rhs) == SSA_NAME) if (TREE_CODE (rhs) == SSA_NAME)
{ {
...@@ -2569,7 +2554,6 @@ lookup_avail_expr (gimple stmt, bool insert) ...@@ -2569,7 +2554,6 @@ lookup_avail_expr (gimple stmt, bool insert)
{ {
expr_hash_elt **slot; expr_hash_elt **slot;
tree lhs; tree lhs;
tree temp;
struct expr_hash_elt element; struct expr_hash_elt element;
/* Get LHS of phi, assignment, or call; else NULL_TREE. */ /* Get LHS of phi, assignment, or call; else NULL_TREE. */
...@@ -2664,14 +2648,7 @@ lookup_avail_expr (gimple stmt, bool insert) ...@@ -2664,14 +2648,7 @@ lookup_avail_expr (gimple stmt, bool insert)
definition of another variable. */ definition of another variable. */
lhs = (*slot)->lhs; lhs = (*slot)->lhs;
/* See if the LHS appears in the CONST_AND_COPIES table. If it does, then lhs = dom_valueize (lhs);
use the value from the const_and_copies table. */
if (TREE_CODE (lhs) == SSA_NAME)
{
temp = SSA_NAME_VALUE (lhs);
if (temp)
lhs = temp;
}
if (dump_file && (dump_flags & TDF_DETAILS)) if (dump_file && (dump_flags & TDF_DETAILS))
{ {
......
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