+2004-07-06 Roger Sayle <roger@eyesopen.com>
+
+ * ifcvt.c (struct noce_if_info): Add a Boolean b_unconditional field.
+ (noce_try_sign_mask): Tweak rtx_cost check if t is evaluated anyway.
+ (noce_process_if_block): Initialize if_info.b_unconditional if insn_b
+ is currently executed unconditionally, i.e. not in "else_bb".
+
2004-07-06 Steven Bosscher <stevenb@suse.de>
* config/alpha/alpha.c (alpha_use_dfa_pipeline_interface): Remove.
rtx insn_a, insn_b;
rtx x, a, b;
rtx jump, cond, cond_earliest;
+ /* True if "b" was originally evaluated unconditionally. */
+ bool b_unconditional;
};
static rtx noce_emit_store_flag (struct noce_if_info *, rtx, int, int);
if (GET_MODE (m) != mode)
return FALSE;
- /* This is only profitable if T is cheap. */
- if (rtx_cost (t, SET) >= COSTS_N_INSNS (2))
+ /* This is only profitable if T is cheap, or T is unconditionally
+ executed/evaluated in the original insn sequence. */
+ if (rtx_cost (t, SET) >= COSTS_N_INSNS (2)
+ && (!if_info->b_unconditional
+ || t != if_info->b))
return FALSE;
start_sequence ();
if_info.x = x;
if_info.a = a;
if_info.b = b;
+ if_info.b_unconditional = else_bb == 0;
/* Try optimizations in some approximation of a useful order. */
/* ??? Should first look to see if X is live incoming at all. If it