aboutsummaryrefslogtreecommitdiff
path: root/gcc/lra-constraints.c
diff options
context:
space:
mode:
authorVladimir Makarov <vmakarov@redhat.com>2013-10-03 00:35:43 +0000
committerVladimir Makarov <vmakarov@gcc.gnu.org>2013-10-03 00:35:43 +0000
commit80f466c4a620cf19a74531420f29f2b50fa43931 (patch)
treec383cf177580793322fe352bf3ad89392c51b481 /gcc/lra-constraints.c
parent7cfbb5a278b3eeda907d08de62a67d0fa4ba087c (diff)
downloadgcc-80f466c4a620cf19a74531420f29f2b50fa43931.zip
gcc-80f466c4a620cf19a74531420f29f2b50fa43931.tar.gz
gcc-80f466c4a620cf19a74531420f29f2b50fa43931.tar.bz2
lra-constraints.c (process_alt_operand): Calculate scratch_p and use it.
2013-10-02 Vladimir Makarov <vmakarov@redhat.com> * lra-constraints.c (process_alt_operand): Calculate scratch_p and use it. Use smaller increase for scratch. Don't increase reject for early clobber scratch. * lra-eliminations.c (eliminate_regs_in_insn): Remove all insns setting eliminated regs except setting fp from hfp. (lra_eliminate): Check lra_insn_recog_data on NULL. From-SVN: r203147
Diffstat (limited to 'gcc/lra-constraints.c')
-rw-r--r--gcc/lra-constraints.c30
1 files changed, 18 insertions, 12 deletions
diff --git a/gcc/lra-constraints.c b/gcc/lra-constraints.c
index f9652c7..783df16 100644
--- a/gcc/lra-constraints.c
+++ b/gcc/lra-constraints.c
@@ -1453,6 +1453,7 @@ process_alt_operands (int only_alternative)
HARD_REG_SET this_alternative_set, this_costly_alternative_set;
bool this_alternative_match_win, this_alternative_win;
bool this_alternative_offmemok;
+ bool scratch_p;
enum machine_mode mode;
opalt_num = nalt * n_operands + nop;
@@ -1858,6 +1859,8 @@ process_alt_operands (int only_alternative)
}
while ((p += len), c);
+ scratch_p = (operand_reg[nop] != NULL_RTX
+ && lra_former_scratch_p (REGNO (operand_reg[nop])));
/* Record which operands fit this alternative. */
if (win)
{
@@ -1878,14 +1881,17 @@ process_alt_operands (int only_alternative)
}
else
{
- /* Prefer won reg to spilled pseudo under other equal
- conditions. */
- if (lra_dump_file != NULL)
- fprintf
- (lra_dump_file,
- " %d Non pseudo reload: reject++\n",
- nop);
- reject++;
+ /* Prefer won reg to spilled pseudo under other
+ equal conditions for possibe inheritance. */
+ if (! scratch_p)
+ {
+ if (lra_dump_file != NULL)
+ fprintf
+ (lra_dump_file,
+ " %d Non pseudo reload: reject++\n",
+ nop);
+ reject++;
+ }
if (in_class_p (operand_reg[nop],
this_costly_alternative, NULL))
{
@@ -1904,13 +1910,13 @@ process_alt_operands (int only_alternative)
insns are generated for the scratches. So it
might cost something but probably less than old
reload pass believes. */
- if (lra_former_scratch_p (REGNO (operand_reg[nop])))
+ if (scratch_p)
{
if (lra_dump_file != NULL)
fprintf (lra_dump_file,
- " %d Scratch win: reject+=3\n",
+ " %d Scratch win: reject+=2\n",
nop);
- reject += 3;
+ reject += 2;
}
}
}
@@ -2124,7 +2130,7 @@ process_alt_operands (int only_alternative)
}
}
- if (early_clobber_p)
+ if (early_clobber_p && ! scratch_p)
{
if (lra_dump_file != NULL)
fprintf (lra_dump_file,