summaryrefslogtreecommitdiff
path: root/gcc/ifcvt.c
diff options
context:
space:
mode:
authorhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2002-02-28 10:11:01 +0000
committerhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2002-02-28 10:11:01 +0000
commit308f9b7994783bcf7867e5c06fe3a88bd01d847f (patch)
tree8d5067250a1945f16e7442da0ebfa33bcd46322d /gcc/ifcvt.c
parentea5356cdbd7b2cbdb81a2f971be4ca11ce8fdda2 (diff)
downloadgcc-308f9b7994783bcf7867e5c06fe3a88bd01d847f.tar.gz
* basic-block.h (BB_REACHABLE): Renumber.
(BB_DIRTY, BB_NEW): New flags. (clear_bb_flags): Declare. (update_life_info_in_dirty_blocks): Declare. * cfg.c (clear_bb_flags): New function. * cfgrtl.c (create_basic_block_structure): Set flags to BB_NEW. * emit-rtl.c (add_insn_after, add_insn_before, remove_insn, reorder_insns, emit_insn_after): Mark block as dirty. * flow.c (update_life_info): Fix clearing of PROP_LOG_LINKS. (update_life_info_in_dirty_blocks): New function. * recog.c (apply_change_group): Dirtify block. * cse.c (cse_insn): Reorder emitting of jump insn to keep cfg consistent. * gcse.c (delete_null_pointer_checks): Likewise. * toplev.c (dump_file_index): Move cse2 after bp, add DFI_null (dump_file_info): Similary. (rest_of_compilation): Avoid most of CFG rebuilds; do first if converision after null pointer checks, do cse2 after branch prediction; avoid full liveness rebuild after initializing subregs. * invoke.texi (-d options): Document -du, renumber. * cfgcleanup.c (bb_flags): Remove BB_UPDATE_LIFE. (notice_new_block): Do not set BB_UPDATE_LIFE. (try_forward_edges, merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps, merge_blocks, try_crossjump_to_edge): Likewise. (try_optimize_cfg): Likewise; use update_life_info_in_dirty_blocks. * cfgrtl.c (merge_blocks_nomove): Copy b's flags to a. * ifcvt.c (SET_UPDATE_LIFE, UPDATE_LIFE): Kill. (merge_of_block): Do not use life_data_ok. (find_if_case_1): Do not use SET_UPDATE_LIFE. (if_convert): Use BB_DIRTY mechanizm to update life. * lcm.c (optimize_mode_switching): Update update_life_info_in_dirty_blocks git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@50127 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ifcvt.c')
-rw-r--r--gcc/ifcvt.c41
1 files changed, 10 insertions, 31 deletions
diff --git a/gcc/ifcvt.c b/gcc/ifcvt.c
index a7860e3ea4e..038b8c5d5ff 100644
--- a/gcc/ifcvt.c
+++ b/gcc/ifcvt.c
@@ -113,10 +113,8 @@ static void noce_emit_move_insn PARAMS ((rtx, rtx));
as well as a flag indicating that the block should be rescaned for
life analysis. */
-#define SET_ORIG_INDEX(BB,I) ((BB)->aux = (void *)((size_t)(I) << 1))
-#define ORIG_INDEX(BB) ((size_t)(BB)->aux >> 1)
-#define SET_UPDATE_LIFE(BB) ((BB)->aux = (void *)((size_t)(BB)->aux | 1))
-#define UPDATE_LIFE(BB) ((size_t)(BB)->aux & 1)
+#define SET_ORIG_INDEX(BB,I) ((BB)->aux = (void *)((size_t)(I)))
+#define ORIG_INDEX(BB) ((size_t)(BB)->aux)
/* Count the number of non-jump active insns in BB. */
@@ -1845,7 +1843,7 @@ merge_if_block (test_bb, then_bb, else_bb, join_bb)
/* First merge TEST block into THEN block. This is a no-brainer since
the THEN block did not have a code label to begin with. */
- if (life_data_ok)
+ if (combo_bb->global_live_at_end)
COPY_REG_SET (combo_bb->global_live_at_end, then_bb->global_live_at_end);
merge_blocks_nomove (combo_bb, then_bb);
num_removed_blocks++;
@@ -1886,7 +1884,7 @@ merge_if_block (test_bb, then_bb, else_bb, join_bb)
&& join_bb != EXIT_BLOCK_PTR)
{
/* We can merge the JOIN. */
- if (life_data_ok)
+ if (combo_bb->global_live_at_end)
COPY_REG_SET (combo_bb->global_live_at_end,
join_bb->global_live_at_end);
merge_blocks_nomove (combo_bb, join_bb);
@@ -1907,9 +1905,6 @@ merge_if_block (test_bb, then_bb, else_bb, join_bb)
tidy_fallthru_edge (combo_bb->succ, combo_bb, join_bb);
}
- /* Make sure we update life info properly. */
- SET_UPDATE_LIFE (combo_bb);
-
num_updated_if_blocks++;
}
@@ -2324,7 +2319,6 @@ find_if_case_1 (test_bb, then_edge, else_edge)
/* Conversion went ok, including moving the insns and fixing up the
jump. Adjust the CFG to match. */
- SET_UPDATE_LIFE (test_bb);
bitmap_operation (test_bb->global_live_at_end,
else_bb->global_live_at_start,
then_bb->global_live_at_end, BITMAP_IOR);
@@ -2333,10 +2327,7 @@ find_if_case_1 (test_bb, then_edge, else_edge)
/* Make rest of code believe that the newly created block is the THEN_BB
block we are going to remove. */
if (new_bb)
- {
- new_bb->aux = then_bb->aux;
- SET_UPDATE_LIFE (then_bb);
- }
+ new_bb->aux = then_bb->aux;
flow_delete_block (then_bb);
/* We've possibly created jump to next insn, cleanup_cfg will solve that
later. */
@@ -2403,7 +2394,6 @@ find_if_case_2 (test_bb, then_edge, else_edge)
/* Conversion went ok, including moving the insns and fixing up the
jump. Adjust the CFG to match. */
- SET_UPDATE_LIFE (test_bb);
bitmap_operation (test_bb->global_live_at_end,
then_bb->global_live_at_start,
else_bb->global_live_at_end, BITMAP_IOR);
@@ -2718,6 +2708,8 @@ if_convert (x_life_data_ok)
post_dominators = sbitmap_vector_alloc (n_basic_blocks, n_basic_blocks);
calculate_dominance_info (NULL, post_dominators, CDI_POST_DOMINATORS);
}
+ if (life_data_ok)
+ clear_bb_flags ();
/* Record initial block numbers. */
for (block_num = 0; block_num < n_basic_blocks; block_num++)
@@ -2742,28 +2734,15 @@ if_convert (x_life_data_ok)
/* Rebuild life info for basic blocks that require it. */
if (num_removed_blocks && life_data_ok)
{
- sbitmap update_life_blocks = sbitmap_alloc (n_basic_blocks);
- sbitmap_zero (update_life_blocks);
-
/* If we allocated new pseudos, we must resize the array for sched1. */
if (max_regno < max_reg_num ())
{
max_regno = max_reg_num ();
allocate_reg_info (max_regno, FALSE, FALSE);
}
-
- for (block_num = 0; block_num < n_basic_blocks; block_num++)
- if (UPDATE_LIFE (BASIC_BLOCK (block_num)))
- SET_BIT (update_life_blocks, block_num);
-
- count_or_remove_death_notes (update_life_blocks, 1);
- /* ??? See about adding a mode that verifies that the initial
- set of blocks don't let registers come live. */
- update_life_info (update_life_blocks, UPDATE_LIFE_GLOBAL,
- PROP_DEATH_NOTES | PROP_SCAN_DEAD_CODE
- | PROP_KILL_DEAD_CODE);
-
- sbitmap_free (update_life_blocks);
+ update_life_info_in_dirty_blocks (UPDATE_LIFE_GLOBAL_RM_NOTES,
+ PROP_DEATH_NOTES | PROP_SCAN_DEAD_CODE
+ | PROP_KILL_DEAD_CODE);
}
clear_aux_for_blocks ();