[new-regalloc-branch]: Split ra.c

Michael Matz matz@suse.de
Thu Jun 20 12:42:00 GMT 2002


Hi,

I just checked in the result of splitting ra.c into seven smaller files
(no other changes besides making it compile and reduce warnings), plus the
below diff.  I won't post the diff for the split itself, obviously.


Ciao,
Michael.
-- 
        Split ra.c into ra.c, ra.h, ra-build.c, ra-colorize.c, ra-debug.c,
        ra-ranges.c and ra-rewrite.c.

        * df.h (struct ref.id): Make unsigned.
        * df.c (df_bb_reg_def_chain_create): Remove unsigned cast.
        * ra.c (regs_overlap_p): Removed.
        (realloc_mem, free_mem, free_all_mem): Split out into ...
        * ra-build.c (ra_build_realloc, ra_build_free,
        ra_build_free_all): ... here ...
        * ra_colorize.c (ra_colorize_free_all): ... and here.
        (ra_colorize_init, ra_colorize_graph): New.
        * ra-rewrite.c (ra_rewrite_init): New.
        * Makefile.in (ra-build.o, ra-colorize.o, ra-debug.o, ra-rewrite.o):
        New targets.
        (libbackend.a): Link them in.

Index: df.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/df.h,v
retrieving revision 1.1.2.9
diff -u -p -r1.1.2.9 df.h
--- df.h	13 Jun 2002 08:41:26 -0000	1.1.2.9
+++ df.h	20 Jun 2002 19:23:25 -0000
@@ -70,7 +70,7 @@ struct ref
   rtx *loc;			/* Loc is the location of the reg.  */
   struct df_link *chain;	/* Head of def-use or use-def chain.  */
   enum df_ref_type type;	/* Type of ref.  */
-  int id;			/* Ref index.  */
+  unsigned int id;		/* Ref index.  */
   enum df_ref_flags flags;	/* Various flags.  */
 };

Index: df.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/df.c,v
retrieving revision 1.1.2.16
diff -u -p -r1.1.2.16 df.c
--- df.c	20 Jun 2002 11:12:12 -0000	1.1.2.16
+++ df.c	20 Jun 2002 19:23:25 -0000
@@ -1391,7 +1391,7 @@ df_bb_reg_def_chain_create (df, bb)
           /* Don't add ref's to the chain two times.  I.e. only add
              new refs.  XXX the same could be done by testing if the current
              insn is a modified (or a new) one.  This would be faster.  */
-          if ((unsigned) DF_REF_ID (def) < df->def_id_save)
+          if (DF_REF_ID (def) < df->def_id_save)
             continue;

 	  df->regs[dregno].defs
@@ -1445,7 +1445,7 @@ df_bb_reg_use_chain_create (df, bb)
           /* Don't add ref's to the chain two times.  I.e. only add
              new refs.  XXX the same could be done by testing if the current
              insn is a modified (or a new) one.  This would be faster.  */
-          if ((unsigned) DF_REF_ID (use) < df->use_id_save)
+          if (DF_REF_ID (use) < df->use_id_save)
             continue;

 	  df->regs[uregno].uses
Index: Makefile.in
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Makefile.in,v
retrieving revision 1.592.2.12
diff -u -p -r1.592.2.12 Makefile.in
--- Makefile.in	19 Jun 2002 18:33:29 -0000	1.592.2.12
+++ Makefile.in	20 Jun 2002 19:23:25 -0000
@@ -735,7 +735,7 @@ OBJS = alias.o bb-reorder.o bitmap.o bui
  sibcall.o simplify-rtx.o ssa.o ssa-ccp.o ssa-dce.o stmt.o		   \
  stor-layout.o stringpool.o timevar.o toplev.o tracer.o tree.o tree-dump.o \
  tree-inline.o unroll.o varasm.o varray.o version.o vmsdbgout.o xcoffout.o \
- ra.o pre-reload.o \
+ ra.o ra-build.o ra-colorize.o ra-debug.o ra-rewrite.o pre-reload.o \
  $(GGC) $(out_object_file) $(EXTRA_OBJS)

 BACKEND = main.o libbackend.a
@@ -1626,7 +1626,15 @@ dependence.o : dependence.c $(CONFIG_H)
 params.o : params.c $(CONFIG_H) $(SYSTEM_H) $(PARAMS_H) toplev.h
 hooks.o: hooks.c $(CONFIG_H) $(SYSTEM_H) $(HOOKS_H)
 ra.o : ra.c df.h $(CONFIG_H) $(SYSTEM_H) $(RTL_H)  insn-config.h $(REGS_H) \
-   $(TM_P_H) reload.h
+   $(TM_P_H) reload.h ra.h
+ra-build.o : ra-build.c df.h $(CONFIG_H) $(SYSTEM_H) $(RTL_H)  insn-config.h \
+   $(REGS_H) $(TM_P_H) reload.h ra.h
+ra-colorize.o : ra-colorize.c df.h $(CONFIG_H) $(SYSTEM_H) $(RTL_H) \
+    insn-config.h $(REGS_H) $(TM_P_H) reload.h ra.h
+ra-debug.o : ra-debug.c df.h $(CONFIG_H) $(SYSTEM_H) $(RTL_H)  insn-config.h \
+   $(REGS_H) $(TM_P_H) reload.h ra.h
+ra-rewrite.o : ra-rewrite.c df.h $(CONFIG_H) $(SYSTEM_H) $(RTL_H) \
+   insn-config.h $(REGS_H) $(TM_P_H) reload.h ra.h
 pre-reload.o : pre-reload.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) real.h flags.h \
    $(EXPR_H) reload.h $(REGS_H) hard-reg-set.h insn-config.h pre-reload.h \
    $(BASIC_BLOCK_H) $(RECOG_H) output.h function.h toplev.h cselib.h \



More information about the Gcc-patches mailing list