From: Richard Earnshaw Date: Sun, 29 Aug 2004 21:07:37 +0000 (+0000) Subject: sched-deps.c (get_condition): Rewrite using jump support functions. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=6903ecd4918625b0d1117747d1500079f4fb9a12;p=gcc.git sched-deps.c (get_condition): Rewrite using jump support functions. * sched-deps.c (get_condition): Rewrite using jump support functions. Use reversed_comparison_code. (conditions_mutex_p): Use reversed_comparison_code. From-SVN: r86736 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index aeb65caaf98..7f0869775bc 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2004-08-29 Richard Earnshaw + + * sched-deps.c (get_condition): Rewrite using jump support functions. + Use reversed_comparison_code. + (conditions_mutex_p): Use reversed_comparison_code. + 2004-08-29 Richard Sandiford * config/mips/mips.c (override_options): Disable hot/cold partitioning diff --git a/gcc/sched-deps.c b/gcc/sched-deps.c index 7b8496c8c8e..18f3d39a9c0 100644 --- a/gcc/sched-deps.c +++ b/gcc/sched-deps.c @@ -145,23 +145,25 @@ get_condition (rtx insn) if (pat == 0) return 0; + if (GET_CODE (pat) == COND_EXEC) return COND_EXEC_TEST (pat); - if (!JUMP_P (insn)) - return 0; - if (GET_CODE (pat) != SET || SET_SRC (pat) != pc_rtx) - return 0; - if (GET_CODE (SET_DEST (pat)) != IF_THEN_ELSE) + + if (!any_condjump_p (insn) || !onlyjump_p (insn)) return 0; - pat = SET_DEST (pat); - cond = XEXP (pat, 0); - if (GET_CODE (XEXP (cond, 1)) == LABEL_REF - && XEXP (cond, 2) == pc_rtx) + + cond = XEXP (SET_SRC (pc_set (insn)), 0); + if (XEXP (cond, 2) == pc_rtx) return cond; - else if (GET_CODE (XEXP (cond, 2)) == LABEL_REF - && XEXP (cond, 1) == pc_rtx) - return gen_rtx_fmt_ee (reverse_condition (GET_CODE (cond)), GET_MODE (cond), - XEXP (cond, 0), XEXP (cond, 1)); + else if (XEXP (cond, 1) == pc_rtx) + { + enum rtx_code revcode = reversed_comparison_code (cond, insn); + + if (revcode == UNKNOWN) + return 0; + return gen_rtx_fmt_ee (revcode, GET_MODE (cond), XEXP (cond, 0), + XEXP (cond, 1)); + } else return 0; } @@ -173,7 +175,7 @@ conditions_mutex_p (rtx cond1, rtx cond2) { if (COMPARISON_P (cond1) && COMPARISON_P (cond2) - && GET_CODE (cond1) == reverse_condition (GET_CODE (cond2)) + && GET_CODE (cond1) == reversed_comparison_code (cond2, NULL) && XEXP (cond1, 0) == XEXP (cond2, 0) && XEXP (cond1, 1) == XEXP (cond2, 1)) return 1;