-static struct loop *unswitch_loop PARAMS ((struct loops *,
- struct loop *, basic_block));
-static void unswitch_single_loop PARAMS ((struct loops *, struct loop *,
- rtx, int));
-static bool may_unswitch_on_p PARAMS ((struct loops *, basic_block,
- struct loop *, basic_block *));
-static rtx reversed_condition PARAMS ((rtx));
+static struct loop *unswitch_loop (struct loops *, struct loop *,
+ basic_block, rtx, rtx);
+static void unswitch_single_loop (struct loops *, struct loop *, rtx, int);
+static rtx may_unswitch_on (basic_block, struct loop *, rtx *);
+
+/* Prepare a sequence comparing OP0 with OP1 using COMP and jumping to LABEL if
+ true, with probability PROB. If CINSN is not NULL, it is the insn to copy
+ in order to create a jump. */
+
+rtx
+compare_and_jump_seq (rtx op0, rtx op1, enum rtx_code comp, rtx label, int prob,
+ rtx cinsn)
+{
+ rtx seq, jump, cond;
+ enum machine_mode mode;
+
+ mode = GET_MODE (op0);
+ if (mode == VOIDmode)
+ mode = GET_MODE (op1);
+
+ start_sequence ();
+ if (GET_MODE_CLASS (mode) == MODE_CC)
+ {
+ /* A hack -- there seems to be no easy generic way how to make a
+ conditional jump from a ccmode comparison. */
+ if (!cinsn)
+ abort ();
+ cond = XEXP (SET_SRC (pc_set (cinsn)), 0);
+ if (GET_CODE (cond) != comp
+ || !rtx_equal_p (op0, XEXP (cond, 0))
+ || !rtx_equal_p (op1, XEXP (cond, 1)))
+ abort ();
+ emit_jump_insn (copy_insn (PATTERN (cinsn)));
+ jump = get_last_insn ();
+ JUMP_LABEL (jump) = JUMP_LABEL (cinsn);
+ LABEL_NUSES (JUMP_LABEL (jump))++;
+ redirect_jump (jump, label, 0);
+ }
+ else
+ {
+ if (cinsn)
+ abort ();
+
+ op0 = force_operand (op0, NULL_RTX);
+ op1 = force_operand (op1, NULL_RTX);
+ do_compare_rtx_and_jump (op0, op1, comp, 0,
+ mode, NULL_RTX, NULL_RTX, label);
+ jump = get_last_insn ();
+ JUMP_LABEL (jump) = label;
+ LABEL_NUSES (label)++;
+ }
+ REG_NOTES (jump) = gen_rtx_EXPR_LIST (REG_BR_PROB, GEN_INT (prob),
+ REG_NOTES (jump));
+ seq = get_insns ();
+ end_sequence ();
+
+ return seq;
+}