This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Ensure noce_convert_multiple_sets handles only multiple sets (PR rtl-optimization/69570)
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Steven Bosscher <stevenb dot gcc at gmail dot com>
- Cc: Richard Biener <rguenther at suse dot de>, Jeff Law <law at redhat dot com>, Bernd Schmidt <bschmidt at redhat dot com>, GCC Patches <gcc-patches at gcc dot gnu dot org>, James Greenhalgh <james dot greenhalgh at arm dot com>
- Date: Mon, 1 Feb 2016 21:26:38 +0100
- Subject: Re: [PATCH] Ensure noce_convert_multiple_sets handles only multiple sets (PR rtl-optimization/69570)
- Authentication-results: sourceware.org; auth=none
- References: <20160201083207 dot GB3017 at tucnak dot redhat dot com> <CABu31nN8AnvkMwsEWu=Ge=97GnPRRfYsyjZK-56QLQOAX5jo3Q at mail dot gmail dot com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Mon, Feb 01, 2016 at 09:39:19AM +0100, Steven Bosscher wrote:
> Browny points for opting out of the loop over all insns in the basic
> block when count > limit.
Like this?
Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk?
2016-02-01 Jakub Jelinek <jakub@redhat.com>
* ifcvt.c (bb_ok_for_noce_convert_multiple_sets): Return false
when count is incremented above limit, don't analyze further
insns afterwards.
--- gcc/ifcvt.c.jj 2016-02-01 09:46:00.000000000 +0100
+++ gcc/ifcvt.c 2016-02-01 12:33:28.932281244 +0100
@@ -3286,15 +3286,13 @@ bb_ok_for_noce_convert_multiple_sets (ba
if (!can_conditionally_move_p (GET_MODE (dest)))
return false;
- ++count;
+ /* FORNOW: Our cost model is a count of the number of instructions we
+ would if-convert. This is suboptimal, and should be improved as part
+ of a wider rework of branch_cost. */
+ if (++count > limit)
+ return false;
}
- /* FORNOW: Our cost model is a count of the number of instructions we
- would if-convert. This is suboptimal, and should be improved as part
- of a wider rework of branch_cost. */
- if (count > limit)
- return false;
-
return count > 1;
}
Jakub