https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99416
--- Comment #4 from Richard Biener <rguenth at gcc dot gnu.org> --- (In reply to Richard Biener from comment #3) > Note it's only the outer loop that confuses us here. With that removed we > have > the following because of yet another "heuristic" to disable distribution. In fact we first analyze the whole nest but then continue to look at the inner loop only, so this isn't really an issue. The fusing because of shared memory refs is only because of the double use of d[i], b[i], b[i-1] or b[i+1] are not detected as problematic for distribution (the "same memory object" check isn't working as intended). Fuse partitions because they have shared memory refs: Part 1: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 15, 16 Part 2: 0, 1, 5, 9, 10, 11, 12, 13, 14, 15, 16 note the intersection of both partitions includes half of the stmts (0, 1, 5, 6, 15, 16) that would be duplicated (5 is the d[i] load) while the other half is different. To defeat the final fusing reason we need a positive motivation, like tracking whether we know a partition can or cannot be vectorized (or whether we are not sure). For the partition containing the b[i], b[i+1] dependence distance of 1 we know we cannot vectorize (with a VF > 0).