> 2013-03-25  Bin Cheng  <bin.ch...@arm.com>
> 
>       * ifcvt.c (ifcvt_after_combine): New static variable.
>       (cheap_bb_rtx_cost_p): Set scale to REG_BR_PROB_BASE when optimizing
>       for size.
>       (rest_of_handle_if_conversion, rest_of_handle_if_after_combine):
>       Clear/set the variable ifcvt_after_combine.

The idea looks sensible.  Some remarks:
 - add an after_combine parameter to if_convert and set the global from within 
this function instead of the pass functions (True, not TRUE, in the comment).
 - explain in the comment why you use optimize_function_for_speed_p instead of 
the 'speed' variable defined just above in cheap_bb_rtx_cost_p,
 - set the 'scale' variable only once in cheap_bb_rtx_cost_p (otherwise this 
is gratuitously confusing) and explain in the comment the reasoning for 
choosing REG_BR_PROB_BASE in the !speed case (I presume it's to void the 
identical scaling applied to the insns of the block).

-- 
Eric Botcazou

Reply via email to