(reg_pending_sets, reg_pending_sets_all): New variables.
(sched_analyze_1): Set reg_pending_sets instead of reg_last_sets. (sched_analyze_2): Set reg_pending_sets or reg_pending_sets_all instead of reg_last_sets. (sched_analyze_insn): Use reg_pending_sets and reg_pending_sets_all to set reg_last_sets. Set reg_pending_sets_all instead of reg_last_sets. (schedule_block): Allocate and clear reg_pending_sets. From-SVN: r6492
This commit is contained in:
parent
cb6c1cf1cf
commit
438be795a5
39
gcc/sched.c
39
gcc/sched.c
@ -142,6 +142,8 @@ static int *sched_reg_live_length;
|
|||||||
by splitting insns. */
|
by splitting insns. */
|
||||||
static rtx *reg_last_uses;
|
static rtx *reg_last_uses;
|
||||||
static rtx *reg_last_sets;
|
static rtx *reg_last_sets;
|
||||||
|
static regset reg_pending_sets;
|
||||||
|
static int reg_pending_sets_all;
|
||||||
|
|
||||||
/* Vector indexed by INSN_UID giving the original ordering of the insns. */
|
/* Vector indexed by INSN_UID giving the original ordering of the insns. */
|
||||||
static int *insn_luid;
|
static int *insn_luid;
|
||||||
@ -1688,7 +1690,8 @@ sched_analyze_1 (x, insn)
|
|||||||
if (reg_last_sets[regno + i])
|
if (reg_last_sets[regno + i])
|
||||||
add_dependence (insn, reg_last_sets[regno + i],
|
add_dependence (insn, reg_last_sets[regno + i],
|
||||||
REG_DEP_OUTPUT);
|
REG_DEP_OUTPUT);
|
||||||
reg_last_sets[regno + i] = insn;
|
reg_pending_sets[(regno + i) / REGSET_ELT_BITS]
|
||||||
|
|= (REGSET_ELT_TYPE) 1 << ((regno + i) % REGSET_ELT_BITS);
|
||||||
if ((call_used_regs[i] || global_regs[i])
|
if ((call_used_regs[i] || global_regs[i])
|
||||||
&& last_function_call)
|
&& last_function_call)
|
||||||
/* Function calls clobber all call_used regs. */
|
/* Function calls clobber all call_used regs. */
|
||||||
@ -1704,7 +1707,8 @@ sched_analyze_1 (x, insn)
|
|||||||
reg_last_uses[regno] = 0;
|
reg_last_uses[regno] = 0;
|
||||||
if (reg_last_sets[regno])
|
if (reg_last_sets[regno])
|
||||||
add_dependence (insn, reg_last_sets[regno], REG_DEP_OUTPUT);
|
add_dependence (insn, reg_last_sets[regno], REG_DEP_OUTPUT);
|
||||||
reg_last_sets[regno] = insn;
|
reg_pending_sets[regno / REGSET_ELT_BITS]
|
||||||
|
|= (REGSET_ELT_TYPE) 1 << (regno % REGSET_ELT_BITS);
|
||||||
|
|
||||||
/* Pseudos that are REG_EQUIV to something may be replaced
|
/* Pseudos that are REG_EQUIV to something may be replaced
|
||||||
by that during reloading. We need only add dependencies for
|
by that during reloading. We need only add dependencies for
|
||||||
@ -1951,8 +1955,8 @@ sched_analyze_2 (x, insn)
|
|||||||
reg_last_uses[i] = 0;
|
reg_last_uses[i] = 0;
|
||||||
if (reg_last_sets[i])
|
if (reg_last_sets[i])
|
||||||
add_dependence (insn, reg_last_sets[i], 0);
|
add_dependence (insn, reg_last_sets[i], 0);
|
||||||
reg_last_sets[i] = insn;
|
|
||||||
}
|
}
|
||||||
|
reg_pending_sets_all = 1;
|
||||||
|
|
||||||
flush_pending_lists (insn);
|
flush_pending_lists (insn);
|
||||||
}
|
}
|
||||||
@ -2006,6 +2010,8 @@ sched_analyze_insn (x, insn)
|
|||||||
{
|
{
|
||||||
register RTX_CODE code = GET_CODE (x);
|
register RTX_CODE code = GET_CODE (x);
|
||||||
rtx link;
|
rtx link;
|
||||||
|
int maxreg = max_reg_num ();
|
||||||
|
int i;
|
||||||
|
|
||||||
if (code == SET || code == CLOBBER)
|
if (code == SET || code == CLOBBER)
|
||||||
sched_analyze_1 (x, insn);
|
sched_analyze_1 (x, insn);
|
||||||
@ -2045,6 +2051,25 @@ sched_analyze_insn (x, insn)
|
|||||||
sched_analyze_2 (XEXP (note, 0), insn);
|
sched_analyze_2 (XEXP (note, 0), insn);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (i = 0; i < regset_size; i++)
|
||||||
|
{
|
||||||
|
REGSET_ELT_TYPE sets = reg_pending_sets[i];
|
||||||
|
if (sets)
|
||||||
|
{
|
||||||
|
register int bit;
|
||||||
|
for (bit = 0; bit < REGSET_ELT_BITS; bit++)
|
||||||
|
if (sets & ((REGSET_ELT_TYPE) 1 << bit))
|
||||||
|
reg_last_sets[i * REGSET_ELT_BITS + bit] = insn;
|
||||||
|
reg_pending_sets[i] = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (reg_pending_sets_all)
|
||||||
|
{
|
||||||
|
for (i = 0; i < maxreg; i++)
|
||||||
|
reg_last_sets[i] = insn;
|
||||||
|
reg_pending_sets_all = 0;
|
||||||
|
}
|
||||||
|
|
||||||
/* Handle function calls and function returns created by the epilogue
|
/* Handle function calls and function returns created by the epilogue
|
||||||
threading code. */
|
threading code. */
|
||||||
if (GET_CODE (insn) == CALL_INSN || GET_CODE (insn) == JUMP_INSN)
|
if (GET_CODE (insn) == CALL_INSN || GET_CODE (insn) == JUMP_INSN)
|
||||||
@ -2132,8 +2157,8 @@ sched_analyze (head, tail)
|
|||||||
reg_last_uses[i] = 0;
|
reg_last_uses[i] = 0;
|
||||||
if (reg_last_sets[i])
|
if (reg_last_sets[i])
|
||||||
add_dependence (insn, reg_last_sets[i], 0);
|
add_dependence (insn, reg_last_sets[i], 0);
|
||||||
reg_last_sets[i] = insn;
|
|
||||||
}
|
}
|
||||||
|
reg_pending_sets_all = 1;
|
||||||
|
|
||||||
/* Add a fake REG_NOTE which we will later convert
|
/* Add a fake REG_NOTE which we will later convert
|
||||||
back into a NOTE_INSN_SETJMP note. */
|
back into a NOTE_INSN_SETJMP note. */
|
||||||
@ -2150,7 +2175,8 @@ sched_analyze (head, tail)
|
|||||||
reg_last_uses[i] = 0;
|
reg_last_uses[i] = 0;
|
||||||
if (reg_last_sets[i])
|
if (reg_last_sets[i])
|
||||||
add_dependence (insn, reg_last_sets[i], REG_DEP_ANTI);
|
add_dependence (insn, reg_last_sets[i], REG_DEP_ANTI);
|
||||||
reg_last_sets[i] = insn;
|
reg_pending_sets[i / REGSET_ELT_BITS]
|
||||||
|
|= (REGSET_ELT_TYPE) 1 << (i % REGSET_ELT_BITS);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3042,6 +3068,9 @@ schedule_block (b, file)
|
|||||||
bzero (reg_last_uses, i * sizeof (rtx));
|
bzero (reg_last_uses, i * sizeof (rtx));
|
||||||
reg_last_sets = (rtx *) alloca (i * sizeof (rtx));
|
reg_last_sets = (rtx *) alloca (i * sizeof (rtx));
|
||||||
bzero (reg_last_sets, i * sizeof (rtx));
|
bzero (reg_last_sets, i * sizeof (rtx));
|
||||||
|
reg_pending_sets = (regset) alloca (regset_bytes);
|
||||||
|
bzero (reg_pending_sets, regset_bytes);
|
||||||
|
reg_pending_sets_all = 0;
|
||||||
clear_units ();
|
clear_units ();
|
||||||
|
|
||||||
/* Remove certain insns at the beginning from scheduling,
|
/* Remove certain insns at the beginning from scheduling,
|
||||||
|
Loading…
Reference in New Issue
Block a user