diff options
author | Jan Hubicka <jh@suse.cz> | 2000-05-25 23:38:49 +0200 |
---|---|---|
committer | Richard Henderson <rth@gcc.gnu.org> | 2000-05-25 14:38:49 -0700 |
commit | 7f1c097d36682769f1f3f8fd72c7845d545104ed (patch) | |
tree | d95b18f4384b97d8d27889e062c1e3644fa14f68 | |
parent | acad7ed35f094e0456334422554ef2558851367c (diff) | |
download | gcc-7f1c097d36682769f1f3f8fd72c7845d545104ed.zip gcc-7f1c097d36682769f1f3f8fd72c7845d545104ed.tar.gz gcc-7f1c097d36682769f1f3f8fd72c7845d545104ed.tar.bz2 |
combine.c (try_combine): Use any_condjump_p...
* 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
-rw-r--r-- | gcc/ChangeLog | 20 | ||||
-rw-r--r-- | gcc/combine.c | 2 | ||||
-rw-r--r-- | gcc/cse.c | 16 | ||||
-rw-r--r-- | gcc/emit-rtl.c | 2 | ||||
-rw-r--r-- | gcc/explow.c | 2 | ||||
-rw-r--r-- | gcc/flow.c | 8 | ||||
-rw-r--r-- | gcc/gcse.c | 4 | ||||
-rw-r--r-- | gcc/ifcvt.c | 19 | ||||
-rw-r--r-- | gcc/integrate.c | 2 | ||||
-rw-r--r-- | gcc/jump.c | 6 | ||||
-rw-r--r-- | gcc/loop.c | 42 | ||||
-rw-r--r-- | gcc/resource.c | 5 | ||||
-rw-r--r-- | gcc/sibcall.c | 2 | ||||
-rw-r--r-- | gcc/unroll.c | 4 |
14 files changed, 80 insertions, 54 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 8fdf38d..287cfb8 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -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 diff --git a/gcc/combine.c b/gcc/combine.c index a1ead20..c9d6a52 100644 --- a/gcc/combine.c +++ b/gcc/combine.c @@ -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; @@ -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) { diff --git a/gcc/emit-rtl.c b/gcc/emit-rtl.c index 86d8534..a455c1e 100644 --- a/gcc/emit-rtl.c +++ b/gcc/emit-rtl.c @@ -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; } diff --git a/gcc/explow.c b/gcc/explow.c index 585dafd..f689b88 100644 --- a/gcc/explow.c +++ b/gcc/explow.c @@ -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; @@ -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); @@ -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. */ diff --git a/gcc/ifcvt.c b/gcc/ifcvt.c index 6b43793..088efd0 100644 --- a/gcc/ifcvt.c +++ b/gcc/ifcvt.c @@ -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. */ diff --git a/gcc/integrate.c b/gcc/integrate.c index 8e0f910..5329574 100644 --- a/gcc/integrate.c +++ b/gcc/integrate.c @@ -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. */ @@ -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); @@ -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 diff --git a/gcc/resource.c b/gcc/resource.c index 61b8b0c..23f5e0e 100644 --- a/gcc/resource.c +++ b/gcc/resource.c @@ -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; diff --git a/gcc/sibcall.c b/gcc/sibcall.c index 34cf5a9..8387bf5 100644 --- a/gcc/sibcall.c +++ b/gcc/sibcall.c @@ -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; diff --git a/gcc/unroll.c b/gcc/unroll.c index b33fb65..f8dfc03 100644 --- a/gcc/unroll.c +++ b/gcc/unroll.c @@ -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; |