tree-optimization/100112 - VN last_vuse and redundant store elimination
authorRichard Biener <rguenther@suse.de>
Mon, 27 Sep 2021 10:01:38 +0000 (12:01 +0200)
committerRichard Biener <rguenther@suse.de>
Tue, 28 Sep 2021 10:31:46 +0000 (12:31 +0200)
commit5b8b1522e04adc20980f396571be1929a32d148a
tree0d646656faaf9ab4b3f1842631747a7275256915
parent4f07769057c45ec9e751ab1c23e0fe4750102840
tree-optimization/100112 - VN last_vuse and redundant store elimination

This avoids the last_vuse optimization hindering redundant store
elimination by always also recording the original VUSE that was
in effect on the load.

In stage3 gcc/*.o we have 3182752 times recorded a single
entry and 903409 times two entries (that's ~20% overhead).

With just recording a single entry the number of hashtable lookups
done when walking the vuse->vdef links to find an earlier access
is 28961618.  When recording the second entry this makes us find
that earlier for donwnstream redundant accesses, reducing the number
of hashtable lookups to 25401052 (that's a ~10% reduction).

2021-09-27  Richard Biener  <rguenther@suse.de>

PR tree-optimization/100112
* tree-ssa-sccvn.c (visit_reference_op_load): Record the
referece into the hashtable twice in case last_vuse is
different from the original vuse on the stmt.

* gcc.dg/tree-ssa/ssa-fre-95.c: New testcase.
gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-95.c [new file with mode: 0644]
gcc/tree-ssa-sccvn.c