Re: [PATCH] haifa-sched: fix autopref_rank_for_schedule qsort comparator

2017-09-25 Thread Maxim Kuvyrkov
> On Sep 22, 2017, at 4:18 AM, Alexander Monakov wrote: > > On Tue, 19 Sep 2017, Alexander Monakov wrote: >> * haifa-sched.c (autopref_rank_for_schedule): Order 'irrelevant' insns >> first, always call autopref_rank_data otherwise. > > May I apply this patch now to unblock qsort checki

Re: [PATCH] haifa-sched: fix autopref_rank_for_schedule qsort comparator

2017-09-22 Thread Alexander Monakov
On Tue, 19 Sep 2017, Alexander Monakov wrote: > * haifa-sched.c (autopref_rank_for_schedule): Order 'irrelevant' insns > first, always call autopref_rank_data otherwise. May I apply this patch now to unblock qsort checking? Further changes or adjustments can then go in independently a

Re: [PATCH] haifa-sched: fix autopref_rank_for_schedule qsort comparator

2017-09-19 Thread Maxim Kuvyrkov
> On Sep 19, 2017, at 6:20 PM, Alexander Monakov wrote: > >> I'd like to keep read/write processing balanced. In the above "read" >> analysis >> has greater weight than "write" analysis. Also, autopref_rank_data() should >> not be called if !rtx_equal_p (data1->base, data2->base). > > I'm afr

Re: [PATCH] haifa-sched: fix autopref_rank_for_schedule qsort comparator

2017-09-19 Thread Alexander Monakov
> I'd like to keep read/write processing balanced. In the above "read" analysis > has greater weight than "write" analysis. Also, autopref_rank_data() should > not be called if !rtx_equal_p (data1->base, data2->base). I'm afraid this doesn't work. Consider you have insns A, B, C such that all a

Re: [PATCH] haifa-sched: fix autopref_rank_for_schedule qsort comparator

2017-09-19 Thread Maxim Kuvyrkov
> On Sep 19, 2017, at 5:25 PM, Alexander Monakov wrote: > > On Tue, 19 Sep 2017, Maxim Kuvyrkov wrote: >> How about the following: >> 1. if both instructions are "irrelevant", then return "0". >> 2. if one instruction is "relevant" and another is "irrelevant", then >> "relevant" instruction is al

Re: [PATCH] haifa-sched: fix autopref_rank_for_schedule qsort comparator

2017-09-19 Thread Alexander Monakov
On Tue, 19 Sep 2017, Maxim Kuvyrkov wrote: > How about the following: > 1. if both instructions are "irrelevant", then return "0". > 2. if one instruction is "relevant" and another is "irrelevant", then > "relevant" instruction is always greater (or lesser) than the non-relevant. > 3. if both inst

Re: [PATCH] haifa-sched: fix autopref_rank_for_schedule qsort comparator

2017-09-19 Thread Maxim Kuvyrkov
> On Sep 19, 2017, at 2:21 PM, Alexander Monakov wrote: > > Hello, > > The autopref_rank_for_schedule qsort sub-comparator is not actually a proper > comparator. For instance, it lacks transitivity: if there's insns A, B, C > such that B has AUTOPREF_MULTUPASS_DATA_IRRELEVANT status, but A and

[PATCH] haifa-sched: fix autopref_rank_for_schedule qsort comparator

2017-09-19 Thread Alexander Monakov
Hello, The autopref_rank_for_schedule qsort sub-comparator is not actually a proper comparator. For instance, it lacks transitivity: if there's insns A, B, C such that B has AUTOPREF_MULTUPASS_DATA_IRRELEVANT status, but A and C compare such that C < A, we can have A == B == C < A according to th