diff options
author | Roger Sayle <roger@eyesopen.com> | 2004-07-06 21:50:47 +0000 |
---|---|---|
committer | Roger Sayle <sayle@gcc.gnu.org> | 2004-07-06 21:50:47 +0000 |
commit | 7b5effb49fd02c0a7bc9d05bb9c61eb644f8acec (patch) | |
tree | 002fe8f401ebeb12dbd0037128fbc763942657be /gcc | |
parent | 97b62d4781edb561dfc43fd79583026f11118982 (diff) | |
download | gcc-7b5effb49fd02c0a7bc9d05bb9c61eb644f8acec.zip gcc-7b5effb49fd02c0a7bc9d05bb9c61eb644f8acec.tar.gz gcc-7b5effb49fd02c0a7bc9d05bb9c61eb644f8acec.tar.bz2 |
ifcvt.c (struct noce_if_info): Add a Boolean b_unconditional field.
* 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".
From-SVN: r84172
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/ifcvt.c | 10 |
2 files changed, 15 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 9985804..eb2dc4e 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +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. diff --git a/gcc/ifcvt.c b/gcc/ifcvt.c index 0be6472..03efaba 100644 --- a/gcc/ifcvt.c +++ b/gcc/ifcvt.c @@ -579,6 +579,8 @@ struct noce_if_info 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); @@ -1730,8 +1732,11 @@ noce_try_sign_mask (struct noce_if_info *if_info) 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 (); @@ -1983,6 +1988,7 @@ noce_process_if_block (struct ce_if_block * ce_info) 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 |