Commit 44ce0063 by John Wehle Committed by John Wehle

rtl.h (only_sets_cc0_p): New prototype.

	* rtl.h (only_sets_cc0_p): New prototype.
	* jump.c (sets_cc0_p): Handle INSN.
	(only_sets_cc0_p): New function.
	* flow.c (merge_blocks_nomove): Use only_sets_cc0_p.
	(tidy_fallthru_edge): Likewise.
	* integrate.c (copy_insn_list): Likewise.
	* unroll.c (unroll_loop): Likewise.
	(copy_loop_body): Likewise.

From-SVN: r44927
parent cff27f1d
Wed Aug 15 15:22:52 EDT 2001 John Wehle (john@feith.com)
* rtl.h (only_sets_cc0_p): New prototype.
* jump.c (sets_cc0_p): Handle INSN.
(only_sets_cc0_p): New function.
* flow.c (merge_blocks_nomove): Use only_sets_cc0_p.
(tidy_fallthru_edge): Likewise.
* integrate.c (copy_insn_list): Likewise.
* unroll.c (unroll_loop): Likewise.
(copy_loop_body): Likewise.
2001-08-15 Jason Eckhardt <jle@redhat.com>
* config/i960/i960.md (trap): Change "faulteq.t" to "faulte.t".
......
......@@ -3008,7 +3008,7 @@ merge_blocks_nomove (a, b)
#ifdef HAVE_cc0
/* If this was a conditional jump, we need to also delete
the insn that set cc0. */
if (prev && sets_cc0_p (prev))
if (only_sets_cc0_p (prev))
{
rtx tmp = prev;
prev = prev_nonnote_insn (prev);
......@@ -4213,7 +4213,7 @@ tidy_fallthru_edge (e, b, c)
#ifdef HAVE_cc0
/* If this was a conditional jump, we need to also delete
the insn that set cc0. */
if (any_condjump_p (q) && sets_cc0_p (PREV_INSN (q)))
if (any_condjump_p (q) && only_sets_cc0_p (PREV_INSN (q)))
q = PREV_INSN (q);
#endif
......
......@@ -1463,7 +1463,7 @@ copy_insn_list (insns, map, static_chain_value)
{
#ifdef HAVE_cc0
/* If the previous insn set cc0 for us, delete it. */
if (sets_cc0_p (PREV_INSN (copy)))
if (only_sets_cc0_p (PREV_INSN (copy)))
delete_insn (PREV_INSN (copy));
#endif
......
......@@ -1265,6 +1265,23 @@ onlyjump_p (insn)
#ifdef HAVE_cc0
/* Return non-zero if X is an RTX that only sets the condition codes
and has no side effects. */
int
only_sets_cc0_p (x)
rtx x;
{
if (! x)
return 0;
if (INSN_P (x))
x = PATTERN (x);
return sets_cc0_p (x) == 1 && ! side_effects_p (x);
}
/* Return 1 if X is an RTX that does nothing but set the condition codes
and CLOBBER or USE registers.
Return -1 if X does explicitly set the condition codes,
......@@ -1272,8 +1289,15 @@ onlyjump_p (insn)
int
sets_cc0_p (x)
rtx x ATTRIBUTE_UNUSED;
rtx x;
{
if (! x)
return 0;
if (INSN_P (x))
x = PATTERN (x);
if (GET_CODE (x) == SET && SET_DEST (x) == cc0_rtx)
return 1;
if (GET_CODE (x) == PARALLEL)
......
......@@ -1714,6 +1714,7 @@ extern rtx condjump_label PARAMS ((rtx));
extern int simplejump_p PARAMS ((rtx));
extern int returnjump_p PARAMS ((rtx));
extern int onlyjump_p PARAMS ((rtx));
extern int only_sets_cc0_p PARAMS ((rtx));
extern int sets_cc0_p PARAMS ((rtx));
extern int invert_jump_1 PARAMS ((rtx, rtx));
extern int invert_jump PARAMS ((rtx, rtx, int));
......
......@@ -379,7 +379,7 @@ unroll_loop (loop, insn_count, strength_reduce_p)
#ifdef HAVE_cc0
/* The immediately preceding insn may be a compare which must be
deleted. */
if (sets_cc0_p (prev))
if (only_sets_cc0_p (prev))
delete_insn (prev);
#endif
}
......@@ -2148,7 +2148,7 @@ copy_loop_body (loop, copy_start, copy_end, map, exit_label, last_iteration,
{
#ifdef HAVE_cc0
/* If the previous insn set cc0 for us, delete it. */
if (sets_cc0_p (PREV_INSN (copy)))
if (only_sets_cc0_p (PREV_INSN (copy)))
delete_insn (PREV_INSN (copy));
#endif
......
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