diff mbox

Ensure noce_convert_multiple_sets handles only multiple sets (PR rtl-optimization/69570)

Message ID 20160201202638.GM3017@tucnak.redhat.com
State New
Headers show

Commit Message

Jakub Jelinek Feb. 1, 2016, 8:26 p.m. UTC
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.



	Jakub

Comments

Richard Biener Feb. 1, 2016, 8:33 p.m. UTC | #1
On February 1, 2016 9:26:38 PM GMT+01:00, Jakub Jelinek <jakub@redhat.com> wrote:
>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?

OK.

Richard.

>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
diff mbox

Patch

--- 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;
 }