From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 7AD8D3858C50; Tue, 12 Jul 2022 09:59:59 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7AD8D3858C50 From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/99416] s211 benchmark of TSVC is vectorized by icc and not by gcc Date: Tue, 12 Jul 2022 09:59:59 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Version: 11.0 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: rguenth at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jul 2022 09:59:59 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D99416 --- Comment #4 from Richard Biener --- (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 in= ner 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).=