Commit 3363daad by Vladimir Makarov Committed by Vladimir Makarov

re PR target/61578 (Code size increase for ARM thumb compared to 4.8.x when compiling with -Os)

2015-09-01  Vladimir Makarov  <vmakarov@redhat.com>

	PR target/61578
	* lra-lives.c (process_bb_lives): Process move pseudos with the
	same value for copies and preferences
	* lra-constraints.c (match_reload): Create match reload pseudo
	with the same value from single dying input pseudo.

From-SVN: r227382
parent aef90c1d
2015-09-01 Vladimir Makarov <vmakarov@redhat.com>
PR target/61578
* lra-lives.c (process_bb_lives): Process move pseudos with the
same value for copies and preferences
* lra-constraints.c (match_reload): Create match reload pseudo
with the same value from single dying input pseudo.
2015-09-01 Ilya Enkovich <enkovich.gnu@gmail.com> 2015-09-01 Ilya Enkovich <enkovich.gnu@gmail.com>
PR target/67405 PR target/67405
......
...@@ -928,10 +928,12 @@ match_reload (signed char out, signed char *ins, enum reg_class goal_class, ...@@ -928,10 +928,12 @@ match_reload (signed char out, signed char *ins, enum reg_class goal_class,
they live in the same place. When we create a pseudo we they live in the same place. When we create a pseudo we
assign value of original pseudo (if any) from which we assign value of original pseudo (if any) from which we
created the new pseudo. If we create the pseudo from the created the new pseudo. If we create the pseudo from the
input pseudo, the new pseudo will no conflict with the input input pseudo, the new pseudo will have no conflict with the
pseudo which is wrong when the input pseudo lives after the input pseudo which is wrong when the input pseudo lives after
insn and as the new pseudo value is changed by the insn the insn and as the new pseudo value is changed by the insn
output. Therefore we create the new pseudo from the output. output. Therefore we create the new pseudo from the output
except the case when we have single matched dying input
pseudo.
We cannot reuse the current output register because we might We cannot reuse the current output register because we might
have a situation like "a <- a op b", where the constraints have a situation like "a <- a op b", where the constraints
...@@ -940,8 +942,12 @@ match_reload (signed char out, signed char *ins, enum reg_class goal_class, ...@@ -940,8 +942,12 @@ match_reload (signed char out, signed char *ins, enum reg_class goal_class,
so that it doesn't clobber the current value of "a". */ so that it doesn't clobber the current value of "a". */
new_in_reg = new_out_reg new_in_reg = new_out_reg
= lra_create_new_reg_with_unique_value (outmode, out_rtx, = (ins[1] < 0 && REG_P (in_rtx)
goal_class, ""); && (int) REGNO (in_rtx) < lra_new_regno_start
&& find_regno_note (curr_insn, REG_DEAD, REGNO (in_rtx))
? lra_create_new_reg (inmode, in_rtx, goal_class, "")
: lra_create_new_reg_with_unique_value (outmode, out_rtx,
goal_class, ""));
} }
/* In operand can be got from transformations before processing insn /* In operand can be got from transformations before processing insn
constraints. One example of such transformations is subreg constraints. One example of such transformations is subreg
......
...@@ -726,28 +726,33 @@ process_bb_lives (basic_block bb, int &curr_point, bool dead_insn_p) ...@@ -726,28 +726,33 @@ process_bb_lives (basic_block bb, int &curr_point, bool dead_insn_p)
lra_hard_reg_usage[reg->regno] += freq; lra_hard_reg_usage[reg->regno] += freq;
call_p = CALL_P (curr_insn); call_p = CALL_P (curr_insn);
src_regno = (set != NULL_RTX && REG_P (SET_SRC (set))
? REGNO (SET_SRC (set)) : -1);
dst_regno = (set != NULL_RTX && REG_P (SET_DEST (set))
? REGNO (SET_DEST (set)) : -1);
if (complete_info_p if (complete_info_p
&& set != NULL_RTX && src_regno >= 0 && dst_regno >= 0
&& REG_P (SET_DEST (set)) && REG_P (SET_SRC (set))
/* Check that source regno does not conflict with /* Check that source regno does not conflict with
destination regno to exclude most impossible destination regno to exclude most impossible
preferences. */ preferences. */
&& ((((src_regno = REGNO (SET_SRC (set))) >= FIRST_PSEUDO_REGISTER && (((src_regno >= FIRST_PSEUDO_REGISTER
&& ! sparseset_bit_p (pseudos_live, src_regno)) && (! sparseset_bit_p (pseudos_live, src_regno)
|| (dst_regno >= FIRST_PSEUDO_REGISTER
&& lra_reg_val_equal_p (src_regno,
lra_reg_info[dst_regno].val,
lra_reg_info[dst_regno].offset))))
|| (src_regno < FIRST_PSEUDO_REGISTER || (src_regno < FIRST_PSEUDO_REGISTER
&& ! TEST_HARD_REG_BIT (hard_regs_live, src_regno))) && ! TEST_HARD_REG_BIT (hard_regs_live, src_regno)))
/* It might be 'inheritance pseudo <- reload pseudo'. */ /* It might be 'inheritance pseudo <- reload pseudo'. */
|| (src_regno >= lra_constraint_new_regno_start || (src_regno >= lra_constraint_new_regno_start
&& ((int) REGNO (SET_DEST (set)) && dst_regno >= lra_constraint_new_regno_start
>= lra_constraint_new_regno_start)
/* Remember to skip special cases where src/dest regnos are /* Remember to skip special cases where src/dest regnos are
the same, e.g. insn SET pattern has matching constraints the same, e.g. insn SET pattern has matching constraints
like =r,0. */ like =r,0. */
&& src_regno != (int) REGNO (SET_DEST (set))))) && src_regno != dst_regno)))
{ {
int hard_regno = -1, regno = -1; int hard_regno = -1, regno = -1;
dst_regno = REGNO (SET_DEST (set));
if (dst_regno >= lra_constraint_new_regno_start if (dst_regno >= lra_constraint_new_regno_start
&& src_regno >= lra_constraint_new_regno_start) && src_regno >= lra_constraint_new_regno_start)
{ {
......
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