What's the advantage of compiler instruction scheduling compared to dynamic scheduling? [closed]

≡放荡痞女 提交于 2019-12-05 12:05:46

Advantage of static (compiler) scheduling:

  • No time bound, therefore can use very complicated algorithms;
  • No bound on the instruction window. This allows for example to exchange an instruction with a whole loop of function call.

Advantage of dynamic (processor scheduling):

  • Take care of the actual environment (cache, arithmetic unit busy due to another hyperthread);
  • Do not force to recompile the code for each architecture upgrade.

That's all I can think of for now.

First, I should note that current RISC architectures first compile then do rescheduling, cause "high level" assembly commands are compiled into smaller RISC commands. At least it is true for x86/x64 architectures.

Then we can imagine an execution cycle as: compile - optimize/reschedule - descrease scale - compile - optimize/reschedule.

That sort of answers the question, compiler has much wider scope of visibility into the application, so it mainly optimizes on macro-level (blocks of application commands), while processor mainly optimizes for micro-level (blocks of RISC commands).

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!