diff options
author | law <law@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-09-06 17:41:48 +0000 |
---|---|---|
committer | law <law@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-09-06 17:41:48 +0000 |
commit | 256b8b105850ed2121753037193b72d583373777 (patch) | |
tree | c8d0ffded8d0eba1cb4f38fea3378802437edd37 | |
parent | 02b1a16c723f587755b25df5aa82ddee073ed13e (diff) | |
download | gcc-256b8b105850ed2121753037193b72d583373777.tar.gz |
* tree-ssa-dom.c (cprop_into_successor_phis): Also propagate
edge implied equivalences into successor phis.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@202345 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/tree-ssa-dom.c | 24 |
2 files changed, 29 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 451879429b0..67cf9e57a89 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2013-09-06 Jeff Law <law@redhat.com> + + * tree-ssa-dom.c (cprop_into_successor_phis): Also propagate + edge implied equivalences into successor phis. + 2013-09-06 Joern Rennecke <joern.rennecke@embecosm.com> * resource.c (mark_referenced_resources): Handle COND_EXEC. diff --git a/gcc/tree-ssa-dom.c b/gcc/tree-ssa-dom.c index 691e6f905a2..f999a648e26 100644 --- a/gcc/tree-ssa-dom.c +++ b/gcc/tree-ssa-dom.c @@ -1642,6 +1642,28 @@ cprop_into_successor_phis (basic_block bb) if (gsi_end_p (gsi)) continue; + /* We may have an equivalence associated with this edge. While + we can not propagate it into non-dominated blocks, we can + propagate them into PHIs in non-dominated blocks. */ + + /* Push the unwind marker so we can reset the const and copies + table back to its original state after processing this edge. */ + const_and_copies_stack.safe_push (NULL_TREE); + + /* Extract and record any simple NAME = VALUE equivalences. + + Don't bother with [01] = COND equivalences, they're not useful + here. */ + struct edge_info *edge_info = (struct edge_info *) e->aux; + if (edge_info) + { + tree lhs = edge_info->lhs; + tree rhs = edge_info->rhs; + + if (lhs && TREE_CODE (lhs) == SSA_NAME) + record_const_or_copy (lhs, rhs); + } + indx = e->dest_idx; for ( ; !gsi_end_p (gsi); gsi_next (&gsi)) { @@ -1667,6 +1689,8 @@ cprop_into_successor_phis (basic_block bb) && may_propagate_copy (orig_val, new_val)) propagate_value (orig_p, new_val); } + + restore_vars_to_original_value (); } } |