diff options
author | Richard Biener <rguenther@suse.de> | 2015-08-12 07:34:07 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2015-08-12 07:34:07 +0000 |
commit | d27139850b789dbfc7c9c5604432c5d16114528d (patch) | |
tree | 2e435f7b3b7059e73f19cbc53ede5d47ec750827 /gcc/tree-ssa-pre.c | |
parent | 51d3809e630ad4576cbf4cbcd7db9782152f9a41 (diff) | |
download | gcc-d27139850b789dbfc7c9c5604432c5d16114528d.zip gcc-d27139850b789dbfc7c9c5604432c5d16114528d.tar.gz gcc-d27139850b789dbfc7c9c5604432c5d16114528d.tar.bz2 |
tree-ssa-pre.c (eliminate_dom_walker::before_dom_children): Eliminate edges marked as not executable by SCCVN.
2015-08-12 Richard Biener <rguenther@suse.de>
* tree-ssa-pre.c (eliminate_dom_walker::before_dom_children):
Eliminate edges marked as not executable by SCCVN.
* tree-ssa-sccvn.c: Include gimple-iterator.h.
(cond_dom_walker): Rename to sccvn_dom_walker.
(sccvn_dom_walker::before_dom_children): Value-number defs
of all stmts.
(run_scc_vn): Remove loop value-numbering all SSA names.
Drop not visited SSA names to varying.
* gcc.dg/tree-ssa/ssa-fre-43.c: Adjust.
From-SVN: r226801
Diffstat (limited to 'gcc/tree-ssa-pre.c')
-rw-r--r-- | gcc/tree-ssa-pre.c | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/gcc/tree-ssa-pre.c b/gcc/tree-ssa-pre.c index 041cb78..697958d 100644 --- a/gcc/tree-ssa-pre.c +++ b/gcc/tree-ssa-pre.c @@ -4291,7 +4291,31 @@ eliminate_dom_walker::before_dom_children (basic_block b) el_to_remove.safe_push (stmt); continue; } - } + } + + /* If this is a control statement value numbering left edges + unexecuted on force the condition in a way consistent with + that. */ + if (gcond *cond = dyn_cast <gcond *> (stmt)) + { + if ((EDGE_SUCC (b, 0)->flags & EDGE_EXECUTABLE) + ^ (EDGE_SUCC (b, 1)->flags & EDGE_EXECUTABLE)) + { + if (dump_file && (dump_flags & TDF_DETAILS)) + { + fprintf (dump_file, "Removing unexecutable edge from "); + print_gimple_stmt (dump_file, stmt, 0, 0); + } + if (((EDGE_SUCC (b, 0)->flags & EDGE_TRUE_VALUE) != 0) + == ((EDGE_SUCC (b, 0)->flags & EDGE_EXECUTABLE) != 0)) + gimple_cond_make_true (cond); + else + gimple_cond_make_false (cond); + update_stmt (cond); + el_todo |= TODO_cleanup_cfg; + continue; + } + } bool can_make_abnormal_goto = stmt_can_make_abnormal_goto (stmt); bool was_noreturn = (is_gimple_call (stmt) |