diff options
author | Richard Biener <rguenther@suse.de> | 2016-07-05 13:25:19 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2016-07-05 13:25:19 +0000 |
commit | 16eba42015a33bf52f19e76eb491b98d99cac723 (patch) | |
tree | 242051bb452019038de6eb83b463e6dd9598172d /gcc/tree-loop-distribution.c | |
parent | b758f6e25bca04390096edff4e7997272333fabe (diff) | |
download | gcc-16eba42015a33bf52f19e76eb491b98d99cac723.zip gcc-16eba42015a33bf52f19e76eb491b98d99cac723.tar.gz gcc-16eba42015a33bf52f19e76eb491b98d99cac723.tar.bz2 |
tree-loop-distribution.c (distribute_loop): Fix issue with the cost model loop.
2016-07-05 Richard Biener <rguenther@suse.de>
* tree-loop-distribution.c (distribute_loop): Fix issue with
the cost model loop.
From-SVN: r238004
Diffstat (limited to 'gcc/tree-loop-distribution.c')
-rw-r--r-- | gcc/tree-loop-distribution.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/gcc/tree-loop-distribution.c b/gcc/tree-loop-distribution.c index e4163b2..9bca56a 100644 --- a/gcc/tree-loop-distribution.c +++ b/gcc/tree-loop-distribution.c @@ -1504,6 +1504,7 @@ distribute_loop (struct loop *loop, vec<gimple *> stmts, memory accesses. */ for (i = 0; partitions.iterate (i, &into); ++i) { + bool changed = false; if (partition_builtin_p (into)) continue; for (int j = i + 1; @@ -1524,8 +1525,15 @@ distribute_loop (struct loop *loop, vec<gimple *> stmts, partitions.unordered_remove (j); partition_free (partition); j--; + changed = true; } } + /* If we fused 0 1 2 in step 1 to 0,2 1 as 0 and 2 have similar + accesses when 1 and 2 have similar accesses but not 0 and 1 + then in the next iteration we will fail to consider merging + 1 into 0,2. So try again if we did any merging into 0. */ + if (changed) + i--; } /* Build the partition dependency graph. */ |