summaryrefslogtreecommitdiff
path: root/gcc/sel-sched-ir.c
diff options
context:
space:
mode:
authorbernds <bernds@138bc75d-0d04-0410-961f-82ee72b054a4>2011-05-27 10:47:48 +0000
committerbernds <bernds@138bc75d-0d04-0410-961f-82ee72b054a4>2011-05-27 10:47:48 +0000
commit52d7e28c26c1f136df0ee1a1993c9be371d52462 (patch)
treebd7ae2e68beab28e466d425df5b2ef2fcb55a8e6 /gcc/sel-sched-ir.c
parent76288c9ae6793fae67779f28de294d908a0fb917 (diff)
downloadgcc-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/sel-sched-ir.c')
-rw-r--r--gcc/sel-sched-ir.c70
1 files changed, 59 insertions, 11 deletions
diff --git a/gcc/sel-sched-ir.c b/gcc/sel-sched-ir.c
index a12617ce3ee..de7629afa06 100644
--- a/gcc/sel-sched-ir.c
+++ b/gcc/sel-sched-ir.c
@@ -2720,6 +2720,54 @@ deps_init_id (idata_t id, insn_t insn, bool force_unique_p)
}
+struct sched_scan_info_def
+{
+ /* This hook notifies scheduler frontend to extend its internal per basic
+ block data structures. This hook should be called once before a series of
+ calls to bb_init (). */
+ void (*extend_bb) (void);
+
+ /* This hook makes scheduler frontend to initialize its internal data
+ structures for the passed basic block. */
+ void (*init_bb) (basic_block);
+
+ /* This hook notifies scheduler frontend to extend its internal per insn data
+ structures. This hook should be called once before a series of calls to
+ insn_init (). */
+ void (*extend_insn) (void);
+
+ /* This hook makes scheduler frontend to initialize its internal data
+ structures for the passed insn. */
+ void (*init_insn) (rtx);
+};
+
+/* A driver function to add a set of basic blocks (BBS) to the
+ scheduling region. */
+static void
+sched_scan (const struct sched_scan_info_def *ssi, bb_vec_t bbs)
+{
+ unsigned i;
+ basic_block bb;
+
+ if (ssi->extend_bb)
+ ssi->extend_bb ();
+
+ if (ssi->init_bb)
+ FOR_EACH_VEC_ELT (basic_block, bbs, i, bb)
+ ssi->init_bb (bb);
+
+ if (ssi->extend_insn)
+ ssi->extend_insn ();
+
+ if (ssi->init_insn)
+ FOR_EACH_VEC_ELT (basic_block, bbs, i, bb)
+ {
+ rtx insn;
+
+ FOR_BB_INSNS (bb, insn)
+ ssi->init_insn (insn);
+ }
+}
/* Implement hooks for collecting fundamental insn properties like if insn is
an ASM or is within a SCHED_GROUP. */
@@ -2944,7 +2992,7 @@ sel_init_global_and_expr (bb_vec_t bbs)
init_global_and_expr_for_insn /* init_insn */
};
- sched_scan (&ssi, bbs, NULL, NULL, NULL);
+ sched_scan (&ssi, bbs);
}
/* Finalize region-scope data structures for basic blocks. */
@@ -3001,7 +3049,7 @@ sel_finish_global_and_expr (void)
finish_global_and_expr_insn /* init_insn */
};
- sched_scan (&ssi, bbs, NULL, NULL, NULL);
+ sched_scan (&ssi, bbs);
}
VEC_free (basic_block, heap, bbs);
@@ -3990,9 +4038,6 @@ finish_region_bb_info (void)
/* Data for each insn in current region. */
VEC (sel_insn_data_def, heap) *s_i_d = NULL;
-/* A vector for the insns we've emitted. */
-static insn_vec_t new_insns = NULL;
-
/* Extend data structures for insns from current region. */
static void
extend_insn_data (void)
@@ -4131,7 +4176,10 @@ sel_init_new_insn (insn_t insn, int flags)
}
if (flags & INSN_INIT_TODO_LUID)
- sched_init_luids (NULL, NULL, NULL, insn);
+ {
+ sched_extend_luids ();
+ sched_init_insn_luid (insn);
+ }
if (flags & INSN_INIT_TODO_SSID)
{
@@ -4473,7 +4521,7 @@ init_bb (basic_block bb)
}
void
-sel_init_bbs (bb_vec_t bbs, basic_block bb)
+sel_init_bbs (bb_vec_t bbs)
{
const struct sched_scan_info_def ssi =
{
@@ -4483,7 +4531,7 @@ sel_init_bbs (bb_vec_t bbs, basic_block bb)
NULL /* init_insn */
};
- sched_scan (&ssi, bbs, bb, new_insns, NULL);
+ sched_scan (&ssi, bbs);
}
/* Restore notes for the whole region. */
@@ -5040,9 +5088,9 @@ static void
sel_add_bb (basic_block bb)
{
/* Extend luids so that new notes will receive zero luids. */
- sched_init_luids (NULL, NULL, NULL, NULL);
+ sched_extend_luids ();
sched_init_bbs ();
- sel_init_bbs (last_added_blocks, NULL);
+ sel_init_bbs (last_added_blocks);
/* When bb is passed explicitly, the vector should contain
the only element that equals to bb; otherwise, the vector
@@ -5583,7 +5631,7 @@ create_insn_rtx_from_pattern (rtx pattern, rtx label)
end_sequence ();
- sched_init_luids (NULL, NULL, NULL, NULL);
+ sched_extend_luids ();
sched_extend_target ();
sched_deps_init (false);