Commit caa4a250 by Bernd Schmidt Committed by Bernd Schmidt

postreload.c (fixup_debug_insns): Remove arg REGNO.

	* postreload.c (fixup_debug_insns): Remove arg REGNO.  New args
	FROM and TO.  All callers changed.  Don't look for tracked uses,
	just scan the RTL for DEBUG_INSNs and substitute.
	(reload_combine_recognize_pattern): Call fixup_debug_insns.
	(reload_combine): Ignore DEBUG_INSNs.

From-SVN: r162342
parent be5fda91
2010-07-20 Bernd Schmidt <bernds@codesourcery.com>
* postreload.c (fixup_debug_insns): Remove arg REGNO. New args
FROM and TO. All callers changed. Don't look for tracked uses,
just scan the RTL for DEBUG_INSNs and substitute.
(reload_combine_recognize_pattern): Call fixup_debug_insns.
(reload_combine): Ignore DEBUG_INSNs.
2010-07-20 Jakub Jelinek <jakub@redhat.com> 2010-07-20 Jakub Jelinek <jakub@redhat.com>
* var-tracking.c (vt_expand_loc, vt_expand_loc_dummy): Bump maximum * var-tracking.c (vt_expand_loc, vt_expand_loc_dummy): Bump maximum
......
...@@ -848,41 +848,26 @@ reload_combine_closest_single_use (unsigned regno, int ruid_limit) ...@@ -848,41 +848,26 @@ reload_combine_closest_single_use (unsigned regno, int ruid_limit)
return retval; return retval;
} }
/* After we've moved an add insn, fix up any debug insns that occur between /* After we've moved an add insn, fix up any debug insns that occur
the old location of the add and the new location. REGNO is the destination between the old location of the add and the new location. REG is
register of the add insn; REG is the corresponding RTX. REPLACEMENT is the destination register of the add insn; REPLACEMENT is the
the SET_SRC of the add. MIN_RUID specifies the ruid of the insn after SET_SRC of the add. FROM and TO specify the range in which we
which we've placed the add, we ignore any debug insns after it. */ should make this change on debug insns. */
static void static void
fixup_debug_insns (unsigned regno, rtx reg, rtx replacement, int min_ruid) fixup_debug_insns (rtx reg, rtx replacement, rtx from, rtx to)
{ {
struct reg_use *use; rtx insn;
int from = reload_combine_ruid; for (insn = from; insn != to; insn = NEXT_INSN (insn))
for (;;)
{ {
rtx t; rtx t;
rtx use_insn = NULL_RTX;
if (from < min_ruid)
break;
use = reload_combine_closest_single_use (regno, from);
if (use)
{
from = use->ruid;
use_insn = use->insn;
}
else
break;
if (NONDEBUG_INSN_P (use->insn)) if (!DEBUG_INSN_P (insn))
continue; continue;
t = INSN_VAR_LOCATION_LOC (use_insn);
t = INSN_VAR_LOCATION_LOC (insn);
t = simplify_replace_rtx (t, reg, copy_rtx (replacement)); t = simplify_replace_rtx (t, reg, copy_rtx (replacement));
validate_change (use->insn, validate_change (insn, &INSN_VAR_LOCATION_LOC (insn), t, 0);
&INSN_VAR_LOCATION_LOC (use->insn), t, 0);
reload_combine_purge_insn_uses (use_insn);
reload_combine_note_use (&PATTERN (use_insn), use_insn,
use->ruid, NULL_RTX);
} }
} }
...@@ -1063,7 +1048,7 @@ reload_combine_recognize_const_pattern (rtx insn) ...@@ -1063,7 +1048,7 @@ reload_combine_recognize_const_pattern (rtx insn)
/* Process the add normally. */ /* Process the add normally. */
return false; return false;
fixup_debug_insns (regno, reg, src, add_moved_after_ruid); fixup_debug_insns (reg, src, insn, add_moved_after_insn);
reorder_insns (insn, insn, add_moved_after_insn); reorder_insns (insn, insn, add_moved_after_insn);
reload_combine_purge_reg_uses_after_ruid (regno, add_moved_after_ruid); reload_combine_purge_reg_uses_after_ruid (regno, add_moved_after_ruid);
...@@ -1191,15 +1176,21 @@ reload_combine_recognize_pattern (rtx insn) ...@@ -1191,15 +1176,21 @@ reload_combine_recognize_pattern (rtx insn)
if (apply_change_group ()) if (apply_change_group ())
{ {
struct reg_use *lowest_ruid = NULL;
/* For every new use of REG_SUM, we have to record the use /* For every new use of REG_SUM, we have to record the use
of BASE therein, i.e. operand 1. */ of BASE therein, i.e. operand 1. */
for (i = reg_state[regno].use_index; for (i = reg_state[regno].use_index;
i < RELOAD_COMBINE_MAX_USES; i++) i < RELOAD_COMBINE_MAX_USES; i++)
reload_combine_note_use {
(&XEXP (*reg_state[regno].reg_use[i].usep, 1), struct reg_use *use = reg_state[regno].reg_use + i;
reg_state[regno].reg_use[i].insn, reload_combine_note_use (&XEXP (*use->usep, 1), use->insn,
reg_state[regno].reg_use[i].ruid, use->ruid, use->containing_mem);
reg_state[regno].reg_use[i].containing_mem); if (lowest_ruid == NULL || use->ruid < lowest_ruid->ruid)
lowest_ruid = use;
}
fixup_debug_insns (reg, reg_sum, insn, lowest_ruid->insn);
/* Delete the reg-reg addition. */ /* Delete the reg-reg addition. */
delete_insn (insn); delete_insn (insn);
...@@ -1313,7 +1304,7 @@ reload_combine (void) ...@@ -1313,7 +1304,7 @@ reload_combine (void)
if (! fixed_regs[r]) if (! fixed_regs[r])
reg_state[r].use_index = RELOAD_COMBINE_MAX_USES; reg_state[r].use_index = RELOAD_COMBINE_MAX_USES;
if (! INSN_P (insn)) if (! NONDEBUG_INSN_P (insn))
continue; continue;
reload_combine_ruid++; reload_combine_ruid++;
......
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