[RA]: Fix some typos and remove unused code

The following patch fixes different harmless typos and removes some unused code.

gcc/ChangeLog:

	* ira-build.cc (add_to_conflicts): Use sizeof(ira_object_p)
	instead of sizeof(ira_allocno_t) for allocations.
	* ira-color.cc (print_hard_reg_set): Fix printing hard reg set.
	* ira-emit.cc (allocno_last_set, allocno_last_set_check): Remove
	unused static variables.
	* ira.cc (combine_and_move_insns): Fix dead note recognition.
	(ira_remove_insn_scratches): Use dump_file instead of
	ira_dump_file.
	* lra-constraints.cc (match_reload): Remove always true condition.
	(undo_optional_reloads): Fix recognition of clobber for assertion.
This commit is contained in:
Vladimir N. Makarov
2026-04-27 09:54:42 -04:00
parent c1b20a283c
commit f180b56b3d
5 changed files with 7 additions and 27 deletions

View File

@@ -710,7 +710,7 @@ add_to_conflicts (ira_object_t obj1, ira_object_t obj2)
if (OBJECT_CONFLICT_ARRAY_SIZE (obj1) < num * sizeof (ira_object_t))
{
ira_object_t *newvec;
size = (3 * num / 2 + 1) * sizeof (ira_allocno_t);
size = (3 * num / 2 + 1) * sizeof (ira_object_t);
newvec = (ira_object_t *) ira_allocate (size);
memcpy (newvec, vec, curr_num * sizeof (ira_object_t));
ira_free (vec);

View File

@@ -505,8 +505,6 @@ print_hard_reg_set (FILE *f, HARD_REG_SET set, bool new_line_p)
{
if (start == end)
fprintf (f, " %d", start);
else if (start == end + 1)
fprintf (f, " %d %d", start, end);
else
fprintf (f, " %d-%d", start, end);
start = -1;

View File

@@ -729,14 +729,6 @@ static move_t hard_regno_last_set[FIRST_PSEUDO_REGISTER];
element in `hard_regno_last_set' is defined and correct. */
static int hard_regno_last_set_check[FIRST_PSEUDO_REGISTER];
/* Last move (in move sequence being processed) setting up the
corresponding allocno. */
static move_t *allocno_last_set;
/* If the element value is equal to CURR_TICK then the corresponding
element in . `allocno_last_set' is defined and correct. */
static int *allocno_last_set_check;
/* Definition of vector of moves. */
/* This vec contains moves sorted topologically (depth-first) on their
@@ -744,8 +736,7 @@ static int *allocno_last_set_check;
static vec<move_t> move_vec;
/* The variable value is used to check correctness of values of
elements of arrays `hard_regno_last_set' and
`allocno_last_set_check'. */
elements of arrays `hard_regno_last_set'. */
static int curr_tick;
/* This recursive function traverses dependencies of MOVE and produces
@@ -1286,11 +1277,6 @@ ira_emit (bool loops_p)
if (e->dest != EXIT_BLOCK_PTR_FOR_FN (cfun))
generate_edge_moves (e);
}
allocno_last_set
= (move_t *) ira_allocate (sizeof (move_t) * max_reg_num ());
allocno_last_set_check
= (int *) ira_allocate (sizeof (int) * max_reg_num ());
memset (allocno_last_set_check, 0, sizeof (int) * max_reg_num ());
memset (hard_regno_last_set_check, 0, sizeof (hard_regno_last_set_check));
curr_tick = 0;
FOR_EACH_BB_FN (bb, cfun)
@@ -1312,8 +1298,6 @@ ira_emit (bool loops_p)
}
}
move_vec.release ();
ira_free (allocno_last_set_check);
ira_free (allocno_last_set);
commit_edge_insertions ();
/* Fix insn codes. It is necessary to do it before reload because
reload assumes initial insn codes defined. The insn codes can be

View File

@@ -4032,7 +4032,7 @@ combine_and_move_insns (void)
/* Append the REG_DEAD notes from def_insn. */
for (rtx *p = &REG_NOTES (def_insn); (link = *p) != 0; )
{
if (REG_NOTE_KIND (XEXP (link, 0)) == REG_DEAD)
if (REG_NOTE_KIND (link) == REG_DEAD)
{
*p = XEXP (link, 1);
XEXP (link, 1) = REG_NOTES (use_insn);
@@ -5469,7 +5469,7 @@ ira_remove_insn_scratches (rtx_insn *insn, bool all_p, FILE *dump_file,
insn_changed_p = true;
*loc = reg = get_reg (*loc);
ira_register_new_scratch_op (insn, i, INSN_CODE (insn));
if (ira_dump_file != NULL)
if (dump_file != NULL)
fprintf (dump_file,
"Removing SCRATCH to p%u in insn #%u (nop %d)\n",
REGNO (reg), INSN_UID (insn), i);

View File

@@ -1251,8 +1251,6 @@ match_reload (signed char out, signed char *ins, signed char *outs,
= (! early_clobber_p && ins[1] < 0 && REG_P (in_rtx)
&& (int) REGNO (in_rtx) < lra_new_regno_start
&& find_regno_note (curr_insn, REG_DEAD, REGNO (in_rtx))
&& (! early_clobber_p
|| check_conflict_input_operands (REGNO (in_rtx), ins))
&& (out < 0
|| regno_val_use_in (REGNO (in_rtx), out_rtx) == NULL_RTX)
&& !out_conflict
@@ -7969,9 +7967,9 @@ undo_optional_reloads (void)
we remove the inheritance pseudo and the optional
reload. */
}
if (GET_CODE (PATTERN (insn)) == CLOBBER
&& REG_P (SET_DEST (insn))
&& get_regno (SET_DEST (insn)) == (int) regno)
rtx pat = PATTERN (insn);
if (GET_CODE (pat) == CLOBBER && REG_P (SET_DEST (pat))
&& get_regno (SET_DEST (pat)) == (int) regno)
/* Refuse to remap clobbers to preexisting pseudos. */
gcc_unreachable ();
lra_substitute_pseudo_within_insn