aboutsummaryrefslogtreecommitdiff
path: root/gcc/reload.h
diff options
context:
space:
mode:
authorBernd Schmidt <crux@pool.informatik.rwth-aachen.de>1998-10-05 18:39:23 -0600
committerJeff Law <law@gcc.gnu.org>1998-10-05 18:39:23 -0600
commitcad6f7d0500211029f717912048103063ea93df5 (patch)
tree8d139251935aba1755bfaa2510b2f95b82ebf53f /gcc/reload.h
parent0eaae86cabfda78baec29e96a461f6bc52f60e6e (diff)
downloadgcc-cad6f7d0500211029f717912048103063ea93df5.zip
gcc-cad6f7d0500211029f717912048103063ea93df5.tar.gz
gcc-cad6f7d0500211029f717912048103063ea93df5.tar.bz2
Makefile.in (stupid.o): Update dependencies.
* Makefile.in (stupid.o): Update dependencies. (global.o): Likewise. * global.c: Include reload.h (reg_becomes_live): New function. (reg_dies): New function. (build_insn_chain): New function. (global_alloc): Call build_insn_chain before calling reload. * reload.h (struct needs): New structure definition. (struct insn_chain): Likewise. (reload_insn_chain): Declare variable. (new_insn_chain): Declare function. * reload1.c (reload_startobj): New variable. (reload_insn_chain): New variable. (unused_insn_chains): New variable. (new_insn_chain): New function. (init_reload): Initialize reload_startobj, not reload_firstobj. (reload): Initialize reload_firstobj. Before returning, free everything on the reload_obstack. * stupid.c: Include insn-config.h, reload.h and basic-block.h. (reg_where_dead_chain, reg_where_born_exact, reg_where_born_clobber, current_chain): New variables. (reg_where_born): Delete variable. (REG_WHERE_BORN): New macro. (find_clobbered_regs): New function. (stupid_life_analysis): Don't allocate/free reg_where_born. Allocate and free reg_where_born_exact, reg_where_born_clobber, reg_where_dead_chain. Use REG_WHERE_BORN instead of reg_where_born. While processing the insns, build the reload_insn_chain with information about register lifetimes. (stupid_reg_compare): Use REG_WHERE_BORN instead of reg_where_born. (stupid_mark_refs): Replace arg INSN with arg CHAIN. All callers changed. Compute and information about birth and death of pseudo registers in reg_where_dead_chain, reg_where_born_exact and reg_where_born_clobber. Delete code to set elements of reg_where_born. From-SVN: r22862
Diffstat (limited to 'gcc/reload.h')
-rw-r--r--gcc/reload.h75
1 files changed, 75 insertions, 0 deletions
diff --git a/gcc/reload.h b/gcc/reload.h
index d99b0c1..58f6be3 100644
--- a/gcc/reload.h
+++ b/gcc/reload.h
@@ -142,6 +142,81 @@ extern enum insn_code reload_in_optab[];
extern enum insn_code reload_out_optab[];
#endif
+struct needs
+{
+ /* [0] is normal, [1] is nongroup. */
+ short regs[2][N_REG_CLASSES];
+ short groups[N_REG_CLASSES];
+};
+
+#if defined SET_HARD_REG_BIT && defined CLEAR_REG_SET
+/* This structure describes instructions which are relevant for reload.
+ Apart from all regular insns, this also includes CODE_LABELs, since they
+ must be examined for register elimination. */
+struct insn_chain
+{
+ /* Links to the neighbour instructions. */
+ struct insn_chain *next, *prev;
+
+ /* Link through a chains set up by calculate_needs_all_insns, containing
+ all insns that need reloading. */
+ struct insn_chain *next_need_reload;
+
+ /* The basic block this insn is in. */
+ int block;
+ /* The rtx of the insn. */
+ rtx insn;
+ /* Register life information: record all live hard registers, and all
+ live pseudos that have a hard register.
+ This information is recorded for the point immediately before the insn
+ (in live_before), and for the point within the insn at which all
+ outputs have just been written to (in live_after). */
+ regset live_before;
+ regset live_after;
+
+ /* For each class, size of group of consecutive regs
+ that is needed for the reloads of this class. */
+ char group_size[N_REG_CLASSES];
+ /* For each class, the machine mode which requires consecutive
+ groups of regs of that class.
+ If two different modes ever require groups of one class,
+ they must be the same size and equally restrictive for that class,
+ otherwise we can't handle the complexity. */
+ enum machine_mode group_mode[N_REG_CLASSES];
+
+ /* Indicates if a register was counted against the need for
+ groups. 0 means it can count against max_nongroup instead. */
+ HARD_REG_SET counted_for_groups;
+
+ /* Indicates if a register was counted against the need for
+ non-groups. 0 means it can become part of a new group.
+ During choose_reload_regs, 1 here means don't use this reg
+ as part of a group, even if it seems to be otherwise ok. */
+ HARD_REG_SET counted_for_nongroups;
+
+ /* Indicates which registers have already been used for spills. */
+ HARD_REG_SET used_spill_regs;
+
+ /* Describe the needs for reload registers of this insn. */
+ struct needs need;
+
+ /* Nonzero if find_reloads said the insn requires reloading. */
+ unsigned int need_reload:1;
+ /* Nonzero if eliminate_regs_in_insn said it requires eliminations. */
+ unsigned int need_elim:1;
+ /* Nonzero if this insn was inserted by perform_caller_saves. */
+ unsigned int is_caller_save_insn:1;
+};
+
+/* A chain of insn_chain structures to describe all non-note insns in
+ a function. */
+extern struct insn_chain *reload_insn_chain;
+
+/* Allocate a new insn_chain structure. */
+extern struct insn_chain *new_insn_chain PROTO((void));
+
+#endif
+
/* Functions from reload.c: */
/* Return a memory location that will be used to copy X in mode MODE.