+2019-12-10 Vladimir Makarov <vmakarov@redhat.com>
+
+ PR rtl-optimization/92796
+ * lra-int.h (lra_risky_transformations_p): Rename to
+ check_and_force_assignment_correctness_p.
+ * lra-assigns.c: Ditto.
+ (lra_assign): Reset check_and_force_assignment_correctness_p.
+ * lra-constraints.c (lra_risky_transformations_p): Rename to
+ check_and_force_assignment_correctness_p.
+ (lra_constraints): Set up check_and_force_assignment_correctness_p
+ only for the 1st sub-pass.
+ * lra-eliminations.c (process_insn_for_elimination): Set up
+ check_and_force_assignment_correctness_p if the insn chnaged its
+ code.
+
2019-12-10 Jakub Jelinek <jakub@redhat.com>
PR rtl-optimization/92882
/* The constraints pass is allowed to create equivalences between
pseudos that make the current allocation "incorrect" (in the sense
that pseudos are assigned to hard registers from their own conflict
- sets). The global variable lra_risky_transformations_p says
+ sets). The global variable check_and_force_assignment_correctness_p says
whether this might have happened.
Process pseudos assigned to hard registers (less frequently used
bitmap_iterator bi;
int max_regno = max_reg_num ();
- if (! lra_risky_transformations_p)
+ if (! check_and_force_assignment_correctness_p)
{
for (i = FIRST_PSEUDO_REGISTER; i < max_regno; i++)
if (reg_renumber[i] >= 0 && lra_reg_info[i].nrefs > 0)
internal_error
("maximum number of LRA assignment passes is achieved (%d)",
LRA_MAX_ASSIGNMENT_ITERATION_NUMBER);
+ /* Reset the assignment correctness flag: */
+ check_and_force_assignment_correctness_p = false;
return no_spills_p;
}
/* The current iteration number of this LRA pass. */
int lra_constraint_iter;
-/* True if we substituted equiv which needs checking register
- allocation correctness because the equivalent value contains
- allocatable hard registers or when we restore multi-register
- pseudo. */
-bool lra_risky_transformations_p;
+/* True if we should during assignment sub-pass check assignment
+ correctness for all pseudos and spill some of them to correct
+ conflicts. It can be necessary when we substitute equiv which
+ needs checking register allocation correctness because the
+ equivalent value contains allocatable hard registers, or when we
+ restore multi-register pseudo, or when we change the insn code and
+ its operand became INOUT operand when it was IN one before. */
+bool check_and_force_assignment_correctness_p;
/* Return true if REGNO is referenced in more than one block. */
static bool
changed_p = false;
if (pic_offset_table_rtx
&& REGNO (pic_offset_table_rtx) >= FIRST_PSEUDO_REGISTER)
- lra_risky_transformations_p = true;
- else
+ check_and_force_assignment_correctness_p = true;
+ else if (first_p)
/* On the first iteration we should check IRA assignment
correctness. In rare cases, the assignments can be wrong as
early clobbers operands are ignored in IRA or usages of
paradoxical sub-registers are not taken into account by
IRA. */
- lra_risky_transformations_p = first_p;
+ check_and_force_assignment_correctness_p = true;
new_insn_uid_start = get_max_uid ();
new_regno_start = first_p ? lra_constraint_new_regno_start : max_reg_num ();
/* Mark used hard regs for target stack size calulations. */
dump_insn_slim (lra_dump_file, curr_insn);
}
if (contains_reg_p (x, true, false))
- lra_risky_transformations_p = true;
+ check_and_force_assignment_correctness_p = true;
lra_set_insn_deleted (curr_insn);
continue;
}
/* Don't split call clobbered hard regs living through
calls, otherwise we might have a check problem in the
assign sub-pass as in the most cases (exception is a
- situation when lra_risky_transformations_p value is
+ situation when check_and_force_assignment_correctness_p value is
true) the assign pass assumes that all pseudos living
through calls are assigned to call saved hard regs. */
&& (regno >= FIRST_PSEUDO_REGISTER
sub-register levels, LRA do this on pseudos level right now and
this discrepancy may create allocation conflicts after
splitting. */
- lra_risky_transformations_p = true;
+ check_and_force_assignment_correctness_p = true;
if (lra_dump_file != NULL)
fprintf (lra_dump_file,
" ))))))))))))))))))))))))))))))))))))))))))))))))\n");
before_p, curr_insn, max_uid))
{
if (reg->subreg_p)
- lra_risky_transformations_p = true;
+ check_and_force_assignment_correctness_p = true;
change_p = true;
/* Invalidate. */
usage_insns[src_regno].check = 0;