diff options
author | Richard Biener <rguenth@gcc.gnu.org> | 2019-05-07 11:17:00 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2019-05-07 11:17:00 +0000 |
commit | 3cf8b3e341b8424d7c34c918406bd37d2feb7407 (patch) | |
tree | c3079ed3fb4d622158479ef6cb1ccfc0355988ec /gcc/tree-ssa-pre.c | |
parent | bca0a3216deff39ec9e4dcf979fff7f313ca6486 (diff) | |
download | gcc-3cf8b3e341b8424d7c34c918406bd37d2feb7407.zip gcc-3cf8b3e341b8424d7c34c918406bd37d2feb7407.tar.gz gcc-3cf8b3e341b8424d7c34c918406bd37d2feb7407.tar.bz2 |
re PR tree-optimization/90316 (large compile time increase in opt / alias stmt walking for Go example)
2019-05-07 Richard Biener <rguenther@suse.de>
PR tree-optimization/90316
* tree-ssa-alias.h (get_continuation_for_phi): Take walking
limit by reference.
(walk_non_aliased_vuses): Take walking limit argument.
* tree-ssa-alias.c (maybe_skip_until): Take limit and abort
walking if it is reached instead of just counting.
(get_continuation_for_phi): Likewise.
(walk_non_aliased_vuses): Likewise, instead of leaving counter
limiting to the callback.
* tree-ssa-sccvn.c (vn_reference_lookup_2): Adjust.
(vn_reference_lookup_3): Likewise.
(vn_reference_lookup_pieces): Likewise.
(vn_reference_lookup): Likewise.
* tree-ssa-pre.c (translate_vuse_through_block): Limit walking.
* tree-ssa-scopedtables.c (vuse_eq): Adjust.
(avail_exprs_stack::lookup_avail_expr): Likewise.
From-SVN: r270940
Diffstat (limited to 'gcc/tree-ssa-pre.c')
-rw-r--r-- | gcc/tree-ssa-pre.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/gcc/tree-ssa-pre.c b/gcc/tree-ssa-pre.c index e1c75f8e..646feb6 100644 --- a/gcc/tree-ssa-pre.c +++ b/gcc/tree-ssa-pre.c @@ -1151,6 +1151,7 @@ translate_vuse_through_block (vec<vn_reference_op_s> operands, if (gimple_bb (phi) != phiblock) return vuse; + unsigned int cnt = PARAM_VALUE (PARAM_SCCVN_MAX_ALIAS_QUERIES_PER_ACCESS); use_oracle = ao_ref_init_from_vn_reference (&ref, set, type, operands); /* Use the alias-oracle to find either the PHI node in this block, @@ -1159,8 +1160,10 @@ translate_vuse_through_block (vec<vn_reference_op_s> operands, if (gimple_code (phi) == GIMPLE_PHI) e = find_edge (block, phiblock); else if (use_oracle) - while (!stmt_may_clobber_ref_p_1 (phi, &ref)) + while (cnt > 0 + && !stmt_may_clobber_ref_p_1 (phi, &ref)) { + --cnt; vuse = gimple_vuse (phi); phi = SSA_NAME_DEF_STMT (vuse); if (gimple_bb (phi) != phiblock) @@ -1179,10 +1182,9 @@ translate_vuse_through_block (vec<vn_reference_op_s> operands, if (use_oracle) { bitmap visited = NULL; - unsigned int cnt; /* Try to find a vuse that dominates this phi node by skipping non-clobbering statements. */ - vuse = get_continuation_for_phi (phi, &ref, &cnt, &visited, false, + vuse = get_continuation_for_phi (phi, &ref, cnt, &visited, false, NULL, NULL); if (visited) BITMAP_FREE (visited); |