diff options
author | Richard Biener <rguenther@suse.de> | 2023-08-25 13:37:30 +0200 |
---|---|---|
committer | Richard Biener <rguenther@suse.de> | 2023-08-25 14:37:37 +0200 |
commit | 845ee9c7107956845e487cb123fa581d9c70ea1b (patch) | |
tree | 48e096ae11fd7b83e679eabb8ba449c98ddbb504 /gcc/ordered-hash-map-tests.cc | |
parent | 470da3b27e6dbeb3286b09dcb1c1b810ac75b276 (diff) | |
download | gcc-845ee9c7107956845e487cb123fa581d9c70ea1b.zip gcc-845ee9c7107956845e487cb123fa581d9c70ea1b.tar.gz gcc-845ee9c7107956845e487cb123fa581d9c70ea1b.tar.bz2 |
tree-optimization/111137 - dependence checking for SLP
The following fixes a mistake with SLP dependence checking. When
checking whether we can hoist loads to the first load place we
special-case stores of the same instance considering them sunk
to the last store place. But we fail to consider that stores from
other SLP instances are sunk in a similar way. This leads us to
miss the dependence between (A) and (B) in
b[0][1] = 0; (A)
...
_6 = b[_5 /* 0 */][0]; (B')
_7 = _6 ^ 1;
b[_5 /* 0 */][0] = _7;
b[0][2] = 0; (A')
_10 = b[_5 /* 0 */][1]; (B)
_11 = _10 ^ 1;
b[_5 /* 0 */][1] = _11;
where the zeroing stores are sunk to (A') and the loads hoisted
to (B'). The following fixes this, treating grouped stores from
other instances similar to stores from our own instance. The
difference is - and this is more conservative than necessary - that
we don't know which stores of a group are in which SLP instance
(though I believe either all of the grouped stores will be in
a single SLP instance or in none at the moment), so we don't
know which stores are sunk where. We simply assume they are
all sunk to the last store we run into. Likewise we do not take
into account that an SLP instance might be cancelled (or a grouped
store not actually belong to any instance).
PR tree-optimization/111137
* tree-vect-data-refs.cc (vect_slp_analyze_load_dependences):
Properly handle grouped stores from other SLP instances.
* gcc.dg/torture/pr111137.c: New testcase.
Diffstat (limited to 'gcc/ordered-hash-map-tests.cc')
0 files changed, 0 insertions, 0 deletions