Commit 3508c681 by Jan Hubicka Committed by Jan Hubicka

loop.c (maybe_eliminate_biv_1): Use GET_CODE (x) == CONST_INT instead of CONSTANT_P for mult_val...

	* loop.c (maybe_eliminate_biv_1): Use GET_CODE (x) == CONST_INT instead
	of CONSTANT_P for mult_val; always use validate_change to update insn.

From-SVN: r33353
parent e0add67f
Sun Apr 23 14:27:44 MET DST 2000 Jan Hubicka <jh@suse.cz>
* loop.c (maybe_eliminate_biv_1): Use GET_CODE (x) == CONST_INT instead
of CONSTANT_P for mult_val; always use validate_change to update insn.
2000-04-22 Zack Weinberg <zack@wolery.cumb.org> 2000-04-22 Zack Weinberg <zack@wolery.cumb.org>
* cpphash.c (trad_stringify, add_pat): New functions. * cpphash.c (trad_stringify, add_pat): New functions.
......
...@@ -8529,7 +8529,7 @@ maybe_eliminate_biv_1 (loop, x, insn, bl, eliminate_p, where) ...@@ -8529,7 +8529,7 @@ maybe_eliminate_biv_1 (loop, x, insn, bl, eliminate_p, where)
overflows. */ overflows. */
for (v = bl->giv; v; v = v->next_iv) for (v = bl->giv; v; v = v->next_iv)
if (CONSTANT_P (v->mult_val) && v->mult_val != const0_rtx if (GET_CODE (v->mult_val) == CONST_INT && v->mult_val != const0_rtx
&& v->add_val == const0_rtx && v->add_val == const0_rtx
&& ! v->ignore && ! v->maybe_dead && v->always_computable && ! v->ignore && ! v->maybe_dead && v->always_computable
&& v->mode == mode && v->mode == mode
...@@ -8561,7 +8561,7 @@ maybe_eliminate_biv_1 (loop, x, insn, bl, eliminate_p, where) ...@@ -8561,7 +8561,7 @@ maybe_eliminate_biv_1 (loop, x, insn, bl, eliminate_p, where)
overflow problem. */ overflow problem. */
for (v = bl->giv; v; v = v->next_iv) for (v = bl->giv; v; v = v->next_iv)
if (CONSTANT_P (v->mult_val) && v->mult_val != const0_rtx if (GET_CODE (v->mult_val) == CONST_INT && v->mult_val != const0_rtx
&& ! v->ignore && ! v->maybe_dead && v->always_computable && ! v->ignore && ! v->maybe_dead && v->always_computable
&& v->mode == mode && v->mode == mode
&& (GET_CODE (v->add_val) == SYMBOL_REF && (GET_CODE (v->add_val) == SYMBOL_REF
...@@ -8626,7 +8626,7 @@ maybe_eliminate_biv_1 (loop, x, insn, bl, eliminate_p, where) ...@@ -8626,7 +8626,7 @@ maybe_eliminate_biv_1 (loop, x, insn, bl, eliminate_p, where)
negative mult_val, but it seems complex to do it in general. */ negative mult_val, but it seems complex to do it in general. */
for (v = bl->giv; v; v = v->next_iv) for (v = bl->giv; v; v = v->next_iv)
if (CONSTANT_P (v->mult_val) && INTVAL (v->mult_val) > 0 if (GET_CODE (v->mult_val) == CONST_INT && INTVAL (v->mult_val) > 0
&& (GET_CODE (v->add_val) == SYMBOL_REF && (GET_CODE (v->add_val) == SYMBOL_REF
|| GET_CODE (v->add_val) == LABEL_REF || GET_CODE (v->add_val) == LABEL_REF
|| GET_CODE (v->add_val) == CONST || GET_CODE (v->add_val) == CONST
...@@ -8642,28 +8642,29 @@ maybe_eliminate_biv_1 (loop, x, insn, bl, eliminate_p, where) ...@@ -8642,28 +8642,29 @@ maybe_eliminate_biv_1 (loop, x, insn, bl, eliminate_p, where)
return 1; return 1;
/* Replace biv with the giv's reduced reg. */ /* Replace biv with the giv's reduced reg. */
XEXP (x, 1-arg_operand) = v->new_reg; validate_change (insn, &XEXP (x, 1-arg_operand), v->new_reg, 1);
/* If all constants are actually constant integers and /* If all constants are actually constant integers and
the derived constant can be directly placed in the COMPARE, the derived constant can be directly placed in the COMPARE,
do so. */ do so. */
if (GET_CODE (arg) == CONST_INT if (GET_CODE (arg) == CONST_INT
&& GET_CODE (v->mult_val) == CONST_INT && GET_CODE (v->mult_val) == CONST_INT
&& GET_CODE (v->add_val) == CONST_INT && GET_CODE (v->add_val) == CONST_INT)
&& validate_change (insn, &XEXP (x, arg_operand), {
GEN_INT (INTVAL (arg) validate_change (insn, &XEXP (x, arg_operand),
* INTVAL (v->mult_val) GEN_INT (INTVAL (arg)
+ INTVAL (v->add_val)), 0)) * INTVAL (v->mult_val)
return 1; + INTVAL (v->add_val)), 1);
}
/* Otherwise, load it into a register. */ else
tem = gen_reg_rtx (mode); {
emit_iv_add_mult (arg, v->mult_val, v->add_val, tem, where); /* Otherwise, load it into a register. */
if (validate_change (insn, &XEXP (x, arg_operand), tem, 0)) tem = gen_reg_rtx (mode);
emit_iv_add_mult (arg, v->mult_val, v->add_val, tem, where);
validate_change (insn, &XEXP (x, arg_operand), tem, 1);
}
if (apply_change_group ())
return 1; return 1;
/* If that failed, put back the change we made above. */
XEXP (x, 1-arg_operand) = reg;
} }
/* Look for giv with positive constant mult_val and nonconst add_val. /* Look for giv with positive constant mult_val and nonconst add_val.
...@@ -8671,7 +8672,7 @@ maybe_eliminate_biv_1 (loop, x, insn, bl, eliminate_p, where) ...@@ -8671,7 +8672,7 @@ maybe_eliminate_biv_1 (loop, x, insn, bl, eliminate_p, where)
??? Turn this off due to possible overflow. */ ??? Turn this off due to possible overflow. */
for (v = bl->giv; v; v = v->next_iv) for (v = bl->giv; v; v = v->next_iv)
if (CONSTANT_P (v->mult_val) && INTVAL (v->mult_val) > 0 if (GET_CODE (v->mult_val) == CONST_INT && INTVAL (v->mult_val) > 0
&& ! v->ignore && ! v->maybe_dead && v->always_computable && ! v->ignore && ! v->maybe_dead && v->always_computable
&& v->mode == mode && v->mode == mode
&& 0) && 0)
...@@ -8707,7 +8708,7 @@ maybe_eliminate_biv_1 (loop, x, insn, bl, eliminate_p, where) ...@@ -8707,7 +8708,7 @@ maybe_eliminate_biv_1 (loop, x, insn, bl, eliminate_p, where)
??? Turn this off due to possible overflow. */ ??? Turn this off due to possible overflow. */
for (v = bl->giv; v; v = v->next_iv) for (v = bl->giv; v; v = v->next_iv)
if (CONSTANT_P (v->mult_val) && INTVAL (v->mult_val) > 0 if (GET_CODE (v->mult_val) == CONST_INT && INTVAL (v->mult_val) > 0
&& ! v->ignore && ! v->maybe_dead && v->always_computable && ! v->ignore && ! v->maybe_dead && v->always_computable
&& v->mode == mode && v->mode == mode
&& 0) && 0)
......
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