From 45d09c02e544c4074aa4a69925c1fe547a0dd7a0 Mon Sep 17 00:00:00 2001 From: Richard Sandiford Date: Tue, 27 Jul 2004 07:27:12 +0000 Subject: expr.h (canonicalize_condition, [...]): Add an int argument. * expr.h (canonicalize_condition, get_condition): Add an int argument. * gcse.c (fis_get_condition): Reimplement using get_condition, leaving it to check whether the condition is still valid at the jump insn. * ifcvt.c (noce_get_condition): Likewise. (noce_get_alt_condition): Update call to canonicalize_condition. * loop-iv.c (simplify_using_initial_values): Update call to get_condition. Remove FIXME. (check_simple_exit): Update call to get_condition. * loop-unswitch.c (may_unswitch_on): Likewise. * loop.c (check_dbra_loop): Likewise. (canonicalize_condition, get_condition): Add an argument to say whether the condition must still be valid at INSN. (get_condition_for_loop): Update call to get_condition. Require that the condition be valid at INSN. * predict.c (estimate_probability): Update call to get_condition. Remove unused earliest parameter. (expected_value_to_br_prob): Update call to canonicalize_condition. From-SVN: r85218 --- gcc/ifcvt.c | 38 ++++---------------------------------- 1 file changed, 4 insertions(+), 34 deletions(-) (limited to 'gcc/ifcvt.c') diff --git a/gcc/ifcvt.c b/gcc/ifcvt.c index ac478af..96833a5 100644 --- a/gcc/ifcvt.c +++ b/gcc/ifcvt.c @@ -1489,7 +1489,7 @@ noce_get_alt_condition (struct noce_if_info *if_info, rtx target, } cond = canonicalize_condition (if_info->jump, cond, reverse, - earliest, target, false); + earliest, target, false, true); if (! cond || ! reg_mentioned_p (target, cond)) return NULL; @@ -1800,7 +1800,7 @@ noce_try_sign_mask (struct noce_if_info *if_info) static rtx noce_get_condition (rtx jump, rtx *earliest) { - rtx cond, set, tmp, insn; + rtx cond, set, tmp; bool reverse; if (! any_condjump_p (jump)) @@ -1829,38 +1829,8 @@ noce_get_condition (rtx jump, rtx *earliest) /* Otherwise, fall back on canonicalize_condition to do the dirty work of manipulating MODE_CC values and COMPARE rtx codes. */ - - tmp = canonicalize_condition (jump, cond, reverse, earliest, NULL_RTX, - false); - if (!tmp) - return NULL_RTX; - - /* We are going to insert code before JUMP, not before EARLIEST. - We must therefore be certain that the given condition is valid - at JUMP by virtue of not having been modified since. */ - for (insn = *earliest; insn != jump; insn = NEXT_INSN (insn)) - if (INSN_P (insn) && modified_in_p (tmp, insn)) - break; - if (insn == jump) - return tmp; - - /* The condition was modified. See if we can get a partial result - that doesn't follow all the reversals. Perhaps combine can fold - them together later. */ - tmp = XEXP (tmp, 0); - if (!REG_P (tmp) || GET_MODE_CLASS (GET_MODE (tmp)) != MODE_INT) - return NULL_RTX; - tmp = canonicalize_condition (jump, cond, reverse, earliest, tmp, - false); - if (!tmp) - return NULL_RTX; - - /* For sanity's sake, re-validate the new result. */ - for (insn = *earliest; insn != jump; insn = NEXT_INSN (insn)) - if (INSN_P (insn) && modified_in_p (tmp, insn)) - return NULL_RTX; - - return tmp; + return canonicalize_condition (jump, cond, reverse, earliest, + NULL_RTX, false, true); } /* Return true if OP is ok for if-then-else processing. */ -- cgit v1.1