summaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-dom.c
diff options
context:
space:
mode:
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2014-07-08 09:22:54 +0000
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2014-07-08 09:22:54 +0000
commit3beff0e12fe55eece14fed410c5e5b66bda90833 (patch)
treefc2de2ca11505b2c9e319eb1096a8574539176b7 /gcc/tree-ssa-dom.c
parentf91737f9fef45f2e5204408aff79fb60013d1c94 (diff)
downloadgcc-3beff0e12fe55eece14fed410c5e5b66bda90833.tar.gz
2014-07-08 Richard Biener <rguenther@suse.de>
* tree-ssa-dom.h (loop_depth_of_name): Remove. * tree-ssa-dom.c (record_equivalences_from_phis): Remove restriction on loop depth difference. (record_equality): Likewise. (propagate_rhs_into_lhs): Likewise. Simplify condition. (loop_depth_of_name): Remove. * tree-ssa-copy.c (copy_prop_visit_phi_node): Remove restriction on loop depth difference. (init_copy_prop): Likewise. * gcc.dg/tree-ssa/ssa-pre-16.c: Adjust expected eliminations. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@212352 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-ssa-dom.c')
-rw-r--r--gcc/tree-ssa-dom.c46
1 files changed, 4 insertions, 42 deletions
diff --git a/gcc/tree-ssa-dom.c b/gcc/tree-ssa-dom.c
index 795ed09ae86..d0501a2d23d 100644
--- a/gcc/tree-ssa-dom.c
+++ b/gcc/tree-ssa-dom.c
@@ -1235,12 +1235,7 @@ record_equivalences_from_phis (basic_block bb)
inferred from a comparison. All uses of this ssa name are dominated
by this assignment, so unwinding just costs time and space. */
if (i == gimple_phi_num_args (phi)
- && may_propagate_copy (lhs, rhs)
- /* Do not propagate copies if the propagated value is at a deeper loop
- depth than the propagatee. Otherwise, this may introduce uses
- of loop variant variables outside of their loops and prevent
- coalescing opportunities. */
- && !(loop_depth_of_name (rhs) > loop_depth_of_name (lhs)))
+ && may_propagate_copy (lhs, rhs))
set_ssa_name_value (lhs, rhs);
}
}
@@ -1575,33 +1570,6 @@ record_const_or_copy_1 (tree x, tree y, tree prev_x)
const_and_copies_stack.quick_push (x);
}
-/* Return the loop depth of the basic block of the defining statement of X.
- This number should not be treated as absolutely correct because the loop
- information may not be completely up-to-date when dom runs. However, it
- will be relatively correct, and as more passes are taught to keep loop info
- up to date, the result will become more and more accurate. */
-
-int
-loop_depth_of_name (tree x)
-{
- gimple defstmt;
- basic_block defbb;
-
- /* If it's not an SSA_NAME, we have no clue where the definition is. */
- if (TREE_CODE (x) != SSA_NAME)
- return 0;
-
- /* Otherwise return the loop depth of the defining statement's bb.
- Note that there may not actually be a bb for this statement, if the
- ssa_name is live on entry. */
- defstmt = SSA_NAME_DEF_STMT (x);
- defbb = gimple_bb (defstmt);
- if (!defbb)
- return 0;
-
- return bb_loop_depth (defbb);
-}
-
/* Record that X is equal to Y in const_and_copies. Record undo
information in the block-local vector. */
@@ -1641,8 +1609,7 @@ record_equality (tree x, tree y)
long as we canonicalize on one value. */
if (is_gimple_min_invariant (y))
;
- else if (is_gimple_min_invariant (x)
- || (loop_depth_of_name (x) <= loop_depth_of_name (y)))
+ else if (is_gimple_min_invariant (x))
prev_x = x, x = y, y = prev_x, prev_x = prev_y;
else if (prev_x && is_gimple_min_invariant (prev_x))
x = y, y = prev_x, prev_x = prev_y;
@@ -2686,13 +2653,8 @@ get_lhs_or_phi_result (gimple stmt)
static void
propagate_rhs_into_lhs (gimple stmt, tree lhs, tree rhs, bitmap interesting_names)
{
- /* First verify that propagation is valid and isn't going to move a
- loop variant variable outside its loop. */
- if (! SSA_NAME_OCCURS_IN_ABNORMAL_PHI (lhs)
- && (TREE_CODE (rhs) != SSA_NAME
- || ! SSA_NAME_OCCURS_IN_ABNORMAL_PHI (rhs))
- && may_propagate_copy (lhs, rhs)
- && loop_depth_of_name (lhs) >= loop_depth_of_name (rhs))
+ /* First verify that propagation is valid. */
+ if (may_propagate_copy (lhs, rhs))
{
use_operand_p use_p;
imm_use_iterator iter;