Commit ab90c27b by Alexander Monakov Committed by Alexander Monakov

haifa-sched: fix autopref_rank_for_schedule qsort comparator

	* haifa-sched.c (autopref_rank_for_schedule): Order 'irrelevant' insns
	first, always call autopref_rank_data otherwise.

From-SVN: r253235
parent d4b7f2ee
2017-09-27 Alexander Monakov <amonakov@ispras.ru>
* haifa-sched.c (autopref_rank_for_schedule): Order 'irrelevant' insns
first, always call autopref_rank_data otherwise.
2017-09-27 Richard Biener <rguenther@suse.de> 2017-09-27 Richard Biener <rguenther@suse.de>
* graphite-scop-detection.c (find_scop_parameters): Move * graphite-scop-detection.c (find_scop_parameters): Move
...@@ -5707,7 +5707,8 @@ autopref_rank_data (autopref_multipass_data_t data1, ...@@ -5707,7 +5707,8 @@ autopref_rank_data (autopref_multipass_data_t data1,
static int static int
autopref_rank_for_schedule (const rtx_insn *insn1, const rtx_insn *insn2) autopref_rank_for_schedule (const rtx_insn *insn1, const rtx_insn *insn2)
{ {
for (int write = 0; write < 2; ++write) int r = 0;
for (int write = 0; write < 2 && !r; ++write)
{ {
autopref_multipass_data_t data1 autopref_multipass_data_t data1
= &INSN_AUTOPREF_MULTIPASS_DATA (insn1)[write]; = &INSN_AUTOPREF_MULTIPASS_DATA (insn1)[write];
...@@ -5716,21 +5717,20 @@ autopref_rank_for_schedule (const rtx_insn *insn1, const rtx_insn *insn2) ...@@ -5716,21 +5717,20 @@ autopref_rank_for_schedule (const rtx_insn *insn1, const rtx_insn *insn2)
if (data1->status == AUTOPREF_MULTIPASS_DATA_UNINITIALIZED) if (data1->status == AUTOPREF_MULTIPASS_DATA_UNINITIALIZED)
autopref_multipass_init (insn1, write); autopref_multipass_init (insn1, write);
if (data1->status == AUTOPREF_MULTIPASS_DATA_IRRELEVANT)
continue;
if (data2->status == AUTOPREF_MULTIPASS_DATA_UNINITIALIZED) if (data2->status == AUTOPREF_MULTIPASS_DATA_UNINITIALIZED)
autopref_multipass_init (insn2, write); autopref_multipass_init (insn2, write);
if (data2->status == AUTOPREF_MULTIPASS_DATA_IRRELEVANT)
continue;
if (!rtx_equal_p (data1->base, data2->base)) int irrel1 = data1->status == AUTOPREF_MULTIPASS_DATA_IRRELEVANT;
continue; int irrel2 = data2->status == AUTOPREF_MULTIPASS_DATA_IRRELEVANT;
return autopref_rank_data (data1, data2); if (!irrel1 && !irrel2)
r = autopref_rank_data (data1, data2);
else
r = irrel2 - irrel1;
} }
return 0; return r;
} }
/* True if header of debug dump was printed. */ /* True if header of debug dump was printed. */
......
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