Commit 6621d78e by Paolo Bonzini Committed by Paolo Bonzini

combine.c (combine_simplify_rtx): Remove the "last" parameter and its documentation.

2004-03-16  Paolo Bonzini  <bonzini@gnu.org>

	* combine.c (combine_simplify_rtx): Remove the "last"
	parameter and its documentation.  Adjust recursive calls.
	(simplify_logical): Always perform the only simplification
	controlled by "last", if the simplified expression is
	actually different.
	(try_combine): Do not pass the "last" parameter to
	combine_simplify_rtx.

From-SVN: r79534
parent 8c7dca8f
2004-03-16 Paolo Bonzini <bonzini@gnu.org>
* combine.c (combine_simplify_rtx): Remove the "last"
parameter and its documentation. Adjust recursive calls.
(simplify_logical): Always perform the only simplification
controlled by "last", if the simplified expression is
actually different.
(try_combine): Do not pass the "last" parameter to
combine_simplify_rtx.
2004-03-16 Richard Sandiford <rsandifo@redhat.com> 2004-03-16 Richard Sandiford <rsandifo@redhat.com>
PR target/14599 PR target/14599
......
...@@ -348,10 +348,10 @@ static void undo_all (void); ...@@ -348,10 +348,10 @@ static void undo_all (void);
static void undo_commit (void); static void undo_commit (void);
static rtx *find_split_point (rtx *, rtx); static rtx *find_split_point (rtx *, rtx);
static rtx subst (rtx, rtx, rtx, int, int); static rtx subst (rtx, rtx, rtx, int, int);
static rtx combine_simplify_rtx (rtx, enum machine_mode, int, int); static rtx combine_simplify_rtx (rtx, enum machine_mode, int);
static rtx simplify_if_then_else (rtx); static rtx simplify_if_then_else (rtx);
static rtx simplify_set (rtx); static rtx simplify_set (rtx);
static rtx simplify_logical (rtx, int); static rtx simplify_logical (rtx);
static rtx expand_compound_operation (rtx); static rtx expand_compound_operation (rtx);
static rtx expand_field_assignment (rtx); static rtx expand_field_assignment (rtx);
static rtx make_extraction (enum machine_mode, rtx, HOST_WIDE_INT, static rtx make_extraction (enum machine_mode, rtx, HOST_WIDE_INT,
...@@ -3543,7 +3543,7 @@ subst (rtx x, rtx from, rtx to, int in_dest, int unique_copy) ...@@ -3543,7 +3543,7 @@ subst (rtx x, rtx from, rtx to, int in_dest, int unique_copy)
/* If X is sufficiently simple, don't bother trying to do anything /* If X is sufficiently simple, don't bother trying to do anything
with it. */ with it. */
if (code != CONST_INT && code != REG && code != CLOBBER) if (code != CONST_INT && code != REG && code != CLOBBER)
x = combine_simplify_rtx (x, op0_mode, i == 3, in_dest); x = combine_simplify_rtx (x, op0_mode, in_dest);
if (GET_CODE (x) == code) if (GET_CODE (x) == code)
break; break;
...@@ -3562,13 +3562,11 @@ subst (rtx x, rtx from, rtx to, int in_dest, int unique_copy) ...@@ -3562,13 +3562,11 @@ subst (rtx x, rtx from, rtx to, int in_dest, int unique_copy)
outer level; call `subst' to simplify recursively. Return the new outer level; call `subst' to simplify recursively. Return the new
expression. expression.
OP0_MODE is the original mode of XEXP (x, 0); LAST is nonzero if this OP0_MODE is the original mode of XEXP (x, 0). IN_DEST is nonzero
will be the iteration even if an expression with a code different from if we are inside a SET_DEST. */
X is returned; IN_DEST is nonzero if we are inside a SET_DEST. */
static rtx static rtx
combine_simplify_rtx (rtx x, enum machine_mode op0_mode, int last, combine_simplify_rtx (rtx x, enum machine_mode op0_mode, int in_dest)
int in_dest)
{ {
enum rtx_code code = GET_CODE (x); enum rtx_code code = GET_CODE (x);
enum machine_mode mode = GET_MODE (x); enum machine_mode mode = GET_MODE (x);
...@@ -4223,7 +4221,7 @@ combine_simplify_rtx (rtx x, enum machine_mode op0_mode, int last, ...@@ -4223,7 +4221,7 @@ combine_simplify_rtx (rtx x, enum machine_mode op0_mode, int last,
{ {
/* Try to simplify the expression further. */ /* Try to simplify the expression further. */
rtx tor = gen_binary (IOR, mode, XEXP (x, 0), XEXP (x, 1)); rtx tor = gen_binary (IOR, mode, XEXP (x, 0), XEXP (x, 1));
temp = combine_simplify_rtx (tor, mode, last, in_dest); temp = combine_simplify_rtx (tor, mode, in_dest);
/* If we could, great. If not, do not go ahead with the IOR /* If we could, great. If not, do not go ahead with the IOR
replacement, since PLUS appears in many special purpose replacement, since PLUS appears in many special purpose
...@@ -4508,7 +4506,7 @@ combine_simplify_rtx (rtx x, enum machine_mode op0_mode, int last, ...@@ -4508,7 +4506,7 @@ combine_simplify_rtx (rtx x, enum machine_mode op0_mode, int last,
case AND: case AND:
case IOR: case IOR:
case XOR: case XOR:
return simplify_logical (x, last); return simplify_logical (x);
case ABS: case ABS:
/* (abs (neg <foo>)) -> (abs <foo>) */ /* (abs (neg <foo>)) -> (abs <foo>) */
...@@ -5290,10 +5288,10 @@ simplify_set (rtx x) ...@@ -5290,10 +5288,10 @@ simplify_set (rtx x)
} }
/* Simplify, X, and AND, IOR, or XOR operation, and return the simplified /* Simplify, X, and AND, IOR, or XOR operation, and return the simplified
result. LAST is nonzero if this is the last retry. */ result. */
static rtx static rtx
simplify_logical (rtx x, int last) simplify_logical (rtx x)
{ {
enum machine_mode mode = GET_MODE (x); enum machine_mode mode = GET_MODE (x);
rtx op0 = XEXP (x, 0); rtx op0 = XEXP (x, 0);
...@@ -5343,11 +5341,13 @@ simplify_logical (rtx x, int last) ...@@ -5343,11 +5341,13 @@ simplify_logical (rtx x, int last)
/* If we have (ior (and (X C1) C2)) and the next restart would be /* If we have (ior (and (X C1) C2)) and the next restart would be
the last, simplify this by making C1 as small as possible the last, simplify this by making C1 as small as possible
and then exit. */ and then exit. Only do this if C1 actually changes: for now
if (last this only saves memory but, should this transformation be
&& GET_CODE (x) == IOR && GET_CODE (op0) == AND moved to simplify-rtx.c, we'd risk unbounded recursion there. */
if (GET_CODE (x) == IOR && GET_CODE (op0) == AND
&& GET_CODE (XEXP (op0, 1)) == CONST_INT && GET_CODE (XEXP (op0, 1)) == CONST_INT
&& GET_CODE (op1) == CONST_INT) && GET_CODE (op1) == CONST_INT
&& (INTVAL (XEXP (op0, 1)) & INTVAL (op1)) != 0)
return gen_binary (IOR, mode, return gen_binary (IOR, mode,
gen_binary (AND, mode, XEXP (op0, 0), gen_binary (AND, mode, XEXP (op0, 0),
GEN_INT (INTVAL (XEXP (op0, 1)) GEN_INT (INTVAL (XEXP (op0, 1))
......
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