From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id E8F593858410; Wed, 10 Nov 2021 22:13:50 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E8F593858410 From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/102906] [12 regression] gcc.target/arm/ivopts-4.c fails since r12-4526 Date: Wed, 10 Nov 2021 22:13:50 +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: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P1 X-Bugzilla-Assigned-To: aldyh at gcc dot gnu.org X-Bugzilla-Target-Milestone: 12.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: Wed, 10 Nov 2021 22:13:51 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D102906 --- Comment #20 from CVS Commits --- The master branch has been updated by Aldy Hernandez : https://gcc.gnu.org/g:e82c382971664d6fd138cc36020db4b1a91885c6 commit r12-5138-ge82c382971664d6fd138cc36020db4b1a91885c6 Author: Aldy Hernandez Date: Wed Nov 10 13:21:59 2021 +0100 Allow loop header copying when first iteration condition is known. As discussed in the PR, the loop header copying pass avoids doing so when optimizing for size. However, sometimes we can determine the loop entry conditional statically for the first iteration of the loop. This patch uses the path solver to determine the outgoing edge out of preheader->header->xx. If so, it allows header copying. Doing this in the loop optimizer saves us from doing gymnastics in the threader which doesn't have the context to determine if a loop transformation is profitable. I am only returning true in entry_loop_condition_is_static for a true conditional. Technically a false conditional is also provably static, but allowing any boolean value causes a regression in gfortran.dg/vector_subscript_1.f90. I would have preferred not passing around the query object, but the layout of pass_ch and should_duplicate_loop_header_p make it a bit awkward to get it right without an outright refactor to the pass. Tested on x86-64 Linux. gcc/ChangeLog: PR tree-optimization/102906 * tree-ssa-loop-ch.c (entry_loop_condition_is_static): New. (should_duplicate_loop_header_p): Call entry_loop_condition_is_static. (class ch_base): Add m_ranger and m_query. (ch_base::copy_headers): Pass m_query to entry_loop_condition_is_static. (pass_ch::execute): Allocate and deallocate m_ranger and m_query. (pass_ch_vect::execute): Same. gcc/testsuite/ChangeLog: * gcc.dg/tree-ssa/pr102906.c: New test.=