From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 5EF413857827; Wed, 19 Jan 2022 08:22:02 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5EF413857827 From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/102756] [12 Regression] Complete unrolling is too senative to PRE; c-c++-common/torture/vector-compare-2.c Date: Wed, 19 Jan 2022 08:22:02 +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: 12.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: 12.0 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc 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: Wed, 19 Jan 2022 08:22:02 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D102756 Richard Biener changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |rsandifo at gcc dot gnu.org --- Comment #6 from Richard Biener --- Btw, the same happens on x86-64. With -O2 and vectorization we end up with [local count: 858993457]: # ivtmp.14_11 =3D PHI _14 =3D (void *) ivtmp.14_11; _1 =3D MEM [(vector(4) int *)_14]; if (_1 !=3D -3) goto ; [0.00%] else goto ; [100.00%] [count: 0]: __builtin_abort (); [local count: 858993457]: ivtmp.14_12 =3D ivtmp.14_11 + 4; if (ivtmp.14_12 !=3D _16) goto ; [80.00%] else goto ; [20.00%] [local count: 214748368]: r =3D{v} {CLOBBER}; while everything is optimized away with -O2 -fno-tree-vectorize. Let's keep this open as a regression since -O2 now enables vectorization. = In principle we could preserve the previous behavior for the very-cheap vectorizer cost model or adjust the heuristic for that case to only cover loops with a single BB. The real issue here is of course the unroller not considering the true size after simplification.=