Commit d58d4c12 by Jan Hubicka Committed by Jan Hubicka

recog.c (split_insn): Break out from ...

	* recog.c (split_insn): Break out from ...
	(split_all_insns): ... here; do not use basic block information
	when it is broken.

From-SVN: r43009
parent 2fe7bb35
Fri Jun 8 14:16:33 CEST 2001 Jan Hubicka <jh@suse.cz>
* recog.c (split_insn): Break out from ...
(split_all_insns): ... here; do not use basic block information
when it is broken.
Thu Jun 7 18:27:53 CEST 2001 Jan Hubicka <jh@suse.cz> Thu Jun 7 18:27:53 CEST 2001 Jan Hubicka <jh@suse.cz>
* simplify-rtx.c (simplify_subreg): Fix verification of * simplify-rtx.c (simplify_subreg): Fix verification of
......
...@@ -57,6 +57,7 @@ static void validate_replace_rtx_1 PARAMS ((rtx *, rtx, rtx, rtx)); ...@@ -57,6 +57,7 @@ static void validate_replace_rtx_1 PARAMS ((rtx *, rtx, rtx, rtx));
static rtx *find_single_use_1 PARAMS ((rtx, rtx *)); static rtx *find_single_use_1 PARAMS ((rtx, rtx *));
static rtx *find_constant_term_loc PARAMS ((rtx *)); static rtx *find_constant_term_loc PARAMS ((rtx *));
static void validate_replace_src_1 PARAMS ((rtx *, void *)); static void validate_replace_src_1 PARAMS ((rtx *, void *));
static rtx split_insn PARAMS ((rtx));
/* Nonzero means allow operands to be volatile. /* Nonzero means allow operands to be volatile.
This should be 0 if you are generating rtl, such as if you are calling This should be 0 if you are generating rtl, such as if you are calling
...@@ -2700,41 +2701,20 @@ reg_fits_class_p (operand, class, offset, mode) ...@@ -2700,41 +2701,20 @@ reg_fits_class_p (operand, class, offset, mode)
return 0; return 0;
} }
/* Split all insns in the function. If UPD_LIFE, update life info after. */ /* Split single instruction. Helper function for split_all_insns.
Return last insn in the sequence if succesfull, or NULL if unsuccesfull. */
void static rtx
split_all_insns (upd_life) split_insn (insn)
int upd_life; rtx insn;
{ {
sbitmap blocks;
int changed;
int i;
blocks = sbitmap_alloc (n_basic_blocks);
sbitmap_zero (blocks);
changed = 0;
for (i = n_basic_blocks - 1; i >= 0; --i)
{
basic_block bb = BASIC_BLOCK (i);
rtx insn, next;
for (insn = bb->head; insn ; insn = next)
{
rtx set; rtx set;
if (!INSN_P (insn))
/* Can't use `next_real_insn' because that might go across
CODE_LABELS and short-out basic blocks. */
next = NEXT_INSN (insn);
if (! INSN_P (insn))
; ;
/* Don't split no-op move insns. These should silently /* Don't split no-op move insns. These should silently
disappear later in final. Splitting such insns would disappear later in final. Splitting such insns would
break the code that handles REG_NO_CONFLICT blocks. */ break the code that handles REG_NO_CONFLICT blocks. */
else if ((set = single_set (insn)) != NULL else if ((set = single_set (insn)) != NULL && set_noop_p (set))
&& set_noop_p (set))
{ {
/* Nops get in the way while scheduling, so delete them /* Nops get in the way while scheduling, so delete them
now if register allocation has already been done. It now if register allocation has already been done. It
...@@ -2756,9 +2736,6 @@ split_all_insns (upd_life) ...@@ -2756,9 +2736,6 @@ split_all_insns (upd_life)
if (last != insn) if (last != insn)
{ {
SET_BIT (blocks, i);
changed = 1;
/* try_split returns the NOTE that INSN became. */ /* try_split returns the NOTE that INSN became. */
PUT_CODE (insn, NOTE); PUT_CODE (insn, NOTE);
NOTE_SOURCE_FILE (insn) = 0; NOTE_SOURCE_FILE (insn) = 0;
...@@ -2779,24 +2756,68 @@ split_all_insns (upd_life) ...@@ -2779,24 +2756,68 @@ split_all_insns (upd_life)
first = NEXT_INSN (first); first = NEXT_INSN (first);
} }
} }
return last;
}
}
return NULL_RTX;
}
/* Split all insns in the function. If UPD_LIFE, update life info after. */
if (insn == bb->end) void
split_all_insns (upd_life)
int upd_life;
{
sbitmap blocks;
int changed;
int i;
if (!upd_life)
{ {
bb->end = last; rtx next, insn;
break;
for (insn = get_insns (); insn ; insn = next)
{
rtx last;
/* Can't use `next_real_insn' because that might go across
CODE_LABELS and short-out basic blocks. */
next = NEXT_INSN (insn);
last = split_insn (insn);
} }
return;
} }
blocks = sbitmap_alloc (n_basic_blocks);
sbitmap_zero (blocks);
changed = 0;
for (i = n_basic_blocks - 1; i >= 0; --i)
{
basic_block bb = BASIC_BLOCK (i);
rtx insn, next;
for (insn = bb->head; insn ; insn = next)
{
rtx last;
/* Can't use `next_real_insn' because that might go across
CODE_LABELS and short-out basic blocks. */
next = NEXT_INSN (insn);
last = split_insn (insn);
if (last)
{
SET_BIT (blocks, i);
changed = 1;
if (insn == bb->end)
bb->end = last;
insn = last;
} }
if (insn == bb->end) if (insn == bb->end)
break; break;
} }
/* ??? When we're called from just after reload, the CFG is in bad if (insn == NULL)
shape, and we may have fallen off the end. This could be fixed
by having reload not try to delete unreachable code. Otherwise
assert we found the end insn. */
if (insn == NULL && upd_life)
abort (); abort ();
} }
......
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