aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-dom.c
diff options
context:
space:
mode:
authorAlan Lawrence <alan.lawrence@arm.com>2015-09-01 10:51:43 +0000
committerAlan Lawrence <alalaw01@gcc.gnu.org>2015-09-01 10:51:43 +0000
commit0b49d67bbdb381e38fc8dcdea1e5cf7e81034566 (patch)
tree52304573bfde137d2005f61f30e5aa2e8d5ba02f /gcc/tree-ssa-dom.c
parent660adea45e1faa109e0b799824ca8340371f60d1 (diff)
downloadgcc-0b49d67bbdb381e38fc8dcdea1e5cf7e81034566.zip
gcc-0b49d67bbdb381e38fc8dcdea1e5cf7e81034566.tar.gz
gcc-0b49d67bbdb381e38fc8dcdea1e5cf7e81034566.tar.bz2
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
Diffstat (limited to 'gcc/tree-ssa-dom.c')
-rw-r--r--gcc/tree-ssa-dom.c31
1 files changed, 4 insertions, 27 deletions
diff --git a/gcc/tree-ssa-dom.c b/gcc/tree-ssa-dom.c
index 248b037..a26ae55 100644
--- a/gcc/tree-ssa-dom.c
+++ b/gcc/tree-ssa-dom.c
@@ -1577,12 +1577,7 @@ record_equivalences_from_phis (basic_block bb)
if (lhs == t)
continue;
- /* Valueize t. */
- if (TREE_CODE (t) == SSA_NAME)
- {
- tree tmp = SSA_NAME_VALUE (t);
- t = tmp ? tmp : t;
- }
+ t = dom_valueize (t);
/* If we have not processed an alternative yet, then set
RHS to this alternative. */
@@ -2160,12 +2155,7 @@ record_equivalences_from_stmt (gimple stmt, int may_optimize_p)
&& (TREE_CODE (rhs) == SSA_NAME
|| is_gimple_min_invariant (rhs)))
{
- /* Valueize rhs. */
- if (TREE_CODE (rhs) == SSA_NAME)
- {
- tree tmp = SSA_NAME_VALUE (rhs);
- rhs = tmp ? tmp : rhs;
- }
+ rhs = dom_valueize (rhs);
if (dump_file && (dump_flags & TDF_DETAILS))
{
@@ -2442,12 +2432,7 @@ optimize_stmt (basic_block bb, gimple_stmt_iterator si)
tree rhs = gimple_assign_rhs1 (stmt);
tree cached_lhs;
gassign *new_stmt;
- if (TREE_CODE (rhs) == SSA_NAME)
- {
- tree tem = SSA_NAME_VALUE (rhs);
- if (tem)
- rhs = tem;
- }
+ rhs = dom_valueize (rhs);
/* Build a new statement with the RHS and LHS exchanged. */
if (TREE_CODE (rhs) == SSA_NAME)
{
@@ -2569,7 +2554,6 @@ lookup_avail_expr (gimple stmt, bool insert)
{
expr_hash_elt **slot;
tree lhs;
- tree temp;
struct expr_hash_elt element;
/* Get LHS of phi, assignment, or call; else NULL_TREE. */
@@ -2664,14 +2648,7 @@ lookup_avail_expr (gimple stmt, bool insert)
definition of another variable. */
lhs = (*slot)->lhs;
- /* See if the LHS appears in the CONST_AND_COPIES table. If it does, then
- use the value from the const_and_copies table. */
- if (TREE_CODE (lhs) == SSA_NAME)
- {
- temp = SSA_NAME_VALUE (lhs);
- if (temp)
- lhs = temp;
- }
+ lhs = dom_valueize (lhs);
if (dump_file && (dump_flags & TDF_DETAILS))
{