Commit d466c016 by Jeffrey A Law Committed by Jeff Law

cse.c (cse_insn): Mostly remove first hunk of code which collapsed a computed jump into an...

        * cse.c (cse_insn): Mostly remove first hunk of code which collapsed
        a computed jump into an unconditional jump.
        In second hunk of code for collapsing computed and conditional jumps
        into unconditional jumps, reemit the jump in additional cases.

From-SVN: r41953
parent f3ce87a9
...@@ -5,6 +5,11 @@ ...@@ -5,6 +5,11 @@
Thu May 10 14:45:44 2001 Jeffrey A Law (law@cygnus.com) Thu May 10 14:45:44 2001 Jeffrey A Law (law@cygnus.com)
* cse.c (cse_insn): Mostly remove first hunk of code which collapsed
a computed jump into an unconditional jump.
In second hunk of code for collapsing computed and conditional jumps
into unconditional jumps, reemit the jump in additional cases.
* jump.c (jump_optimize_1): Do not wrap the new jump target * jump.c (jump_optimize_1): Do not wrap the new jump target
inside a LABEL_REF; gen_jump will do that automatically. inside a LABEL_REF; gen_jump will do that automatically.
......
...@@ -5518,31 +5518,17 @@ cse_insn (insn, libcall_insn) ...@@ -5518,31 +5518,17 @@ cse_insn (insn, libcall_insn)
check for this separately here. We will delete such an check for this separately here. We will delete such an
insn below. insn below.
Tablejump insns contain a USE of the table, so simply replacing For other cases such as a table jump or conditional jump
the operand with the constant won't match. This is simply an where we know the ultimate target, go ahead and replace the
unconditional branch, however, and is therefore valid. Just operand. While that may not make a valid insn, we will
insert the substitution here and we will delete and re-emit reemit the jump below (and also insert any necessary
the insn later. */ barriers). */
if (n_sets == 1 && dest == pc_rtx if (n_sets == 1 && dest == pc_rtx
&& (trial == pc_rtx && (trial == pc_rtx
|| (GET_CODE (trial) == LABEL_REF || (GET_CODE (trial) == LABEL_REF
&& ! condjump_p (insn)))) && ! condjump_p (insn))))
{ {
if (trial == pc_rtx) SET_SRC (sets[i].rtl) = trial;
{
SET_SRC (sets[i].rtl) = trial;
cse_jumps_altered = 1;
break;
}
PATTERN (insn) = gen_jump (XEXP (trial, 0));
INSN_CODE (insn) = -1;
if (NEXT_INSN (insn) != 0
&& GET_CODE (NEXT_INSN (insn)) != BARRIER)
emit_barrier_after (insn);
cse_jumps_altered = 1; cse_jumps_altered = 1;
break; break;
} }
...@@ -5804,13 +5790,17 @@ cse_insn (insn, libcall_insn) ...@@ -5804,13 +5790,17 @@ cse_insn (insn, libcall_insn)
} }
/* If this SET is now setting PC to a label, we know it used to /* If this SET is now setting PC to a label, we know it used to
be a conditional or computed branch. So we see if we can follow be a conditional or computed branch. */
it. If it was a computed branch, delete it and re-emit. */
else if (dest == pc_rtx && GET_CODE (src) == LABEL_REF) else if (dest == pc_rtx && GET_CODE (src) == LABEL_REF)
{ {
/* If this is not in the format for a simple branch and /* We reemit the jump in as many cases as possible just in
we are the only SET in it, re-emit it. */ case the form of an unconditional jump is significantly
if (! simplejump_p (insn) && n_sets == 1) different than a computed jump or conditional jump.
If this insn has multiple sets, then reemitting the
jump is nontrivial. So instead we just force rerecognition
and hope for the best. */
if (n_sets == 1)
{ {
rtx new = emit_jump_insn_before (gen_jump (XEXP (src, 0)), insn); rtx new = emit_jump_insn_before (gen_jump (XEXP (src, 0)), insn);
JUMP_LABEL (new) = XEXP (src, 0); JUMP_LABEL (new) = XEXP (src, 0);
...@@ -5818,11 +5808,6 @@ cse_insn (insn, libcall_insn) ...@@ -5818,11 +5808,6 @@ cse_insn (insn, libcall_insn)
insn = new; insn = new;
} }
else else
/* Otherwise, force rerecognition, since it probably had
a different pattern before.
This shouldn't really be necessary, since whatever
changed the source value above should have done this.
Until the right place is found, might as well do this here. */
INSN_CODE (insn) = -1; INSN_CODE (insn) = -1;
never_reached_warning (insn); never_reached_warning (insn);
......
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