Commit ed8d2920 by Michael Matz Committed by Michael Matz

[multiple changes]

2002-07-15  Michael Matz  <matz@suse.de>,
            Daniel Berlin  <dberlin@dberlin.org>,
	    Denis Chertykov  <denisc@overta.ru>

	Add a new register allocator.

	* ra.c: New file.
	* ra.h: New file.
	* ra-build.c: New file.
	* ra-colorize.c: New file.
	* ra-debug.c: New file.
	* ra-rewrite.c: New file.

	* Makefile.in (ra.o, ra-build.o, ra-colorize.o, ra-debug.o,
	(ra-rewrite.o): New .o files for libbackend.a.
	(GTFILES): Add basic-block.h.

	* toplev.c (flag_new_regalloc): New.
	(f_options): New option "new-ra".
	(rest_of_compilation): Call initialize_uninitialized_subregs()
	only for the old allocator.  If flag_new_regalloc is set, call
	new allocator, instead of local_alloc(), global_alloc() and
	friends.

	* doc/invoke.texi: Document -fnew-ra.
	* basic-block.h (FOR_ALL_BB): New.
	* config/rs6000/rs6000.c (print_operand): Write small constants
	as @l+80.

	* df.c (read_modify_subreg_p): Narrow down cases for a rmw subreg.
	(df_reg_table_realloc): Make size at least as large as max_reg_num().
	(df_insn_table_realloc): Size argument now is absolute, not relative.
	Changed all callers.

	* gengtype.c (main): Add the pseudo-type "HARD_REG_SET".
	* regclass.c (reg_scan_mark_refs): Ignore NULL rtx's.

	2002-06-20  Michael Matz  <matz@suse.de>

	* df.h (struct ref.id): Make unsigned.
	* df.c (df_bb_reg_def_chain_create): Remove unsigned cast.

	2002-06-13  Michael Matz  <matz@suse.de>

	* df.h (DF_REF_MODE_CHANGE): New flag.
	* df.c (df_def_record_1, df_uses_record): Set this flag for refs
	involving subregs with invalid mode changes, when
	CLASS_CANNOT_CHANGE_MODE is defined.

	2002-05-07  Michael Matz  <matz@suse.de>

	* reload1.c (fixup_abnormal_edges): Don't insert on NULL edge.

	2002-05-03  Michael Matz  <matz@suse.de>

	* sbitmap.c (sbitmap_difference): Accept sbitmaps of different size.

	Sat Feb  2 18:58:07 2002  Denis Chertykov  <denisc@overta.ru>

	* regclass.c (regclass): Work with all regs which have sets or
	refs.
	(reg_scan_mark_refs): Count regs inside (clobber ...).

	2002-01-04  Michael Matz  <matzmich@cs.tu-berlin.de>

	* df.c (df_ref_record): Correctly calculate SUBREGs of hardregs.
	(df_bb_reg_def_chain_create, df_bb_reg_use_chain_create): Only
	add new refs.
	(df_bb_refs_update): Don't clear insns_modified here, ...
	(df_analyse): ... but here.

	* sbitmap.c (dump_sbitmap_file): New.
	(debug_sbitmap): Use it.

	* sbitmap.h (dump_sbitmap_file): Add prototype.

	2001-08-07  Daniel Berlin  <dan@cgsoftware.com>

	* df.c (df_insn_modify): Grow the UID table if necessary, rather
	than assume all emits go through df_insns_modify.

	2001-07-26  Daniel Berlin  <dan@cgsoftware.com>

	* regclass.c (reg_scan_mark_refs): When we increase REG_N_SETS,
	increase REG_N_REFS (like flow does), so that regclass doesn't
	think a reg is useless, and thus, not calculate a class, when it
	really should have.

	2001-01-28  Daniel Berlin  <dberlin@redhat.com>

	* sbitmap.h (EXECUTE_IF_SET_IN_SBITMAP_REV): New macro, needed for
	dataflow analysis.

From-SVN: r55458
parent 7bc7d27b
2002-07-15 Michael Matz <matz@suse.de>,
Daniel Berlin <dberlin@dberlin.org>,
Denis Chertykov <denisc@overta.ru>
Add a new register allocator.
* ra.c: New file.
* ra.h: New file.
* ra-build.c: New file.
* ra-colorize.c: New file.
* ra-debug.c: New file.
* ra-rewrite.c: New file.
* Makefile.in (ra.o, ra-build.o, ra-colorize.o, ra-debug.o,
(ra-rewrite.o): New .o files for libbackend.a.
(GTFILES): Add basic-block.h.
* toplev.c (flag_new_regalloc): New.
(f_options): New option "new-ra".
(rest_of_compilation): Call initialize_uninitialized_subregs()
only for the old allocator. If flag_new_regalloc is set, call
new allocator, instead of local_alloc(), global_alloc() and
friends.
* doc/invoke.texi: Document -fnew-ra.
* basic-block.h (FOR_ALL_BB): New.
* config/rs6000/rs6000.c (print_operand): Write small constants
as @l+80.
* df.c (read_modify_subreg_p): Narrow down cases for a rmw subreg.
(df_reg_table_realloc): Make size at least as large as max_reg_num().
(df_insn_table_realloc): Size argument now is absolute, not relative.
Changed all callers.
* gengtype.c (main): Add the pseudo-type "HARD_REG_SET".
* regclass.c (reg_scan_mark_refs): Ignore NULL rtx's.
2002-06-20 Michael Matz <matz@suse.de>
* df.h (struct ref.id): Make unsigned.
* df.c (df_bb_reg_def_chain_create): Remove unsigned cast.
2002-06-13 Michael Matz <matz@suse.de>
* df.h (DF_REF_MODE_CHANGE): New flag.
* df.c (df_def_record_1, df_uses_record): Set this flag for refs
involving subregs with invalid mode changes, when
CLASS_CANNOT_CHANGE_MODE is defined.
2002-05-07 Michael Matz <matz@suse.de>
* reload1.c (fixup_abnormal_edges): Don't insert on NULL edge.
2002-05-03 Michael Matz <matz@suse.de>
* sbitmap.c (sbitmap_difference): Accept sbitmaps of different size.
Sat Feb 2 18:58:07 2002 Denis Chertykov <denisc@overta.ru>
* regclass.c (regclass): Work with all regs which have sets or
refs.
(reg_scan_mark_refs): Count regs inside (clobber ...).
2002-01-04 Michael Matz <matzmich@cs.tu-berlin.de>
* df.c (df_ref_record): Correctly calculate SUBREGs of hardregs.
(df_bb_reg_def_chain_create, df_bb_reg_use_chain_create): Only
add new refs.
(df_bb_refs_update): Don't clear insns_modified here, ...
(df_analyse): ... but here.
* sbitmap.c (dump_sbitmap_file): New.
(debug_sbitmap): Use it.
* sbitmap.h (dump_sbitmap_file): Add prototype.
2001-08-07 Daniel Berlin <dan@cgsoftware.com>
* df.c (df_insn_modify): Grow the UID table if necessary, rather
than assume all emits go through df_insns_modify.
2001-07-26 Daniel Berlin <dan@cgsoftware.com>
* regclass.c (reg_scan_mark_refs): When we increase REG_N_SETS,
increase REG_N_REFS (like flow does), so that regclass doesn't
think a reg is useless, and thus, not calculate a class, when it
really should have.
2001-01-28 Daniel Berlin <dberlin@redhat.com>
* sbitmap.h (EXECUTE_IF_SET_IN_SBITMAP_REV): New macro, needed for
dataflow analysis.
2002-07-15 Jakub Jelinek <jakub@redhat.com>
PR middle-end/7245
......
......@@ -731,7 +731,8 @@ OBJS = alias.o bb-reorder.o bitmap.o builtins.o caller-save.o calls.o \
insn-extract.o insn-opinit.o insn-output.o insn-peep.o insn-recog.o \
integrate.o intl.o jump.o langhooks.o lcm.o lists.o local-alloc.o \
loop.o mbchar.o optabs.o params.o predict.o print-rtl.o print-tree.o \
profile.o real.o recog.o reg-stack.o regclass.o regmove.o regrename.o \
profile.o ra.o ra-build.o ra-colorize.o ra-debug.o ra-rewrite.o \
real.o recog.o reg-stack.o regclass.o regmove.o regrename.o \
reload.o reload1.o reorg.o resource.o rtl.o rtlanal.o rtl-error.o \
sbitmap.o sched-deps.o sched-ebb.o sched-rgn.o sched-vis.o sdbout.o \
sibcall.o simplify-rtx.o ssa.o ssa-ccp.o ssa-dce.o stmt.o \
......@@ -1562,6 +1563,19 @@ global.o : global.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) flags.h reload.h function.h
$(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h insn-config.h output.h toplev.h \
$(TM_P_H)
varray.o : varray.c $(CONFIG_H) $(SYSTEM_H) varray.h $(GGC_H) errors.h
ra.o : ra.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(TM_P_H) insn-config.h \
$(RECOG_H) integrate.h function.h $(REGS_H) $(OBSTACK_H) hard-reg-set.h \
$(BASIC_BLOCK_H) df.h expr.h output.h toplev.h flags.h reload.h ra.h
ra-build.o : ra-build.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(TM_P_H) \
insn-config.h $(RECOG_H) function.h $(REGS_H) hard-reg-set.h \
$(BASIC_BLOCK_H) df.h output.h ggc.h ra.h gt-ra-build.h
ra-colorize.o : ra-colorize.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(TM_P_H) \
function.h $(REGS_H) hard-reg-set.h $(BASIC_BLOCK_H) df.h output.h ra.h
ra-debug.o : ra-debug.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) insn-config.h \
$(RECOG_H) function.h hard-reg-set.h $(BASIC_BLOCK_H) df.h output.h ra.h
ra-rewrite.o : ra-rewrite.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(TM_P_H) \
function.h $(REGS_H) hard-reg-set.h $(BASIC_BLOCK_H) df.h expr.h \
output.h except.h ra.h
reload.o : reload.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) flags.h output.h \
$(EXPR_H) $(OPTABS_H) reload.h $(RECOG_H) hard-reg-set.h insn-config.h \
$(REGS_H) function.h real.h toplev.h $(TM_P_H)
......@@ -1820,7 +1834,8 @@ GTFILES = $(GCONFIG_H) $(srcdir)/location.h \
$(srcdir)/except.c $(srcdir)/explow.c $(srcdir)/expr.c \
$(srcdir)/fold-const.c $(srcdir)/function.c \
$(srcdir)/gcse.c $(srcdir)/integrate.c $(srcdir)/lists.c $(srcdir)/optabs.c \
$(srcdir)/profile.c $(srcdir)/regclass.c $(srcdir)/reg-stack.c \
$(srcdir)/profile.c $(srcdir)/ra-build.c $(srcdir)/regclass.c \
$(srcdir)/reg-stack.c \
$(srcdir)/sdbout.c $(srcdir)/stmt.c $(srcdir)/stor-layout.c \
$(srcdir)/tree.c $(srcdir)/varasm.c \
$(out_file) \
......@@ -1836,7 +1851,7 @@ gt-integrate.h gt-stmt.h gt-tree.h gt-varasm.h gt-emit-rtl.h : s-gtype; @true
gt-explow.h gt-stor-layout.h gt-regclass.h gt-lists.h : s-gtype; @true
gt-alias.h gt-cselib.h gt-fold-const.h gt-gcse.h gt-profile.h : s-gtype; @true
gt-expr.h gt-sdbout.h gt-optabs.h gt-bitmap.h gt-dwarf2out.h : s-gtype ; @true
gt-reg-stack.h gt-dependence.h : s-gtype ; @true
gt-ra-build.h gt-reg-stack.h gt-dependence.h : s-gtype ; @true
gt-c-common.h gt-c-decl.h gt-c-parse.h gt-c-pragma.h : s-gtype; @true
gt-c-objc-common.h gtype-c.h gt-location.h : s-gtype ; @true
......
......@@ -261,6 +261,12 @@ extern varray_type basic_block_info;
#define FOR_EACH_BB_REVERSE(BB) \
FOR_BB_BETWEEN (BB, EXIT_BLOCK_PTR->prev_bb, ENTRY_BLOCK_PTR, prev_bb)
/* Cycles through _all_ basic blocks, even the fake ones (entry and
exit block). */
#define FOR_ALL_BB(BB) \
for (BB = ENTRY_BLOCK_PTR; BB; BB = BB->next_bb)
/* What registers are live at the setjmp call. */
extern regset regs_live_at_setjmp;
......
......@@ -6258,6 +6258,11 @@ print_operand (file, x, code)
output_operand_lossage ("invalid %%K value");
print_operand_address (file, XEXP (XEXP (x, 0), 0));
fputs ("@l", file);
/* For GNU as, there must be a non-alphanumeric character
between 'l' and the number. The '-' is added by
print_operand() already. */
if (INTVAL (XEXP (XEXP (x, 0), 1)) >= 0)
fputs ("+", file);
print_operand (file, XEXP (XEXP (x, 0), 1), 0);
}
return;
......
......@@ -50,7 +50,16 @@ struct df_link
enum df_ref_flags
{
DF_REF_READ_WRITE = 1
DF_REF_READ_WRITE = 1,
/* This flag is set on register references itself representing a or
being inside a subreg on machines which have CLASS_CANNOT_CHANGE_MODE
and where the mode change of that subreg expression is invalid for
this class. Note, that this flag can also be set on df_refs
representing the REG itself (i.e. one might not see the subreg
anyore). Also note, that this flag is set also for hardreg refs.
I.e. you must check yourself if it's a pseudo. */
DF_REF_MODE_CHANGE = 2
};
/* Define a register reference structure. */
......@@ -61,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. */
};
......
......@@ -270,7 +270,7 @@ in the following sections.
-fif-conversion -fif-conversion2 @gol
-finline-functions -finline-limit=@var{n} -fkeep-inline-functions @gol
-fkeep-static-consts -fmerge-constants -fmerge-all-constants @gol
-fmove-all-movables -fno-default-inline -fno-defer-pop @gol
-fmove-all-movables -fnew-ra -fno-default-inline -fno-defer-pop @gol
-fno-function-cse -fno-guess-branch-probability @gol
-fno-inline -fno-math-errno -fno-peephole -fno-peephole2 @gol
-funsafe-math-optimizations -fno-trapping-math @gol
......@@ -3395,6 +3395,12 @@ types. Languages like C or C++ require each non-automatic variable to
have distinct location, so using this option will result in non-conforming
behavior.
@item -fnew-ra
@opindex fnew-ra
Use a graph coloring register allocator. Currently this option is meant
for testing, so we are interested to hear about miscompilations with
@option{-fnew-ra}.
@item -fno-function-cse
@opindex fno-function-cse
Do not put function addresses in registers; make each instruction that
......
......@@ -1939,6 +1939,10 @@ main(argc, argv)
strlen ("void"))),
&pos);
do_typedef ("HARD_REG_SET", create_array (
create_scalar_type ("unsigned long", strlen ("unsigned long")),
"2"), &pos);
for (i = 0; i < NUM_GT_FILES; i++)
{
int dupflag = 0;
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
......@@ -1317,7 +1317,7 @@ regclass (f, nregs, dump)
/* In non-optimizing compilation REG_N_REFS is not initialized
yet. */
if (optimize && !REG_N_REFS (i))
if (optimize && !REG_N_REFS (i) && !REG_N_SETS (i))
continue;
for (class = (int) ALL_REGS - 1; class > 0; class--)
......@@ -2397,6 +2397,8 @@ reg_scan_mark_refs (x, insn, note_flag, min_regno)
rtx dest;
rtx note;
if (!x)
return;
code = GET_CODE (x);
switch (code)
{
......@@ -2423,6 +2425,10 @@ reg_scan_mark_refs (x, insn, note_flag, min_regno)
REGNO_LAST_UID (regno) = INSN_UID (insn);
if (REGNO_FIRST_UID (regno) == 0)
REGNO_FIRST_UID (regno) = INSN_UID (insn);
/* If we are called by reg_scan_update() (indicated by min_regno
being set), we also need to update the reference count. */
if (min_regno)
REG_N_REFS (regno)++;
}
}
break;
......@@ -2439,6 +2445,18 @@ reg_scan_mark_refs (x, insn, note_flag, min_regno)
reg_scan_mark_refs (XEXP (x, 1), insn, note_flag, min_regno);
break;
case CLOBBER:
{
rtx reg = XEXP (x, 0);
if (REG_P (reg)
&& REGNO (reg) >= min_regno)
{
REG_N_SETS (REGNO (reg))++;
REG_N_REFS (REGNO (reg))++;
}
}
break;
case SET:
/* Count a set of the destination if it is a register. */
for (dest = SET_DEST (x);
......
......@@ -9475,12 +9475,21 @@ fixup_abnormal_edges ()
{
delete_insn (insn);
/* We're not deleting it, we're moving it. */
INSN_DELETED_P (insn) = 0;
PREV_INSN (insn) = NULL_RTX;
NEXT_INSN (insn) = NULL_RTX;
/* Sometimes there's still the return value USE.
If it's placed after a trapping call (i.e. that
call is the last insn anyway), we have no fallthru
edge. Simply delete this use and don't try to insert
on the non-existant edge. */
if (GET_CODE (PATTERN (insn)) != USE)
{
rtx seq;
/* We're not deleting it, we're moving it. */
INSN_DELETED_P (insn) = 0;
PREV_INSN (insn) = NULL_RTX;
NEXT_INSN (insn) = NULL_RTX;
insert_insn_on_edge (insn, e);
insert_insn_on_edge (insn, e);
}
}
insn = next;
}
......
......@@ -218,13 +218,26 @@ void
sbitmap_difference (dst, a, b)
sbitmap dst, a, b;
{
unsigned int i, n = dst->size;
unsigned int i, dst_size = dst->size;
unsigned int min_size = dst->size;
sbitmap_ptr dstp = dst->elms;
sbitmap_ptr ap = a->elms;
sbitmap_ptr bp = b->elms;
for (i = 0; i < n; i++)
*dstp++ = *ap++ & ~*bp++;
/* A should be at least as large as DEST, to have a defined source. */
if (a->size < dst_size)
abort ();
/* If minuend is smaller, we simply pretend it to be zero bits, i.e.
only copy the subtrahend into dest. */
if (b->size < min_size)
min_size = b->size;
for (i = 0; i < min_size; i++)
*dstp++ = *ap++ & (~*bp++);
/* Now fill the rest of dest from A, if B was too short.
This makes sense only when destination and A differ. */
if (dst != a && i != dst_size)
for (; i < dst_size; i++)
*dstp++ = *ap++;
}
/* Set DST to be (A and B).
......@@ -658,27 +671,35 @@ dump_sbitmap (file, bmap)
}
void
debug_sbitmap (bmap)
dump_sbitmap_file (file, bmap)
FILE *file;
sbitmap bmap;
{
unsigned int i, pos;
fprintf (stderr, "n_bits = %d, set = {", bmap->n_bits);
fprintf (file, "n_bits = %d, set = {", bmap->n_bits);
for (pos = 30, i = 0; i < bmap->n_bits; i++)
if (TEST_BIT (bmap, i))
{
if (pos > 70)
{
fprintf (stderr, "\n");
fprintf (file, "\n ");
pos = 0;
}
fprintf (stderr, "%d ", i);
pos += 1 + (i >= 10) + (i >= 100);
fprintf (file, "%d ", i);
pos += 2 + (i >= 10) + (i >= 100) + (i >= 1000);
}
fprintf (stderr, "}\n");
fprintf (file, "}\n");
}
void
debug_sbitmap (bmap)
sbitmap bmap;
{
dump_sbitmap_file (stderr, bmap);
}
void
......
......@@ -85,12 +85,41 @@ do { \
} \
} while (0)
#define EXECUTE_IF_SET_IN_SBITMAP_REV(SBITMAP, N, CODE) \
do { \
unsigned int word_num_; \
unsigned int bit_num_; \
unsigned int size_ = (SBITMAP)->size; \
SBITMAP_ELT_TYPE *ptr_ = (SBITMAP)->elms; \
\
for (word_num_ = size_; word_num_ > 0; word_num_--) \
{ \
SBITMAP_ELT_TYPE word_ = ptr_[word_num_ - 1]; \
\
if (word_ != 0) \
for (bit_num_ = SBITMAP_ELT_BITS; bit_num_ > 0; bit_num_--) \
{ \
SBITMAP_ELT_TYPE _mask = (SBITMAP_ELT_TYPE)1 << (bit_num_ - 1);\
\
if ((word_ & _mask) != 0) \
{ \
word_ &= ~ _mask; \
(N) = (word_num_ - 1) * SBITMAP_ELT_BITS + bit_num_ - 1;\
CODE; \
if (word_ == 0) \
break; \
} \
} \
} \
} while (0)
#define sbitmap_free(MAP) free(MAP)
#define sbitmap_vector_free(VEC) free(VEC)
struct int_list;
extern void dump_sbitmap PARAMS ((FILE *, sbitmap));
extern void dump_sbitmap_file PARAMS ((FILE *, sbitmap));
extern void dump_sbitmap_vector PARAMS ((FILE *, const char *,
const char *, sbitmap *,
int));
......
......@@ -95,6 +95,8 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
extern int size_directive_output;
extern tree last_assemble_variable_decl;
extern void reg_alloc PARAMS ((void));
static void general_init PARAMS ((char *));
static bool parse_options_and_default_flags PARAMS ((int, char **));
static void do_compile PARAMS ((int));
......@@ -865,6 +867,9 @@ int flag_merge_constants = 1;
one, unconditionally renumber instruction UIDs. */
int flag_renumber_insns = 1;
/* If nonzero, use the graph coloring register allocator. */
int flag_new_regalloc = 0;
/* Nonzero if we perform superblock formation. */
int flag_tracer = 0;
......@@ -1173,6 +1178,8 @@ static const lang_independent_options f_options[] =
N_("Report on permanent memory allocation at end of run") },
{ "trapv", &flag_trapv, 1,
N_("Trap for signed overflow in addition / subtraction / multiplication") },
{ "new-ra", &flag_new_regalloc, 1,
N_("Use graph coloring register allocation.") },
};
/* Table of language-specific options. */
......@@ -3039,7 +3046,7 @@ rest_of_compilation (decl)
if (optimize)
{
clear_bb_flags ();
if (initialize_uninitialized_subregs ())
if (!flag_new_regalloc && initialize_uninitialized_subregs ())
{
/* Insns were inserted, so things might look a bit different. */
insns = get_insns ();
......@@ -3174,60 +3181,101 @@ rest_of_compilation (decl)
if (! register_life_up_to_date)
recompute_reg_usage (insns, ! optimize_size);
/* Allocate the reg_renumber array. */
allocate_reg_info (max_regno, FALSE, TRUE);
if (flag_new_regalloc)
{
delete_trivially_dead_insns (insns, max_reg_num ());
reg_alloc ();
/* And the reg_equiv_memory_loc array. */
reg_equiv_memory_loc = (rtx *) xcalloc (max_regno, sizeof (rtx));
timevar_pop (TV_LOCAL_ALLOC);
if (dump_file[DFI_lreg].enabled)
{
timevar_push (TV_DUMP);
allocate_initial_values (reg_equiv_memory_loc);
close_dump_file (DFI_lreg, NULL, NULL);
timevar_pop (TV_DUMP);
}
regclass (insns, max_reg_num (), rtl_dump_file);
rebuild_label_notes_after_reload = local_alloc ();
/* XXX clean up the whole mess to bring live info in shape again. */
timevar_push (TV_GLOBAL_ALLOC);
open_dump_file (DFI_greg, decl);
timevar_pop (TV_LOCAL_ALLOC);
build_insn_chain (insns);
failure = reload (insns, 0);
if (dump_file[DFI_lreg].enabled)
{
timevar_push (TV_DUMP);
timevar_pop (TV_GLOBAL_ALLOC);
dump_flow_info (rtl_dump_file);
dump_local_alloc (rtl_dump_file);
if (dump_file[DFI_greg].enabled)
{
timevar_push (TV_DUMP);
close_dump_file (DFI_lreg, print_rtl_with_bb, insns);
timevar_pop (TV_DUMP);
dump_global_regs (rtl_dump_file);
close_dump_file (DFI_greg, print_rtl_with_bb, insns);
timevar_pop (TV_DUMP);
}
if (failure)
goto exit_rest_of_compilation;
reload_completed = 1;
rebuild_label_notes_after_reload = 0;
}
else
{
/* Allocate the reg_renumber array. */
allocate_reg_info (max_regno, FALSE, TRUE);
ggc_collect ();
/* And the reg_equiv_memory_loc array. */
reg_equiv_memory_loc = (rtx *) xcalloc (max_regno, sizeof (rtx));
timevar_push (TV_GLOBAL_ALLOC);
open_dump_file (DFI_greg, decl);
allocate_initial_values (reg_equiv_memory_loc);
/* If optimizing, allocate remaining pseudo-regs. Do the reload
pass fixing up any insns that are invalid. */
regclass (insns, max_reg_num (), rtl_dump_file);
rebuild_label_notes_after_reload = local_alloc ();
if (optimize)
failure = global_alloc (rtl_dump_file);
else
{
build_insn_chain (insns);
failure = reload (insns, 0);
}
timevar_pop (TV_LOCAL_ALLOC);
if (dump_file[DFI_lreg].enabled)
{
timevar_push (TV_DUMP);
timevar_pop (TV_GLOBAL_ALLOC);
dump_flow_info (rtl_dump_file);
dump_local_alloc (rtl_dump_file);
if (dump_file[DFI_greg].enabled)
{
timevar_push (TV_DUMP);
close_dump_file (DFI_lreg, print_rtl_with_bb, insns);
timevar_pop (TV_DUMP);
}
dump_global_regs (rtl_dump_file);
ggc_collect ();
close_dump_file (DFI_greg, print_rtl_with_bb, insns);
timevar_pop (TV_DUMP);
}
timevar_push (TV_GLOBAL_ALLOC);
open_dump_file (DFI_greg, decl);
if (failure)
goto exit_rest_of_compilation;
/* If optimizing, allocate remaining pseudo-regs. Do the reload
pass fixing up any insns that are invalid. */
if (optimize)
failure = global_alloc (rtl_dump_file);
else
{
build_insn_chain (insns);
failure = reload (insns, 0);
}
timevar_pop (TV_GLOBAL_ALLOC);
if (dump_file[DFI_greg].enabled)
{
timevar_push (TV_DUMP);
dump_global_regs (rtl_dump_file);
close_dump_file (DFI_greg, print_rtl_with_bb, insns);
timevar_pop (TV_DUMP);
}
if (failure)
goto exit_rest_of_compilation;
}
ggc_collect ();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment