]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
combine.c (try_combine): Use any_condjump_p...
authorJan Hubicka <jh@suse.cz>
Thu, 25 May 2000 21:38:49 +0000 (23:38 +0200)
committerRichard Henderson <rth@gcc.gnu.org>
Thu, 25 May 2000 21:38:49 +0000 (14:38 -0700)
        * combine.c (try_combine): Use any_condjump_p, any_uncondjump_p
        and pc_set at the place of simplejump_p and condjump_p.
        * cse.c (record_jump_equiv): Likewise.
        * emit-rtl.c (emit): Likewise.
        * explow.c (find_next_ref): Likewise.
        * flow.c (tidy_fallthru_edge): Likewise.
        (init_propagate_block_info): Likewise.
        * gcse.c (delete_null_pointer_checks): Likewise.
        * ifcvt.c (cond_exec_get_condition, noce_get_condition,
        dead_or_predicable): Likewise.
        * integrate.c (copy_insn_list): Likewise.
        * loop.c (scan_loop, verify_dominator, find_and_verify_loops,
        for_each_insn_in_loop, check_dbra_loop, get_condition,
        insert_bct, load_mems): Likewise.
        * resource.c (find_dead_or_set_registers): Likewise.
        * sibcalls.c (simplejump_p): Likewise.
        * unroll.c (copy_loop_body, reg_dead_after_loop): Likewise.

From-SVN: r34175

14 files changed:
gcc/ChangeLog
gcc/combine.c
gcc/cse.c
gcc/emit-rtl.c
gcc/explow.c
gcc/flow.c
gcc/gcse.c
gcc/ifcvt.c
gcc/integrate.c
gcc/jump.c
gcc/loop.c
gcc/resource.c
gcc/sibcall.c
gcc/unroll.c

index 8fdf38df4fdfa405dd87a6ddcef776afab117a6e..287cfb8cde2454847f8d4754e3dea3cfdad129cd 100644 (file)
@@ -1,3 +1,23 @@
+2000-05-25  Jan Hubicka  <jh@suse.cz>
+
+       * combine.c (try_combine): Use any_condjump_p, any_uncondjump_p
+       and pc_set at the place of simplejump_p and condjump_p.
+       * cse.c (record_jump_equiv): Likewise.
+       * emit-rtl.c (emit): Likewise.
+       * explow.c (find_next_ref): Likewise.
+       * flow.c (tidy_fallthru_edge): Likewise.
+       (init_propagate_block_info): Likewise.
+       * gcse.c (delete_null_pointer_checks): Likewise.
+       * ifcvt.c (cond_exec_get_condition, noce_get_condition,
+       dead_or_predicable): Likewise.
+       * integrate.c (copy_insn_list): Likewise.
+       * loop.c (scan_loop, verify_dominator, find_and_verify_loops,
+       for_each_insn_in_loop, check_dbra_loop, get_condition,
+       insert_bct, load_mems): Likewise.
+       * resource.c (find_dead_or_set_registers): Likewise.
+       * sibcalls.c (simplejump_p): Likewise.
+       * unroll.c (copy_loop_body, reg_dead_after_loop): Likewise.
+
 2000-05-25  David Edelsohn  <edelsohn@gnu.org>
 
        * rs6000.c (expand_block_move): Add 64-bit PowerPC doubleword move
index a1ead209e9ad578f8ba99960c0a79554263eb917..c9d6a52f294c8a43eca8939ee52f3ee78ab39a90 100644 (file)
@@ -2737,7 +2737,7 @@ try_combine (i3, i2, i1, new_direct_jump_p)
        BARRIER following it since it may have initially been a
        conditional jump.  It may also be the last nonnote insn.  */
     
-    if (GET_CODE (newpat) == RETURN || simplejump_p (i3))
+    if (GET_CODE (newpat) == RETURN || any_uncondjump_p (i3))
       {
        *new_direct_jump_p = 1;
 
index 9f2f007fb76409f127ee37ece69e9a505629d1bb..15210d85e0a8377f86836f67207f4932c114904e 100644 (file)
--- a/gcc/cse.c
+++ b/gcc/cse.c
@@ -4201,26 +4201,28 @@ record_jump_equiv (insn, taken)
 {
   int cond_known_true;
   rtx op0, op1;
+  rtx set;
   enum machine_mode mode, mode0, mode1;
   int reversed_nonequality = 0;
   enum rtx_code code;
 
   /* Ensure this is the right kind of insn.  */
-  if (! condjump_p (insn) || simplejump_p (insn))
+  if (! any_condjump_p (insn))
     return;
+  set = pc_set (insn);
 
   /* See if this jump condition is known true or false.  */
   if (taken)
-    cond_known_true = (XEXP (SET_SRC (PATTERN (insn)), 2) == pc_rtx);
+    cond_known_true = (XEXP (SET_SRC (set), 2) == pc_rtx);
   else
-    cond_known_true = (XEXP (SET_SRC (PATTERN (insn)), 1) == pc_rtx);
+    cond_known_true = (XEXP (SET_SRC (set), 1) == pc_rtx);
 
   /* Get the type of comparison being done and the operands being compared.
      If we had to reverse a non-equality condition, record that fact so we
      know that it isn't valid for floating-point.  */
-  code = GET_CODE (XEXP (SET_SRC (PATTERN (insn)), 0));
-  op0 = fold_rtx (XEXP (XEXP (SET_SRC (PATTERN (insn)), 0), 0), insn);
-  op1 = fold_rtx (XEXP (XEXP (SET_SRC (PATTERN (insn)), 0), 1), insn);
+  code = GET_CODE (XEXP (SET_SRC (set), 0));
+  op0 = fold_rtx (XEXP (XEXP (SET_SRC (set), 0), 0), insn);
+  op1 = fold_rtx (XEXP (XEXP (SET_SRC (set), 0), 1), insn);
 
   code = find_comparison_args (code, &op0, &op1, &mode0, &mode1);
   if (! cond_known_true)
@@ -7033,7 +7035,7 @@ cse_basic_block (from, to, next_branch, around_loop)
         basic block.  If we are jumping to the end of our block, show
         that we can have one usage of TO.  */
 
-      if (simplejump_p (insn))
+      if (any_uncondjump_p (insn))
        {
          if (to == 0)
            {
index 86d85342e1c5ccfc6d775b71804a85b0d96b2c90..a455c1e44fc5efe204eb9d2e4f0c23a63af5a363 100644 (file)
@@ -3457,7 +3457,7 @@ emit (x)
   else if (code == JUMP_INSN)
     {
       register rtx insn = emit_jump_insn (x);
-      if (simplejump_p (insn) || GET_CODE (x) == RETURN)
+      if (any_uncondjump_p (insn) || GET_CODE (x) == RETURN)
        return emit_barrier ();
       return insn;
     }
index 585dafd69ce070bdb81da762887b181b09ce9708..f689b88b9e1330b394b3ca6e1deb583d672d3fbe 100644 (file)
@@ -294,7 +294,7 @@ find_next_ref (reg, insn)
            return insn;
          if (GET_CODE (insn) == JUMP_INSN)
            {
-             if (simplejump_p (insn))
+             if (any_uncondjump_p (insn))
                next = JUMP_LABEL (insn);
              else
                return 0;
index 8c3eb830fe9963f7670bb7ff44c8fcc2e6588259..ec621e555b40a87392154121d34470756b65540b 100644 (file)
@@ -2454,13 +2454,14 @@ tidy_fallthru_edge (e, b, c)
      note.  */
   q = b->end;
   if (GET_CODE (q) == JUMP_INSN
-      && (simplejump_p (q)
+      && onlyjump_p (q)
+      && (any_uncondjump_p (q)
          || (b->succ == e && e->succ_next == NULL)))
     {
 #ifdef HAVE_cc0
       /* If this was a conditional jump, we need to also delete
         the insn that set cc0.  */
-      if (! simplejump_p (q) && condjump_p (q) && sets_cc0_p (PREV_INSN (q)))
+      if (any_condjump_p (q) && sets_cc0_p (PREV_INSN (q)))
        q = PREV_INSN (q);
 #endif
 
@@ -3589,8 +3590,7 @@ init_propagate_block_info (bb, live, local_set, flags)
      from one side of the branch and not the other, record the register
      as conditionally dead.  */
   if (GET_CODE (bb->end) == JUMP_INSN
-      && condjump_p (bb->end)
-      && ! simplejump_p (bb->end))
+      && any_condjump_p (bb->end))
     {
       regset_head diff_head;
       regset diff = INITIALIZE_REG_SET (diff_head);
index 78b9d5910aefaf5cce2ed2455a691d5d8fe34d49..4665133ee60212b34053dcf1488f77bab190b273 100644 (file)
@@ -5101,8 +5101,8 @@ delete_null_pointer_checks (f)
 
       /* We only want conditional branches.  */
       if (GET_CODE (last_insn) != JUMP_INSN
-         || !condjump_p (last_insn)
-         || simplejump_p (last_insn))
+         || !any_condjump_p (last_insn)
+         || !onlyjump_p (last_insn))
        continue;
 
       /* LAST_INSN is a conditional jump.  Get its condition.  */
index 6b43793371555dd9e2ac0abfa7d04287bfb0841b..088efd0943dae893fbcd3fb216e68c3a440dd692 100644 (file)
@@ -247,10 +247,8 @@ cond_exec_get_condition (jump)
 {
   rtx test_if, cond;
 
-  if (condjump_p (jump))
-    test_if = SET_SRC (PATTERN (jump));
-  else if (condjump_in_parallel_p (jump))
-    test_if = SET_SRC (XVECEXP (PATTERN (jump), 0, 0));
+  if (any_condjump_p (jump))
+    test_if = pc_set (jump);
   else
     return NULL_RTX;
   cond = XEXP (test_if, 0);
@@ -1014,14 +1012,17 @@ noce_get_condition (jump, earliest)
      rtx *earliest;
 {
   rtx cond;
+  rtx set;
 
   /* If the condition variable is a register and is MODE_INT, accept it.
      Otherwise, fall back on get_condition.  */
 
-  if (! condjump_p (jump))
+  if (! any_condjump_p (jump))
     return NULL_RTX;
 
-  cond = XEXP (SET_SRC (PATTERN (jump)), 0);
+  set = pc_set (jump);
+
+  cond = XEXP (SET_SRC (set), 0);
   if (GET_CODE (XEXP (cond, 0)) == REG
       && GET_MODE_CLASS (GET_MODE (XEXP (cond, 0))) == MODE_INT)
     {
@@ -1029,8 +1030,8 @@ noce_get_condition (jump, earliest)
 
       /* If this branches to JUMP_LABEL when the condition is false,
         reverse the condition.  */
-      if (GET_CODE (XEXP (SET_SRC (PATTERN (jump)), 2)) == LABEL_REF
-         && XEXP (XEXP (SET_SRC (PATTERN (jump)), 2), 0) == JUMP_LABEL (jump))
+      if (GET_CODE (XEXP (SET_SRC (set), 2)) == LABEL_REF
+         && XEXP (XEXP (SET_SRC (set), 2), 0) == JUMP_LABEL (jump))
        cond = gen_rtx_fmt_ee (reverse_condition (GET_CODE (cond)),
                               GET_MODE (cond), XEXP (cond, 0),
                               XEXP (cond, 1));
@@ -1840,7 +1841,7 @@ dead_or_predicable (test_bb, merge_bb, other_bb, new_dest, reversep)
            break;
        }
 
-      if (! condjump_p (jump))
+      if (! any_condjump_p (jump))
        return FALSE;
 
       /* Find the extent of the conditional.  */
index 8e0f9101c35b31ed4028ef96b05e33173949a07b..53295744ff48bc2b0664788891ca3cd4acdcc3e2 100644 (file)
@@ -1400,7 +1400,7 @@ copy_insn_list (insns, map, static_chain_value)
 
          /* If this used to be a conditional jump insn but whose branch
             direction is now know, we must do something special.  */
-         if (condjump_p (insn) && ! simplejump_p (insn) && map->last_pc_value)
+         if (any_condjump_p (insn) && onlyjump_p (insn) && map->last_pc_value)
            {
 #ifdef HAVE_cc0
              /* If the previous insn set cc0 for us, delete it.  */
index cf4d78d87415a420f32f3313ad56a8d921d8dcdb..a5e878721ecc7746f77c9cb393f1af14784d9f77 100644 (file)
@@ -553,16 +553,16 @@ jump_optimize_1 (f, cross_jump, noop_moves, after_regscan,
                   && GET_CODE (PATTERN (temp)) == TRAP_IF
                   && (this_is_any_uncondjump
                       || (this_is_any_condjump
-                          && temp2 = get_condition (insn, &temp4))))
+                          && (temp2 = get_condition (insn, &temp4)))))
            {
              rtx tc = TRAP_CONDITION (PATTERN (temp));
 
              if (tc == const_true_rtx
-                 || (! this_is_uncondjump && rtx_equal_p (temp2, tc)))
+                 || (! this_is_any_uncondjump && rtx_equal_p (temp2, tc)))
                {
                  rtx new;
                  /* Replace an unconditional jump to a trap with a trap.  */
-                 if (this_is_uncondjump)
+                 if (this_is_any_uncondjump)
                    {
                      emit_barrier_after (emit_insn_before (gen_trap (), insn));
                      delete_jump (insn);
index 6746c98c2b12a68284e7cddcf7ed9c0691e1005b..90abf7e84344103131eed5aa9e5d1992534e91c2 100644 (file)
@@ -668,7 +668,7 @@ scan_loop (loop, flags)
       loop_entry_jump = p;
 
       /* Loop entry must be unconditional jump (and not a RETURN)  */
-      if (simplejump_p (p)
+      if (any_uncondjump_p (p)
          && JUMP_LABEL (p) != 0
          /* Check to see whether the jump actually
             jumps out of the loop (meaning it's no loop).
@@ -1074,7 +1074,7 @@ scan_loop (loop, flags)
                  followed a by barrier then loop end.  */
                && ! (GET_CODE (p) == JUMP_INSN && JUMP_LABEL (p) == loop->top
                     && NEXT_INSN (NEXT_INSN (p)) == loop_end
-                    && simplejump_p (p)))
+                    && any_uncondjump_p (p)))
        maybe_never = 1;
       else if (GET_CODE (p) == NOTE)
        {
@@ -2569,8 +2569,7 @@ verify_dominator (loop)
             which we do not have jump target information in the JUMP_LABEL
             field (consider ADDR_VEC and ADDR_DIFF_VEC insns), then clear
             LOOP->CONT_DOMINATOR.  */
-         if ((! condjump_p (insn)
-              && ! condjump_in_parallel_p (insn))
+         if (! any_condjump_p (insn)
              || label == NULL_RTX)
            {
              loop->cont_dominator = NULL_RTX;
@@ -2666,7 +2665,7 @@ find_and_verify_loops (f, loops)
        {
          rtx label = JUMP_LABEL (insn);
 
-         if (! condjump_p (insn) && ! condjump_in_parallel_p (insn))
+         if (! any_condjump_p (insn))
            label = NULL_RTX;
 
          loop = current_loop;
@@ -2760,7 +2759,8 @@ find_and_verify_loops (f, loops)
        /* See if this is an unconditional branch outside the loop.  */
        if (this_loop
            && (GET_CODE (PATTERN (insn)) == RETURN
-               || (simplejump_p (insn)
+               || (any_uncondjump_p (insn)
+                   && onlyjump_p (insn)
                    && (uid_loop[INSN_UID (JUMP_LABEL (insn))]
                        != this_loop)))
            && get_max_uid () < max_uid_for_loop)
@@ -2817,8 +2817,7 @@ find_and_verify_loops (f, loops)
                /* Just ignore jumps to labels that were never emitted.
                   These always indicate compilation errors.  */
                && INSN_UID (JUMP_LABEL (p)) != 0
-               && condjump_p (p)
-               && ! simplejump_p (p)
+               && any_condjump_p (p) && onlyjump_p (p)
                && next_real_insn (JUMP_LABEL (p)) == our_next
                /* If it's not safe to move the sequence, then we
                   mustn't try.  */
@@ -3757,7 +3756,7 @@ for_each_insn_in_loop (loop, fncall)
 
              if (GET_CODE (insn) == JUMP_INSN
                  && GET_CODE (PATTERN (insn)) != RETURN
-                 && (!condjump_p (insn)
+                 && (!any_condjump_p (insn)
                      || (JUMP_LABEL (insn) != 0
                          && JUMP_LABEL (insn) != loop->scan_start
                          && !loop_insn_first_p (p, JUMP_LABEL (insn)))))
@@ -3778,8 +3777,9 @@ for_each_insn_in_loop (loop, fncall)
          This can be any kind of jump, since we want to know if insns
          will be executed if the loop is executed.  */
          && !(JUMP_LABEL (p) == loop->top
-            && ((NEXT_INSN (NEXT_INSN (p)) == loop->end && simplejump_p (p))
-                || (NEXT_INSN (p) == loop->end && condjump_p (p)))))
+            && ((NEXT_INSN (NEXT_INSN (p)) == loop->end
+                 && any_uncondjump_p (p))
+                || (NEXT_INSN (p) == loop->end && any_condjump_p (p)))))
        {
          rtx label = 0;
 
@@ -7782,6 +7782,8 @@ check_dbra_loop (loop, insn_count)
   comparison = get_condition_for_loop (loop, jump);
   if (comparison == 0)
     return 0;
+  if (!onlyjump_p (jump))
+    return 0;
 
   /* Try to compute whether the compare/branch at the loop end is one or
      two instructions.  */
@@ -9189,19 +9191,21 @@ get_condition (jump, earliest)
 {
   rtx cond;
   int reverse;
+  rtx set;
 
   /* If this is not a standard conditional jump, we can't parse it.  */
   if (GET_CODE (jump) != JUMP_INSN
-      || ! condjump_p (jump) || simplejump_p (jump))
+      || ! any_condjump_p (jump))
     return 0;
+  set = pc_set (jump);
 
-  cond = XEXP (SET_SRC (PATTERN (jump)), 0);
+  cond = XEXP (SET_SRC (set), 0);
 
   /* If this branches to JUMP_LABEL when the condition is false, reverse
      the condition.  */
   reverse
-    = GET_CODE (XEXP (SET_SRC (PATTERN (jump)), 2)) == LABEL_REF
-      && XEXP (XEXP (SET_SRC (PATTERN (jump)), 2), 0) == JUMP_LABEL (jump);
+    = GET_CODE (XEXP (SET_SRC (set), 2)) == LABEL_REF
+      && XEXP (XEXP (SET_SRC (set), 2), 0) == JUMP_LABEL (jump);
 
   return canonicalize_condition (jump, cond, reverse, earliest, NULL_RTX);
 }
@@ -9276,8 +9280,8 @@ insert_bct (loop)
 
   /* Make sure that the last loop insn is a conditional jump.  */
   if (GET_CODE (PREV_INSN (loop_end)) != JUMP_INSN
-      || ! condjump_p (PREV_INSN (loop_end))
-      || simplejump_p (PREV_INSN (loop_end)))
+      || ! onlyjump_p (PREV_INSN (loop_end))
+      || ! any_condjump_p (PREV_INSN (loop_end)))
     {
       if (loop_dump_stream)
        fprintf (loop_dump_stream,
@@ -9712,9 +9716,9 @@ load_mems (loop)
               && ! (GET_CODE (p) == JUMP_INSN 
                     && JUMP_LABEL (p) == loop->top
                     && NEXT_INSN (NEXT_INSN (p)) == loop->end
-                    && simplejump_p (p)))
+                    && any_uncondjump_p (p)))
        {
-         if (!condjump_p (p))
+         if (!any_condjump_p (p))
            /* Something complicated.  */
            maybe_never = 1;
          else
index 61b8b0ca48aa02997e10ef48c5066533c09532f9..23f5e0e4ead50ca05a17552a8ebca21e3127d0c5 100644 (file)
@@ -472,7 +472,7 @@ find_dead_or_set_registers (target, res, jump_target, jump_count, set, needed)
        {
          if (jump_count++ < 10)
            {
-             if (simplejump_p (this_jump_insn)
+             if (any_uncondjump_p (this_jump_insn)
                  || GET_CODE (PATTERN (this_jump_insn)) == RETURN)
                {
                  next = JUMP_LABEL (this_jump_insn);
@@ -483,8 +483,7 @@ find_dead_or_set_registers (target, res, jump_target, jump_count, set, needed)
                        *jump_target = JUMP_LABEL (this_jump_insn);
                    }
                }
-             else if (condjump_p (this_jump_insn)
-                      || condjump_in_parallel_p (this_jump_insn))
+             else if (any_condjump_p (this_jump_insn))
                {
                  struct resources target_set, target_res;
                  struct resources fallthrough_res;
index 34cf5a93348ee67a50fa15e6f3ed47ac0fc6dd38..8387bf5d79b5292dc34f6506872806bf41843ee1 100644 (file)
@@ -229,7 +229,7 @@ skip_jump_insn (orig_insn)
 
   if (insn
       && GET_CODE (insn) == JUMP_INSN
-      && simplejump_p (insn))
+      && any_uncondjump_p (insn))
     return insn;
 
   return orig_insn;
index b33fb65e2b49f72e8b563cf6efd63c176f46f5d7..f8dfc034b5a497973281e4f86174ee5bf0616023 100644 (file)
@@ -2124,7 +2124,7 @@ copy_loop_body (copy_start, copy_end, map, exit_label, last_iteration,
 
          /* If this used to be a conditional jump insn but whose branch
             direction is now known, we must do something special.  */
-         if (condjump_p (insn) && !simplejump_p (insn) && map->last_pc_value)
+         if (any_condjump_p (insn) && onlyjump_p (insn) && map->last_pc_value)
            {
 #ifdef HAVE_cc0
              /* If the previous insn set cc0 for us, delete it.  */
@@ -3281,7 +3281,7 @@ reg_dead_after_loop (loop, reg)
            {
              if (GET_CODE (PATTERN (insn)) == RETURN)
                break;
-             else if (! simplejump_p (insn)
+             else if (!any_uncondjump_p (insn)
                       /* Prevent infinite loop following infinite loops.  */
                       || jump_count++ > 20)
                return 0;