re PR rtl-optimization/37296 (Bootstrap failure compiling libgcc)

2008-09-03  Vladimir Makarov  <vmakarov@redhat.com>

	PR rtl-opt/37296

	* ira-int.h (ira_sort_insn_chain): Remove.

	* ira.c (basic_block_order_nums, chain_insn_order,
	chain_freq_compare, chain_bb_compare, ira_sort_insn_chain): Remove.
	(ira): Don't call ira_sort_insn_chain.

	* reload1.c (reload): Don't call ira_sort_insn_chain.

From-SVN: r139948
This commit is contained in:
Vladimir Makarov 2008-09-03 19:49:30 +00:00 committed by Vladimir Makarov
parent e8f97b70cb
commit 204853a765
4 changed files with 12 additions and 104 deletions

View File

@ -1,3 +1,15 @@
2008-09-03 Vladimir Makarov <vmakarov@redhat.com>
PR rtl-opt/37296
* ira-int.h (ira_sort_insn_chain): Remove.
* ira.c (basic_block_order_nums, chain_insn_order,
chain_freq_compare, chain_bb_compare, ira_sort_insn_chain): Remove.
(ira): Don't call ira_sort_insn_chain.
* reload1.c (reload): Don't call ira_sort_insn_chain.
2008-09-03 Andrew Pinski <andrew_pinski@playstation.sony.com> 2008-09-03 Andrew Pinski <andrew_pinski@playstation.sony.com>
PR middle-end/37293 PR middle-end/37293

View File

@ -1681,101 +1681,6 @@ expand_reg_info (int old_size)
/* This page contains code for sorting the insn chain used by reload.
In the old register allocator, the insn chain order corresponds to
the order of insns in RTL. By putting insns with higher execution
frequency BBs first, reload has a better chance to generate less
expensive operand reloads for such insns. */
/* Map bb index -> order number in the BB chain in RTL code. */
static int *basic_block_order_nums;
/* Map chain insn uid -> order number in the insn chain before sorting
the insn chain. */
static int *chain_insn_order;
/* The function is used to sort insn chain according insn execution
frequencies. */
static int
chain_freq_compare (const void *v1p, const void *v2p)
{
const struct insn_chain *c1 = *(struct insn_chain * const *)v1p;
const struct insn_chain *c2 = *(struct insn_chain * const *)v2p;
int diff;
diff = (BASIC_BLOCK (c2->block)->frequency
- BASIC_BLOCK (c1->block)->frequency);
if (diff)
return diff;
/* Keep the same order in BB scope. */
return (chain_insn_order[INSN_UID(c1->insn)]
- chain_insn_order[INSN_UID(c2->insn)]);
}
/* Sort the insn chain according insn original order. */
static int
chain_bb_compare (const void *v1p, const void *v2p)
{
const struct insn_chain *c1 = *(struct insn_chain * const *)v1p;
const struct insn_chain *c2 = *(struct insn_chain * const *)v2p;
int diff;
diff = (basic_block_order_nums[c1->block]
- basic_block_order_nums[c2->block]);
if (diff)
return diff;
/* Keep the same order in BB scope. */
return (chain_insn_order[INSN_UID(c1->insn)]
- chain_insn_order[INSN_UID(c2->insn)]);
}
/* Sort the insn chain according to insn frequencies if
FREQ_P or according to insn original order otherwise. */
void
ira_sort_insn_chain (bool freq_p)
{
struct insn_chain *chain, **chain_arr;
basic_block bb;
int i, n;
chain_insn_order = (int *) ira_allocate (get_max_uid () * sizeof (int));
for (n = 0, chain = reload_insn_chain; chain != 0; chain = chain->next)
{
chain_insn_order[INSN_UID (chain->insn)] = n;
n++;
}
if (n <= 1)
return;
chain_arr
= (struct insn_chain **) ira_allocate (n * sizeof (struct insn_chain *));
basic_block_order_nums
= (int *) ira_allocate (sizeof (int) * last_basic_block);
n = 0;
FOR_EACH_BB (bb)
{
basic_block_order_nums[bb->index] = n++;
}
for (n = 0, chain = reload_insn_chain; chain != 0; chain = chain->next)
chain_arr[n++] = chain;
qsort (chain_arr, n, sizeof (struct insn_chain *),
freq_p ? chain_freq_compare : chain_bb_compare);
ira_free (chain_insn_order);
for (i = 1; i < n - 1; i++)
{
chain_arr[i]->next = chain_arr[i + 1];
chain_arr[i]->prev = chain_arr[i - 1];
}
chain_arr[i]->next = NULL;
chain_arr[i]->prev = chain_arr[i - 1];
reload_insn_chain = chain_arr[0];
reload_insn_chain->prev = NULL;
reload_insn_chain->next = chain_arr[1];
ira_free (basic_block_order_nums);
ira_free (chain_arr);
}
/* All natural loops. */ /* All natural loops. */
struct loops ira_loops; struct loops ira_loops;
@ -1966,9 +1871,6 @@ ira (FILE *f)
df_set_flags (DF_NO_INSN_RESCAN); df_set_flags (DF_NO_INSN_RESCAN);
build_insn_chain (); build_insn_chain ();
if (optimize)
ira_sort_insn_chain (true);
reload_completed = !reload (get_insns (), optimize > 0); reload_completed = !reload (get_insns (), optimize > 0);
timevar_pop (TV_RELOAD); timevar_pop (TV_RELOAD);

View File

@ -24,7 +24,6 @@ extern void ira_init_once (void);
extern void ira_init (void); extern void ira_init (void);
extern void ira_finish_once (void); extern void ira_finish_once (void);
extern rtx ira_eliminate_regs (rtx, enum machine_mode); extern rtx ira_eliminate_regs (rtx, enum machine_mode);
extern void ira_sort_insn_chain (bool);
extern void ira_sort_regnos_for_alter_reg (int *, int, unsigned int *); extern void ira_sort_regnos_for_alter_reg (int *, int, unsigned int *);
extern void ira_mark_allocation_change (int); extern void ira_mark_allocation_change (int);

View File

@ -1118,11 +1118,6 @@ reload (rtx first, int global)
obstack_free (&reload_obstack, reload_firstobj); obstack_free (&reload_obstack, reload_firstobj);
} }
if (flag_ira && optimize)
/* Restore the original insn chain order for correct reload work
(e.g. for correct inheritance). */
ira_sort_insn_chain (false);
/* If global-alloc was run, notify it of any register eliminations we have /* If global-alloc was run, notify it of any register eliminations we have
done. */ done. */
if (global) if (global)