[PATCH]: Allow TARGET_SCHED_ADJUST_PRIORITY hook to reduce priority

Jeff Law law@redhat.com
Tue Sep 18 13:51:00 GMT 2018


On 9/18/18 1:52 AM, Andreas Schwab wrote:
> On Sep 17 2018, Jeff Law <law@redhat.com> wrote:
> 
>> On 9/17/18 3:08 AM, Andreas Schwab wrote:
>>> 	PR rtl-optimization/85458
>>> 	* sel-sched.c (sel_target_adjust_priority): Remove wrong
>>> 	assertion.
>> Under what conditions is the new priority negative?  Without digging
>> deep into the ia64 port that just seems wrong.
> 
> It is created in create_speculation_check:
But that says nothing about why this happens or whether or not it's a
valid state.



 /* Decrease priority of check by difference of load/check instruction
     latencies.  */
  EXPR_PRIORITY (INSN_EXPR (insn)) -= (sel_vinsn_cost (INSN_VINSN
(orig_insn))
                                       - sel_vinsn_cost (INSN_VINSN
(insn)));

There's nothing inherently wrong with having one cost be higher than the
other.  So I don't think this is a problem with computing costs in the
target files.  This feels a lot more like a bug in sel-sched.c


My inclination would be to declare negative priorities invalid and clamp
the value in sel-sched.c.  THere's other places in sel-sched.c that look
fishy as well.  Of course my other inclination would be to kill
sel-sched completely.

Jeff



More information about the Gcc-patches mailing list