From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id C0E60385734F; Tue, 17 May 2022 03:37:29 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C0E60385734F From: "crazylht at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/105617] [12/13 Regression] Slp is maybe too aggressive in some/many cases Date: Tue, 17 May 2022 03:37:29 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 12.1.0 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: normal X-Bugzilla-Who: crazylht at gmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 12.2 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, 17 May 2022 03:37:29 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D105617 --- Comment #9 from Hongtao.liu --- (In reply to Hongtao.liu from comment #8) > (In reply to Hongtao.liu from comment #7) > > Hmm, we have specific code to add scalar->vector(vmovq) cost to vector > > construct, but it seems not to work here, guess it's because &r0,and th= ought > > it was load not scalar=EF=BC=9F=20 > Yes, true for as gimple_assign_load_p >=20 >=20 > (gdb) p debug_gimple_stmt (def) > 72# VUSE <.MEM_46> > 73r0.0_20 =3D r0; It's a load from stack, and finally eliminated in rtl dse1, but here the vectorizer doesn't know. And slp will not vectorize it when there's extra scalar->vector cost. typedef long long uint64_t; void add4i(uint64_t r0, uint64_t r1, uint64_t r2, uint64_t r3, uint64_t *ds= t) { dst[0] =3D r0; dst[1] =3D r1; dst[2] =3D r2; dst[3] =3D r3; } add4i: mov QWORD PTR [r8], rdi mov QWORD PTR [r8+8], rsi mov QWORD PTR [r8+16], rdx mov QWORD PTR [r8+24], rcx ret=