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
This commit is contained in:
Jan Hubicka 2001-06-08 14:19:12 +02:00 committed by Jan Hubicka
parent 2fe7bb353a
commit d58d4c12b0
2 changed files with 92 additions and 65 deletions

View File

@ -1,3 +1,9 @@
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>
* simplify-rtx.c (simplify_subreg): Fix verification of

View File

@ -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_constant_term_loc PARAMS ((rtx *));
static void validate_replace_src_1 PARAMS ((rtx *, void *));
static rtx split_insn PARAMS ((rtx));
/* Nonzero means allow operands to be volatile.
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)
return 0;
}
/* Split all insns in the function. If UPD_LIFE, update life info after. */
void
split_all_insns (upd_life)
int upd_life;
{
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)
/* Split single instruction. Helper function for split_all_insns.
Return last insn in the sequence if succesfull, or NULL if unsuccesfull. */
static rtx
split_insn (insn)
rtx insn;
{
rtx set;
/* 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
disappear later in final. Splitting such insns would
break the code that handles REG_NO_CONFLICT blocks. */
else if ((set = single_set (insn)) != NULL
&& set_noop_p (set))
else if ((set = single_set (insn)) != NULL && set_noop_p (set))
{
/* Nops get in the way while scheduling, so delete them
now if register allocation has already been done. It
@ -2756,9 +2736,6 @@ split_all_insns (upd_life)
if (last != insn)
{
SET_BIT (blocks, i);
changed = 1;
/* try_split returns the NOTE that INSN became. */
PUT_CODE (insn, NOTE);
NOTE_SOURCE_FILE (insn) = 0;
@ -2779,24 +2756,68 @@ split_all_insns (upd_life)
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)
{
rtx next, insn;
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;
break;
}
}
insn = last;
}
if (insn == bb->end)
break;
}
/* ??? When we're called from just after reload, the CFG is in bad
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)
if (insn == NULL)
abort ();
}