[LLVMdev] [llvm-commits] Bottom-Up Scheduling?

Andrew Trick atrick at apple.com
Tue Nov 29 19:30:20 PST 2011


On Nov 29, 2011, at 7:10 PM, Hal Finkel wrote:

>> From the perspective of the hazard recognizer, from what I can tell, the
> difference between the top-down and bottom-up modes are:
> 
> In top-down mode, the scheduling proceeds in the forward direction.
> AdvanceCycle() may be used, RecedeCycle() is not used. EmitInstruction()
> implies a cycle-count increment. In bottom-up mode, scheduling proceeds
> in the backwards direction (last instruction first). AdvanceCycle() is
> not used, RecedeCycle() is always used to decrement the current cycle
> offset (EmitInstruction() does *not* imply a cycle-count decrement).
> 
> Is this right? Have I captured everything?

ScoreboardHazardRecognizer::EmitInstruction checks the reservation table where cycle=0 corresponds to the first pipeline stage and cycle=n is the stage the occurs after n cycles in the itinerary. It doesn't care if we're scheduling top-down or bottom-up. For top-down, the reservation table models resources used by previous instructions, and for bottom-up it models the resources of subsequent instructions, but the EmitInstruction logic is the same either way. 

AdvanceCycle is called by the current top-down scheduler (now postRA only) to shift the reservation table forward in time. The earliest pipeline stage is dropped.

RecedeCycle is called by the bottom-up scheduler (preRA) to shift the reservation table backward in time. The latest pipeline stage is dropped.

It's easier to think about hazards in a top-down scheduler.

-Andy

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20111129/9a00e128/attachment.html>


More information about the llvm-dev mailing list