summaryrefslogtreecommitdiffstats
path: root/gcc/lcm.c
diff options
context:
space:
mode:
authorhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2001-10-30 11:13:49 +0000
committerhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2001-10-30 11:13:49 +0000
commit7fb47f9f1adf513b1b2b5798de845536228fe16d (patch)
tree5aed4d117e8130cabea4a775fc620383c6f0edc9 /gcc/lcm.c
parent8c2b78bf912345e40f7b955ed80add8d6c49c4dc (diff)
downloadppe42-gcc-7fb47f9f1adf513b1b2b5798de845536228fe16d.tar.gz
ppe42-gcc-7fb47f9f1adf513b1b2b5798de845536228fe16d.zip
* lcm.c (optimize_mode_switching): Do not rebuild liveness information
when no changes has been made. * gcse.c (reg_set_bitmap): Turn into reg_set. (modify_mem_list_set, canon_modify_mem_list_set) (clear_modify_mem_tables, free_modify_mem_tables): New. (gcse_main); Use free_modify_mem_tables. (free_gcse_mem): Likewise; free the bitmaps. (alloc_gcse_main): Initialize the bitmaps. (canon_list_insert): Set canon_modify_mem_list_set. (record_last_mem_set_info): Likewise; set modify_mem_list_set. (compute_hash_table): Use clear_modify_mem_tables. (reset_opr_set_tables): Likewise. (oprs_not_set_p): reg_set_bitmap is regset. (mark_set, mark_clobber): Likewise. * df.h (DF_EQUIV_NOTES): New constant. (df_insn_refs_record): Record uses inside or REG_EQUIV/EQUAL notes when asked for. * sched-rgn.c (CHECK_DEAD_NOTES): New constant. (init_regions, schedule_insns): Conditionalize the checking code by CHECK_DEAD_NOTES; avoid multiple calls to update_life_info. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@46634 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/lcm.c')
-rw-r--r--gcc/lcm.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/gcc/lcm.c b/gcc/lcm.c
index 4f5d6927161..88e58410d81 100644
--- a/gcc/lcm.c
+++ b/gcc/lcm.c
@@ -1029,6 +1029,7 @@ optimize_mode_switching (file)
int i, j;
int n_entities;
int max_num_modes = 0;
+ bool emited = false;
#ifdef NORMAL_MODE
/* Increment n_basic_blocks before allocating bb_info. */
@@ -1239,10 +1240,16 @@ optimize_mode_switching (file)
mode_set = gen_sequence ();
end_sequence ();
+ /* Do not bother to insert empty sequence. */
+ if (GET_CODE (mode_set) == SEQUENCE
+ && !XVECLEN (mode_set, 0))
+ continue;
+
/* If this is an abnormal edge, we'll insert at the end
of the previous block. */
if (eg->flags & EDGE_ABNORMAL)
{
+ emited = true;
if (GET_CODE (src_bb->end) == JUMP_INSN)
emit_insn_before (mode_set, src_bb->end);
/* It doesn't make sense to switch to normal mode
@@ -1313,10 +1320,16 @@ optimize_mode_switching (file)
mode_set = gen_sequence ();
end_sequence ();
+ /* Do not bother to insert empty sequence. */
+ if (GET_CODE (mode_set) == SEQUENCE
+ && !XVECLEN (mode_set, 0))
+ continue;
+
/* If this is an abnormal edge, we'll insert at the end of the
previous block. */
if (eg->flags & EDGE_ABNORMAL)
{
+ emited = true;
if (GET_CODE (eg->src->end) == JUMP_INSN)
emit_insn_before (mode_set, eg->src->end);
else if (GET_CODE (eg->src->end) == INSN)
@@ -1349,6 +1362,12 @@ optimize_mode_switching (file)
mode_set = gen_sequence ();
end_sequence ();
+ /* Do not bother to insert empty sequence. */
+ if (GET_CODE (mode_set) == SEQUENCE
+ && !XVECLEN (mode_set, 0))
+ continue;
+
+ emited = true;
if (GET_CODE (ptr->insn_ptr) == NOTE
&& (NOTE_LINE_NUMBER (ptr->insn_ptr)
== NOTE_INSN_BASIC_BLOCK))
@@ -1376,6 +1395,9 @@ optimize_mode_switching (file)
if (need_commit)
commit_edge_insertions ();
+ if (!need_commit && !emited)
+ return 0;
+
/* Ideally we'd figure out what blocks were affected and start from
there, but this is enormously complicated by commit_edge_insertions,
which would screw up any indicies we'd collected, and also need to
OpenPOWER on IntegriCloud