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-scopedtables.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-scopedtables.c')
-rw-r--r-- | gcc/tree-ssa-scopedtables.c | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/gcc/tree-ssa-scopedtables.c b/gcc/tree-ssa-scopedtables.c index 2f3ba18..0614afc 100644 --- a/gcc/tree-ssa-scopedtables.c +++ b/gcc/tree-ssa-scopedtables.c @@ -100,19 +100,12 @@ avail_exprs_stack::record_expr (class expr_hash_elt *elt1, the desired memory state. */ static void * -vuse_eq (ao_ref *, tree vuse1, unsigned int cnt, void *data) +vuse_eq (ao_ref *, tree vuse1, void *data) { tree vuse2 = (tree) data; if (vuse1 == vuse2) return data; - /* This bounds the stmt walks we perform on reference lookups - to O(1) instead of O(N) where N is the number of dominating - stores leading to a candidate. We re-use the SCCVN param - for this as it is basically the same complexity. */ - if (cnt > (unsigned) PARAM_VALUE (PARAM_SCCVN_MAX_ALIAS_QUERIES_PER_ACCESS)) - return (void *)-1; - return NULL; } @@ -299,13 +292,14 @@ avail_exprs_stack::lookup_avail_expr (gimple *stmt, bool insert, bool tbaa_p) up the virtual use-def chain using walk_non_aliased_vuses. But don't do this when removing expressions from the hash. */ ao_ref ref; + unsigned limit = PARAM_VALUE (PARAM_SCCVN_MAX_ALIAS_QUERIES_PER_ACCESS); if (!(vuse1 && vuse2 && gimple_assign_single_p (stmt) && TREE_CODE (gimple_assign_lhs (stmt)) == SSA_NAME && (ao_ref_init (&ref, gimple_assign_rhs1 (stmt)), ref.base_alias_set = ref.ref_alias_set = tbaa_p ? -1 : 0, true) - && walk_non_aliased_vuses (&ref, vuse2, - vuse_eq, NULL, NULL, vuse1) != NULL)) + && walk_non_aliased_vuses (&ref, vuse2, vuse_eq, NULL, NULL, + limit, vuse1) != NULL)) { if (insert) { |