[llvm] r210390 - Fix the MachineScheduler's logic for updating ready times for in-order.

Andrew Trick atrick at apple.com
Thu Jun 12 15:46:39 PDT 2014


Thanks. The problem is that CurrCycle can be eagerly advanced after setting ReadyCycle but before calling releaseNode.
See r210846.

That assertion is really just a helpful diagnostic for developers hacking on the scheduler.
-Andy

On Jun 11, 2014, at 11:45 PM, WenHan Gu (谷汶翰) <wenhan.gu at gmail.com> wrote:

> Hi Andrew,
> 
> AFAIK, ReadyCycle - CurrCycle is not always >= 0,  (I use assert (ReadyCycle>= CurrCycle) to check)
> but these are unsigned types so will be underflow. (Sometimes, I got 2^32-x on MaxObservedStall)
> 
> I suggest maybe we should use signed temp var for this calculation?
> Thanks!
>  
>  void SchedBoundary::releaseNode(SUnit *SU, unsigned ReadyCycle) {
> +  assert(SU->getInstr() && "Scheduled SUnit must have instr");
> +
> +#ifndef NDEBUG
> +  MaxObservedStall = std::max(ReadyCycle - CurrCycle, MaxObservedStall);
> +#endif
> +
>    if (ReadyCycle < MinReadyCycle)
>      MinReadyCycle = ReadyCycle;
> 





More information about the llvm-commits mailing list