From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id D1234385702E; Mon, 29 Mar 2021 08:35:13 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D1234385702E From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/99807] [11 Regression] ICE in vect_slp_analyze_node_operations_1, at tree-vect-slp.c:3727 Date: Mon, 29 Mar 2021 08:35:13 +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: 11.0 X-Bugzilla-Keywords: ice-on-valid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P1 X-Bugzilla-Assigned-To: rguenth at gcc dot gnu.org X-Bugzilla-Target-Milestone: 11.0 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: Mon, 29 Mar 2021 08:35:13 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D99807 --- Comment #4 from Richard Biener --- (In reply to Richard Biener from comment #3) > Just to say we currently require a ("random") SLP_TREE_REPRESENTATIVE eve= n on > VEC_PERM_EXPR SLP nodes. With the testcase the choosen one is no longer > explicitely referenced and thus it does not get marked by SLP. Note this > will > also cause it to turn hybrid - so it's probably one of the cases where the > SLP marking as patterns "helped". We can fix the ICE by delaying the assert but the other issue still shows in costing (which also only walks participating stmts): t.f90:5:30: note: Cost model analysis: 0x35e56c0 _25 1 times scalar_store costs 1 in body 0x35e56c0 _26 1 times scalar_store costs 1 in body 0x35e56c0 _11 + _23 1 times scalar_stmt costs 1 in body 0x35e56c0 _12 + _24 1 times scalar_stmt costs 1 in body 0x35e56c0 REALPART_EXPR <(*z_8(D))[0]> 1 times scalar_load costs 1 in body 0x35e56c0 IMAGPART_EXPR <(*z_8(D))[0]> 1 times scalar_load costs 1 in body 0x35e56c0 REALPART_EXPR <(*z_8(D))[1]> 1 times scalar_load costs 1 in body 0x35e56c0 REALPART_EXPR <(*z_8(D))[0]> 1 times unaligned_load (misalign -1) costs 1 in body 0x35e56c0 REALPART_EXPR <(*z_8(D))[0]> 1 times vec_perm costs 2 in body 0x35e56c0 REALPART_EXPR <(*z_8(D))[1]> 1 times unaligned_load (misalign -1) costs 1 in body 0x35e56c0 1 times vec_perm costs 2 in body 0x35e56c0 1 times vec_construct costs 2 in prologue 0x35e56c0 .COMPLEX_FMA (_25, _25, _25) 1 times vector_stmt costs 1 in body 0x35e56c0 1 times vec_construct costs 2 in prologue 0x35e56c0 _25 1 times unaligned_store (misalign -1) costs 1 in body 0x35e56c0 REALPART_EXPR <(*z_8(D))[1]> 1 times vec_to_scalar costs 2 in epilogue 0x35e56c0 REALPART_EXPR <(*z_8(D))[1]> 1 times vec_to_scalar costs 2 in epilogue t.f90:5:30: note: Cost model analysis for part in loop 0: Vector cost: 16 Scalar cost: 7 t.f90:5:30: missed: not vectorized: vectorization is not profitable. so we're not costing all the scalar stmts covered by the .COMPLEX_FMA expression because scalar costing only looks at SLP_TREE_SCALAR_STMTS (it would not cost multiple stmts covering a scalar pattern either). That said, I'm going to fix this simple to deal with ICE now, all the rest needs more thoughts (and I'd like to defer any solution to GCC 12 for the moment).=