Some questions about Instruction Scheduling

Hi everybody,

I got some beginner’s questions around the topic of Instruction Scheduling. To give some background info: the planned project is to implement a data-driven instruction scheduler, i.e. using machine learning for solving the scheduling problem for new processors in order to reduce the development task for new targets. So the scheduler should learn on its own what makes good scheduling. It should only be given basic hardware information that is required, e.g. register information.

Some questions came up while learning about how scheduling in LLVM works. Please correct me if there is anything wrong with my statements.

  1. I learned that there are two ways of Instruction Scheduling in LLVM. The legacy scheduler ScheduleDAGRRList and the newer MachineScheduler [1]. In this talk, they also said, it was target-dependent which one is used.
    So if I want to implement one, is it important on which one it will be based?
    Any recommendations on which one I should choose as a basis if I have a choice?
  2. I wasn’t able to understand the differences between the two schedulers and why the new one might be better? Does the new one also work on DAGs? Could you give a brief explanation?
  3. Are heuristics (like register pressure, variable liveness) tracked automatically? And how can I access them in code?
  4. Do you have any recommendations on how to benchmark the schedules most accurately?

If there’s a better place to ask these questions, please let me know.

[1] 2017 LLVM Developers’ Meeting: “Writing Great Machine Schedulers”

1 Like