From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id BD6E43857807; Mon, 8 Mar 2021 08:11:50 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BD6E43857807 From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/99407] s243 benchmark of TSVC is vectorized by clang and not by gcc, missed DSE Date: Mon, 08 Mar 2021 08:11:50 +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: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cf_reconfirmed_on everconfirmed keywords blocked short_desc component bug_status 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: Mon, 08 Mar 2021 08:11:50 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D99407 Richard Biener changed: What |Removed |Added ---------------------------------------------------------------------------- Last reconfirmed| |2021-03-08 Ever confirmed|0 |1 Keywords| |missed-optimization Blocks| |53947 Summary|s243 benchmark of TSVC is |s243 benchmark of TSVC is |vectorized by clang and not |vectorized by clang and not |by gcc |by gcc, missed DSE Component|middle-end |tree-optimization Status|UNCONFIRMED |NEW --- Comment #2 from Richard Biener --- Hmm, wonder why DSE didn't remove the first a[i] store. Ah, because DSE doesn't use data-ref analysis and thus cannot disambiguate the variable off= set. Manually applying DSE produces .L4: vmovaps c(%rax), %ymm1 vaddps e(%rax), %ymm1, %ymm0 addq $32, %rax vmovups a-28(%rax), %ymm1 vmulps d-32(%rax), %ymm1, %ymm1 vmulps d-32(%rax), %ymm0, %ymm0 vaddps b-32(%rax), %ymm0, %ymm0 vmovaps %ymm0, b-32(%rax) vaddps %ymm0, %ymm1, %ymm0 vmovaps %ymm0, a-32(%rax) cmpq $127968, %rax jne .L4 manually DSEd loop: for (int nl =3D 0; nl < iterations; nl++) { for (int i =3D 0; i < LEN_1D-1; i++) { real_t tem =3D b[i] + c[i ] * d[i]; b[i] =3D tem + d[i ] * e[i]; a[i] =3D b[i] + a[i+1] * d[i]; } } Referenced Bugs: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D53947 [Bug 53947] [meta-bug] vectorizer missed-optimizations=