* cfgcleanup.c (try_crossjump_to_edge): Remove useless declaration. Remove argument MODE. All callers changed. (try_crossjump_bb): Likewise. (outgoing_edges_match): Likewise. (flow_find_cross_jump): Likewise. (old_insns_match_p): Likewise. Remove unused STACK_REGS block. * basic-block.h (CLEANUP_POST_REGSTACK): Remove. (CLEANUP_THREADING, CLEANUP_NO_INSN_DEL, CLEANUP_CFGLAYOUT): Renumber. Index: cfgcleanup.c =================================================================== --- cfgcleanup.c (revision 158134) +++ cfgcleanup.c (working copy) @@ -65,12 +65,6 @@ static bool first_pass; /* Set to true if crossjumps occured in the latest run of try_optimize_cfg. */ static bool crossjumps_occured; -static bool try_crossjump_to_edge (int, edge, edge); -static bool try_crossjump_bb (int, basic_block); -static bool outgoing_edges_match (int, basic_block, basic_block); -static int flow_find_cross_jump (int, basic_block, basic_block, rtx *, rtx *); -static bool old_insns_match_p (int, rtx, rtx); - static void merge_blocks_move_predecessor_nojumps (basic_block, basic_block); static void merge_blocks_move_successor_nojumps (basic_block, basic_block); static bool try_optimize_cfg (int); @@ -945,7 +939,7 @@ merge_memattrs (rtx x, rtx y) /* Return true if I1 and I2 are equivalent and thus can be crossjumped. */ static bool -old_insns_match_p (int mode ATTRIBUTE_UNUSED, rtx i1, rtx i2) +old_insns_match_p (rtx i1, rtx i2) { rtx p1, p2; @@ -980,36 +974,6 @@ old_insns_match_p (int mode ATTRIBUTE_UN || SIBLING_CALL_P (i1) != SIBLING_CALL_P (i2))) return false; -#ifdef STACK_REGS - /* If cross_jump_death_matters is not 0, the insn's mode - indicates whether or not the insn contains any stack-like - regs. */ - - if ((mode & CLEANUP_POST_REGSTACK) && stack_regs_mentioned (i1)) - { - /* If register stack conversion has already been done, then - death notes must also be compared before it is certain that - the two instruction streams match. */ - - rtx note; - HARD_REG_SET i1_regset, i2_regset; - - CLEAR_HARD_REG_SET (i1_regset); - CLEAR_HARD_REG_SET (i2_regset); - - for (note = REG_NOTES (i1); note; note = XEXP (note, 1)) - if (REG_NOTE_KIND (note) == REG_DEAD && STACK_REG_P (XEXP (note, 0))) - SET_HARD_REG_BIT (i1_regset, REGNO (XEXP (note, 0))); - - for (note = REG_NOTES (i2); note; note = XEXP (note, 1)) - if (REG_NOTE_KIND (note) == REG_DEAD && STACK_REG_P (XEXP (note, 0))) - SET_HARD_REG_BIT (i2_regset, REGNO (XEXP (note, 0))); - - if (!hard_reg_set_equal_p (i1_regset, i2_regset)) - return false; - } -#endif - if (reload_completed ? rtx_renumbered_equal_p (p1, p2) : rtx_equal_p (p1, p2)) return true; @@ -1025,8 +989,7 @@ old_insns_match_p (int mode ATTRIBUTE_UN store the head of the blocks in *F1 and *F2. */ static int -flow_find_cross_jump (int mode ATTRIBUTE_UNUSED, basic_block bb1, - basic_block bb2, rtx *f1, rtx *f2) +flow_find_cross_jump (basic_block bb1, basic_block bb2, rtx *f1, rtx *f2) { rtx i1, i2, last1, last2, afterlast1, afterlast2; int ninsns = 0; @@ -1066,7 +1029,7 @@ flow_find_cross_jump (int mode ATTRIBUTE if (i1 == BB_HEAD (bb1) || i2 == BB_HEAD (bb2)) break; - if (!old_insns_match_p (mode, i1, i2)) + if (!old_insns_match_p (i1, i2)) break; merge_memattrs (i1, i2); @@ -1137,7 +1100,7 @@ flow_find_cross_jump (int mode ATTRIBUTE We may assume that there exists one edge with a common destination. */ static bool -outgoing_edges_match (int mode, basic_block bb1, basic_block bb2) +outgoing_edges_match (basic_block bb1, basic_block bb2) { int nehedges1 = 0, nehedges2 = 0; edge fallthru1 = 0, fallthru2 = 0; @@ -1320,7 +1283,7 @@ outgoing_edges_match (int mode, basic_bl rr.update_label_nuses = false; for_each_rtx (&BB_END (bb1), replace_label, &rr); - match = old_insns_match_p (mode, BB_END (bb1), BB_END (bb2)); + match = old_insns_match_p (BB_END (bb1), BB_END (bb2)); if (dump_file && match) fprintf (dump_file, "Tablejumps in bb %i and %i match.\n", @@ -1342,7 +1305,7 @@ outgoing_edges_match (int mode, basic_bl /* First ensure that the instructions match. There may be many outgoing edges so this test is generally cheaper. */ - if (!old_insns_match_p (mode, BB_END (bb1), BB_END (bb2))) + if (!old_insns_match_p (BB_END (bb1), BB_END (bb2))) return false; /* Search the outgoing edges, ensure that the counts do match, find possible @@ -1438,7 +1401,7 @@ block_has_preserve_label (basic_block bb (maybe the middle of) E1->SRC to (maybe the middle of) E2->SRC. */ static bool -try_crossjump_to_edge (int mode, edge e1, edge e2) +try_crossjump_to_edge (edge e1, edge e2) { int nmatch; basic_block src1 = e1->src, src2 = e2->src; @@ -1494,11 +1457,11 @@ try_crossjump_to_edge (int mode, edge e1 return false; /* Look for the common insn sequence, part the first ... */ - if (!outgoing_edges_match (mode, src1, src2)) + if (!outgoing_edges_match (src1, src2)) return false; /* ... and part the second. */ - nmatch = flow_find_cross_jump (mode, src1, src2, &newpos1, &newpos2); + nmatch = flow_find_cross_jump (src1, src2, &newpos1, &newpos2); /* Don't proceed with the crossjump unless we found a sufficient number of matching instructions or the 'from' block was totally matched @@ -1675,7 +1638,7 @@ try_crossjump_to_edge (int mode, edge e1 any changes made. */ static bool -try_crossjump_bb (int mode, basic_block bb) +try_crossjump_bb (basic_block bb) { edge e, e2, fallthru; bool changed; @@ -1748,7 +1711,7 @@ try_crossjump_bb (int mode, basic_block && !(df_get_bb_dirty (fallthru->src)))) continue; - if (try_crossjump_to_edge (mode, e, fallthru)) + if (try_crossjump_to_edge (e, fallthru)) { changed = true; ix = 0; @@ -1798,7 +1761,7 @@ try_crossjump_bb (int mode, basic_block && !(df_get_bb_dirty (e2->src)))) continue; - if (try_crossjump_to_edge (mode, e, e2)) + if (try_crossjump_to_edge (e, e2)) { changed = true; ev2 = bb; @@ -2019,7 +1982,7 @@ try_optimize_cfg (int mode) /* Look for shared code between blocks. */ if ((mode & CLEANUP_CROSSJUMP) - && try_crossjump_bb (mode, b)) + && try_crossjump_bb (b)) changed_here = true; /* Don't get confused by the index shift caused by @@ -2031,7 +1994,7 @@ try_optimize_cfg (int mode) } if ((mode & CLEANUP_CROSSJUMP) - && try_crossjump_bb (mode, EXIT_BLOCK_PTR)) + && try_crossjump_bb (EXIT_BLOCK_PTR)) changed = true; #ifdef ENABLE_CHECKING Index: basic-block.h =================================================================== --- basic-block.h (revision 158134) +++ basic-block.h (working copy) @@ -812,12 +812,10 @@ edge find_edge (basic_block, basic_block #define CLEANUP_EXPENSIVE 1 /* Do relatively expensive optimizations except for edge forwarding */ #define CLEANUP_CROSSJUMP 2 /* Do crossjumping. */ -#define CLEANUP_POST_REGSTACK 4 /* We run after reg-stack and need - to care REG_DEAD notes. */ -#define CLEANUP_THREADING 8 /* Do jump threading. */ -#define CLEANUP_NO_INSN_DEL 16 /* Do not try to delete trivially dead +#define CLEANUP_THREADING 4 /* Do jump threading. */ +#define CLEANUP_NO_INSN_DEL 8 /* Do not try to delete trivially dead insns. */ -#define CLEANUP_CFGLAYOUT 32 /* Do cleanup in cfglayout mode. */ +#define CLEANUP_CFGLAYOUT 16 /* Do cleanup in cfglayout mode. */ /* In lcm.c */ extern struct edge_list *pre_edge_lcm (int, sbitmap *, sbitmap *,