diff mbox

[ifcvt] Add a new parameter to limit if-conversion

Message ID CAEoMCqTh6ebYgsqkD0QvGAy6e3Et10mdVPg1GRMF=prtyAu=Bg@mail.gmail.com
State New
Headers show

Commit Message

Yuri Rumyantsev Jan. 13, 2016, 1:11 p.m. UTC
Hi Bernd,

Here is updated patch as your proposed to avoid regression on ia64.
Bootstarp and regression testing on x86_64 did not show any new failures.

Is it OK for trunk?

Thanks.


ChangeLog:
2016-01-13  Yuri Rumyantsev  <ysrumyan@gmail.com>

PR rtl-optimization/68920
* ifcvt.c (cond_move_process_if_block): Limit number of conditional
moves.


2016-01-13 4:52 GMT+03:00 Bernd Schmidt <bschmidt@redhat.com>:
> On 01/12/2016 04:41 PM, Yuri Rumyantsev wrote:
>>
>> Here is a simple fix to exclude dg/ifcvt-5.c test from ia64 testing.
>>
>> Is it OK for trunk?
>
>
> Please ensure patches are attached as plain text so that reviewers don't
> have to save them to be able to read them.
>
> It looks like ia64 is making chanes in cond_move_process_if_block. Maybe
> that function needs to take the param into account so we don't have to keep
> adding excluded targets to the testcase?
>
>
> Bernd
>

Comments

Bernd Schmidt Jan. 13, 2016, 4:33 p.m. UTC | #1
>
> PR rtl-optimization/68920
> * ifcvt.c (cond_move_process_if_block): Limit number of conditional
> moves.

Ok. This should probably be consolidated a bit post 6.0.


Bernd
diff mbox

Patch

diff --git a/gcc/ifcvt.c b/gcc/ifcvt.c
index 189d60f..ef6fa69 100644
--- a/gcc/ifcvt.c
+++ b/gcc/ifcvt.c
@@ -3730,6 +3730,7 @@  cond_move_process_if_block (struct noce_if_info *if_info)
   vec<rtx> else_regs = vNULL;
   unsigned int i;
   int success_p = FALSE;
+  int limit = PARAM_VALUE (PARAM_MAX_RTL_IF_CONVERSION_INSNS);

   /* Build a mapping for each block to the value used for each
      register.  */
@@ -3779,7 +3780,8 @@  cond_move_process_if_block (struct noce_if_info *if_info)
      is the number of assignments currently made in only one of the
      branches, since if we convert we are going to always execute
      them.  */
-  if (c > MAX_CONDITIONAL_EXECUTE)
+  if (c > MAX_CONDITIONAL_EXECUTE
+      || c > limit)
     goto done;

   /* Try to emit the conditional moves.  First do the then block,