Move the region scheduling code out of haifa-sched.c.

From-SVN: r37977
This commit is contained in:
Bernd Schmidt 2000-12-03 19:00:00 +00:00 committed by Bernd Schmidt
parent f415f5a4ca
commit b4ead7d413
5 changed files with 3266 additions and 3183 deletions

View File

@ -1,3 +1,64 @@
2000-12-03 Bernd Schmidt <bernds@redhat.co.uk>
* Makefile.in (OBJS): Add sched-rgn.o.
(sched-rgn.o): New rule. * haifa-sched.c (sched_verbose): No
longer static.
(INSN_PRIORITY, INSN_COST, INSN_UNIT, INSN_REG_WEIGHT,
INSN_BLOCKAGE, UNIT_BITS, BLOCKAGE_MASK, ENCODE_BLOCKAGE,
UNIT_BLOCKED, BLOCKAGE_RANGE, MIN_BLOCKAGE_COST,
MAX_BLOCKAGE_COST): Move to sched-int.h.
(MAX_RGN_BLOCKS, MAX_RGN_INSNS, INSN_REF_COUNT, FED_BY_SPEC_LOAD,
IS_LOAD_INSN, struct haifa_edge, edge_table, NEXT_IN, NEXT_OUT,
FROM_BLOCK, TO_BLOCK, nr_edges, in_edges, out_edges, IN_EDGES,
OUT_EDGES, edgelst, struct region, nr_regions, rgn_table,
rgn_bb_table, block_to_bb, containing_rgn, RGN_NR_BLOCKS,
RGN_BLOCKS, BLOCK_TO_BB, BB_TO_BLOCK, CONTAINING_RGN,
debug_regions, find_single_block_region, find_rgns, too_large,
init_regions, current_nr_blocks, current_blocks, bitset, bitlst,
bitlst_table_last, bitlst_table_size, bitlst_table, bitset_member,
extract_bitlst, bblst, struct candidate, candidate_table,
bblst_table, bblst_size, bblst_last, IS_VALID, IS_SPECULATIVE,
SRC_PROB, target_bb, split_edges, compute_trg_info,
debug_candidate, debug_candidates, bbset, bbset_size, dom,
IS_RGN_ENTRY, IS_DOMINATED, prob, GET_SRC_PROB, edgeset,
rgn_nr_edges, rgn_edges, edgeset_size, edgeset_bitsize,
EDGE_TO_BIT, edge_to_bit, pot_split, ancestor_edges,
compute_dom_prob_ps, ABS_VALUE, INSN_PROBABILITY,
IS_SPECULATIVE_INSN, INSN_BB, MIN_DIFF_PRIORITY, MIN_PROBABILITY,
MIN_PROB_DIFF, check_live_1, update_live_1, check_live,
update_live, set_spec_fed, is_pfree, find_conditional_protection,
is_conditionally_protected, may_trap_exp, haifa_classify_insn,
is_prisky, is_exception_free, add_branch_dependences,
propagate_deps, compute_block_backward_dependences,
debug_dependencies, is_cfg_nonregular, build_control_flow,
new_edge, bb_deps, BITSET_UNION, BITSET_INTER, BITSET_DIFFER,
BITSET_INVERT, BITSET_ADD, BITSET_REMOVE, debug_regions,
UPDATE_LOOP_RELATIONS, INSN_TRAP_CLASS, WORST_CLASS, IS_REACHABLE,
CONST_BASED_ADDRESS_P, free_pending_lists, sched_target_n_insns,
target_n_insns, sched_n_insns, init_ready_list, deaths_in_region,
can_schedule_ready_p, new_ready, schedule_more_p, rgn_print_insn,
rgn_rank, region_sched_info): Move to sched-rgn.c.
(debug_reg_vector): Delete useless function.
(get_bb_head_tail): Likewise.
(insn_issue_delay, insn_cost, ready_add, get_block_head_tail,
no_real_insns_p, rm_line_notes, save_line_notes,
restore_line_notes, rm_redundant_line_notes, sched_init): No
longer static.
(rm_line_notes, save_line_notes, restore_line_notes,
schedule_block, set_priorities): Change argument to be a real
basic block, not one of haifa's "bb"s. All callers changed
(rm_other_notes): Initialize note_list here, not in
schedule_region.
(sched_finish): New function, called from schedule_insn. * *
sched-int.h (INSN_PRIORITY, INSN_COST, INSN_UNIT, INSN_REG_WEIGHT,
INSN_BLOCKAGE, UNIT_BITS, BLOCKAGE_MASK, ENCODE_BLOCKAGE,
UNIT_BLOCKED, BLOCKAGE_RANGE, MIN_BLOCKAGE_COST,
MAX_BLOCKAGE_COST): Moved here from haifa-sched.c.
(get_block_head_tail, no_real_insns_p, rm_line_notes,
save_line_notes, restore_line_notes, rm_redundant_line_notes,
rm_other_notes, insn_issue_delay, set_priorities, schedule_block,
sched_init, sched_finish, ready_add, insn_cost): Declare.
2000-12-03 Laurynas Biveinis <lauras@softhome.net>
Bruce Korb <bkorb@gnu.org>

View File

@ -737,7 +737,7 @@ OBJS = diagnostic.o version.o tree.o print-tree.o stor-layout.o fold-const.o \
mbchar.o splay-tree.o graph.o sbitmap.o resource.o hash.o predict.o \
lists.o ggc-common.o $(GGC) stringpool.o simplify-rtx.o ssa.o bb-reorder.o \
sibcall.o conflict.o timevar.o ifcvt.o dominance.o dependence.o dce.o \
sched-vis.o sched-deps.o hashtab.o
sched-vis.o sched-deps.o sched-rgn.o hashtab.o
BACKEND = toplev.o libbackend.a
@ -1458,6 +1458,9 @@ haifa-sched.o : haifa-sched.c $(CONFIG_H) system.h $(RTL_H) sched-int.h \
sched-deps.o : haifa-sched.c $(CONFIG_H) system.h $(RTL_H) sched-int.h \
$(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h flags.h insn-config.h function.h \
$(INSN_ATTR_H) toplev.h $(RECOG_H) except.h
sched-rgn.o : haifa-sched.c $(CONFIG_H) system.h $(RTL_H) sched-int.h \
$(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h flags.h insn-config.h function.h \
$(INSN_ATTR_H) toplev.h $(RECOG_H) except.h
sched-vis.o : sched-vis.c $(CONFIG_H) system.h $(RTL_H) sched-int.h \
$(INSN_ATTR_H) $(REGS_H)
final.o : final.c $(CONFIG_H) system.h $(RTL_H) $(TREE_H) flags.h intl.h \

File diff suppressed because it is too large Load Diff

View File

@ -184,13 +184,35 @@ struct haifa_insn_data
extern struct haifa_insn_data *h_i_d;
/* Accessor macros for h_i_d. There are more in haifa-sched.c. */
/* Accessor macros for h_i_d. There are more in haifa-sched.c and
sched-rgn.c. */
#define INSN_DEPEND(INSN) (h_i_d[INSN_UID (INSN)].depend)
#define INSN_LUID(INSN) (h_i_d[INSN_UID (INSN)].luid)
#define CANT_MOVE(insn) (h_i_d[INSN_UID (insn)].cant_move)
#define INSN_DEP_COUNT(INSN) (h_i_d[INSN_UID (INSN)].dep_count)
#define INSN_PRIORITY(INSN) (h_i_d[INSN_UID (INSN)].priority)
#define INSN_COST(INSN) (h_i_d[INSN_UID (INSN)].cost)
#define INSN_UNIT(INSN) (h_i_d[INSN_UID (INSN)].units)
#define INSN_REG_WEIGHT(INSN) (h_i_d[INSN_UID (INSN)].reg_weight)
#define INSN_BLOCKAGE(INSN) (h_i_d[INSN_UID (INSN)].blockage)
#define UNIT_BITS 5
#define BLOCKAGE_MASK ((1 << BLOCKAGE_BITS) - 1)
#define ENCODE_BLOCKAGE(U, R) \
(((U) << BLOCKAGE_BITS \
| MIN_BLOCKAGE_COST (R)) << BLOCKAGE_BITS \
| MAX_BLOCKAGE_COST (R))
#define UNIT_BLOCKED(B) ((B) >> (2 * BLOCKAGE_BITS))
#define BLOCKAGE_RANGE(B) \
(((((B) >> BLOCKAGE_BITS) & BLOCKAGE_MASK) << (HOST_BITS_PER_INT / 2)) \
| ((B) & BLOCKAGE_MASK))
/* Encodings of the `<name>_unit_blockage_range' function. */
#define MIN_BLOCKAGE_COST(R) ((R) >> (HOST_BITS_PER_INT / 2))
#define MAX_BLOCKAGE_COST(R) ((R) & ((1 << (HOST_BITS_PER_INT / 2)) - 1))
extern FILE *sched_dump;
extern int sched_verbose;
#ifndef __GNUC__
#define __inline
@ -227,7 +249,28 @@ extern void init_dependency_caches PARAMS ((int));
extern void free_dependency_caches PARAMS ((void));
/* Functions in haifa-sched.c. */
extern void get_block_head_tail PARAMS ((int, rtx *, rtx *));
extern int no_real_insns_p PARAMS ((rtx, rtx));
extern void rm_line_notes PARAMS ((int));
extern void save_line_notes PARAMS ((int));
extern void restore_line_notes PARAMS ((int));
extern void rm_redundant_line_notes PARAMS ((void));
extern void rm_other_notes PARAMS ((rtx, rtx));
extern int insn_issue_delay PARAMS ((rtx));
extern int set_priorities PARAMS ((int));
extern void schedule_block PARAMS ((int, int));
extern void sched_init PARAMS ((FILE *));
extern void sched_finish PARAMS ((void));
extern void ready_add PARAMS ((struct ready_list *, rtx));
/* The following are exported for the benefit of debugging functions. It
would be nicer to keep them private to haifa-sched.c. */
extern int insn_unit PARAMS ((rtx));
extern int insn_cost PARAMS ((rtx, rtx, rtx));
extern rtx get_unit_last_insn PARAMS ((int));
extern int actual_hazard_this_instance PARAMS ((int, int, rtx, int, int));

3116
gcc/sched-rgn.c Normal file

File diff suppressed because it is too large Load Diff