From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 3F2F7385742A; Tue, 17 May 2022 03:29:00 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3F2F7385742A 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:29:00 +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:29:00 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D105617 --- Comment #8 from Hongtao.liu --- (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 thou= ght > it was load not scalar=EF=BC=9F=20 Yes, true for as gimple_assign_load_p (gdb) p debug_gimple_stmt (def) 72# VUSE <.MEM_46> 73r0.0_20 =3D r0; (gdb) l 21723246 move it to a vector register, otherwise we have to = go 21823247 via a GPR or via vpinsr which involves similar cost. 21923248 Likewise with a BIT_FIELD_REF extracting from a vec= tor 22023249 register we can hope to avoid using a GPR. */ 22123250 if (!is_gimple_assign (def) 22223251 || (!gimple_assign_load_p (def) 22323252 && (gimple_assign_rhs_code (def) !=3D BIT_FIEL= D_REF 22423253 || !VECTOR_TYPE_P (TREE_TYPE 22523254 (TREE_OPERAND (gimple_assign_rhs1 (def), 0)))))) 22623255 stmt_cost +=3D ix86_cost->sse_to_integer;=