diff options
author | Jeff Law <law@gcc.gnu.org> | 2015-11-06 16:26:20 -0700 |
---|---|---|
committer | Jeff Law <law@gcc.gnu.org> | 2015-11-06 16:26:20 -0700 |
commit | b9e59e4f11bc85b72167f93d1f356ff77074af01 (patch) | |
tree | 7996214e64ec8ce0a80f2a8768057c4e391c0fe0 /gcc/tree-vrp.c | |
parent | a6fa947e8261399636817b840fd0fc7c202742e6 (diff) | |
download | gcc-b9e59e4f11bc85b72167f93d1f356ff77074af01.zip gcc-b9e59e4f11bc85b72167f93d1f356ff77074af01.tar.gz gcc-b9e59e4f11bc85b72167f93d1f356ff77074af01.tar.bz2 |
[PATCH] Allow vrp to thread across backedges using FSM threader
* cfg-flags.def (IGNORE): New edge flag.
* tree-vrp.c (identify_jump_threads): Mark and clear edges
scheduled for removal with EDGE_IGNORE around call into
jump threader. Do no thread across edges with EDGE_IGNORE,
but do allow threading across those with EDGE_DFS_BACK.
* gcc.dg/tree-ssa/ssa-dom-thread-7.c: Adjust to look for
realized jump threads.
* gcc.dg/tree-ssa-pr66752-3.c: Look in vrp1 dump for jump
threads rather than dom1 dump.
From-SVN: r229902
Diffstat (limited to 'gcc/tree-vrp.c')
-rw-r--r-- | gcc/tree-vrp.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/gcc/tree-vrp.c b/gcc/tree-vrp.c index c0b6cfc..87c0265 100644 --- a/gcc/tree-vrp.c +++ b/gcc/tree-vrp.c @@ -10076,9 +10076,9 @@ identify_jump_threads (void) mark_dfs_back_edges (); /* Do not thread across edges we are about to remove. Just marking - them as EDGE_DFS_BACK will do. */ + them as EDGE_IGNORE will do. */ FOR_EACH_VEC_ELT (to_remove_edges, i, e) - e->flags |= EDGE_DFS_BACK; + e->flags |= EDGE_IGNORE; /* Allocate our unwinder stack to unwind any temporary equivalences that might be recorded. */ @@ -10135,9 +10135,9 @@ identify_jump_threads (void) it to a specific successor. */ FOR_EACH_EDGE (e, ei, bb->preds) { - /* Do not thread across back edges or abnormal edges - in the CFG. */ - if (e->flags & (EDGE_DFS_BACK | EDGE_COMPLEX)) + /* Do not thread across edges marked to ignoreor abnormal + edges in the CFG. */ + if (e->flags & (EDGE_IGNORE | EDGE_COMPLEX)) continue; thread_across_edge (dummy, e, true, equiv_stack, NULL, @@ -10146,6 +10146,10 @@ identify_jump_threads (void) } } + /* Clear EDGE_IGNORE. */ + FOR_EACH_VEC_ELT (to_remove_edges, i, e) + e->flags &= ~EDGE_IGNORE; + /* We do not actually update the CFG or SSA graphs at this point as ASSERT_EXPRs are still in the IL and cfg cleanup code does not yet handle ASSERT_EXPRs gracefully. */ |