diff options
-rw-r--r-- | gcc/ChangeLog | 56 | ||||
-rw-r--r-- | gcc/bt-load.c | 4 | ||||
-rw-r--r-- | gcc/combine.c | 2 | ||||
-rw-r--r-- | gcc/config/sh/sh.c | 2 | ||||
-rw-r--r-- | gcc/cse.c | 4 | ||||
-rw-r--r-- | gcc/df-core.c | 129 | ||||
-rw-r--r-- | gcc/df-problems.c | 56 | ||||
-rw-r--r-- | gcc/df-scan.c | 4 | ||||
-rw-r--r-- | gcc/df.h | 14 | ||||
-rw-r--r-- | gcc/global.c | 2 | ||||
-rw-r--r-- | gcc/ifcvt.c | 18 | ||||
-rw-r--r-- | gcc/init-regs.c | 9 | ||||
-rw-r--r-- | gcc/integrate.c | 8 | ||||
-rw-r--r-- | gcc/local-alloc.c | 12 | ||||
-rw-r--r-- | gcc/postreload.c | 5 | ||||
-rw-r--r-- | gcc/regmove.c | 2 | ||||
-rw-r--r-- | gcc/regrename.c | 2 | ||||
-rw-r--r-- | gcc/resource.c | 2 | ||||
-rw-r--r-- | gcc/rtl-factoring.c | 12 | ||||
-rw-r--r-- | gcc/sched-ebb.c | 4 | ||||
-rw-r--r-- | gcc/sched-rgn.c | 8 |
21 files changed, 212 insertions, 143 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 8308ee683c7..2c19891b6dd 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,57 @@ +<<<<<<< .mine +2007-06-15 Kenneth Zadeck <zadeck@naturalbridge.com> + + * df.h (DF_FIRST_OPTIONAL_PROBLEM): Removed. + (struct df_problem.free_blocks_on_set_blocks): New field. + (struct dataflow.optional_p): New field. + (df_bb_regno_last_use_find, df_insn_regno_def_p): Removed. + (df_live_set_all_dirty): New function. + * df-scan.c (df_scan_alloc): Initialize optional_p. + (problem_SCAN): Initialize free_blocks_on_set_blocks. + * df-core.c (df_set_blocks): Removed use of + DF_FIRST_OPTIONAL_PROBLEM. Now uses + df_problem.free_blocks_on_set_blocks to determine which blocks are + recycled. + (df_remove_problem): Removed use of DF_FIRST_OPTIONAL_PROBLEM. + (df_finish_pass): Removed use of DF_FIRST_OPTIONAL_PROBLEM. Now + uses dataflow.optional_p to determine if problem should be + deleted. + (rest_of_handle_df_initialize): Only start live problem if + -02 or above. + (df_bb_regno_last_use_find, df_insn_regno_def_p): Removed. + * df-problems.c (df_ru_alloc, df_rd_alloc, df_lr_alloc, + df_live_alloc, df_urec_alloc, df_note_alloc): set optional_p. + (problem_RU, problem_RD, problem_LR, problem_UREC, problem_CHAIN, + problem_NOTE): Initialize free_blocks_on_set_blocks. + (df_lr_bb_local_compute): Recompute luids if df_live problem is + not active. + (df_live_set_all_dirty, df_note_alloc): New function. + * regrename.c (merge_overlapping_regs): Change DF_LIVE_* to + df_get_live_*. + * sched_ebb.c (compute_jump_reg_dependencies): Ditto. + * postreload.c (reload_combine): Ditto. + * cse.c (cse_extended_basic_block): Ditto. + * regmove.c (mark_flags_life_zones): Ditto. + * rtlfactoring.c (split_blocks_after_seqs, split_pattern_seq, + erase_matching_seqs): Ditto. + * bt-load.c (compute_defs_uses_and_gen): Ditto. + * integrate (allocate_initial_values): Ditto. + * combine.c (reg_dead_at_p): Ditto. + * resource.c (mark_target_live_regs): Ditto. + * sched-rgn.c (check_live_1, update_live_1): Ditto. + * config/sh/sh.c (find_r0_life_regions): Ditto. + * global.c (rest_of_handle_global_alloc): Only add back df_live + for -O > 1. + * local-alloc.c (rest_of_handle_local_alloc): Only remove + df_live for -O > 1. + * ifcvt.c (dead_or_predicable): Change DF_LIVE_* to + df_get_live_*. + (if_convert): Make sure df_live is there at -O == 1. + (pass_if_after_combine): Cleanup flags. + * init-regs.c (initialize_uninitialized_regs): Make sure df_live + is there at -O == 1. + +======= 2007-06-19 Seongbae Park <seongbae.park@gmail.com> * config/arm/arm.c (arm_get_frame_offsets): Set @@ -44,6 +98,7 @@ * config/frv/frv.c (frv_ifcvt_modify_tests): Dataflow merge fix. (frv_ifcvt_modify_insn): Likewise. +>>>>>>> .r125856 2007-06-19 Richard Guenther <rguenther@suse.de> * tree-ssa-structalias.c (handle_ptr_arith): Make sure to @@ -719,6 +774,7 @@ * df-scan.c (df_get_exit-block_use_set): Always add the stack pointer to the exit block use set. + (df_insn_delete, df_insn_rescan): Fixed spelling of "deferring". * gcse.c (cpro_jump): Don't emit barrier in cfglayout mode. * config/sparc/sparc.c (sparc_check_64): Check df != NULL. diff --git a/gcc/bt-load.c b/gcc/bt-load.c index 91ea0e6d1e6..fbb413561f3 100644 --- a/gcc/bt-load.c +++ b/gcc/bt-load.c @@ -478,7 +478,7 @@ compute_defs_uses_and_gen (fibheap_t all_btr_defs, btr_def *def_array, CLEAR_HARD_REG_SET (info.btrs_written_in_block); for (reg = first_btr; reg <= last_btr; reg++) if (TEST_HARD_REG_BIT (all_btrs, reg) - && REGNO_REG_SET_P (DF_LIVE_IN (bb), reg)) + && REGNO_REG_SET_P (df_get_live_in (bb), reg)) SET_HARD_REG_BIT (info.btrs_live_in_block, reg); for (insn = BB_HEAD (bb), last = NEXT_INSN (BB_END (bb)); @@ -579,7 +579,7 @@ compute_defs_uses_and_gen (fibheap_t all_btr_defs, btr_def *def_array, COPY_HARD_REG_SET (btrs_live[i], info.btrs_live_in_block); COPY_HARD_REG_SET (btrs_written[i], info.btrs_written_in_block); - REG_SET_TO_HARD_REG_SET (btrs_live_at_end[i], DF_LIVE_OUT (bb)); + REG_SET_TO_HARD_REG_SET (btrs_live_at_end[i], df_get_live_out (bb)); /* If this block ends in a jump insn, add any uses or even clobbers of branch target registers that it might have. */ for (insn = BB_END (bb); insn != BB_HEAD (bb) && ! INSN_P (insn); ) diff --git a/gcc/combine.c b/gcc/combine.c index 6fbf8168049..cb0d00f6f82 100644 --- a/gcc/combine.c +++ b/gcc/combine.c @@ -11835,7 +11835,7 @@ reg_dead_at_p (rtx reg, rtx insn) } for (i = reg_dead_regno; i < reg_dead_endregno; i++) - if (REGNO_REG_SET_P (DF_LIVE_IN (block), i)) + if (REGNO_REG_SET_P (df_get_live_in (block), i)) return 0; return 1; diff --git a/gcc/config/sh/sh.c b/gcc/config/sh/sh.c index 9d327847fe4..60520f7871c 100644 --- a/gcc/config/sh/sh.c +++ b/gcc/config/sh/sh.c @@ -9159,7 +9159,7 @@ find_r0_life_regions (basic_block b) int set; int death = 0; - if (REGNO_REG_SET_P (DF_LIVE_IN (b), R0_REG)) + if (REGNO_REG_SET_P (df_get_live_in (b), R0_REG)) { set = 1; live = 1; diff --git a/gcc/cse.c b/gcc/cse.c index 58055ddae06..431a4194bef 100644 --- a/gcc/cse.c +++ b/gcc/cse.c @@ -6001,8 +6001,8 @@ cse_extended_basic_block (struct cse_basic_block_data *ebb_data) qty_table = XNEWVEC (struct qty_table_elem, max_qty); new_basic_block (); - cse_ebb_live_in = DF_LIVE_IN (ebb_data->path[0].bb); - cse_ebb_live_out = DF_LIVE_OUT (ebb_data->path[path_size - 1].bb); + cse_ebb_live_in = df_get_live_in (ebb_data->path[0].bb); + cse_ebb_live_out = df_get_live_out (ebb_data->path[path_size - 1].bb); for (path_entry = 0; path_entry < path_size; path_entry++) { basic_block bb; diff --git a/gcc/df-core.c b/gcc/df-core.c index 67a4040d50e..deca8758530 100644 --- a/gcc/df-core.c +++ b/gcc/df-core.c @@ -506,15 +506,17 @@ df_set_blocks (bitmap blocks) bitmap_print (dump_file, blocks, "setting blocks to analyze ", "\n"); if (df->blocks_to_analyze) { + /* This block is called to change the focus from one subset + to another. */ int p; bitmap diff = BITMAP_ALLOC (&df_bitmap_obstack); bitmap_and_compl (diff, df->blocks_to_analyze, blocks); - for (p = df->num_problems_defined - 1; p >= DF_FIRST_OPTIONAL_PROBLEM ;p--) + for (p = 0; p < df->num_problems_defined; p++) { struct dataflow *dflow = df->problems_in_order[p]; - if (dflow->problem->reset_fun) + if (dflow->optional_p && dflow->problem->reset_fun) dflow->problem->reset_fun (df->blocks_to_analyze); - else if (dflow->problem->free_bb_fun) + else if (dflow->problem->free_blocks_on_set_blocks) { bitmap_iterator bi; unsigned int bb_index; @@ -539,33 +541,31 @@ df_set_blocks (bitmap blocks) } else { - /* If we have not actually run scanning before, do not try - to clear anything. */ - if (df_scan->problem_data) + /* This block of code is executed to change the focus from + the entire function to a subset. */ + bitmap blocks_to_reset = NULL; + int p; + for (p = 0; p < df->num_problems_defined; p++) { - bitmap blocks_to_reset = NULL; - int p; - for (p = df->num_problems_defined - 1; p >= DF_FIRST_OPTIONAL_PROBLEM ;p--) + struct dataflow *dflow = df->problems_in_order[p]; + if (dflow->optional_p && dflow->problem->reset_fun) { - struct dataflow *dflow = df->problems_in_order[p]; - if (dflow->problem->reset_fun) + if (!blocks_to_reset) { - if (!blocks_to_reset) + basic_block bb; + blocks_to_reset = + BITMAP_ALLOC (&df_bitmap_obstack); + FOR_ALL_BB(bb) { - basic_block bb; - blocks_to_reset = - BITMAP_ALLOC (&df_bitmap_obstack); - FOR_ALL_BB(bb) - { - bitmap_set_bit (blocks_to_reset, bb->index); - } + bitmap_set_bit (blocks_to_reset, bb->index); } - dflow->problem->reset_fun (blocks_to_reset); } + dflow->problem->reset_fun (blocks_to_reset); } - if (blocks_to_reset) - BITMAP_FREE (blocks_to_reset); } + if (blocks_to_reset) + BITMAP_FREE (blocks_to_reset); + df->blocks_to_analyze = BITMAP_ALLOC (&df_bitmap_obstack); } bitmap_copy (df->blocks_to_analyze, blocks); @@ -573,8 +573,10 @@ df_set_blocks (bitmap blocks) } else { + /* This block is executed to reset the focus to the entire + function. */ if (dump_file) - fprintf (dump_file, "clearing blocks to analyze\n"); + fprintf (dump_file, "clearing blocks_to_analyze\n"); if (df->blocks_to_analyze) { BITMAP_FREE (df->blocks_to_analyze); @@ -599,7 +601,6 @@ df_remove_problem (struct dataflow *dflow) { struct df_problem *problem; int i; - int start = 0; if (!dflow) return; @@ -607,18 +608,13 @@ df_remove_problem (struct dataflow *dflow) problem = dflow->problem; gcc_assert (problem->remove_problem_fun); - /* Normally only optional problems are removed, but during global, - we remove ur and live and replace it with urec. */ - if (problem->id >= DF_FIRST_OPTIONAL_PROBLEM) - start = DF_FIRST_OPTIONAL_PROBLEM; - /* Delete any problems that depended on this problem first. */ - for (i = start; i < df->num_problems_defined; i++) + for (i = 0; i < df->num_problems_defined; i++) if (df->problems_in_order[i]->problem->dependent_problem == problem) df_remove_problem (df->problems_in_order[i]); /* Now remove this problem. */ - for (i = start; i < df->num_problems_defined; i++) + for (i = 0; i < df->num_problems_defined; i++) if (df->problems_in_order[i] == dflow) { int j; @@ -658,16 +654,19 @@ df_finish_pass (void) saved_flags = df->changeable_flags; #endif - for (i = DF_FIRST_OPTIONAL_PROBLEM; i < df->num_problems_defined; i++) + for (i = 0; i < df->num_problems_defined; i++) { struct dataflow *dflow = df->problems_in_order[i]; struct df_problem *problem = dflow->problem; - gcc_assert (problem->remove_problem_fun); - (problem->remove_problem_fun) (); - df->problems_in_order[i] = NULL; - df->problems_by_index[problem->id] = NULL; - removed++; + if (dflow->optional_p) + { + gcc_assert (problem->remove_problem_fun); + (problem->remove_problem_fun) (); + df->problems_in_order[i] = NULL; + df->problems_by_index[problem->id] = NULL; + removed++; + } } df->num_problems_defined -= removed; @@ -720,7 +719,7 @@ rest_of_handle_df_initialize (void) /* These three problems are permanent. */ df_lr_add_problem (); - if (optimize) + if (optimize > 1) df_live_add_problem (); df->postorder = XNEWVEC (int, last_basic_block); @@ -1600,40 +1599,6 @@ df_set_clean_cfg (void) ----------------------------------------------------------------------------*/ -/* Return last use of REGNO within BB. */ - -struct df_ref * -df_bb_regno_last_use_find (basic_block bb, unsigned int regno) -{ - rtx insn; - struct df_ref **use_rec; - unsigned int uid; - - FOR_BB_INSNS_REVERSE (bb, insn) - { - if (!INSN_P (insn)) - continue; - - uid = INSN_UID (insn); - for (use_rec = DF_INSN_UID_USES (uid); *use_rec; use_rec++) - { - struct df_ref *use = *use_rec; - if (DF_REF_REGNO (use) == regno) - return use; - } - - if (df->changeable_flags & DF_EQ_NOTES) - for (use_rec = DF_INSN_UID_EQ_USES (uid); *use_rec; use_rec++) - { - struct df_ref *use = *use_rec; - if (DF_REF_REGNO (use) == regno) - return use; - } - } - return NULL; -} - - /* Return first def of REGNO within BB. */ struct df_ref * @@ -1686,26 +1651,6 @@ df_bb_regno_last_def_find (basic_block bb, unsigned int regno) return NULL; } -/* Return true if INSN defines REGNO. */ - -bool -df_insn_regno_def_p (rtx insn, unsigned int regno) -{ - unsigned int uid; - struct df_ref **def_rec; - - uid = INSN_UID (insn); - for (def_rec = DF_INSN_UID_DEFS (uid); *def_rec; def_rec++) - { - struct df_ref *def = *def_rec; - if (DF_REF_REGNO (def) == regno) - return true; - } - - return false; -} - - /* Finds the reference corresponding to the definition of REG in INSN. DF is the dataflow object. */ diff --git a/gcc/df-problems.c b/gcc/df-problems.c index dc5270e935b..101b46f58e3 100644 --- a/gcc/df-problems.c +++ b/gcc/df-problems.c @@ -331,6 +331,7 @@ df_ru_alloc (bitmap all_blocks) bb_info->out = BITMAP_ALLOC (&problem_data->ru_bitmaps); } } + df_ru->optional_p = true; } @@ -711,7 +712,8 @@ static struct df_problem problem_RU = NULL, /* Incremental solution verify start. */ NULL, /* Incremental solution verfiy end. */ NULL, /* Dependent problem. */ - TV_DF_RU /* Timing variable. */ + TV_DF_RU, /* Timing variable. */ + true /* Reset blocks on dropping out of blocks_to_analyze. */ }; @@ -841,6 +843,7 @@ df_rd_alloc (bitmap all_blocks) bb_info->out = BITMAP_ALLOC (&problem_data->rd_bitmaps); } } + df_rd->optional_p = true; } @@ -1207,7 +1210,8 @@ static struct df_problem problem_RD = NULL, /* Incremental solution verify start. */ NULL, /* Incremental solution verfiy end. */ NULL, /* Dependent problem. */ - TV_DF_RD /* Timing variable. */ + TV_DF_RD, /* Timing variable. */ + true /* Reset blocks on dropping out of blocks_to_analyze. */ }; @@ -1320,6 +1324,8 @@ df_lr_alloc (bitmap all_blocks ATTRIBUTE_UNUSED) bb_info->ause = NULL; } } + + df_lr->optional_p = false; } @@ -1478,6 +1484,13 @@ df_lr_bb_local_compute (unsigned int bb_index) } } #endif + + /* If the df_live problem is not defined, such as at -O0 and -O1, we + still need to keep the luids up to date. This is normally done + in the df_live problem since this problem has a forwards + scan. */ + if (!df_live) + df_recompute_luids (bb); } @@ -1818,7 +1831,8 @@ static struct df_problem problem_LR = df_lr_verify_solution_start,/* Incremental solution verify start. */ df_lr_verify_solution_end, /* Incremental solution verify end. */ NULL, /* Dependent problem. */ - TV_DF_LR /* Timing variable. */ + TV_DF_LR, /* Timing variable. */ + false /* Reset blocks on dropping out of blocks_to_analyze. */ }; @@ -2016,6 +2030,7 @@ df_live_alloc (bitmap all_blocks ATTRIBUTE_UNUSED) bb_info->out = BITMAP_ALLOC (NULL); } } + df_live->optional_p = (optimize <= 1); } @@ -2368,7 +2383,8 @@ static struct df_problem problem_LIVE = df_live_verify_solution_start,/* Incremental solution verify start. */ df_live_verify_solution_end, /* Incremental solution verify end. */ &problem_LR, /* Dependent problem. */ - TV_DF_LIVE /* Timing variable. */ + TV_DF_LIVE, /* Timing variable. */ + false /* Reset blocks on dropping out of blocks_to_analyze. */ }; @@ -2386,6 +2402,19 @@ df_live_add_problem (void) } +/* Set all of the blocks as dirty. This needs to be done if this + problem is added after all of the insns have been scanned. */ + +void +df_live_set_all_dirty (void) +{ + basic_block bb; + FOR_ALL_BB (bb) + bitmap_set_bit (df_live->out_of_date_transfer_functions, + bb->index); +} + + /* Verify that all of the lr related info is consistent and correct. */ @@ -2555,6 +2584,7 @@ df_urec_alloc (bitmap all_blocks) bb_info->earlyclobber = BITMAP_ALLOC (NULL); } } + df_urec->optional_p = true; } @@ -3041,7 +3071,8 @@ static struct df_problem problem_UREC = NULL, /* Incremental solution verify start. */ NULL, /* Incremental solution verfiy end. */ &problem_LR, /* Dependent problem. */ - TV_DF_UREC /* Timing variable. */ + TV_DF_UREC, /* Timing variable. */ + false /* Reset blocks on dropping out of blocks_to_analyze. */ }; @@ -3213,6 +3244,7 @@ df_chain_alloc (bitmap all_blocks ATTRIBUTE_UNUSED) df_chain_remove_problem (); df_chain->block_pool = create_alloc_pool ("df_chain_block pool", sizeof (struct df_link), 50); + df_chain->optional_p = true; } @@ -3520,7 +3552,8 @@ static struct df_problem problem_CHAIN = NULL, /* Incremental solution verify start. */ NULL, /* Incremental solution verfiy end. */ &problem_RD, /* Dependent problem. */ - TV_DF_CHAIN /* Timing variable. */ + TV_DF_CHAIN, /* Timing variable. */ + false /* Reset blocks on dropping out of blocks_to_analyze. */ }; @@ -3543,6 +3576,12 @@ df_chain_add_problem (enum df_chain_flags chain_flags) This pass computes REG_DEAD and REG_UNUSED notes. ----------------------------------------------------------------------------*/ +static void +df_note_alloc (bitmap all_blocks ATTRIBUTE_UNUSED) +{ + df_note->optional_p = true; +} + #ifdef REG_DEAD_DEBUGGING static void df_print_note (const char *prefix, rtx insn, rtx note) @@ -4077,7 +4116,7 @@ static struct df_problem problem_NOTE = { DF_NOTE, /* Problem id. */ DF_NONE, /* Direction. */ - NULL, /* Allocate the problem specific data. */ + df_note_alloc, /* Allocate the problem specific data. */ NULL, /* Reset global information. */ NULL, /* Free basic block info. */ df_note_compute, /* Local compute function. */ @@ -4099,7 +4138,8 @@ static struct df_problem problem_NOTE = but it will produce information if built one of uninitialized register problems (UR, UREC) is also run. */ &problem_LR, /* Dependent problem. */ - TV_DF_NOTE /* Timing variable. */ + TV_DF_NOTE, /* Timing variable. */ + false /* Reset blocks on dropping out of blocks_to_analyze. */ }; diff --git a/gcc/df-scan.c b/gcc/df-scan.c index 49d6df8ca15..fff621f0261 100644 --- a/gcc/df-scan.c +++ b/gcc/df-scan.c @@ -341,6 +341,7 @@ df_scan_alloc (bitmap all_blocks ATTRIBUTE_UNUSED) df->insns_to_delete = BITMAP_ALLOC (&problem_data->insn_bitmaps); df->insns_to_rescan = BITMAP_ALLOC (&problem_data->insn_bitmaps); df->insns_to_notes_rescan = BITMAP_ALLOC (&problem_data->insn_bitmaps); + df_scan->optional_p = false; } @@ -434,7 +435,8 @@ static struct df_problem problem_SCAN = NULL, /* Incremental solution verify start. */ NULL, /* Incremental solution verfiy end. */ NULL, /* Dependent problem. */ - TV_DF_SCAN /* Timing variable. */ + TV_DF_SCAN, /* Timing variable. */ + false /* Reset blocks on dropping out of blocks_to_analyze. */ }; @@ -52,7 +52,6 @@ struct df_link; #define DF_NOTE 7 /* REG_DEF and REG_UNUSED notes. */ #define DF_LAST_PROBLEM_PLUS1 (DF_NOTE + 1) -#define DF_FIRST_OPTIONAL_PROBLEM DF_RU /* Dataflow direction. */ enum df_flow_dir @@ -249,8 +248,13 @@ struct df_problem { df_verify_solution_start verify_start_fun; df_verify_solution_end verify_end_fun; struct df_problem *dependent_problem; + /* The timevar id associated with this pass. */ unsigned int tv_id; + + /* True if the df_set_blocks should null out the basic block info if + this block drops out of df->blocks_to_analyze. */ + bool free_blocks_on_set_blocks; }; @@ -293,6 +297,11 @@ struct dataflow solutions. Note that this bit is always true for all problems except lr and live. */ bool solutions_dirty; + + /* If true, this pass is deleted by df_finish_pass. This is never + true for DF_SCAN and DF_LR. It is true for DF_LIVE if optimize > + 1. It is always true for the other problems. */ + bool optional_p; }; @@ -837,10 +846,8 @@ extern void df_verify (void); #ifdef DF_DEBUG_CFG extern void df_check_cfg_clean (void); #endif -extern struct df_ref *df_bb_regno_last_use_find (basic_block, unsigned int); extern struct df_ref *df_bb_regno_first_def_find (basic_block, unsigned int); extern struct df_ref *df_bb_regno_last_def_find (basic_block, unsigned int); -extern bool df_insn_regno_def_p (rtx, unsigned int); extern struct df_ref *df_find_def (rtx, rtx); extern bool df_reg_defined (rtx, rtx); extern struct df_ref *df_find_use (rtx, rtx); @@ -882,6 +889,7 @@ extern void df_lr_add_problem (void); extern void df_lr_verify_transfer_functions (void); extern void df_live_verify_transfer_functions (void); extern void df_live_add_problem (void); +extern void df_live_set_all_dirty (void); extern void df_urec_add_problem (void); extern void df_chain_add_problem (enum df_chain_flags); extern void df_note_add_problem (void); diff --git a/gcc/global.c b/gcc/global.c index c60c57df64e..62b7b6273e3 100644 --- a/gcc/global.c +++ b/gcc/global.c @@ -2080,7 +2080,7 @@ rest_of_handle_global_alloc (void) going to help here because it does not touch the artificial uses and defs. */ df_finish_pass (); - if (optimize) + if (optimize > 1) df_live_add_problem (); df_scan_alloc (NULL); df_scan_blocks (); diff --git a/gcc/ifcvt.c b/gcc/ifcvt.c index e5d88970be0..dd7764b921f 100644 --- a/gcc/ifcvt.c +++ b/gcc/ifcvt.c @@ -3836,7 +3836,7 @@ dead_or_predicable (basic_block test_bb, basic_block merge_bb, /* The loop below takes the set of live registers after JUMP, and calculates the live set before EARLIEST. */ - bitmap_copy (test_live, DF_LIVE_IN (other_bb)); + bitmap_copy (test_live, df_get_live_in (other_bb)); df_simulate_artificial_refs_at_end (test_bb, test_live); for (insn = jump; ; insn = prev) { @@ -3858,7 +3858,7 @@ dead_or_predicable (basic_block test_bb, basic_block merge_bb, if (bitmap_intersect_p (test_set, merge_set) || bitmap_intersect_p (test_live, merge_set) - || bitmap_intersect_p (test_set, DF_LIVE_IN (merge_bb))) + || bitmap_intersect_p (test_set, df_get_live_in (merge_bb))) fail = 1; BITMAP_FREE (merge_set); @@ -3958,6 +3958,12 @@ if_convert (bool recompute_dominance) basic_block bb; int pass; + if (optimize == 1) + { + df_live_add_problem (); + df_live_set_all_dirty (); + } + num_possible_if_blocks = 0; num_updated_if_blocks = 0; num_true_changes = 0; @@ -4039,6 +4045,9 @@ if_convert (bool recompute_dominance) num_true_changes); } + if (optimize == 1) + df_remove_problem (df_live); + #ifdef ENABLE_CHECKING verify_flow_info (); #endif @@ -4125,14 +4134,13 @@ struct tree_opt_pass pass_if_after_combine = static bool gate_handle_if_after_reload (void) { - return (optimize > 0); + return (optimize > 0 && flag_if_conversion2); } static unsigned int rest_of_handle_if_after_reload (void) { - if (flag_if_conversion2) - if_convert (true); + if_convert (true); return 0; } diff --git a/gcc/init-regs.c b/gcc/init-regs.c index adde3fa2cd7..7e4d0565122 100644 --- a/gcc/init-regs.c +++ b/gcc/init-regs.c @@ -53,6 +53,12 @@ initialize_uninitialized_regs (void) basic_block bb; bitmap already_genned = BITMAP_ALLOC (NULL); + if (optimize == 1) + { + df_live_add_problem (); + df_live_set_all_dirty (); + } + df_analyze (); FOR_EACH_BB (bb) @@ -111,6 +117,9 @@ initialize_uninitialized_regs (void) } } + if (optimize == 1) + df_remove_problem (df_live); + BITMAP_FREE (already_genned); } diff --git a/gcc/integrate.c b/gcc/integrate.c index 827afb7fe51..fb893ddb00e 100644 --- a/gcc/integrate.c +++ b/gcc/integrate.c @@ -352,10 +352,10 @@ allocate_initial_values (rtx *reg_equiv_memory_loc) /* Update global register liveness information. */ FOR_EACH_BB (bb) { - if (REGNO_REG_SET_P(DF_LIVE_IN (bb), regno)) - SET_REGNO_REG_SET (DF_LIVE_IN (bb), new_regno); - if (REGNO_REG_SET_P(DF_LIVE_OUT (bb), regno)) - SET_REGNO_REG_SET (DF_LIVE_OUT (bb), new_regno); + if (REGNO_REG_SET_P(df_get_live_in (bb), regno)) + SET_REGNO_REG_SET (df_get_live_in (bb), new_regno); + if (REGNO_REG_SET_P(df_get_live_out (bb), regno)) + SET_REGNO_REG_SET (df_get_live_out (bb), new_regno); } } } diff --git a/gcc/local-alloc.c b/gcc/local-alloc.c index 93bdbfac1c3..59ee52fd3c0 100644 --- a/gcc/local-alloc.c +++ b/gcc/local-alloc.c @@ -2509,13 +2509,13 @@ rest_of_handle_local_alloc (void) int max_regno = max_reg_num (); df_note_add_problem (); + + if (optimize > 1) + df_remove_problem (df_live); + /* Create a new version of df that has the special version of UR if + we are doing optimization. */ if (optimize) - { - /* Create a new version of df that has the special version of UR - if we are doing optimization. */ - df_remove_problem (df_live); - df_urec_add_problem (); - } + df_urec_add_problem (); df_analyze (); regstat_init_n_sets_and_refs (); regstat_compute_ri (); diff --git a/gcc/postreload.c b/gcc/postreload.c index 3182ac0b8e9..3894efaec8f 100644 --- a/gcc/postreload.c +++ b/gcc/postreload.c @@ -743,9 +743,10 @@ reload_combine (void) if (LABEL_P (insn)) { HARD_REG_SET live; + bitmap live_in = df_get_live_in (bb); - REG_SET_TO_HARD_REG_SET (live, DF_LIVE_IN (bb)); - compute_use_by_pseudos (&live, DF_LIVE_IN (bb)); + REG_SET_TO_HARD_REG_SET (live, live_in); + compute_use_by_pseudos (&live, live_in); COPY_HARD_REG_SET (LABEL_LIVE (insn), live); IOR_HARD_REG_SET (ever_live_at_start, live); } diff --git a/gcc/regmove.c b/gcc/regmove.c index c54879bc3a7..067940f4b7c 100644 --- a/gcc/regmove.c +++ b/gcc/regmove.c @@ -325,7 +325,7 @@ mark_flags_life_zones (rtx flags) { int i; for (i = 0; i < flags_nregs; ++i) - live |= REGNO_REG_SET_P (DF_LIVE_IN (block), flags_regno + i); + live |= REGNO_REG_SET_P (df_get_live_in (block), flags_regno + i); } #endif diff --git a/gcc/regrename.c b/gcc/regrename.c index 7026ef3b47d..8fdc74e92ab 100644 --- a/gcc/regrename.c +++ b/gcc/regrename.c @@ -139,7 +139,7 @@ merge_overlapping_regs (basic_block b, HARD_REG_SET *pset, rtx insn; HARD_REG_SET live; - REG_SET_TO_HARD_REG_SET (live, DF_LIVE_IN (b)); + REG_SET_TO_HARD_REG_SET (live, df_get_live_in (b)); insn = BB_HEAD (b); while (t) { diff --git a/gcc/resource.c b/gcc/resource.c index c2b08495d0a..6f9456f0383 100644 --- a/gcc/resource.c +++ b/gcc/resource.c @@ -957,7 +957,7 @@ mark_target_live_regs (rtx insns, rtx target, struct resources *res) TARGET. Otherwise, we must assume everything is live. */ if (b != -1) { - regset regs_live = DF_LIVE_IN (BASIC_BLOCK (b)); + regset regs_live = df_get_live_in (BASIC_BLOCK (b)); rtx start_insn, stop_insn; reg_set_iterator rsi; diff --git a/gcc/rtl-factoring.c b/gcc/rtl-factoring.c index 8ab5e8bd3dd..6e37df7bced 100644 --- a/gcc/rtl-factoring.c +++ b/gcc/rtl-factoring.c @@ -978,8 +978,8 @@ split_blocks_after_seqs (void) for (mseq = sb->matching_seqs; mseq; mseq = mseq->next_matching_seq) { block_label_after (mseq->insn); - IOR_REG_SET (DF_LIVE_OUT (BLOCK_FOR_INSN (pattern_seqs->insn)), - DF_LIVE_OUT (BLOCK_FOR_INSN (mseq->insn))); + IOR_REG_SET (df_get_live_out (BLOCK_FOR_INSN (pattern_seqs->insn)), + df_get_live_out (BLOCK_FOR_INSN (mseq->insn))); } } } @@ -1033,7 +1033,7 @@ split_pattern_seq (void) gen_symbol_ref_rtx_for_label (retlabel)), BB_END (bb)); /* Update liveness info. */ - SET_REGNO_REG_SET (DF_LIVE_OUT (bb), + SET_REGNO_REG_SET (df_get_live_out (bb), REGNO (pattern_seqs->link_reg)); } @@ -1085,12 +1085,12 @@ erase_matching_seqs (void) BB_END (bb) = callinsn; /* Maintain control flow and liveness information. */ - SET_REGNO_REG_SET (DF_LIVE_OUT (bb), + SET_REGNO_REG_SET (df_get_live_out (bb), REGNO (pattern_seqs->link_reg)); emit_barrier_after (BB_END (bb)); make_single_succ_edge (bb, BLOCK_FOR_INSN (sb->label), 0); - IOR_REG_SET (DF_LIVE_OUT (bb), - DF_LIVE_IN (BLOCK_FOR_INSN (sb->label))); + IOR_REG_SET (df_get_live_out (bb), + df_get_live_in (BLOCK_FOR_INSN (sb->label))); make_edge (BLOCK_FOR_INSN (seq_blocks->label), BLOCK_FOR_INSN (retlabel), EDGE_ABNORMAL); diff --git a/gcc/sched-ebb.c b/gcc/sched-ebb.c index dbece7d80e3..b03655d889f 100644 --- a/gcc/sched-ebb.c +++ b/gcc/sched-ebb.c @@ -252,9 +252,9 @@ compute_jump_reg_dependencies (rtx insn, regset cond_set, regset used, it may guard the fallthrough block from using a value that has conditionally overwritten that of the main codepath. So we consider that it restores the value of the main codepath. */ - bitmap_and (set, DF_LIVE_IN (e->dest), cond_set); + bitmap_and (set, df_get_live_in (e->dest), cond_set); else - bitmap_ior_into (used, DF_LIVE_IN (e->dest)); + bitmap_ior_into (used, df_get_live_in (e->dest)); } /* Used in schedule_insns to initialize current_sched_info for scheduling diff --git a/gcc/sched-rgn.c b/gcc/sched-rgn.c index aafb8121ea0..0bb69ee4cdc 100644 --- a/gcc/sched-rgn.c +++ b/gcc/sched-rgn.c @@ -1551,7 +1551,7 @@ check_live_1 (int src, rtx x) gcc_assert (!t || (CONTAINING_RGN (b->index) != CONTAINING_RGN (BB_TO_BLOCK (src)))); - if (t || REGNO_REG_SET_P (DF_LIVE_IN (b), regno + j)) + if (t || REGNO_REG_SET_P (df_get_live_in (b), regno + j)) return 0; } } @@ -1567,7 +1567,7 @@ check_live_1 (int src, rtx x) gcc_assert (!t || (CONTAINING_RGN (b->index) != CONTAINING_RGN (BB_TO_BLOCK (src)))); - if (t || REGNO_REG_SET_P (DF_LIVE_IN (b), regno)) + if (t || REGNO_REG_SET_P (df_get_live_in (b), regno)) return 0; } } @@ -1624,7 +1624,7 @@ update_live_1 (int src, rtx x) { basic_block b = candidate_table[src].update_bbs.first_member[i]; - SET_REGNO_REG_SET (DF_LIVE_IN (b), regno + j); + SET_REGNO_REG_SET (df_get_live_in (b), regno + j); } } } @@ -1634,7 +1634,7 @@ update_live_1 (int src, rtx x) { basic_block b = candidate_table[src].update_bbs.first_member[i]; - SET_REGNO_REG_SET (DF_LIVE_IN (b), regno); + SET_REGNO_REG_SET (df_get_live_in (b), regno); } } } |