Commit 9994ad20 by Kito Cheng Committed by Chung-Ju Wu

Clean up useless initialization for IRA if using LRA.

gcc/
	* ira.c (ira): Don't initialize ira_spilled_reg_stack_slots and
	ira_spilled_reg_stack_slots_num if using lra.
	(do_reload): Remove release ira_spilled_reg_stack_slots part.
	* ira-color.c (ira_sort_regnos_for_alter_reg): Add assertion to
	make sure not using lra.
	(ira_reuse_stack_slot): Likewise.
	(ira_mark_new_stack_slot): Likewise.

From-SVN: r215286
parent a86507b2
2014-09-16 Kito Cheng <kito@0xlab.org>
* ira.c (ira): Don't initialize ira_spilled_reg_stack_slots and
ira_spilled_reg_stack_slots_num if using lra.
(do_reload): Remove release ira_spilled_reg_stack_slots part.
* ira-color.c (ira_sort_regnos_for_alter_reg): Add assertion to
make sure not using lra.
(ira_reuse_stack_slot): Likewise.
(ira_mark_new_stack_slot): Likewise.
2014-09-15 Andi Kleen <ak@linux.intel.com> 2014-09-15 Andi Kleen <ak@linux.intel.com>
* function.c (allocate_struct_function): Force * function.c (allocate_struct_function): Force
...@@ -4067,6 +4067,8 @@ ira_sort_regnos_for_alter_reg (int *pseudo_regnos, int n, ...@@ -4067,6 +4067,8 @@ ira_sort_regnos_for_alter_reg (int *pseudo_regnos, int n,
ira_allocno_iterator ai; ira_allocno_iterator ai;
ira_allocno_t *spilled_coalesced_allocnos; ira_allocno_t *spilled_coalesced_allocnos;
ira_assert (! ira_use_lra_p);
/* Set up allocnos can be coalesced. */ /* Set up allocnos can be coalesced. */
coloring_allocno_bitmap = ira_allocate_bitmap (); coloring_allocno_bitmap = ira_allocate_bitmap ();
for (i = 0; i < n; i++) for (i = 0; i < n; i++)
...@@ -4416,6 +4418,8 @@ ira_reuse_stack_slot (int regno, unsigned int inherent_size, ...@@ -4416,6 +4418,8 @@ ira_reuse_stack_slot (int regno, unsigned int inherent_size,
bitmap_iterator bi; bitmap_iterator bi;
struct ira_spilled_reg_stack_slot *slot = NULL; struct ira_spilled_reg_stack_slot *slot = NULL;
ira_assert (! ira_use_lra_p);
ira_assert (inherent_size == PSEUDO_REGNO_BYTES (regno) ira_assert (inherent_size == PSEUDO_REGNO_BYTES (regno)
&& inherent_size <= total_size && inherent_size <= total_size
&& ALLOCNO_HARD_REGNO (allocno) < 0); && ALLOCNO_HARD_REGNO (allocno) < 0);
...@@ -4528,6 +4532,8 @@ ira_mark_new_stack_slot (rtx x, int regno, unsigned int total_size) ...@@ -4528,6 +4532,8 @@ ira_mark_new_stack_slot (rtx x, int regno, unsigned int total_size)
int slot_num; int slot_num;
ira_allocno_t allocno; ira_allocno_t allocno;
ira_assert (! ira_use_lra_p);
ira_assert (PSEUDO_REGNO_BYTES (regno) <= total_size); ira_assert (PSEUDO_REGNO_BYTES (regno) <= total_size);
allocno = ira_regno_allocno_map[regno]; allocno = ira_regno_allocno_map[regno];
slot_num = -ALLOCNO_HARD_REGNO (allocno) - 2; slot_num = -ALLOCNO_HARD_REGNO (allocno) - 2;
......
...@@ -5260,7 +5260,8 @@ ira (FILE *f) ...@@ -5260,7 +5260,8 @@ ira (FILE *f)
#ifdef ENABLE_IRA_CHECKING #ifdef ENABLE_IRA_CHECKING
print_redundant_copies (); print_redundant_copies ();
#endif #endif
if (! ira_use_lra_p)
{
ira_spilled_reg_stack_slots_num = 0; ira_spilled_reg_stack_slots_num = 0;
ira_spilled_reg_stack_slots ira_spilled_reg_stack_slots
= ((struct ira_spilled_reg_stack_slot *) = ((struct ira_spilled_reg_stack_slot *)
...@@ -5269,6 +5270,7 @@ ira (FILE *f) ...@@ -5269,6 +5270,7 @@ ira (FILE *f)
memset (ira_spilled_reg_stack_slots, 0, memset (ira_spilled_reg_stack_slots, 0,
max_regno * sizeof (struct ira_spilled_reg_stack_slot)); max_regno * sizeof (struct ira_spilled_reg_stack_slot));
} }
}
allocate_initial_values (); allocate_initial_values ();
/* See comment for find_moveable_pseudos call. */ /* See comment for find_moveable_pseudos call. */
...@@ -5304,9 +5306,6 @@ do_reload (void) ...@@ -5304,9 +5306,6 @@ do_reload (void)
bb->loop_father = NULL; bb->loop_father = NULL;
current_loops = NULL; current_loops = NULL;
if (ira_conflicts_p)
ira_free (ira_spilled_reg_stack_slots);
ira_destroy (); ira_destroy ();
lra (ira_dump_file); lra (ira_dump_file);
......
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