mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-02-13 23:10:18 +08:00
basic-block.h (life_analysis): Declare here ...
* basic-block.h (life_analysis): Declare here ... * output.h: ... not here. * flow.c (life_analysis): Remove nregs parameter; replace remove_dead_code with flags. Remove ssa dead code check. Only init alias analysis if we'll use it. * reg-stack.c (reg_to_stack): Update life_analysis arguments. * ssa.c (convert_to_ssa): Likewise. (convert_from_ssa): Likewise. * toplev.c (rest_of_compilation): Likewise. From-SVN: r33459
This commit is contained in:
parent
5229452121
commit
7f8a79ba7e
@ -1,3 +1,15 @@
|
|||||||
|
2000-04-26 Richard Henderson <rth@cygnus.com>
|
||||||
|
|
||||||
|
* basic-block.h (life_analysis): Declare here ...
|
||||||
|
* output.h: ... not here.
|
||||||
|
* flow.c (life_analysis): Remove nregs parameter; replace
|
||||||
|
remove_dead_code with flags. Remove ssa dead code check.
|
||||||
|
Only init alias analysis if we'll use it.
|
||||||
|
* reg-stack.c (reg_to_stack): Update life_analysis arguments.
|
||||||
|
* ssa.c (convert_to_ssa): Likewise.
|
||||||
|
(convert_from_ssa): Likewise.
|
||||||
|
* toplev.c (rest_of_compilation): Likewise.
|
||||||
|
|
||||||
2000-04-26 Richard Henderson <rth@cygnus.com>
|
2000-04-26 Richard Henderson <rth@cygnus.com>
|
||||||
|
|
||||||
* flow.c (flow_delete_block): Rename from delete_block. Export.
|
* flow.c (flow_delete_block): Rename from delete_block. Export.
|
||||||
|
@ -427,6 +427,7 @@ enum update_life_extent
|
|||||||
#define PROP_AUTOINC 32 /* Create autoinc mem references. */
|
#define PROP_AUTOINC 32 /* Create autoinc mem references. */
|
||||||
#define PROP_FINAL 63 /* All of the above. */
|
#define PROP_FINAL 63 /* All of the above. */
|
||||||
|
|
||||||
|
extern void life_analysis PARAMS ((rtx, FILE *, int));
|
||||||
extern void update_life_info PARAMS ((sbitmap, enum update_life_extent,
|
extern void update_life_info PARAMS ((sbitmap, enum update_life_extent,
|
||||||
int));
|
int));
|
||||||
extern int count_or_remove_death_notes PARAMS ((sbitmap, int));
|
extern int count_or_remove_death_notes PARAMS ((sbitmap, int));
|
||||||
|
40
gcc/flow.c
40
gcc/flow.c
@ -2491,32 +2491,21 @@ calculate_loop_depth (dump)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Perform data flow analysis.
|
/* Perform data flow analysis.
|
||||||
F is the first insn of the function and NREGS the number of register numbers
|
F is the first insn of the function; FLAGS is a set of PROP_* flags
|
||||||
in use. */
|
to be used in accumulating flow info. */
|
||||||
|
|
||||||
void
|
void
|
||||||
life_analysis (f, nregs, file, remove_dead_code)
|
life_analysis (f, file, flags)
|
||||||
rtx f;
|
rtx f;
|
||||||
int nregs;
|
|
||||||
FILE *file;
|
FILE *file;
|
||||||
int remove_dead_code;
|
int flags;
|
||||||
{
|
{
|
||||||
#ifdef ELIMINABLE_REGS
|
#ifdef ELIMINABLE_REGS
|
||||||
register int i;
|
register int i;
|
||||||
static struct {int from, to; } eliminables[] = ELIMINABLE_REGS;
|
static struct {int from, to; } eliminables[] = ELIMINABLE_REGS;
|
||||||
#endif
|
#endif
|
||||||
int flags;
|
|
||||||
sbitmap all_blocks;
|
sbitmap all_blocks;
|
||||||
|
|
||||||
/* Dead code elimination changes basic block structure and therefore
|
|
||||||
breaks the SSA phi representation. Particularly, a phi node
|
|
||||||
can have an alternative value for each incoming block, referenced
|
|
||||||
by the block number. Removing dead code can bump entire blocks
|
|
||||||
and therefore cause blocks to be renumbered, invalidating the
|
|
||||||
numbering of phi alternatives. */
|
|
||||||
if (remove_dead_code && in_ssa_form)
|
|
||||||
abort ();
|
|
||||||
|
|
||||||
/* Record which registers will be eliminated. We use this in
|
/* Record which registers will be eliminated. We use this in
|
||||||
mark_used_regs. */
|
mark_used_regs. */
|
||||||
|
|
||||||
@ -2529,17 +2518,8 @@ life_analysis (f, nregs, file, remove_dead_code)
|
|||||||
SET_HARD_REG_BIT (elim_reg_set, FRAME_POINTER_REGNUM);
|
SET_HARD_REG_BIT (elim_reg_set, FRAME_POINTER_REGNUM);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* We want alias analysis information for local dead store elimination. */
|
|
||||||
init_alias_analysis ();
|
|
||||||
|
|
||||||
if (! optimize)
|
if (! optimize)
|
||||||
flags = PROP_DEATH_NOTES | PROP_REG_INFO;
|
flags &= PROP_DEATH_NOTES | PROP_REG_INFO;
|
||||||
else
|
|
||||||
{
|
|
||||||
flags = PROP_FINAL;
|
|
||||||
if (! remove_dead_code)
|
|
||||||
flags &= ~(PROP_SCAN_DEAD_CODE | PROP_KILL_DEAD_CODE);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* The post-reload life analysis have (on a global basis) the same
|
/* The post-reload life analysis have (on a global basis) the same
|
||||||
registers live as was computed by reload itself. elimination
|
registers live as was computed by reload itself. elimination
|
||||||
@ -2550,7 +2530,11 @@ life_analysis (f, nregs, file, remove_dead_code)
|
|||||||
if (reload_completed)
|
if (reload_completed)
|
||||||
flags &= ~PROP_REG_INFO;
|
flags &= ~PROP_REG_INFO;
|
||||||
|
|
||||||
max_regno = nregs;
|
/* We want alias analysis information for local dead store elimination. */
|
||||||
|
if (flags & PROP_SCAN_DEAD_CODE)
|
||||||
|
init_alias_analysis ();
|
||||||
|
|
||||||
|
max_regno = max_reg_num ();
|
||||||
|
|
||||||
/* Always remove no-op moves. Do this before other processing so
|
/* Always remove no-op moves. Do this before other processing so
|
||||||
that we don't have to keep re-scanning them. */
|
that we don't have to keep re-scanning them. */
|
||||||
@ -2582,7 +2566,9 @@ life_analysis (f, nregs, file, remove_dead_code)
|
|||||||
|
|
||||||
/* Clean up. */
|
/* Clean up. */
|
||||||
sbitmap_free (all_blocks);
|
sbitmap_free (all_blocks);
|
||||||
end_alias_analysis ();
|
|
||||||
|
if (flags & PROP_SCAN_DEAD_CODE)
|
||||||
|
end_alias_analysis ();
|
||||||
|
|
||||||
if (file)
|
if (file)
|
||||||
dump_flow_info (file);
|
dump_flow_info (file);
|
||||||
|
@ -137,7 +137,6 @@ extern void cleanup_cfg PARAMS ((rtx));
|
|||||||
extern void calculate_loop_depth PARAMS ((FILE *));
|
extern void calculate_loop_depth PARAMS ((FILE *));
|
||||||
extern void free_basic_block_vars PARAMS ((int));
|
extern void free_basic_block_vars PARAMS ((int));
|
||||||
extern void set_block_num PARAMS ((rtx, int));
|
extern void set_block_num PARAMS ((rtx, int));
|
||||||
extern void life_analysis PARAMS ((rtx, int, FILE *, int));
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Functions in varasm.c. */
|
/* Functions in varasm.c. */
|
||||||
|
@ -435,7 +435,7 @@ reg_to_stack (first, file)
|
|||||||
build the CFG and run life analysis. */
|
build the CFG and run life analysis. */
|
||||||
find_basic_blocks (first, max_reg_num (), file);
|
find_basic_blocks (first, max_reg_num (), file);
|
||||||
count_or_remove_death_notes (NULL, 1);
|
count_or_remove_death_notes (NULL, 1);
|
||||||
life_analysis (first, max_reg_num (), file, 0);
|
life_analysis (first, file, PROP_DEATH_NOTES);
|
||||||
|
|
||||||
/* Set up block info for each basic block. */
|
/* Set up block info for each basic block. */
|
||||||
bi = (block_info) xcalloc ((n_basic_blocks + 1), sizeof (*bi));
|
bi = (block_info) xcalloc ((n_basic_blocks + 1), sizeof (*bi));
|
||||||
|
@ -855,7 +855,7 @@ convert_to_ssa()
|
|||||||
if (in_ssa_form)
|
if (in_ssa_form)
|
||||||
abort ();
|
abort ();
|
||||||
|
|
||||||
life_analysis (get_insns (), max_reg_num (), NULL, 1);
|
life_analysis (get_insns (), NULL, PROP_KILL_DEAD_CODE | PROP_SCAN_DEAD_CODE);
|
||||||
|
|
||||||
/* Compute dominators. */
|
/* Compute dominators. */
|
||||||
dominators = sbitmap_vector_alloc (n_basic_blocks, n_basic_blocks);
|
dominators = sbitmap_vector_alloc (n_basic_blocks, n_basic_blocks);
|
||||||
@ -1812,7 +1812,7 @@ convert_from_ssa()
|
|||||||
|
|
||||||
/* We need up-to-date life information. */
|
/* We need up-to-date life information. */
|
||||||
compute_bb_for_insn (get_max_uid ());
|
compute_bb_for_insn (get_max_uid ());
|
||||||
life_analysis (insns, max_reg_num (), NULL, 0);
|
life_analysis (insns, NULL, PROP_KILL_DEAD_CODE | PROP_SCAN_DEAD_CODE);
|
||||||
|
|
||||||
/* Figure out which regs in copies and phi nodes don't conflict and
|
/* Figure out which regs in copies and phi nodes don't conflict and
|
||||||
therefore can be coalesced. */
|
therefore can be coalesced. */
|
||||||
|
@ -3247,7 +3247,7 @@ rest_of_compilation (decl)
|
|||||||
cleanup_cfg (insns);
|
cleanup_cfg (insns);
|
||||||
if (optimize)
|
if (optimize)
|
||||||
calculate_loop_depth (rtl_dump_file);
|
calculate_loop_depth (rtl_dump_file);
|
||||||
life_analysis (insns, max_reg_num (), rtl_dump_file, 1);
|
life_analysis (insns, rtl_dump_file, PROP_FINAL);
|
||||||
mark_constant_function ();
|
mark_constant_function ();
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -3434,7 +3434,7 @@ rest_of_compilation (decl)
|
|||||||
TIMEVAR (flow2_time,
|
TIMEVAR (flow2_time,
|
||||||
{
|
{
|
||||||
cleanup_cfg (insns);
|
cleanup_cfg (insns);
|
||||||
life_analysis (insns, max_reg_num (), rtl_dump_file, 1);
|
life_analysis (insns, rtl_dump_file, PROP_FINAL);
|
||||||
});
|
});
|
||||||
|
|
||||||
/* This is kind of heruistics. We need to run combine_stack_adjustments
|
/* This is kind of heruistics. We need to run combine_stack_adjustments
|
||||||
|
Loading…
Reference in New Issue
Block a user