aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-alias.c
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2014-12-09 14:25:09 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2014-12-09 14:25:09 +0000
commit92a5094e04e9c9a50e596884eacabe53b36a53e9 (patch)
treeb2b878ed94eea9cd92e69a9449a9a13df6159253 /gcc/tree-ssa-alias.c
parentc3e1e6936a4bbeb7cd73640e046bb32d23997ac0 (diff)
downloadgcc-92a5094e04e9c9a50e596884eacabe53b36a53e9.zip
gcc-92a5094e04e9c9a50e596884eacabe53b36a53e9.tar.gz
gcc-92a5094e04e9c9a50e596884eacabe53b36a53e9.tar.bz2
re PR tree-optimization/64193 (Decreased performance after r173250)
2014-12-09 Richard Biener <rguenther@suse.de> PR tree-optimization/64193 * tree-ssa-alias.c (walk_non_aliased_vuses): Add valueize parameter and valueize the VUSE before looking up the def stmt. * tree-ssa-alias.h (walk_non_aliased_vuses): Adjust prototype. * tree-ssa-sccvn.c (vn_reference_lookup_pieces): Pass vn_valueize to walk_non_aliased_vuses. (vn_reference_lookup): Likewise. * tree-ssa-dom.c (lookup_avail_expr): Pass NULL as valueize callback to walk_non_aliased_vuses. * gcc.dg/tree-ssa/ssa-fre-43.c: New testcase. From-SVN: r218515
Diffstat (limited to 'gcc/tree-ssa-alias.c')
-rw-r--r--gcc/tree-ssa-alias.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/gcc/tree-ssa-alias.c b/gcc/tree-ssa-alias.c
index 17e8414..5ad2576 100644
--- a/gcc/tree-ssa-alias.c
+++ b/gcc/tree-ssa-alias.c
@@ -2632,12 +2632,18 @@ get_continuation_for_phi (gimple phi, ao_ref *ref,
If TRANSLATE returns NULL the walk continues and TRANSLATE is supposed
to adjust REF and *DATA to make that valid.
+ VALUEIZE if non-NULL is called with the next VUSE that is considered
+ and return value is substituted for that. This can be used to
+ implement optimistic value-numbering for example. Note that the
+ VUSE argument is assumed to be valueized already.
+
TODO: Cache the vector of equivalent vuses per ref, vuse pair. */
void *
walk_non_aliased_vuses (ao_ref *ref, tree vuse,
void *(*walker)(ao_ref *, tree, unsigned int, void *),
void *(*translate)(ao_ref *, tree, void *, bool),
+ tree (*valueize)(tree),
void *data)
{
bitmap visited = NULL;
@@ -2663,6 +2669,8 @@ walk_non_aliased_vuses (ao_ref *ref, tree vuse,
else if (res != NULL)
break;
+ if (valueize)
+ vuse = valueize (vuse);
def_stmt = SSA_NAME_DEF_STMT (vuse);
if (gimple_nop_p (def_stmt))
break;