Commit 2f259720 by Vladimir Makarov Committed by Vladimir Makarov

lra-constraints.c (inherit_in_ebb): Process static hard regs too.

2013-06-27  Vladimir Makarov  <vmakarov@redhat.com>

	* lra-constraints.c (inherit_in_ebb): Process static hard regs
	too.  Process OP_INOUT regs for splitting too.

From-SVN: r200475
parent fef4d2b3
2013-06-27 Vladimir Makarov <vmakarov@redhat.com>
* lra-constraints.c (inherit_in_ebb): Process static hard regs
too. Process OP_INOUT regs for splitting too.
2013-06-27 Jakub Jelinek <jakub@redhat.com> 2013-06-27 Jakub Jelinek <jakub@redhat.com>
* tree-vect-stmts.c (vectorizable_store): Move ptr_incr var * tree-vect-stmts.c (vectorizable_store): Move ptr_incr var
......
...@@ -4762,76 +4762,81 @@ inherit_in_ebb (rtx head, rtx tail) ...@@ -4762,76 +4762,81 @@ inherit_in_ebb (rtx head, rtx tail)
} }
else if (INSN_P (curr_insn)) else if (INSN_P (curr_insn))
{ {
int iter;
int max_uid = get_max_uid (); int max_uid = get_max_uid ();
curr_id = lra_get_insn_recog_data (curr_insn); curr_id = lra_get_insn_recog_data (curr_insn);
curr_static_id = curr_id->insn_static_data;
to_inherit_num = 0; to_inherit_num = 0;
/* Process insn definitions. */ /* Process insn definitions. */
for (reg = curr_id->regs; reg != NULL; reg = reg->next) for (iter = 0; iter < 2; iter++)
if (reg->type != OP_IN for (reg = iter == 0 ? curr_id->regs : curr_static_id->hard_regs;
&& (dst_regno = reg->regno) < lra_constraint_new_regno_start) reg != NULL;
{ reg = reg->next)
if (dst_regno >= FIRST_PSEUDO_REGISTER && reg->type == OP_OUT if (reg->type != OP_IN
&& reg_renumber[dst_regno] < 0 && ! reg->subreg_p && (dst_regno = reg->regno) < lra_constraint_new_regno_start)
&& usage_insns[dst_regno].check == curr_usage_insns_check {
&& (next_usage_insns if (dst_regno >= FIRST_PSEUDO_REGISTER && reg->type == OP_OUT
= usage_insns[dst_regno].insns) != NULL_RTX) && reg_renumber[dst_regno] < 0 && ! reg->subreg_p
{ && usage_insns[dst_regno].check == curr_usage_insns_check
struct lra_insn_reg *r; && (next_usage_insns
= usage_insns[dst_regno].insns) != NULL_RTX)
for (r = curr_id->regs; r != NULL; r = r->next) {
if (r->type != OP_OUT && r->regno == dst_regno) struct lra_insn_reg *r;
break;
/* Don't do inheritance if the pseudo is also for (r = curr_id->regs; r != NULL; r = r->next)
used in the insn. */ if (r->type != OP_OUT && r->regno == dst_regno)
if (r == NULL) break;
/* We can not do inheritance right now /* Don't do inheritance if the pseudo is also
because the current insn reg info (chain used in the insn. */
regs) can change after that. */ if (r == NULL)
add_to_inherit (dst_regno, next_usage_insns); /* We can not do inheritance right now
} because the current insn reg info (chain
/* We can not process one reg twice here because of regs) can change after that. */
usage_insns invalidation. */ add_to_inherit (dst_regno, next_usage_insns);
if ((dst_regno < FIRST_PSEUDO_REGISTER }
|| reg_renumber[dst_regno] >= 0) /* We can not process one reg twice here because of
&& ! reg->subreg_p && reg->type == OP_OUT) usage_insns invalidation. */
{ if ((dst_regno < FIRST_PSEUDO_REGISTER
HARD_REG_SET s; || reg_renumber[dst_regno] >= 0)
&& ! reg->subreg_p && reg->type != OP_IN)
if (split_if_necessary (dst_regno, reg->biggest_mode, {
potential_reload_hard_regs, HARD_REG_SET s;
false, curr_insn, max_uid))
change_p = true; if (split_if_necessary (dst_regno, reg->biggest_mode,
CLEAR_HARD_REG_SET (s); potential_reload_hard_regs,
if (dst_regno < FIRST_PSEUDO_REGISTER) false, curr_insn, max_uid))
add_to_hard_reg_set (&s, reg->biggest_mode, dst_regno); change_p = true;
else CLEAR_HARD_REG_SET (s);
add_to_hard_reg_set (&s, PSEUDO_REGNO_MODE (dst_regno), if (dst_regno < FIRST_PSEUDO_REGISTER)
reg_renumber[dst_regno]); add_to_hard_reg_set (&s, reg->biggest_mode, dst_regno);
AND_COMPL_HARD_REG_SET (live_hard_regs, s); else
} add_to_hard_reg_set (&s, PSEUDO_REGNO_MODE (dst_regno),
/* We should invalidate potential inheritance or reg_renumber[dst_regno]);
splitting for the current insn usages to the next AND_COMPL_HARD_REG_SET (live_hard_regs, s);
usage insns (see code below) as the output pseudo }
prevents this. */ /* We should invalidate potential inheritance or
if ((dst_regno >= FIRST_PSEUDO_REGISTER splitting for the current insn usages to the next
&& reg_renumber[dst_regno] < 0) usage insns (see code below) as the output pseudo
|| (reg->type == OP_OUT && ! reg->subreg_p prevents this. */
&& (dst_regno < FIRST_PSEUDO_REGISTER if ((dst_regno >= FIRST_PSEUDO_REGISTER
|| reg_renumber[dst_regno] >= 0))) && reg_renumber[dst_regno] < 0)
{ || (reg->type == OP_OUT && ! reg->subreg_p
/* Invalidate and mark definitions. */ && (dst_regno < FIRST_PSEUDO_REGISTER
if (dst_regno >= FIRST_PSEUDO_REGISTER) || reg_renumber[dst_regno] >= 0)))
usage_insns[dst_regno].check = -(int) INSN_UID (curr_insn); {
else /* Invalidate and mark definitions. */
{ if (dst_regno >= FIRST_PSEUDO_REGISTER)
nregs = hard_regno_nregs[dst_regno][reg->biggest_mode]; usage_insns[dst_regno].check = -(int) INSN_UID (curr_insn);
for (i = 0; i < nregs; i++) else
usage_insns[dst_regno + i].check {
= -(int) INSN_UID (curr_insn); nregs = hard_regno_nregs[dst_regno][reg->biggest_mode];
} for (i = 0; i < nregs; i++)
} usage_insns[dst_regno + i].check
} = -(int) INSN_UID (curr_insn);
}
}
}
if (! JUMP_P (curr_insn)) if (! JUMP_P (curr_insn))
for (i = 0; i < to_inherit_num; i++) for (i = 0; i < to_inherit_num; i++)
if (inherit_reload_reg (true, to_inherit[i].regno, if (inherit_reload_reg (true, to_inherit[i].regno,
...@@ -4876,59 +4881,62 @@ inherit_in_ebb (rtx head, rtx tail) ...@@ -4876,59 +4881,62 @@ inherit_in_ebb (rtx head, rtx tail)
} }
to_inherit_num = 0; to_inherit_num = 0;
/* Process insn usages. */ /* Process insn usages. */
for (reg = curr_id->regs; reg != NULL; reg = reg->next) for (iter = 0; iter < 2; iter++)
if ((reg->type != OP_OUT for (reg = iter == 0 ? curr_id->regs : curr_static_id->hard_regs;
|| (reg->type == OP_OUT && reg->subreg_p)) reg != NULL;
&& (src_regno = reg->regno) < lra_constraint_new_regno_start) reg = reg->next)
{ if ((reg->type != OP_OUT
if (src_regno >= FIRST_PSEUDO_REGISTER || (reg->type == OP_OUT && reg->subreg_p))
&& reg_renumber[src_regno] < 0 && reg->type == OP_IN) && (src_regno = reg->regno) < lra_constraint_new_regno_start)
{ {
if (usage_insns[src_regno].check == curr_usage_insns_check if (src_regno >= FIRST_PSEUDO_REGISTER
&& (next_usage_insns && reg_renumber[src_regno] < 0 && reg->type == OP_IN)
= usage_insns[src_regno].insns) != NULL_RTX {
&& NONDEBUG_INSN_P (curr_insn)) if (usage_insns[src_regno].check == curr_usage_insns_check
add_to_inherit (src_regno, next_usage_insns); && (next_usage_insns
else if (usage_insns[src_regno].check = usage_insns[src_regno].insns) != NULL_RTX
!= -(int) INSN_UID (curr_insn)) && NONDEBUG_INSN_P (curr_insn))
/* Add usages but only if the reg is not set up add_to_inherit (src_regno, next_usage_insns);
in the same insn. */ else if (usage_insns[src_regno].check
add_next_usage_insn (src_regno, curr_insn, reloads_num); != -(int) INSN_UID (curr_insn))
} /* Add usages but only if the reg is not set up
else if (src_regno < FIRST_PSEUDO_REGISTER in the same insn. */
|| reg_renumber[src_regno] >= 0) add_next_usage_insn (src_regno, curr_insn, reloads_num);
{ }
bool before_p; else if (src_regno < FIRST_PSEUDO_REGISTER
rtx use_insn = curr_insn; || reg_renumber[src_regno] >= 0)
{
before_p = (JUMP_P (curr_insn) bool before_p;
|| (CALL_P (curr_insn) && reg->type == OP_IN)); rtx use_insn = curr_insn;
if (NONDEBUG_INSN_P (curr_insn)
&& split_if_necessary (src_regno, reg->biggest_mode, before_p = (JUMP_P (curr_insn)
potential_reload_hard_regs, || (CALL_P (curr_insn) && reg->type == OP_IN));
before_p, curr_insn, max_uid)) if (NONDEBUG_INSN_P (curr_insn)
{ && split_if_necessary (src_regno, reg->biggest_mode,
if (reg->subreg_p) potential_reload_hard_regs,
lra_risky_transformations_p = true; before_p, curr_insn, max_uid))
change_p = true; {
/* Invalidate. */ if (reg->subreg_p)
usage_insns[src_regno].check = 0; lra_risky_transformations_p = true;
if (before_p) change_p = true;
use_insn = PREV_INSN (curr_insn); /* Invalidate. */
} usage_insns[src_regno].check = 0;
if (NONDEBUG_INSN_P (curr_insn)) if (before_p)
{ use_insn = PREV_INSN (curr_insn);
if (src_regno < FIRST_PSEUDO_REGISTER) }
add_to_hard_reg_set (&live_hard_regs, if (NONDEBUG_INSN_P (curr_insn))
reg->biggest_mode, src_regno); {
else if (src_regno < FIRST_PSEUDO_REGISTER)
add_to_hard_reg_set (&live_hard_regs, add_to_hard_reg_set (&live_hard_regs,
PSEUDO_REGNO_MODE (src_regno), reg->biggest_mode, src_regno);
reg_renumber[src_regno]); else
} add_to_hard_reg_set (&live_hard_regs,
add_next_usage_insn (src_regno, use_insn, reloads_num); PSEUDO_REGNO_MODE (src_regno),
} reg_renumber[src_regno]);
} }
add_next_usage_insn (src_regno, use_insn, reloads_num);
}
}
for (i = 0; i < to_inherit_num; i++) for (i = 0; i < to_inherit_num; i++)
{ {
src_regno = to_inherit[i].regno; src_regno = to_inherit[i].regno;
......
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