This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH GCC]Allow cfgcleanup to remove forwarder loop preheaders and latches
- From: Hans-Peter Nilsson <hp at bitrange dot com>
- To: "bin.cheng" <bin dot cheng at arm dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Thu, 27 Feb 2014 20:34:52 -0500 (EST)
- Subject: Re: [PATCH GCC]Allow cfgcleanup to remove forwarder loop preheaders and latches
- Authentication-results: sourceware.org; auth=none
- References: <001901cf31e8$2218ad50$664a07f0$ at arm dot com>
On Tue, 25 Feb 2014, bin.cheng wrote:
> Hi,
> This patch is to fix regression reported in PR60280 by removing forward loop
> headers/latches in cfg cleanup if possible. Several tests are broken by
> this change since cfg cleanup is shared by all optimizers. Some tests has
> already been fixed by recent patches, I went through and fixed the others.
> One case needs to be clarified is "gcc.dg/tree-prof/update-loopch.c". When
> GCC removing a basic block, it checks profile information by calling
> check_bb_profile after redirecting incoming edges of the bb. This certainly
> results in warnings about invalid profile information and causes the case to
> fail. I will send a patch to skip checking profile information for a
> removing basic block in stage 1 if it sounds reasonable. For now I just
> twisted the case itself.
>
> Bootstrap and tested on x86_64 and arm_a15.
>
> Is it OK?
>
>
> 2014-02-25 Bin Cheng <bin.cheng@arm.com>
>
> PR target/60280
> * tree-cfgcleanup.c (tree_forwarder_block_p): Protect loop
> preheaders and latches only if requested. Fix latch if it
> is removed.
> * tree-ssa-dom.c (tree_ssa_dominator_optimize): Set
> LOOPS_HAVE_PREHEADERS.
>
> gcc/testsuite/ChangeLog
> 2014-02-25 Bin Cheng <bin.cheng@arm.com>
>
> PR target/60280
> * gnat.dg/renaming5.adb: Change to two expected gotos.
> * gcc.dg/tree-ssa/pr21559.c: Change back to three expected
> jump threads.
> * gcc.dg/tree-prof/update-loopch.c: Check two "Invalid sum"
> messages for removed basic block.
> * gcc.dg/tree-ssa/ivopt_1.c: Fix unreliable scanning string.
> * gcc.dg/tree-ssa/ivopt_2.c: Ditto.
> * gcc.dg/tree-ssa/ivopt_3.c: Ditto.
> * gcc.dg/tree-ssa/ivopt_4.c: Ditto.
Do you need to also update gcc.dg/tree-ssa/ssa-dom-thread-4.c,
at least for logical_op_short_circuit targets?
(There's a nice analysis comment there by Richard S which may
also have to be updated.)
This caused a regression for logical_op_short_circuit targets, I
entered PR60363 for convenience.
brgds, H-P