From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 95BD03858416; Tue, 24 Aug 2021 12:27:30 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 95BD03858416 From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/100089] [11/12 Regression] 30% performance regression for denbench/mp2decoddata2 with -O3 Date: Tue, 24 Aug 2021 12:27:30 +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: 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: 11.3 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, 24 Aug 2021 12:27:30 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D100089 --- Comment #11 from Richard Biener --- So this fixes it for -fvect-cost-model=3Dvery-cheap. One could argue that = we should enable the code for all cost models, fixing the -O3 regression (and backportable to the branch). I'll see to experiment with "fancy" costing of the stray vectorizations. I= 'll also note that the scanning for load/store (and other ifns not supported) could be handled in the costing as well (but the costing would need to run also for -fno-vect-cost-model then, just the result ignored if not forced). I'm talking about bool require_loop_vectorize =3D false; for (gimple_stmt_iterator gsi =3D gsi_start_bb (bb); !gsi_end_p (gsi); gsi_next (&gsi)) { gimple *stmt =3D gsi_stmt (gsi); gcall *call =3D dyn_cast (stmt); if (call && gimple_call_internal_p (call)) { internal_fn ifn =3D gimple_call_internal_fn (call); if (ifn =3D=3D IFN_MASK_LOAD || ifn =3D=3D IFN_MASK_STORE /* Don't keep the if-converted parts when the ifn with specifc type is not supported by the backend. */ || (direct_internal_fn_p (ifn) && !direct_internal_fn_supported_p (call, OPTIMIZE_FOR_SPEED))) { require_loop_vectorize =3D true; break; } }=