diff options
author | bernds <bernds@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-05-27 10:47:48 +0000 |
---|---|---|
committer | bernds <bernds@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-05-27 10:47:48 +0000 |
commit | 52d7e28c26c1f136df0ee1a1993c9be371d52462 (patch) | |
tree | bd7ae2e68beab28e466d425df5b2ef2fcb55a8e6 /gcc/haifa-sched.c | |
parent | 76288c9ae6793fae67779f28de294d908a0fb917 (diff) | |
download | gcc-52d7e28c26c1f136df0ee1a1993c9be371d52462.tar.gz |
* haifa-sched.c (sched_scan_info): Remove.
(schedule_block): Call sched_extend_luids rather than sched_init_luids
with NULL args.
(extend_bb, init_bb, extend_insn, init_insn, init_insns_in_bb):
Remove functions.
(sched_scan): Remove.
(sched_extend_luids): Renamed from luids_extend_insn and no longer
static. All callers changed.
(sched_init_insn_luid): Renamed from luids_init_insn and no longer
static. All callers changed.
(sched_init_luids): Remove all arguments except the first. All
callers changed. Don't use sched_scan.
(haifa_init_h_i_d): Likewise.
(haifa_init_insn): Call sched_extend_luids and sched_init_insn_luid
manually rather than using sched_init_luids. Likewise with
extend_h_i_d, init_h_i_d and haifa_init_h_i_d.
* sel-sched.c (sel_region_target_finish): Call sched_extend_luids
rather than sched_init_luids with NULL args.
* sel-sched-ir.c (new_insns): Remove variable.
(sched_scan): New static function, previously in haifa-sched.c. Remove
all arguments but the first two; all callers changed.
(sel_init_new_insn): Call sched_extend_luids and sched_init_insn_luid
rather than sched_init_luids.
(sel_init_bbs): Remove second argument. All callers changed.
(sel_add_bb): Call sched_extend_luids rather than sched_init_luids
with NULL arguments.
(create_insn_rtx_from_pattern): Likewise.
* sel-sched-ir.h (sel_init_bbs): Adjust declaration.
* sched-int.h (sched_init_luids, haifa_init_h_i_d): Likewise.
(sched_init_insn_luid, sched_extend_luids): Declare.
(sched_scan_info_def, sched_scan_info, sched_scan): Remove
declarations.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@174327 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/haifa-sched.c')
-rw-r--r-- | gcc/haifa-sched.c | 158 |
1 files changed, 33 insertions, 125 deletions
diff --git a/gcc/haifa-sched.c b/gcc/haifa-sched.c index 6b949b41179..0cb329077bb 100644 --- a/gcc/haifa-sched.c +++ b/gcc/haifa-sched.c @@ -332,8 +332,6 @@ const struct common_sched_info_def haifa_common_sched_info = SCHED_PASS_UNKNOWN /* sched_pass_id */ }; -const struct sched_scan_info_def *sched_scan_info; - /* Mapping from instruction UID to its Logical UID. */ VEC (int, heap) *sched_luids = NULL; @@ -3336,7 +3334,7 @@ schedule_block (basic_block *target_bb) in its md_finish () hook. These new insns don't have any data initialized and to identify them we extend h_i_d so that they'll get zero luids. */ - sched_init_luids (NULL, NULL, NULL, NULL); + sched_extend_luids (); } if (sched_verbose) @@ -3544,10 +3542,10 @@ haifa_sched_init (void) FOR_EACH_BB (bb) VEC_quick_push (basic_block, bbs, bb); - sched_init_luids (bbs, NULL, NULL, NULL); + sched_init_luids (bbs); sched_deps_init (true); sched_extend_target (); - haifa_init_h_i_d (bbs, NULL, NULL, NULL); + haifa_init_h_i_d (bbs); VEC_free (basic_block, heap, bbs); } @@ -5335,105 +5333,9 @@ check_cfg (rtx head, rtx tail) #endif /* ENABLE_CHECKING */ -/* Extend per basic block data structures. */ -static void -extend_bb (void) -{ - if (sched_scan_info->extend_bb) - sched_scan_info->extend_bb (); -} - -/* Init data for BB. */ -static void -init_bb (basic_block bb) -{ - if (sched_scan_info->init_bb) - sched_scan_info->init_bb (bb); -} - -/* Extend per insn data structures. */ -static void -extend_insn (void) -{ - if (sched_scan_info->extend_insn) - sched_scan_info->extend_insn (); -} - -/* Init data structures for INSN. */ -static void -init_insn (rtx insn) -{ - if (sched_scan_info->init_insn) - sched_scan_info->init_insn (insn); -} - -/* Init all insns in BB. */ -static void -init_insns_in_bb (basic_block bb) -{ - rtx insn; - - FOR_BB_INSNS (bb, insn) - init_insn (insn); -} - -/* A driver function to add a set of basic blocks (BBS), - a single basic block (BB), a set of insns (INSNS) or a single insn (INSN) - to the scheduling region. */ -void -sched_scan (const struct sched_scan_info_def *ssi, - bb_vec_t bbs, basic_block bb, insn_vec_t insns, rtx insn) -{ - sched_scan_info = ssi; - - if (bbs != NULL || bb != NULL) - { - extend_bb (); - - if (bbs != NULL) - { - unsigned i; - basic_block x; - - FOR_EACH_VEC_ELT (basic_block, bbs, i, x) - init_bb (x); - } - - if (bb != NULL) - init_bb (bb); - } - - extend_insn (); - - if (bbs != NULL) - { - unsigned i; - basic_block x; - - FOR_EACH_VEC_ELT (basic_block, bbs, i, x) - init_insns_in_bb (x); - } - - if (bb != NULL) - init_insns_in_bb (bb); - - if (insns != NULL) - { - unsigned i; - rtx x; - - FOR_EACH_VEC_ELT (rtx, insns, i, x) - init_insn (x); - } - - if (insn != NULL) - init_insn (insn); -} - - /* Extend data structures for logical insn UID. */ -static void -luids_extend_insn (void) +void +sched_extend_luids (void) { int new_luids_max_uid = get_max_uid () + 1; @@ -5441,8 +5343,8 @@ luids_extend_insn (void) } /* Initialize LUID for INSN. */ -static void -luids_init_insn (rtx insn) +void +sched_init_insn_luid (rtx insn) { int i = INSN_P (insn) ? 1 : common_sched_info->luid_for_non_insn (insn); int luid; @@ -5458,21 +5360,23 @@ luids_init_insn (rtx insn) SET_INSN_LUID (insn, luid); } -/* Initialize luids for BBS, BB, INSNS and INSN. +/* Initialize luids for BBS. The hook common_sched_info->luid_for_non_insn () is used to determine if notes, labels, etc. need luids. */ void -sched_init_luids (bb_vec_t bbs, basic_block bb, insn_vec_t insns, rtx insn) +sched_init_luids (bb_vec_t bbs) { - const struct sched_scan_info_def ssi = + int i; + basic_block bb; + + sched_extend_luids (); + FOR_EACH_VEC_ELT (basic_block, bbs, i, bb) { - NULL, /* extend_bb */ - NULL, /* init_bb */ - luids_extend_insn, /* extend_insn */ - luids_init_insn /* init_insn */ - }; + rtx insn; - sched_scan (&ssi, bbs, bb, insns, insn); + FOR_BB_INSNS (bb, insn) + sched_init_insn_luid (insn); + } } /* Free LUIDs. */ @@ -5529,19 +5433,21 @@ init_h_i_d (rtx insn) } } -/* Initialize haifa_insn_data for BBS, BB, INSNS and INSN. */ +/* Initialize haifa_insn_data for BBS. */ void -haifa_init_h_i_d (bb_vec_t bbs, basic_block bb, insn_vec_t insns, rtx insn) +haifa_init_h_i_d (bb_vec_t bbs) { - const struct sched_scan_info_def ssi = + int i; + basic_block bb; + + extend_h_i_d (); + FOR_EACH_VEC_ELT (basic_block, bbs, i, bb) { - NULL, /* extend_bb */ - NULL, /* init_bb */ - extend_h_i_d, /* extend_insn */ - init_h_i_d /* init_insn */ - }; + rtx insn; - sched_scan (&ssi, bbs, bb, insns, insn); + FOR_BB_INSNS (bb, insn) + init_h_i_d (insn); + } } /* Finalize haifa_insn_data. */ @@ -5570,10 +5476,12 @@ haifa_init_insn (rtx insn) { gcc_assert (insn != NULL); - sched_init_luids (NULL, NULL, NULL, insn); + sched_extend_luids (); + sched_init_insn_luid (insn); sched_extend_target (); sched_deps_init (false); - haifa_init_h_i_d (NULL, NULL, NULL, insn); + extend_h_i_d (); + init_h_i_d (insn); if (adding_bb_to_current_region_p) { |