Commit ee932b8f by Bernd Schmidt Committed by Bernd Schmidt

recog.c (peep2_do_rebuild_jump_labels, [...]): New static variables.

	* recog.c (peep2_do_rebuild_jump_labels, peep2_do_cleanup_cfg): New
	static variables.
	(peep2_buf_position): New static function.
	(peep2_regno_dead_p, peep2_reg_dead_p, peep2_find_free_register,
	peephole2_optimize): Use it.
	(peep2_attempt, peep2_update_life): New static functions, broken out
	of peephole2_optimize.
	(peep2_fill_buffer): New static function.
	(peephole2_optimize): Change the main loop to try to fill the buffer
	with the maximum number of insns before matching them against
	peepholes.  Use a forward scan.  Remove special case for targets with
	conditional execution.
	* genrecog.c (change_state): Delete dead code.
	* config/i386/i386.md (peephole2 for arithmetic ops with memory):
	Rewrite so as not to expect the second insn to have had a peephole
	applied yet.

From-SVN: r161570
parent 68d8db77
2010-06-30 Bernd Schmidt <bernds@codesourcery.com>
* recog.c (peep2_do_rebuild_jump_labels, peep2_do_cleanup_cfg): New
static variables.
(peep2_buf_position): New static function.
(peep2_regno_dead_p, peep2_reg_dead_p, peep2_find_free_register,
peephole2_optimize): Use it.
(peep2_attempt, peep2_update_life): New static functions, broken out
of peephole2_optimize.
(peep2_fill_buffer): New static function.
(peephole2_optimize): Change the main loop to try to fill the buffer
with the maximum number of insns before matching them against
peepholes. Use a forward scan. Remove special case for targets with
conditional execution.
* genrecog.c (change_state): Delete dead code.
* config/i386/i386.md (peephole2 for arithmetic ops with memory):
Rewrite so as not to expect the second insn to have had a peephole
applied yet.
2010-06-29 Nathan Froyd <froydnj@codesourcery.com>
* genhooks.c (emit_findices): Cast field precision to int.
......
......@@ -17558,15 +17558,14 @@
;; leal (%edx,%eax,4), %eax
(define_peephole2
[(parallel [(set (match_operand 0 "register_operand" "")
[(match_scratch:SI 5 "r")
(parallel [(set (match_operand 0 "register_operand" "")
(ashift (match_operand 1 "register_operand" "")
(match_operand 2 "const_int_operand" "")))
(clobber (reg:CC FLAGS_REG))])
(set (match_operand 3 "register_operand")
(match_operand 4 "x86_64_general_operand" ""))
(parallel [(set (match_operand 5 "register_operand" "")
(plus (match_operand 6 "register_operand" "")
(match_operand 7 "register_operand" "")))
(parallel [(set (match_operand 3 "register_operand" "")
(plus (match_dup 0)
(match_operand 4 "x86_64_general_operand" "")))
(clobber (reg:CC FLAGS_REG))])]
"INTVAL (operands[2]) >= 0 && INTVAL (operands[2]) <= 3
/* Validate MODE for lea. */
......@@ -17576,30 +17575,21 @@
|| GET_MODE (operands[0]) == SImode
|| (TARGET_64BIT && GET_MODE (operands[0]) == DImode))
/* We reorder load and the shift. */
&& !rtx_equal_p (operands[1], operands[3])
&& !reg_overlap_mentioned_p (operands[0], operands[4])
/* Last PLUS must consist of operand 0 and 3. */
&& !rtx_equal_p (operands[0], operands[3])
&& (rtx_equal_p (operands[3], operands[6])
|| rtx_equal_p (operands[3], operands[7]))
&& (rtx_equal_p (operands[0], operands[6])
|| rtx_equal_p (operands[0], operands[7]))
/* The intermediate operand 0 must die or be same as output. */
&& (rtx_equal_p (operands[0], operands[5])
|| peep2_reg_dead_p (3, operands[0]))"
[(set (match_dup 3) (match_dup 4))
&& !reg_overlap_mentioned_p (operands[0], operands[4])"
[(set (match_dup 5) (match_dup 4))
(set (match_dup 0) (match_dup 1))]
{
enum machine_mode mode = GET_MODE (operands[5]) == DImode ? DImode : SImode;
enum machine_mode mode = GET_MODE (operands[1]) == DImode ? DImode : SImode;
int scale = 1 << INTVAL (operands[2]);
rtx index = gen_lowpart (Pmode, operands[1]);
rtx base = gen_lowpart (Pmode, operands[3]);
rtx dest = gen_lowpart (mode, operands[5]);
rtx base = gen_lowpart (Pmode, operands[5]);
rtx dest = gen_lowpart (mode, operands[3]);
operands[1] = gen_rtx_PLUS (Pmode, base,
gen_rtx_MULT (Pmode, index, GEN_INT (scale)));
if (mode != Pmode)
operands[1] = gen_rtx_SUBREG (mode, operands[1], 0);
operands[5] = base;
operands[0] = dest;
})
......
......@@ -1761,20 +1761,11 @@ change_state (const char *oldpos, const char *newpos, const char *indent)
int odepth = strlen (oldpos);
int ndepth = strlen (newpos);
int depth;
int old_has_insn, new_has_insn;
/* Pop up as many levels as necessary. */
for (depth = odepth; strncmp (oldpos, newpos, depth) != 0; --depth)
continue;
/* Hunt for the last [A-Z] in both strings. */
for (old_has_insn = odepth - 1; old_has_insn >= 0; --old_has_insn)
if (ISUPPER (oldpos[old_has_insn]))
break;
for (new_has_insn = ndepth - 1; new_has_insn >= 0; --new_has_insn)
if (ISUPPER (newpos[new_has_insn]))
break;
/* Go down to desired level. */
while (depth < ndepth)
{
......
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